[ARVADOS-WORKBENCH2] updated: 1.3.0-234-g87eaf9dd
Git user
git at public.curoverse.com
Thu Dec 20 13:03:25 EST 2018
Summary of changes:
src/services/groups-service/groups-service.ts | 2 +-
.../resource-type-filters/resource-type-filters.ts | 8 ++++++++
.../trash-panel/trash-panel-middleware-service.ts | 2 +-
.../form-fields/search-bar-form-fields.tsx | 24 ++++++++++++++--------
src/views/trash-panel/trash-panel.tsx | 7 +++++--
5 files changed, 31 insertions(+), 12 deletions(-)
via 87eaf9dd29c3a9ad816f0cb45b89282644b328d3 (commit)
from 3b20598eaffacd4762c8cc92af42ca30e0750189 (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 87eaf9dd29c3a9ad816f0cb45b89282644b328d3
Author: Daniel Kos <daniel.kos at contractors.roche.com>
Date: Thu Dec 20 19:03:22 2018 +0100
Fix trash panel access
Feature #14348
Arvados-DCO-1.1-Signed-off-by: Daniel Kos <daniel.kos at contractors.roche.com>
diff --git a/src/services/groups-service/groups-service.ts b/src/services/groups-service/groups-service.ts
index d8b33f60..668a0ac5 100644
--- a/src/services/groups-service/groups-service.ts
+++ b/src/services/groups-service/groups-service.ts
@@ -53,7 +53,7 @@ export class GroupsService<T extends GroupResource = GroupResource> extends Tras
.get(this.resourceType + pathUrl, {
params: CommonResourceService.mapKeys(_.snakeCase)(params)
}),
- this.actions,
+ this.actions,
false
);
diff --git a/src/store/resource-type-filters/resource-type-filters.ts b/src/store/resource-type-filters/resource-type-filters.ts
index 78777be1..a6abf44b 100644
--- a/src/store/resource-type-filters/resource-type-filters.ts
+++ b/src/store/resource-type-filters/resource-type-filters.ts
@@ -52,6 +52,14 @@ export const getInitialResourceTypeFilters = pipe(
initFilter(CollectionTypeFilter.LOG_COLLECTION, ObjectTypeFilter.COLLECTION),
);
+export const getTrashPanelTypeFilters = pipe(
+ (): DataTableFilters => createTree<DataTableFilterItem>(),
+ initFilter(ObjectTypeFilter.PROJECT),
+ initFilter(ObjectTypeFilter.COLLECTION),
+ initFilter(CollectionTypeFilter.GENERAL_COLLECTION, ObjectTypeFilter.COLLECTION),
+ initFilter(CollectionTypeFilter.OUTPUT_COLLECTION, ObjectTypeFilter.COLLECTION),
+ initFilter(CollectionTypeFilter.LOG_COLLECTION, ObjectTypeFilter.COLLECTION),
+);
const createFiltersBuilder = (filters: DataTableFilters) =>
({ fb: new FilterBuilder(), selectedFilters: getSelectedNodes(filters) });
diff --git a/src/store/trash-panel/trash-panel-middleware-service.ts b/src/store/trash-panel/trash-panel-middleware-service.ts
index f52421a1..3708f073 100644
--- a/src/store/trash-panel/trash-panel-middleware-service.ts
+++ b/src/store/trash-panel/trash-panel-middleware-service.ts
@@ -41,7 +41,7 @@ export class TrashPanelMiddlewareService extends DataExplorerMiddlewareService {
const otherFilters = new FilterBuilder()
.addILike("name", dataExplorer.searchValue, GroupContentsResourcePrefix.COLLECTION)
- .addILike("name", dataExplorer.searchValue, GroupContentsResourcePrefix.PROCESS)
+ // .addILike("name", dataExplorer.searchValue, GroupContentsResourcePrefix.PROCESS)
.addILike("name", dataExplorer.searchValue, GroupContentsResourcePrefix.PROJECT)
.addEqual("is_trashed", true)
.getFilters();
diff --git a/src/views-components/form-fields/search-bar-form-fields.tsx b/src/views-components/form-fields/search-bar-form-fields.tsx
index 85abbe19..6fb23498 100644
--- a/src/views-components/form-fields/search-bar-form-fields.tsx
+++ b/src/views-components/form-fields/search-bar-form-fields.tsx
@@ -18,6 +18,8 @@ import { PropertyKeyInput } from '~/views-components/resource-properties-form/pr
import { PropertyValueInput, PropertyValueFieldProps } from '~/views-components/resource-properties-form/property-value-field';
import { VocabularyProp, connectVocabulary } from '~/views-components/resource-properties-form/property-field-common';
import { compose } from 'redux';
+import { connect } from "react-redux";
+import { RootState } from "~/store/store";
export const SearchBarTypeField = () =>
<Field
@@ -30,16 +32,22 @@ export const SearchBarTypeField = () =>
{ key: ResourceKind.PROCESS, value: 'Process' }
]} />;
-export const SearchBarClusterField = () =>
- <Field
+
+interface SearchBarClusterFieldProps {
+ clusters: { key: string, value: string }[];
+}
+
+export const SearchBarClusterField = connect(
+ (state: RootState) => ({
+ clusters: [{key: '', value: 'Any'}].concat(state.auth.sessions.map(s => ({
+ key: s.clusterId,
+ value: s.clusterId
+ })))
+ }))((props: SearchBarClusterFieldProps) => <Field
name='cluster'
component={NativeSelectField}
- items={[
- { key: '', value: 'Any' },
- { key: ClusterObjectType.INDIANAPOLIS, value: 'Indianapolis' },
- { key: ClusterObjectType.KAISERAUGST, value: 'Kaiseraugst' },
- { key: ClusterObjectType.PENZBERG, value: 'Penzberg' }
- ]} />;
+ items={props.clusters}/>
+ );
export const SearchBarProjectField = () =>
<Field
diff --git a/src/views/trash-panel/trash-panel.tsx b/src/views/trash-panel/trash-panel.tsx
index bcc66114..7a319ef7 100644
--- a/src/views/trash-panel/trash-panel.tsx
+++ b/src/views/trash-panel/trash-panel.tsx
@@ -32,7 +32,10 @@ import { ContextMenuKind } from "~/views-components/context-menu/context-menu";
import { Dispatch } from "redux";
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';
+import {
+ getInitialResourceTypeFilters,
+ getTrashPanelTypeFilters
+} from '~/store/resource-type-filters/resource-type-filters';
type CssRules = "toolbar" | "button";
@@ -93,7 +96,7 @@ export const trashPanelColumns: DataColumns<string> = [
selected: true,
configurable: true,
sortDirection: SortDirection.NONE,
- filters: getInitialResourceTypeFilters(),
+ filters: getTrashPanelTypeFilters(),
render: uuid => <ResourceType uuid={uuid} />,
},
{
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list