- handleContextMenu: (event: React.MouseEvent<HTMLElement>, resource: any, isAdmin: boolean) => {
- event.stopPropagation();
- // When viewing the contents of a filter group, all contents should be treated as read only.
- let readOnly = false;
- if (resource.groupClass === 'filter') {
- readOnly = true;
- }
- let menuKind = dispatch<any>(resourceUuidToContextMenuKind(resource.uuid, readOnly));
- if (menuKind === ContextMenuKind.ROOT_PROJECT) {
- menuKind = ContextMenuKind.USER_DETAILS;
- }
- if (menuKind && resource) {
- dispatch<any>(
- openContextMenu(event, {
- name: resource.name,
- uuid: resource.uuid,
- ownerUuid: resource.ownerUuid,
- isTrashed: 'isTrashed' in resource ? resource.isTrashed : false,
- kind: resource.kind,
- menuKind,
- isAdmin,
- isFrozen: !!resource.frozenByUuid,
- description: resource.description,
- storageClassesDesired: (resource as CollectionResource).storageClassesDesired,
- properties: 'properties' in resource ? resource.properties : {},
- })
- );
- }
- },