import { CollectionResource } from 'models/collection';
import { GroupClass, GroupResource } from 'models/group';
import { GroupContentsResource } from 'services/groups-service/groups-service';
+import { LinkResource } from 'models/link';
export const contextMenuActions = unionize({
OPEN_CONTEXT_MENU: ofType<{ position: ContextMenuPosition, resource: ContextMenuResource }>(),
isEditable?: boolean;
outputUuid?: string;
workflowUuid?: string;
+ storageClassesDesired?: string[];
+ properties?: { [key: string]: string | string[] };
};
export const isKeyboardClick = (event: React.MouseEvent<HTMLElement>) => event.nativeEvent.detail === 0;
}));
};
-export const openComputeNodeContextMenu = (event: React.MouseEvent<HTMLElement>, resourceUuid: string) =>
- (dispatch: Dispatch) => {
- dispatch<any>(openContextMenu(event, {
- name: '',
- uuid: resourceUuid,
- ownerUuid: '',
- kind: ResourceKind.NODE,
- menuKind: ContextMenuKind.NODE
- }));
- };
-
export const openApiClientAuthorizationContextMenu =
(event: React.MouseEvent<HTMLElement>, resourceUuid: string) =>
(dispatch: Dispatch) => {
name: res.name,
description: res.description,
outputUuid: res.outputUuid || '',
- workflowUuid: res.properties.workflowUuid || '',
- menuKind: ContextMenuKind.PROCESS
+ workflowUuid: res.properties.template_uuid || '',
+ menuKind: ContextMenuKind.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,
+ }));
+ }
+ };
+
+export const openUserContextMenu = (event: React.MouseEvent<HTMLElement>, user: UserResource) =>
+ (dispatch: Dispatch, getState: () => RootState) => {
+ dispatch<any>(openContextMenu(event, {
+ name: '',
+ uuid: user.uuid,
+ ownerUuid: user.ownerUuid,
+ kind: user.kind,
+ menuKind: ContextMenuKind.USER
+ }));
+ };
+
export const resourceUuidToContextMenuKind = (uuid: string, readonly = false) =>
(dispatch: Dispatch, getState: () => RootState) => {
const { isAdmin: isAdminUser, uuid: userUuid } = getState().auth.user!;
return ContextMenuKind.ROOT_PROJECT;
case ResourceKind.LINK:
return ContextMenuKind.LINK;
+ case ResourceKind.WORKFLOW:
+ return ContextMenuKind.WORKFLOW;
default:
return;
}