- outputUuid: res.outputUuid || '',
- workflowUuid: res.properties.workflowUuid || '',
- menuKind: ContextMenuKind.PROCESS
- }));
+ outputUuid: res.outputUuid || "",
+ workflowUuid: res.properties.template_uuid || "",
+ menuKind: ContextMenuKind.PROCESS_RESOURCE,
+ })
+ );
+ }
+};
+
+export const openRunningProcessContextMenu =
+ (event: React.MouseEvent<HTMLElement>, process: Process) => (dispatch: Dispatch, getState: () => RootState) => {
+ const res = getResource<ProcessResource>(process.containerRequest.uuid)(getState().resources);
+ if (res) {
+ dispatch<any>(
+ openContextMenu(event, {
+ uuid: res.uuid,
+ ownerUuid: res.ownerUuid,
+ kind: ResourceKind.PROCESS,
+ name: res.name,
+ description: res.description,
+ outputUuid: res.outputUuid || "",
+ workflowUuid: res.properties.template_uuid || "",
+ menuKind: ContextMenuKind.RUNNING_PROCESS_RESOURCE,
+ })
+ );
+ }
+ };
+
+export const openPermissionEditContextMenu =
+ (event: React.MouseEvent<HTMLElement>, link: LinkResource) => (dispatch: Dispatch, getState: () => RootState) => {
+ if (link) {
+ dispatch<any>(
+ openContextMenu(event, {
+ name: link.name,
+ uuid: link.uuid,
+ kind: link.kind,
+ menuKind: ContextMenuKind.PERMISSION_EDIT,
+ ownerUuid: link.ownerUuid,
+ })
+ );