[arvados-workbench2] updated: 2.7.0-221-gf34a6f70
git repository hosting
git at public.arvados.org
Mon Nov 27 20:10:31 UTC 2023
Summary of changes:
.../multiselect-toolbar/MultiselectToolbar.tsx | 22 +++++++++---
.../ms-toolbar-action-filters.ts | 27 +++++++++++++--
.../multiselect-toolbar/ms-project-action-set.ts | 39 +++++++++++++++++++---
3 files changed, 77 insertions(+), 11 deletions(-)
via f34a6f707a2a06a079957e76c6ba1b775881d191 (commit)
from b209139fad51806fb985a6dd0b7b1be5b3917189 (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 f34a6f707a2a06a079957e76c6ba1b775881d191
Author: Lisa Knox <lisaknox83 at gmail.com>
Date: Mon Nov 27 15:10:26 2023 -0500
21128: frozen project menu works Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>
diff --git a/src/components/multiselect-toolbar/MultiselectToolbar.tsx b/src/components/multiselect-toolbar/MultiselectToolbar.tsx
index dbc5e59e..51fe4375 100644
--- a/src/components/multiselect-toolbar/MultiselectToolbar.tsx
+++ b/src/components/multiselect-toolbar/MultiselectToolbar.tsx
@@ -10,17 +10,18 @@ import { RootState } from "store/store";
import { Dispatch } from "redux";
import { TCheckedList } from "components/data-table/data-table";
import { ContextMenuResource } from "store/context-menu/context-menu-actions";
-import { Resource, extractUuidKind } from "models/resource";
+import { Resource, ResourceKind, extractUuidKind } from "models/resource";
import { getResource } from "store/resources/resources";
import { ResourcesState } from "store/resources/resources";
import { MultiSelectMenuAction, MultiSelectMenuActionSet, MultiSelectMenuActionNames } from "views-components/multiselect-toolbar/ms-menu-actions";
import { ContextMenuAction } from "views-components/context-menu/context-menu-action-set";
-import { multiselectActionsFilters, TMultiselectActionsFilters } from "./ms-toolbar-action-filters";
+import { multiselectActionsFilters, TMultiselectActionsFilters, msResourceKind } from "./ms-toolbar-action-filters";
import { kindToActionSet, findActionByName } from "./ms-kind-action-differentiator";
import { msToggleTrashAction } from "views-components/multiselect-toolbar/ms-project-action-set";
import { copyToClipboardAction } from "store/open-in-new-tab/open-in-new-tab.actions";
import { ContainerRequestResource } from "models/container-request";
import { FavoritesState } from "store/favorites/favorites-reducer";
+import { resourceIsFrozen } from "common/frozen-resources";
type CssRules = "root" | "button";
@@ -58,14 +59,16 @@ export const MultiselectToolbar = connect(
)(
withStyles(styles)((props: MultiselectToolbarProps & WithStyles<CssRules>) => {
const { classes, checkedList, selectedUuid: singleSelectedUuid, iconProps } = props;
- const currentResourceKinds = Array.from(selectedToKindSet(checkedList));
+ const singleProjectKind = singleSelectedUuid ? resourceSubKind(singleSelectedUuid, iconProps.resources) : ''
+ const currentResourceKinds = singleProjectKind ? singleProjectKind :Array.from(selectedToKindSet(checkedList));
const currentPathIsTrash = window.location.pathname === "/trash";
+
const actions =
currentPathIsTrash && selectedToKindSet(checkedList).size
? [msToggleTrashAction]
- : selectActionsByKind(currentResourceKinds, multiselectActionsFilters)
+ : selectActionsByKind(currentResourceKinds as string[], multiselectActionsFilters)
.filter((action) => (singleSelectedUuid === null ? action.isForMulti : true));
return (
@@ -141,6 +144,17 @@ function filterActions(actionArray: MultiSelectMenuActionSet, filters: Set<strin
return actionArray[0].filter(action => filters.has(action.name as string));
}
+const resourceSubKind = (uuid: string, resources: ResourcesState) => {
+ const resource = getResource(uuid)(resources) as ContainerRequestResource | Resource;
+ switch (resource.kind) {
+ case ResourceKind.PROJECT:
+ if(resourceIsFrozen(resource, resources)) return [msResourceKind.PROJECT_FROZEN]
+ return [msResourceKind.PROJECT]
+ default:
+ return resource.kind
+ }
+};
+
function selectActionsByKind(currentResourceKinds: Array<string>, filterSet: TMultiselectActionsFilters) {
const rawResult: Set<MultiSelectMenuAction> = new Set();
const resultNames = new Set();
diff --git a/src/components/multiselect-toolbar/ms-toolbar-action-filters.ts b/src/components/multiselect-toolbar/ms-toolbar-action-filters.ts
index 9ad80f7d..4f4a60b8 100644
--- a/src/components/multiselect-toolbar/ms-toolbar-action-filters.ts
+++ b/src/components/multiselect-toolbar/ms-toolbar-action-filters.ts
@@ -2,10 +2,9 @@
//
// SPDX-License-Identifier: AGPL-3.0
-import { ResourceKind } from 'models/resource';
import { MultiSelectMenuActionSet, MultiSelectMenuActionNames } from 'views-components/multiselect-toolbar/ms-menu-actions';
import { msCollectionActionSet } from 'views-components/multiselect-toolbar/ms-collection-action-set';
-import { msProjectActionSet } from 'views-components/multiselect-toolbar/ms-project-action-set';
+import { msProjectActionSet, msReadOnlyProjectActionSet, msFilterGroupActionSet, msFrozenActionSet } from 'views-components/multiselect-toolbar/ms-project-action-set';
import { msProcessActionSet } from 'views-components/multiselect-toolbar/ms-process-action-set';
import { msWorkflowActionSet } from 'views-components/multiselect-toolbar/ms-workflow-action-set';
@@ -55,12 +54,34 @@ const projectMSActionsFilter = new Set([
]);
const workflowMSActionFilter = new Set([OPEN_IN_NEW_TAB, COPY_TO_CLIPBOARD, VIEW_DETAILS, API_DETAILS, RUN_WORKFLOW, DELETE_WORKFLOW]);
-const { COLLECTION, PROCESS, PROJECT, WORKFLOW } = ResourceKind;
+
+export enum msResourceKind {
+ API_CLIENT_AUTHORIZATION = "arvados#apiClientAuthorization",
+ COLLECTION = "arvados#collection",
+ CONTAINER = "arvados#container",
+ CONTAINER_REQUEST = "arvados#containerRequest",
+ GROUP = "arvados#group",
+ LINK = "arvados#link",
+ LOG = "arvados#log",
+ PROCESS = "arvados#containerRequest",
+ PROJECT = "arvados#group",
+ PROJECT_FROZEN = "arvados#group_frozen",
+ REPOSITORY = "arvados#repository",
+ SSH_KEY = "arvados#authorizedKeys",
+ KEEP_SERVICE = "arvados#keepService",
+ USER = "arvados#user",
+ VIRTUAL_MACHINE = "arvados#virtualMachine",
+ WORKFLOW = "arvados#workflow",
+ NONE = "arvados#none"
+}
+
+const { COLLECTION, PROCESS, PROJECT, PROJECT_FROZEN, WORKFLOW } = msResourceKind;
export const multiselectActionsFilters: TMultiselectActionsFilters = {
[COLLECTION]: [msCollectionActionSet, allActionNames(msCollectionActionSet)],
[PROCESS]: [msProcessActionSet, processResourceMSActionsFilter],
[PROJECT]: [msProjectActionSet, projectMSActionsFilter],
+ [PROJECT_FROZEN]: [msProjectActionSet, allActionNames(msFrozenActionSet)],
[WORKFLOW]: [msWorkflowActionSet, workflowMSActionFilter]
};
diff --git a/src/views-components/multiselect-toolbar/ms-project-action-set.ts b/src/views-components/multiselect-toolbar/ms-project-action-set.ts
index 115c4ce9..5d16da91 100644
--- a/src/views-components/multiselect-toolbar/ms-project-action-set.ts
+++ b/src/views-components/multiselect-toolbar/ms-project-action-set.ts
@@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: AGPL-3.0
-import { MultiSelectMenuAction, MultiSelectMenuActionNames } from 'views-components/multiselect-toolbar/ms-menu-actions';
+import { MultiSelectMenuActionSet, MultiSelectMenuActionNames } from 'views-components/multiselect-toolbar/ms-menu-actions';
import { openMoveProjectDialog } from 'store/projects/project-move-actions';
import { toggleProjectTrashed } from 'store/trash/trash-actions';
import { copyToClipboardAction, openInNewTabAction } from 'store/open-in-new-tab/open-in-new-tab.actions';
@@ -177,9 +177,8 @@ export const msNewProjectAction: any = {
},
};
-export const msProjectActionSet: MultiSelectMenuAction[][] = [
+export const msProjectActionSet: MultiSelectMenuActionSet = [
[
- msCopyToClipboardMenuAction,
msToggleFavoriteAction,
msOpenInNewTabMenuAction,
msCopyToClipboardMenuAction,
@@ -190,7 +189,39 @@ export const msProjectActionSet: MultiSelectMenuAction[][] = [
msShareAction,
msMoveToAction,
msToggleTrashAction,
- msFreezeProjectAction,
msNewProjectAction,
+ msFreezeProjectAction,
+ ],
+];
+
+export const msReadOnlyProjectActionSet: MultiSelectMenuActionSet = [
+ [msToggleFavoriteAction, msOpenInNewTabMenuAction, msCopyToClipboardMenuAction, msViewDetailsAction, msAdvancedAction, msOpenWith3rdPartyClientAction],
+];
+
+export const msFilterGroupActionSet: MultiSelectMenuActionSet = [
+ [
+ msToggleFavoriteAction,
+ msOpenInNewTabMenuAction,
+ msCopyToClipboardMenuAction,
+ msViewDetailsAction,
+ msAdvancedAction,
+ msOpenWith3rdPartyClientAction,
+ msEditProjectAction,
+ msShareAction,
+ msMoveToAction,
+ msToggleTrashAction,
],
];
+
+export const msFrozenActionSet: MultiSelectMenuActionSet = [
+ [
+ msShareAction,
+ msToggleFavoriteAction,
+ msOpenInNewTabMenuAction,
+ msCopyToClipboardMenuAction,
+ msViewDetailsAction,
+ msAdvancedAction,
+ msOpenWith3rdPartyClientAction,
+ msFreezeProjectAction,
+ ],
+];
\ No newline at end of file
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list