From: Lisa Knox Date: Thu, 16 May 2024 18:10:08 +0000 (-0400) Subject: 21224: changed user card toolbar item order X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/9ce49e908a4abdfb7f546181283b6a4a60f04a82?ds=sidebyside 21224: changed user card toolbar item order Arvados-DCO-1.1-Signed-off-by: Lisa Knox --- diff --git a/services/workbench2/src/views-components/context-menu/menu-item-sort.ts b/services/workbench2/src/views-components/context-menu/menu-item-sort.ts index 0e06be1685..f60842c94e 100644 --- a/services/workbench2/src/views-components/context-menu/menu-item-sort.ts +++ b/services/workbench2/src/views-components/context-menu/menu-item-sort.ts @@ -121,6 +121,12 @@ const workflowOrder = [ ContextMenuActionNames.DELETE_WORKFLOW, ] +const rootProjectOrder = [ + ContextMenuActionNames.VIEW_DETAILS, + ContextMenuActionNames.USER_ACCOUNT, + ContextMenuActionNames.API_DETAILS, +]; + const defaultMultiOrder = [ ContextMenuActionNames.MOVE_TO, ContextMenuActionNames.MAKE_A_COPY, @@ -148,6 +154,9 @@ const kindToOrder: Record = { [ContextMenuKind.WORKFLOW]: workflowOrder, [ContextMenuKind.READONLY_WORKFLOW]: workflowOrder, + + [ContextMenuKind.ROOT_PROJECT]: rootProjectOrder, + [ContextMenuKind.ROOT_PROJECT_ADMIN]: rootProjectOrder, }; export const menuDirection = { diff --git a/services/workbench2/src/views-components/multiselect-toolbar/ms-user-details-action-set.ts b/services/workbench2/src/views-components/multiselect-toolbar/ms-user-details-action-set.ts index ff54d26dd2..8ed9b9df03 100644 --- a/services/workbench2/src/views-components/multiselect-toolbar/ms-user-details-action-set.ts +++ b/services/workbench2/src/views-components/multiselect-toolbar/ms-user-details-action-set.ts @@ -2,54 +2,40 @@ // // SPDX-License-Identifier: AGPL-3.0 -import { AdvancedIcon, AttributesIcon, UserPanelIcon } from 'components/icon/icon'; +import { AdvancedIcon, DetailsIcon, UserPanelIcon } from 'components/icon/icon'; +import { toggleDetailsPanel } from 'store/details-panel/details-panel-action'; import { openAdvancedTabDialog } from 'store/advanced-tab/advanced-tab'; import { navigateToUserProfile } from 'store/navigation/navigation-action'; import { ContextMenuActionNames } from "views-components/context-menu/context-menu-action-set"; import { MultiSelectMenuActionSet } from './ms-menu-actions'; -import { Dispatch } from 'redux'; -import { RootState } from 'store/store'; -import { ServiceRepository } from 'services/services'; -import { dialogActions } from 'store/dialog/dialog-actions'; -import { UserResource } from 'models/user'; -import { getResource } from 'store/resources/resources'; - -const USER_ATTRIBUTES_DIALOG = 'userAttributesDialog'; - -const msOpenUserAttributes = (uuid: string) => - (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { - const { resources } = getState(); - const data = getResource(uuid)(resources); - dispatch(dialogActions.OPEN_DIALOG({ id: USER_ATTRIBUTES_DIALOG, data })); - }; export const UserDetailsActionSet: MultiSelectMenuActionSet= [ [ { - name: ContextMenuActionNames.ATTRIBUTES, - icon: AttributesIcon, + name: ContextMenuActionNames.VIEW_DETAILS, + icon: DetailsIcon, hasAlts: false, isForMulti: false, execute: (dispatch, resources) => { - dispatch(msOpenUserAttributes(resources[0].uuid)); + dispatch(toggleDetailsPanel(resources[0].uuid)); }, }, { - name: ContextMenuActionNames.API_DETAILS, - icon: AdvancedIcon, + name: ContextMenuActionNames.USER_ACCOUNT, + icon: UserPanelIcon, hasAlts: false, isForMulti: false, execute: (dispatch, resources) => { - dispatch(openAdvancedTabDialog(resources[0].uuid)); + dispatch(navigateToUserProfile(resources[0].uuid)); }, }, { - name: ContextMenuActionNames.USER_ACCOUNT, - icon: UserPanelIcon, + name: ContextMenuActionNames.API_DETAILS, + icon: AdvancedIcon, hasAlts: false, isForMulti: false, execute: (dispatch, resources) => { - dispatch(navigateToUserProfile(resources[0].uuid)); + dispatch(openAdvancedTabDialog(resources[0].uuid)); }, }, ],