X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/9b390921232a4a3d1279d59da96f00dabeba1150..876e5e2f31a218255845977489ea70aacc0211cd:/src/views-components/context-menu/action-sets/root-project-action-set.ts diff --git a/src/views-components/context-menu/action-sets/root-project-action-set.ts b/src/views-components/context-menu/action-sets/root-project-action-set.ts index afb428a3..fb380fc4 100644 --- a/src/views-components/context-menu/action-sets/root-project-action-set.ts +++ b/src/views-components/context-menu/action-sets/root-project-action-set.ts @@ -2,14 +2,31 @@ // // SPDX-License-Identifier: AGPL-3.0 +import { reset } from "redux-form"; + import { ContextMenuActionSet } from "../context-menu-action-set"; -import actions from "../../../store/project/project-action"; -import { NewProjectIcon } from "../../../components/icon/icon"; +import { projectActions } from "~/store/project/project-action"; +import { NewProjectIcon } from "~/components/icon/icon"; +import { collectionCreateActions } from "../../../store/collections/creator/collection-creator-action"; +import { PROJECT_CREATE_DIALOG } from "../../dialog-create/dialog-project-create"; +import { COLLECTION_CREATE_DIALOG } from "../../dialog-create/dialog-collection-create"; +import { NewProjectIcon, CollectionIcon } from "../../../components/icon/icon"; -export const rootProjectActionSet: ContextMenuActionSet = [[{ - icon: NewProjectIcon, - name: "New project", - execute: (dispatch, resource) => { - dispatch(actions.OPEN_PROJECT_CREATOR({ ownerUuid: resource.uuid })); +export const rootProjectActionSet: ContextMenuActionSet = [[ + { + icon: NewProjectIcon, + name: "New project", + execute: (dispatch, resource) => { + dispatch(reset(PROJECT_CREATE_DIALOG)); + dispatch(projectActions.OPEN_PROJECT_CREATOR({ ownerUuid: resource.uuid })); + } + }, + { + icon: CollectionIcon, + name: "New Collection", + execute: (dispatch, resource) => { + dispatch(reset(COLLECTION_CREATE_DIALOG)); + dispatch(collectionCreateActions.OPEN_COLLECTION_CREATOR({ ownerUuid: resource.uuid })); + } } -}]]; \ No newline at end of file +]];