X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/e99aebfc86f72db64d3bd04edeaabd5c31b9b3e6..c38a6d84f0dc5bf5a5048095396a9142de9938d5:/src/views-components/context-menu/action-sets/trashed-collection-action-set.ts diff --git a/src/views-components/context-menu/action-sets/trashed-collection-action-set.ts b/src/views-components/context-menu/action-sets/trashed-collection-action-set.ts index 1f91d7e543..3e8f0cb647 100644 --- a/src/views-components/context-menu/action-sets/trashed-collection-action-set.ts +++ b/src/views-components/context-menu/action-sets/trashed-collection-action-set.ts @@ -2,39 +2,41 @@ // // SPDX-License-Identifier: AGPL-3.0 -import { ContextMenuActionSet } from "../context-menu-action-set"; -import { DetailsIcon, ProvenanceGraphIcon, AdvancedIcon, RestoreFromTrashIcon } from '~/components/icon/icon'; -import { toggleCollectionTrashed } from "~/store/trash/trash-actions"; -import { detailsPanelActions } from "~/store/details-panel/details-panel-action"; -import { openAdvancedTabDialog } from "~/store/advanced-tab/advanced-tab"; +import { ContextMenuActionSet } from '../context-menu-action-set'; +import { DetailsIcon, ProvenanceGraphIcon, AdvancedIcon, RestoreFromTrashIcon } from 'components/icon/icon'; +import { toggleCollectionTrashed } from 'store/trash/trash-actions'; +import { openAdvancedTabDialog } from 'store/advanced-tab/advanced-tab'; +import { toggleDetailsPanel } from 'store/details-panel/details-panel-action'; -export const trashedCollectionActionSet: ContextMenuActionSet = [[ - { - icon: DetailsIcon, - name: "View details", - execute: dispatch => { - dispatch(detailsPanelActions.TOGGLE_DETAILS_PANEL()); - } - }, - { - icon: ProvenanceGraphIcon, - name: "Provenance graph", - execute: (dispatch, resource) => { - // add code - } - }, - { - icon: AdvancedIcon, - name: "Advanced", - execute: (dispatch, resource) => { - dispatch(openAdvancedTabDialog(resource.uuid)); - } - }, - { - icon: RestoreFromTrashIcon, - name: "Restore", - execute: (dispatch, resource) => { - dispatch(toggleCollectionTrashed(resource.uuid, true)); - } - }, -]]; +export const trashedCollectionActionSet: ContextMenuActionSet = [ + [ + { + icon: DetailsIcon, + name: 'View details', + execute: (dispatch) => { + dispatch(toggleDetailsPanel()); + }, + }, + { + icon: ProvenanceGraphIcon, + name: 'Provenance graph', + execute: (dispatch, resource) => { + // add code + }, + }, + { + icon: AdvancedIcon, + name: 'API Details', + execute: (dispatch, resources) => { + dispatch(openAdvancedTabDialog(resources[0].uuid)); + }, + }, + { + icon: RestoreFromTrashIcon, + name: 'Restore', + execute: (dispatch, resources) => { + resources.forEach((resource) => dispatch(toggleCollectionTrashed(resource.uuid, true))); + }, + }, + ], +];