//
// SPDX-License-Identifier: AGPL-3.0
-import { ContextMenuActionSet } from "../context-menu-action-set";
+import { ContextMenuActionSet, ContextMenuActionNames } from "../context-menu-action-set";
import { ToggleFavoriteAction } from "../actions/favorite-action";
import { toggleFavorite } from "store/favorites/favorites-actions";
import {
RenameIcon,
- ShareIcon,
- MoveToIcon,
DetailsIcon,
RemoveIcon,
ReRunProcessIcon,
StopIcon,
} from "components/icon/icon";
import { favoritePanelActions } from "store/favorite-panel/favorite-panel-action";
-import { openMoveProcessDialog } from "store/processes/process-move-actions";
import { openProcessUpdateDialog } from "store/processes/process-update-actions";
import { openCopyProcessDialog } from "store/processes/process-copy-actions";
-import { openSharingDialog } from "store/sharing-dialog/sharing-dialog-actions";
import { openRemoveProcessDialog } from "store/processes/processes-actions";
import { toggleDetailsPanel } from "store/details-panel/details-panel-action";
import { navigateToOutput } from "store/process-panel/process-panel-actions";
[
{
component: ToggleFavoriteAction,
+ name: ContextMenuActionNames.ADD_TO_FAVORITES,
execute: (dispatch, resources) => {
dispatch<any>(toggleFavorite(resources[0])).then(() => {
dispatch<any>(favoritePanelActions.REQUEST_ITEMS());
},
{
icon: OpenIcon,
- name: "Open in new tab",
+ name: ContextMenuActionNames.OPEN_IN_NEW_TAB,
execute: (dispatch, resources) => {
dispatch<any>(openInNewTabAction(resources[0]));
},
},
{
icon: ReRunProcessIcon,
- name: "Copy and re-run process",
+ name: ContextMenuActionNames.COPY_AND_RERUN_PROCESS,
execute: (dispatch, resources) => {
dispatch<any>(openCopyProcessDialog(resources[0]));
},
},
{
icon: OutputIcon,
- name: "Outputs",
+ name: ContextMenuActionNames.OUTPUTS,
execute: (dispatch, resources) => {
- if (resources[0].outputUuid) {
- dispatch<any>(navigateToOutput(resources[0].outputUuid));
+ if (resources[0]) {
+ dispatch<any>(navigateToOutput(resources[0]));
}
},
},
{
icon: DetailsIcon,
- name: "View details",
+ name: ContextMenuActionNames.VIEW_DETAILS,
execute: dispatch => {
dispatch<any>(toggleDetailsPanel());
},
},
{
icon: AdvancedIcon,
- name: "API Details",
+ name: ContextMenuActionNames.API_DETAILS,
execute: (dispatch, resources) => {
dispatch<any>(openAdvancedTabDialog(resources[0].uuid));
},
...readOnlyProcessResourceActionSet.reduce((prev, next) => prev.concat(next), []),
{
icon: RenameIcon,
- name: "Edit process",
+ name: ContextMenuActionNames.EDIT_PROCESS,
execute: (dispatch, resources) => {
dispatch<any>(openProcessUpdateDialog(resources[0]));
},
},
+ // removed until auto-move children is implemented
+ // {
+ // icon: MoveToIcon,
+ // name: ContextMenuActionNames.MOVE_TO,
+ // execute: (dispatch, resources) => {
+ // dispatch<any>(openMoveProcessDialog(resources[0]));
+ // },
+ // },
{
- icon: ShareIcon,
- name: "Share",
- execute: (dispatch, resources) => {
- dispatch<any>(openSharingDialog(resources[0].uuid));
- },
- },
- {
- icon: MoveToIcon,
- name: "Move to",
- execute: (dispatch, resources) => {
- dispatch<any>(openMoveProcessDialog(resources[0]));
- },
- },
- {
- name: "Remove",
+ name: ContextMenuActionNames.REMOVE,
icon: RemoveIcon,
execute: (dispatch, resources) => {
dispatch<any>(openRemoveProcessDialog(resources[0], resources.length));
const runningProcessOnlyActionSet: ContextMenuActionSet = [
[
{
- name: "CANCEL",
+ name: ContextMenuActionNames.CANCEL,
icon: StopIcon,
execute: (dispatch, resources) => {
dispatch<any>(cancelRunningWorkflow(resources[0].uuid));
...processResourceActionSet.reduce((prev, next) => prev.concat(next), []),
{
component: TogglePublicFavoriteAction,
- name: "Add to public favorites",
+ name: ContextMenuActionNames.ADD_TO_PUBLIC_FAVORITES,
execute: (dispatch, resources) => {
dispatch<any>(togglePublicFavorite(resources[0])).then(() => {
dispatch<any>(publicFavoritePanelActions.REQUEST_ITEMS());