-export const processResourceActionSet: ContextMenuActionSet = [[
- ...readOnlyProcessResourceActionSet.reduce((prev, next) => prev.concat(next), []),
- {
- icon: RenameIcon,
- name: "Edit process",
- execute: (dispatch, resource) => {
- dispatch<any>(openProcessUpdateDialog(resource));
- }
- },
- {
- icon: ShareIcon,
- name: "Share",
- execute: (dispatch, { uuid }) => {
- dispatch<any>(openSharingDialog(uuid));
- }
- },
- {
- icon: MoveToIcon,
- name: "Move to",
- execute: (dispatch, resource) => {
- dispatch<any>(openMoveProcessDialog(resource));
- }
- },
- {
- name: "Remove",
- icon: RemoveIcon,
- execute: (dispatch, resource) => {
- dispatch<any>(openRemoveProcessDialog(resource.uuid));
- }
- }
-]];
+export const processResourceActionSet: ContextMenuActionSet = [
+ [
+ ...readOnlyProcessResourceActionSet.reduce((prev, next) => prev.concat(next), []),
+ {
+ icon: RenameIcon,
+ name: "Edit process",
+ execute: (dispatch, resources) => {
+ dispatch<any>(openProcessUpdateDialog(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",
+ icon: RemoveIcon,
+ execute: (dispatch, resources) => {
+ dispatch<any>(openRemoveProcessDialog(resources[0], resources.length));
+ },
+ },
+ ],
+];
+
+const runningProcessOnlyActionSet: ContextMenuActionSet = [
+ [
+ {
+ name: "CANCEL",
+ icon: StopIcon,
+ execute: (dispatch, resources) => {
+ dispatch<any>(cancelRunningWorkflow(resources[0].uuid));
+ },
+ },
+ ]
+];
+
+export const processResourceAdminActionSet: ContextMenuActionSet = [
+ [
+ ...processResourceActionSet.reduce((prev, next) => prev.concat(next), []),
+ {
+ component: TogglePublicFavoriteAction,
+ name: "Add to public favorites",
+ execute: (dispatch, resources) => {
+ dispatch<any>(togglePublicFavorite(resources[0])).then(() => {
+ dispatch<any>(publicFavoritePanelActions.REQUEST_ITEMS());
+ });
+ },
+ },
+ ],
+];
+
+export const runningProcessResourceActionSet = [
+ [
+ ...processResourceActionSet.reduce((prev, next) => prev.concat(next), []),
+ ...runningProcessOnlyActionSet.reduce((prev, next) => prev.concat(next), []),
+ ],
+];
+
+export const runningProcessResourceAdminActionSet: ContextMenuActionSet = [
+ [
+ ...processResourceAdminActionSet.reduce((prev, next) => prev.concat(next), []),
+ ...runningProcessOnlyActionSet.reduce((prev, next) => prev.concat(next), []),
+ ],
+];