projects
/
arvados-workbench2.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch '17426-plug-ins' refs #17426
[arvados-workbench2.git]
/
src
/
views-components
/
context-menu
/
context-menu.tsx
diff --git
a/src/views-components/context-menu/context-menu.tsx
b/src/views-components/context-menu/context-menu.tsx
index f6910290a40f694ce8b84aa3e5e7c1b1f93ce1cd..ee87d71a37d84da65a8f0594cf1cfe3130a97fc3 100644
(file)
--- a/
src/views-components/context-menu/context-menu.tsx
+++ b/
src/views-components/context-menu/context-menu.tsx
@@
-10,6
+10,7
@@
import { createAnchorAt } from "~/components/popover/helpers";
import { ContextMenuActionSet, ContextMenuAction } from "./context-menu-action-set";
import { Dispatch } from "redux";
import { memoize } from 'lodash';
import { ContextMenuActionSet, ContextMenuAction } from "./context-menu-action-set";
import { Dispatch } from "redux";
import { memoize } from 'lodash';
+import { sortByProperty } from "~/common/array-utils";
type DataProps = Pick<ContextMenuProps, "anchorEl" | "items" | "open"> & { resource?: ContextMenuResource };
const mapStateToProps = (state: RootState): DataProps => {
const { open, position, resource } = state.contextMenu;
type DataProps = Pick<ContextMenuProps, "anchorEl" | "items" | "open"> & { resource?: ContextMenuResource };
const mapStateToProps = (state: RootState): DataProps => {
const { open, position, resource } = state.contextMenu;
@@
-53,7
+54,8
@@
export const ContextMenu = connect(mapStateToProps, mapDispatchToProps, mergePro
const menuActionSets = new Map<string, ContextMenuActionSet>();
export const addMenuActionSet = (name: string, itemSet: ContextMenuActionSet) => {
const menuActionSets = new Map<string, ContextMenuActionSet>();
export const addMenuActionSet = (name: string, itemSet: ContextMenuActionSet) => {
- menuActionSets.set(name, itemSet);
+ const sorted = itemSet.map(items => items.sort(sortByProperty('name')));
+ menuActionSets.set(name, sorted);
};
const emptyActionSet: ContextMenuActionSet = [];
};
const emptyActionSet: ContextMenuActionSet = [];
@@
-65,17
+67,27
@@
export enum ContextMenuKind {
API_CLIENT_AUTHORIZATION = "ApiClientAuthorization",
ROOT_PROJECT = "RootProject",
PROJECT = "Project",
API_CLIENT_AUTHORIZATION = "ApiClientAuthorization",
ROOT_PROJECT = "RootProject",
PROJECT = "Project",
+ FILTER_GROUP = "FilterGroup",
+ READONLY_PROJECT = 'ReadOnlyProject',
+ PROJECT_ADMIN = "ProjectAdmin",
+ FILTER_GROUP_ADMIN = "FilterGroupAdmin",
RESOURCE = "Resource",
FAVORITE = "Favorite",
TRASH = "Trash",
COLLECTION_FILES = "CollectionFiles",
RESOURCE = "Resource",
FAVORITE = "Favorite",
TRASH = "Trash",
COLLECTION_FILES = "CollectionFiles",
+ READONLY_COLLECTION_FILES = "ReadOnlyCollectionFiles",
COLLECTION_FILES_ITEM = "CollectionFilesItem",
COLLECTION_FILES_ITEM = "CollectionFilesItem",
+ READONLY_COLLECTION_FILES_ITEM = "ReadOnlyCollectionFilesItem",
COLLECTION_FILES_NOT_SELECTED = "CollectionFilesNotSelected",
COLLECTION = 'Collection',
COLLECTION_FILES_NOT_SELECTED = "CollectionFilesNotSelected",
COLLECTION = 'Collection',
- COLLECTION_RESOURCE = 'CollectionResource',
+ COLLECTION_ADMIN = 'CollectionAdmin',
+ READONLY_COLLECTION = 'ReadOnlyCollection',
+ OLD_VERSION_COLLECTION = 'OldVersionCollection',
TRASHED_COLLECTION = 'TrashedCollection',
PROCESS = "Process",
TRASHED_COLLECTION = 'TrashedCollection',
PROCESS = "Process",
+ PROCESS_ADMIN = 'ProcessAdmin',
PROCESS_RESOURCE = 'ProcessResource',
PROCESS_RESOURCE = 'ProcessResource',
+ READONLY_PROCESS_RESOURCE = 'ReadOnlyProcessResource',
PROCESS_LOGS = "ProcessLogs",
REPOSITORY = "Repository",
SSH_KEY = "SshKey",
PROCESS_LOGS = "ProcessLogs",
REPOSITORY = "Repository",
SSH_KEY = "SshKey",