Merge branch '17098-old-version-as-head'
[arvados-workbench2.git] / src / views-components / context-menu / action-sets / project-admin-action-set.ts
index 1076696a19a6e72960b51e2f013cb7d29e133447..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";
@@ -17,6 +17,9 @@ 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";
 
 export const projectAdminActionSet: ContextMenuActionSet = [[
     {
@@ -26,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",
@@ -42,6 +59,7 @@ export const projectAdminActionSet: ContextMenuActionSet = [[
     },
     {
         component: ToggleFavoriteAction,
+        name: 'ToggleFavoriteAction',
         execute: (dispatch, resource) => {
             dispatch<any>(toggleFavorite(resource)).then(() => {
                 dispatch<any>(favoritePanelActions.REQUEST_ITEMS());
@@ -50,9 +68,10 @@ export const projectAdminActionSet: ContextMenuActionSet = [[
     },
     {
         component: TogglePublicFavoriteAction,
+        name: 'TogglePublicFavoriteAction',
         execute: (dispatch, resource) => {
-            dispatch<any>(toggleFavorite(resource)).then(() => {
-                dispatch<any>(favoritePanelActions.REQUEST_ITEMS());
+            dispatch<any>(togglePublicFavorite(resource)).then(() => {
+                dispatch<any>(publicFavoritePanelActions.REQUEST_ITEMS());
             });
         }
     },
@@ -86,6 +105,7 @@ export const projectAdminActionSet: ContextMenuActionSet = [[
     },
     {
         component: ToggleTrashAction,
+        name: 'ToggleTrashAction',
         execute: (dispatch, resource) => {
             dispatch<any>(toggleProjectTrashed(resource.uuid, resource.ownerUuid, resource.isTrashed!!));
         }