X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/515ca43f5ea8c913b4c17224698a15778fea6c95..701db873d602c7f1ba414ebbbf07551892587055:/src/views-components/context-menu/action-sets/project-admin-action-set.ts diff --git a/src/views-components/context-menu/action-sets/project-admin-action-set.ts b/src/views-components/context-menu/action-sets/project-admin-action-set.ts index 398864dc..a3a8ce79 100644 --- a/src/views-components/context-menu/action-sets/project-admin-action-set.ts +++ b/src/views-components/context-menu/action-sets/project-admin-action-set.ts @@ -3,69 +3,14 @@ // SPDX-License-Identifier: AGPL-3.0 import { ContextMenuActionSet } from "../context-menu-action-set"; -import { NewProjectIcon, RenameIcon, MoveToIcon, DetailsIcon, AdvancedIcon, OpenIcon, Link } from '~/components/icon/icon'; -import { ToggleFavoriteAction } from "../actions/favorite-action"; -import { toggleFavorite } from "~/store/favorites/favorites-actions"; -import { favoritePanelActions } from "~/store/favorite-panel/favorite-panel-action"; -import { openMoveProjectDialog } from '~/store/projects/project-move-actions'; -import { openProjectCreateDialog } from '~/store/projects/project-create-actions'; -import { openProjectUpdateDialog } from '~/store/projects/project-update-actions'; -import { ToggleTrashAction } from "~/views-components/context-menu/actions/trash-action"; -import { toggleProjectTrashed } from "~/store/trash/trash-actions"; -import { ShareIcon } from '~/components/icon/icon'; -import { openSharingDialog } from "~/store/sharing-dialog/sharing-dialog-actions"; -import { openAdvancedTabDialog } from "~/store/advanced-tab/advanced-tab"; -import { toggleDetailsPanel } from '~/store/details-panel/details-panel-action'; import { TogglePublicFavoriteAction } from "~/views-components/context-menu/actions/public-favorite-action"; import { togglePublicFavorite } from "~/store/public-favorites/public-favorites-actions"; import { publicFavoritePanelActions } from "~/store/public-favorites-panel/public-favorites-action"; -import { copyToClipboardAction, openInNewTabAction } from "~/store/open-in-new-tab/open-in-new-tab.actions"; + +import { projectActionSet } from "~/views-components/context-menu/action-sets/project-action-set"; export const projectAdminActionSet: ContextMenuActionSet = [[ - { - icon: NewProjectIcon, - name: "New project", - execute: (dispatch, resource) => { - dispatch(openProjectCreateDialog(resource.uuid)); - } - }, - { - icon: OpenIcon, - name: "Open in new tab", - execute: (dispatch, resource) => { - dispatch(openInNewTabAction(resource)); - } - }, - { - icon: Link, - name: "Copy to clipboard", - execute: (dispatch, resource) => { - dispatch(copyToClipboardAction(resource)); - } - }, - { - icon: RenameIcon, - name: "Edit project", - execute: (dispatch, resource) => { - dispatch(openProjectUpdateDialog(resource)); - } - }, - { - icon: ShareIcon, - name: "Share", - execute: (dispatch, { uuid }) => { - dispatch(openSharingDialog(uuid)); - } - }, - { - component: ToggleFavoriteAction, - name: 'ToggleFavoriteAction', - execute: (dispatch, resource) => { - dispatch(toggleFavorite(resource)).then(() => { - dispatch(favoritePanelActions.REQUEST_ITEMS()); - }); - } - }, + ...projectActionSet.reduce((prev, next) => prev.concat(next), []), { component: TogglePublicFavoriteAction, name: 'TogglePublicFavoriteAction', @@ -74,40 +19,5 @@ export const projectAdminActionSet: ContextMenuActionSet = [[ dispatch(publicFavoritePanelActions.REQUEST_ITEMS()); }); } - }, - { - icon: MoveToIcon, - name: "Move to", - execute: (dispatch, resource) => { - dispatch(openMoveProjectDialog(resource)); - } - }, - // { - // icon: CopyIcon, - // name: "Copy to project", - // execute: (dispatch, resource) => { - // // add code - // } - // }, - { - icon: DetailsIcon, - name: "View details", - execute: dispatch => { - dispatch(toggleDetailsPanel()); - } - }, - { - icon: AdvancedIcon, - name: "Advanced", - execute: (dispatch, resource) => { - dispatch(openAdvancedTabDialog(resource.uuid)); - } - }, - { - component: ToggleTrashAction, - name: 'ToggleTrashAction', - execute: (dispatch, resource) => { - dispatch(toggleProjectTrashed(resource.uuid, resource.ownerUuid, resource.isTrashed!!)); - } - }, + } ]];