X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/80fdf9603c057f1e41915e7c8890c942d240b36e..8045851b13e03215f3f2c8be6d54b43bd4619862:/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 1076696a..ebf827aa 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,91 +3,34 @@ // SPDX-License-Identifier: AGPL-3.0 import { ContextMenuActionSet } from "../context-menu-action-set"; -import { NewProjectIcon, RenameIcon, MoveToIcon, DetailsIcon, AdvancedIcon } 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 { 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 { projectActionSet, filterGroupActionSet } from "views-components/context-menu/action-sets/project-action-set"; export const projectAdminActionSet: ContextMenuActionSet = [[ + ...projectActionSet.reduce((prev, next) => prev.concat(next), []), { - icon: NewProjectIcon, - name: "New project", - execute: (dispatch, resource) => { - dispatch(openProjectCreateDialog(resource.uuid)); - } - }, - { - icon: RenameIcon, - name: "Edit project", - execute: (dispatch, resource) => { - dispatch(openProjectUpdateDialog(resource)); - } - }, - { - icon: ShareIcon, - name: "Share", - execute: (dispatch, { uuid }) => { - dispatch(openSharingDialog(uuid)); - } - }, - { - component: ToggleFavoriteAction, + component: TogglePublicFavoriteAction, + name: 'TogglePublicFavoriteAction', execute: (dispatch, resource) => { - dispatch(toggleFavorite(resource)).then(() => { - dispatch(favoritePanelActions.REQUEST_ITEMS()); + dispatch(togglePublicFavorite(resource)).then(() => { + dispatch(publicFavoritePanelActions.REQUEST_ITEMS()); }); } - }, + } +]]; + +export const filterGroupAdminActionSet: ContextMenuActionSet = [[ + ...filterGroupActionSet.reduce((prev, next) => prev.concat(next), []), { component: TogglePublicFavoriteAction, + name: 'TogglePublicFavoriteAction', execute: (dispatch, resource) => { - dispatch(toggleFavorite(resource)).then(() => { - dispatch(favoritePanelActions.REQUEST_ITEMS()); + dispatch(togglePublicFavorite(resource)).then(() => { + 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, - execute: (dispatch, resource) => { - dispatch(toggleProjectTrashed(resource.uuid, resource.ownerUuid, resource.isTrashed!!)); - } - }, + } ]];