[ARVADOS-WORKBENCH2] updated: 1.2.0-942-g6f48379
Git user
git at public.curoverse.com
Mon Nov 26 04:40:07 EST 2018
Summary of changes:
.../favorite-panel-middleware-service.ts | 15 ++++++++-----
.../resource-type-filters/resource-type-filters.ts | 19 +++++++++++++---
.../trash-panel/trash-panel-middleware-service.ts | 26 +++++++++++++++-------
src/views/favorite-panel/favorite-panel.tsx | 9 ++++----
4 files changed, 47 insertions(+), 22 deletions(-)
via 6f48379abdd444ed69e030b25e47174b39129a5d (commit)
via 65dd200fab411bdd638aec5b4d35c3063e596eac (commit)
via 89059eace676f0855ca66aa0a66d6110223b1d7e (commit)
via dad5fab1615023c73ad67a9dff8f63aa7d1bf282 (commit)
via d32c007b46b6137c6490009b3739a363dbe2bd66 (commit)
via 87636089f8b7d150a2987cafd48a2ca7dd6c24f9 (commit)
from 781bcd15b161efd660d859dc9e0e62fcdeee53a6 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 6f48379abdd444ed69e030b25e47174b39129a5d
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date: Mon Nov 26 10:39:48 2018 +0100
Restore type filters to favorit-middleware-service
Feature #14258
Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
diff --git a/src/store/favorite-panel/favorite-panel-middleware-service.ts b/src/store/favorite-panel/favorite-panel-middleware-service.ts
index 0d75ad1..87f49f3 100644
--- a/src/store/favorite-panel/favorite-panel-middleware-service.ts
+++ b/src/store/favorite-panel/favorite-panel-middleware-service.ts
@@ -2,8 +2,8 @@
//
// SPDX-License-Identifier: AGPL-3.0
-import { DataExplorerMiddlewareService } from "../data-explorer/data-explorer-middleware-service";
-import { FavoritePanelColumnNames, FavoritePanelFilter } from "~/views/favorite-panel/favorite-panel";
+import { DataExplorerMiddlewareService } from "~/store/data-explorer/data-explorer-middleware-service";
+import { FavoritePanelColumnNames } from "~/views/favorite-panel/favorite-panel";
import { RootState } from "../store";
import { DataColumns } from "~/components/data-table/data-table";
import { ServiceRepository } from "~/services/services";
@@ -21,6 +21,8 @@ import { progressIndicatorActions } from '~/store/progress-indicator/progress-in
import { getDataExplorer } from "~/store/data-explorer/data-explorer-reducer";
import { loadMissingProcessesInformation } from "~/store/project-panel/project-panel-middleware-service";
import { getSortColumn } from "~/store/data-explorer/data-explorer-reducer";
+import { getDataExplorerColumnFilters } from '~/store/data-explorer/data-explorer-middleware-service';
+import { serializeSimpleObjectTypeFilters } from '../resource-type-filters/resource-type-filters';
export class FavoritePanelMiddlewareService extends DataExplorerMiddlewareService {
constructor(private services: ServiceRepository, id: string) {
@@ -34,7 +36,8 @@ export class FavoritePanelMiddlewareService extends DataExplorerMiddlewareServic
} else {
const columns = dataExplorer.columns as DataColumns<string>;
const sortColumn = getSortColumn(dataExplorer);
- const typeFilters = this.getColumnFilters(columns, FavoritePanelColumnNames.TYPE);
+ const typeFilters = serializeSimpleObjectTypeFilters(getDataExplorerColumnFilters(columns, FavoritePanelColumnNames.TYPE));
+
const linkOrder = new OrderBuilder<LinkResource>();
const contentOrder = new OrderBuilder<GroupContentsResource>();
@@ -59,10 +62,10 @@ export class FavoritePanelMiddlewareService extends DataExplorerMiddlewareServic
linkOrder: linkOrder.getOrder(),
contentOrder: contentOrder.getOrder(),
filters: new FilterBuilder()
- // TODO: update filters
- // .addIsA("headUuid", typeFilters.map(filter => filter.type))
.addILike("name", dataExplorer.searchValue)
- .getFilters()
+ .addIsA("headUuid", typeFilters)
+ .getFilters(),
+
});
api.dispatch(progressIndicatorActions.PERSIST_STOP_WORKING(this.getId()));
api.dispatch(resourcesActions.SET_RESOURCES(response.items));
commit 65dd200fab411bdd638aec5b4d35c3063e596eac
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date: Mon Nov 26 10:39:04 2018 +0100
Replace type filters with simplified ones in favorite-panel
Feature #14258
Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
diff --git a/src/views/favorite-panel/favorite-panel.tsx b/src/views/favorite-panel/favorite-panel.tsx
index 40bf9a0..4682d3f 100644
--- a/src/views/favorite-panel/favorite-panel.tsx
+++ b/src/views/favorite-panel/favorite-panel.tsx
@@ -11,7 +11,6 @@ import { RouteComponentProps } from 'react-router';
import { DataTableFilterItem } from '~/components/data-table-filters/data-table-filters';
import { SortDirection } from '~/components/data-table/data-column';
import { ResourceKind } from '~/models/resource';
-import { resourceLabel } from '~/common/labels';
import { ArvadosTheme } from '~/common/custom-theme';
import { FAVORITE_PANEL_ID } from "~/store/favorite-panel/favorite-panel-action";
import {
@@ -28,12 +27,12 @@ import { openContextMenu, resourceKindToContextMenuKind } from '~/store/context-
import { loadDetailsPanel } from '~/store/details-panel/details-panel-action';
import { navigateTo } from '~/store/navigation/navigation-action';
import { ContainerRequestState } from "~/models/container-request";
-import { FavoritesState } from '../../store/favorites/favorites-reducer';
+import { FavoritesState } from '~/store/favorites/favorites-reducer';
import { RootState } from '~/store/store';
import { DataTableDefaultView } from '~/components/data-table-default-view/data-table-default-view';
import { createTree } from '~/models/tree';
-import { getInitialResourceTypeFilters } from '../../store/resource-type-filters/resource-type-filters';
-// TODO: clean up code
+import { getSimpleObjectTypeFilters } from '~/store/resource-type-filters/resource-type-filters';
+
type CssRules = "toolbar" | "button";
const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
@@ -79,7 +78,7 @@ export const favoritePanelColumns: DataColumns<string> = [
name: FavoritePanelColumnNames.TYPE,
selected: true,
configurable: true,
- filters: getInitialResourceTypeFilters(),
+ filters: getSimpleObjectTypeFilters(),
render: uuid => <ResourceType uuid={uuid} />
},
{
commit 89059eace676f0855ca66aa0a66d6110223b1d7e
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date: Mon Nov 26 10:32:55 2018 +0100
Format resource-type-filters
Feature #14258
Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
diff --git a/src/store/resource-type-filters/resource-type-filters.ts b/src/store/resource-type-filters/resource-type-filters.ts
index 717b059..78777be 100644
--- a/src/store/resource-type-filters/resource-type-filters.ts
+++ b/src/store/resource-type-filters/resource-type-filters.ts
@@ -116,8 +116,8 @@ const NON_GENERAL_COLLECTION_TYPES = difference(COLLECTION_TYPES, [CollectionTyp
const COLLECTION_PROPERTIES_PREFIX = `${GroupContentsResourcePrefix.COLLECTION}.properties`;
-const buildCollectiomTypeFilters = ({ fb, filters}: { fb: FilterBuilder, filters: CollectionType[] }) => {
- switch(true){
+const buildCollectiomTypeFilters = ({ fb, filters }: { fb: FilterBuilder, filters: CollectionType[] }) => {
+ switch (true) {
case filters.length === 0 || filters.length === COLLECTION_TYPES.length:
return fb;
case includes(CollectionType.GENERAL, filters):
commit dad5fab1615023c73ad67a9dff8f63aa7d1bf282
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date: Mon Nov 26 10:31:51 2018 +0100
Create function for serializing simplified object type filters
Feature #14258
Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
diff --git a/src/store/resource-type-filters/resource-type-filters.ts b/src/store/resource-type-filters/resource-type-filters.ts
index eef973e..717b059 100644
--- a/src/store/resource-type-filters/resource-type-filters.ts
+++ b/src/store/resource-type-filters/resource-type-filters.ts
@@ -3,7 +3,7 @@
// SPDX-License-Identifier: AGPL-3.0
import { difference, pipe, values, includes, __ } from 'lodash/fp';
-import { createTree, setNode, TreeNodeStatus, TreeNode } from '~/models/tree';
+import { createTree, setNode, TreeNodeStatus, TreeNode, Tree } from '~/models/tree';
import { DataTableFilterItem, DataTableFilters } from '~/components/data-table-filters/data-table-filters-tree';
import { ResourceKind } from '~/models/resource';
import { FilterBuilder } from '~/services/api/filter-builder';
@@ -133,3 +133,9 @@ export const serializeResourceTypeFilters = pipe(
serializeCollectionTypeFilters,
({ fb }) => fb.getFilters(),
);
+
+export const serializeSimpleObjectTypeFilters = (filters: Tree<DataTableFilterItem>) => {
+ return getSelectedNodes(filters)
+ .map(f => f.id)
+ .map(objectTypeToResourceKind);
+};
commit d32c007b46b6137c6490009b3739a363dbe2bd66
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date: Mon Nov 26 10:28:04 2018 +0100
Create simplified object type filters for use where collection types are not supported
Feature #14258
Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
diff --git a/src/store/resource-type-filters/resource-type-filters.ts b/src/store/resource-type-filters/resource-type-filters.ts
index 295818a..eef973e 100644
--- a/src/store/resource-type-filters/resource-type-filters.ts
+++ b/src/store/resource-type-filters/resource-type-filters.ts
@@ -35,6 +35,13 @@ const initFilter = (name: string, parent = '') =>
status: TreeNodeStatus.LOADED,
});
+export const getSimpleObjectTypeFilters = pipe(
+ (): DataTableFilters => createTree<DataTableFilterItem>(),
+ initFilter(ObjectTypeFilter.PROJECT),
+ initFilter(ObjectTypeFilter.PROCESS),
+ initFilter(ObjectTypeFilter.COLLECTION),
+);
+
export const getInitialResourceTypeFilters = pipe(
(): DataTableFilters => createTree<DataTableFilterItem>(),
initFilter(ObjectTypeFilter.PROJECT),
commit 87636089f8b7d150a2987cafd48a2ca7dd6c24f9
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date: Sun Nov 25 22:21:03 2018 +0100
Restore type filters to trash panel
Feature #14258
Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
diff --git a/src/store/trash-panel/trash-panel-middleware-service.ts b/src/store/trash-panel/trash-panel-middleware-service.ts
index e6cee25..f52421a 100644
--- a/src/store/trash-panel/trash-panel-middleware-service.ts
+++ b/src/store/trash-panel/trash-panel-middleware-service.ts
@@ -23,6 +23,9 @@ import { snackbarActions, SnackbarKind } from "~/store/snackbar/snackbar-actions
import { updateResources } from "~/store/resources/resources-actions";
import { progressIndicatorActions } from "~/store/progress-indicator/progress-indicator-actions";
import { getSortColumn } from "~/store/data-explorer/data-explorer-reducer";
+import { serializeResourceTypeFilters } from '~/store//resource-type-filters/resource-type-filters';
+import { getDataExplorerColumnFilters } from '~/store/data-explorer/data-explorer-middleware-service';
+import { joinFilters } from '../../services/api/filter-builder';
export class TrashPanelMiddlewareService extends DataExplorerMiddlewareService {
constructor(private services: ServiceRepository, id: string) {
@@ -33,7 +36,20 @@ export class TrashPanelMiddlewareService extends DataExplorerMiddlewareService {
const dataExplorer = api.getState().dataExplorer[this.getId()];
const columns = dataExplorer.columns as DataColumns<string>;
const sortColumn = getSortColumn(dataExplorer);
- const typeFilters = this.getColumnFilters(columns, TrashPanelColumnNames.TYPE);
+
+ const typeFilters = serializeResourceTypeFilters(getDataExplorerColumnFilters(columns, ProjectPanelColumnNames.TYPE));
+
+ const otherFilters = new FilterBuilder()
+ .addILike("name", dataExplorer.searchValue, GroupContentsResourcePrefix.COLLECTION)
+ .addILike("name", dataExplorer.searchValue, GroupContentsResourcePrefix.PROCESS)
+ .addILike("name", dataExplorer.searchValue, GroupContentsResourcePrefix.PROJECT)
+ .addEqual("is_trashed", true)
+ .getFilters();
+
+ const filters = joinFilters(
+ typeFilters,
+ otherFilters,
+ );
const order = new OrderBuilder<ProjectResource>();
@@ -55,13 +71,7 @@ export class TrashPanelMiddlewareService extends DataExplorerMiddlewareService {
.contents(userUuid, {
...dataExplorerToListParams(dataExplorer),
order: order.getOrder(),
- filters: new FilterBuilder()
- // TODO: update filters
- // .addIsA("uuid", typeFilters.map(f => f.type))
- .addILike("name", dataExplorer.searchValue, GroupContentsResourcePrefix.COLLECTION)
- .addILike("name", dataExplorer.searchValue, GroupContentsResourcePrefix.PROJECT)
- .addEqual("is_trashed", true)
- .getFilters(),
+ filters,
recursive: true,
includeTrash: true
});
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list