X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/9ee35a64c605f116aec71f78c65b54730d6e1076..9555a2020771863c2e4f6b8802bd6850efb37713:/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 43474dd1..ee87d71a 100644 --- 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 { sortByProperty } from "~/common/array-utils"; type DataProps = Pick & { 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(); 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 = []; @@ -65,8 +67,10 @@ export enum ContextMenuKind { 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", @@ -78,10 +82,12 @@ export enum ContextMenuKind { COLLECTION = 'Collection', COLLECTION_ADMIN = 'CollectionAdmin', READONLY_COLLECTION = 'ReadOnlyCollection', + OLD_VERSION_COLLECTION = 'OldVersionCollection', TRASHED_COLLECTION = 'TrashedCollection', PROCESS = "Process", PROCESS_ADMIN = 'ProcessAdmin', PROCESS_RESOURCE = 'ProcessResource', + READONLY_PROCESS_RESOURCE = 'ReadOnlyProcessResource', PROCESS_LOGS = "ProcessLogs", REPOSITORY = "Repository", SSH_KEY = "SshKey",