16005: Open collection and project in new tab feature added
[arvados-workbench2.git] / src / views-components / context-menu / action-sets / project-admin-action-set.ts
index f6185804406321a27b36149c1029f3dca3bcea53..398864dc97b7b5bc4147fd3639dfaab8d9da54d5 100644 (file)
@@ -3,7 +3,7 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import { ContextMenuActionSet } from "../context-menu-action-set";
-import { NewProjectIcon, RenameIcon, MoveToIcon, DetailsIcon, AdvancedIcon } from '~/components/icon/icon';
+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";
@@ -19,6 +19,7 @@ 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";
 
 export const projectAdminActionSet: ContextMenuActionSet = [[
     {
@@ -28,6 +29,20 @@ export const projectAdminActionSet: ContextMenuActionSet = [[
             dispatch<any>(openProjectCreateDialog(resource.uuid));
         }
     },
+    {
+        icon: OpenIcon,
+        name: "Open in new tab",
+        execute: (dispatch, resource) => {
+            dispatch<any>(openInNewTabAction(resource));
+        }
+    },
+    {
+        icon: Link,
+        name: "Copy to clipboard",
+        execute: (dispatch, resource) => {
+            dispatch<any>(copyToClipboardAction(resource));
+        }
+    },
     {
         icon: RenameIcon,
         name: "Edit project",
@@ -44,6 +59,7 @@ export const projectAdminActionSet: ContextMenuActionSet = [[
     },
     {
         component: ToggleFavoriteAction,
+        name: 'ToggleFavoriteAction',
         execute: (dispatch, resource) => {
             dispatch<any>(toggleFavorite(resource)).then(() => {
                 dispatch<any>(favoritePanelActions.REQUEST_ITEMS());
@@ -52,6 +68,7 @@ export const projectAdminActionSet: ContextMenuActionSet = [[
     },
     {
         component: TogglePublicFavoriteAction,
+        name: 'TogglePublicFavoriteAction',
         execute: (dispatch, resource) => {
             dispatch<any>(togglePublicFavorite(resource)).then(() => {
                 dispatch<any>(publicFavoritePanelActions.REQUEST_ITEMS());
@@ -88,6 +105,7 @@ export const projectAdminActionSet: ContextMenuActionSet = [[
     },
     {
         component: ToggleTrashAction,
+        name: 'ToggleTrashAction',
         execute: (dispatch, resource) => {
             dispatch<any>(toggleProjectTrashed(resource.uuid, resource.ownerUuid, resource.isTrashed!!));
         }