21448: created string constants for menu items Arvados-DCO-1.1-Signed-off-by: Lisa...
authorLisa Knox <lisaknox83@gmail.com>
Wed, 27 Mar 2024 14:01:51 +0000 (10:01 -0400)
committerLisa Knox <lisaknox83@gmail.com>
Wed, 27 Mar 2024 14:01:51 +0000 (10:01 -0400)
services/workbench2/src/views-components/context-menu/action-sets/collection-action-set.ts
services/workbench2/src/views-components/context-menu/action-sets/favorite-action-set.ts
services/workbench2/src/views-components/context-menu/action-sets/process-resource-action-set.ts
services/workbench2/src/views-components/context-menu/action-sets/project-action-set.ts
services/workbench2/src/views-components/context-menu/action-sets/project-admin-action-set.ts
services/workbench2/src/views-components/context-menu/action-sets/resource-action-set.ts
services/workbench2/src/views-components/context-menu/action-sets/trash-action-set.ts
services/workbench2/src/views-components/context-menu/context-menu-action-set.ts

index 95aec9c7c94f476be3de1aa2f595040211b8d6b6..16f87aa4811703d0e4a3bf8dbc591f2c7cbbacbd 100644 (file)
@@ -36,7 +36,7 @@ import { ContextMenuResource } from "store/context-menu/context-menu-actions";
 
 const toggleFavoriteAction: ContextMenuAction = {
     component: ToggleFavoriteAction,
-    name: "ToggleFavoriteAction",
+    name: "Add to Favorites",
     execute: (dispatch, resources) => {
         for (const resource of [...resources]) {
             dispatch<any>(toggleFavorite(resource)).then(() => {
@@ -124,7 +124,7 @@ export const collectionActionSet: ContextMenuActionSet = [
         },
         {
             component: ToggleTrashAction,
-            name: "ToggleTrashAction",
+            name: "Move to trash",
             execute: (dispatch, resources: ContextMenuResource[]) => {
                 for (const resource of [...resources]) {
                     dispatch<any>(toggleCollectionTrashed(resource.uuid, resource.isTrashed!!));
@@ -139,7 +139,7 @@ export const collectionAdminActionSet: ContextMenuActionSet = [
         ...collectionActionSet.reduce((prev, next) => prev.concat(next), []),
         {
             component: TogglePublicFavoriteAction,
-            name: "TogglePublicFavoriteAction",
+            name: "Add to public favorites",
             execute: (dispatch, resources) => {
                 for (const resource of [...resources]) {
                     dispatch<any>(togglePublicFavorite(resource)).then(() => {
index bdc4b07a2452658569830103a99b1a58134ca982..c01d8da9b5359ec07ad6fe9e3fee0cc9a5e8c986 100644 (file)
@@ -11,6 +11,7 @@ export const favoriteActionSet: ContextMenuActionSet = [
     [
         {
             component: ToggleFavoriteAction,
+            name: 'Add to Favorites',
             execute: (dispatch, resources) => {
                 resources.forEach((resource) =>
                     dispatch<any>(toggleFavorite(resource)).then(() => {
index 2aa7faa1242369be4ea985bad80805b94529b72f..58cfb118b6659160ad3439efc76f967e8ee554ca 100644 (file)
@@ -36,6 +36,7 @@ export const readOnlyProcessResourceActionSet: ContextMenuActionSet = [
     [
         {
             component: ToggleFavoriteAction,
+            name: "Add to Favorites",
             execute: (dispatch, resources) => {
                 dispatch<any>(toggleFavorite(resources[0])).then(() => {
                     dispatch<any>(favoritePanelActions.REQUEST_ITEMS());
index c722e61076088a830a91c54d837b589108580b93..f1c4643507c000c84539fb669c5447ee17ab63fe 100644 (file)
@@ -23,7 +23,7 @@ import { freezeProject, unfreezeProject } from "store/projects/project-lock-acti
 
 export const toggleFavoriteAction = {
     component: ToggleFavoriteAction,
-    name: "ToggleFavoriteAction",
+    name: "Add to Favorites",
     execute: (dispatch, resources) => {
         dispatch(toggleFavorite(resources[0])).then(() => {
             dispatch(favoritePanelActions.REQUEST_ITEMS());
@@ -97,7 +97,7 @@ export const moveToAction = {
 
 export const toggleTrashAction = {
     component: ToggleTrashAction,
-    name: "ToggleTrashAction",
+    name: "Move to trash",
     execute: (dispatch, resources) => {
         dispatch(toggleProjectTrashed(resources[0].uuid, resources[0].ownerUuid, resources[0].isTrashed!!, resources.length > 1));
     },
@@ -105,7 +105,7 @@ export const toggleTrashAction = {
 
 export const freezeProjectAction = {
     component: ToggleLockAction,
-    name: "ToggleLockAction",
+    name: "Freeze Project",
     execute: (dispatch, resources) => {
         if (resources[0].isFrozen) {
             dispatch(unfreezeProject(resources[0].uuid));
index 490bf3e30a9e649f85165a988751aff4357be40f..53df7b370e7429e98822d0798a6f119dded4b614 100644 (file)
@@ -24,7 +24,7 @@ import {
 
 export const togglePublicFavoriteAction = {
     component: TogglePublicFavoriteAction,
-    name: "TogglePublicFavoriteAction",
+    name: "Add to public favorites",
     execute: (dispatch, resources) => {
         dispatch(togglePublicFavorite(resources[0])).then(() => {
             dispatch(publicFavoritePanelActions.REQUEST_ITEMS());
index 401e9634d93c3db56533f4450298f6e7f9acb380..6c33b3ccd24485eb770bfe0b968b42f4d07072b3 100644 (file)
@@ -10,6 +10,7 @@ export const resourceActionSet: ContextMenuActionSet = [
     [
         {
             component: ToggleFavoriteAction,
+            name: 'Add to Favorites',
             execute: (dispatch, resources) => {
                 resources.forEach((resource) => dispatch<any>(toggleFavorite(resource)));
             },
index 82e00df6cbbb9fbf26229f012370f8dba568c242..dfcb4f6c954cf0edb663580bece78f18445a2a11 100644 (file)
@@ -10,6 +10,7 @@ export const trashActionSet: ContextMenuActionSet = [
     [
         {
             component: ToggleTrashAction,
+            name: 'Move to Trash',
             execute: (dispatch, resources) => {
                 resources.forEach((resource) => dispatch<any>(toggleTrashed(resource.kind, resource.uuid, resource.ownerUuid, resource.isTrashed!!)));
             },
index a953500b3ae7a49f9216bce9544b24b3771a9982..65e96ad7e8c0cc895041ac4c634e2101d43958dc 100644 (file)
@@ -6,6 +6,52 @@ import { Dispatch } from "redux";
 import { ContextMenuItem } from "components/context-menu/context-menu";
 import { ContextMenuResource } from "store/context-menu/context-menu-actions";
 
+export enum ContextMenuActionNames {
+    ACCOUNT_SETTINGS = 'Account settings',
+    ACTIVATE_USER = 'Activate user',
+    ADD_TO_FAVORITES = 'Add to Favorites',
+    ADD_TO_PUBLIC_FAVORITES = 'Add to public favorites',
+    ATTRIBUTES = 'Attributes',
+    API_DETAILS = 'API Details',
+    CANCEL = 'CANCEL',
+    COPY_AND_RERUN_PROCESS = 'Copy and re-run process',
+    COPY_SELECTED_INTO_EXISTING_COLLECTION = 'Copy selected into existing collection',
+    COPY_SELECTED_INTO_SEPARATE_COLLECTIONS = 'Copy selected into separate collections',
+    COPY_SELECTED_INTO_NEW_COLLECTION = 'Copy selected into new collection',
+    COPY_TO_CLIPBOARD = 'Copy to clipboard',
+    DEACTIVATE_USER = 'Deactivate user',
+    DELETE_WORKFLOW = 'Delete Workflow',
+    EDIT_COLLECTION = 'Edit collection',
+    EDIT_PROCESS = 'Edit process',
+    EDIT_PROJECT = 'Edit project',
+    FREEZE_PROJECT = 'Freeze Project',
+    LOGIN_AS_USER = 'Login as user',
+    MAKE_A_COPY = 'Make a copy',
+    MANAGE = 'Manage',
+    MOVE_SELECTED_INTO_EXISTING_COLLECTION = 'Move selected into existing collection',
+    MOVE_SELECTED_INTO_NEW_COLLECTION = 'Move selected into new collection',
+    MOVE_SELECTED_INTO_SEPARATE_COLLECTIONS = 'Move selected into separate collections',
+    MOVE_TO = 'Move to',
+    MOVE_TO_TRASH = 'Move to trash',
+    NEW_COLLECTION = 'New Collection',
+    NEW_PROJECT = 'New project',
+    OPEN_IN_NEW_TAB = 'Open in new tab',
+    OPEN_W_3RD_PARTY_CLIENT = 'Open with 3rd party client',
+    OUTPUTS = 'Outputs',
+    READ = 'Read',
+    REMOVE = 'Remove',
+    REMOVE_SELECTED = 'Remove selected',
+    RENAME = 'Rename',
+    RESTORE_VERSION = 'Restore version',
+    RUN_WORKFLOW = 'Run Workflow',
+    SELECT_ALL = 'Select all',
+    SETUP_USER = 'Setup user',
+    SHARE = 'Share',
+    UNSELECT_ALL = 'Unselect all',
+    VIEW_DETAILS = 'View details',
+    WRITE = 'Write',
+}
+
 export interface ContextMenuAction extends ContextMenuItem {
     execute(dispatch: Dispatch, resources: ContextMenuResource[], state?: any): void;
 }