1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { ContextMenuActionSet, ContextMenuActionNames } from 'views-components/context-menu/context-menu-action-set';
15 } from 'components/icon/icon';
16 import { openAdvancedTabDialog } from 'store/advanced-tab/advanced-tab';
17 import { loginAs, openUserAttributes, openUserProjects } from 'store/users/users-actions';
18 import { openSetupDialog, openDeactivateDialog, openActivateDialog } from 'store/user-profile/user-profile-actions';
19 import { navigateToUserProfile } from 'store/navigation/navigation-action';
27 } from 'store/context-menu/context-menu-filters';
29 export const userActionSet: ContextMenuActionSet = [
32 name: ContextMenuActionNames.ATTRIBUTES,
34 execute: (dispatch, resources) => {
35 dispatch<any>(openUserAttributes(resources[0].uuid));
39 name: ContextMenuActionNames.HOME_PROJECT,
41 execute: (dispatch, resources) => {
42 dispatch<any>(openUserProjects(resources[0].uuid));
46 name: ContextMenuActionNames.API_DETAILS,
48 execute: (dispatch, resources) => {
49 dispatch<any>(openAdvancedTabDialog(resources[0].uuid));
53 name: ContextMenuActionNames.ACCOUNT_SETTINGS,
55 execute: (dispatch, resources) => {
56 dispatch<any>(navigateToUserProfile(resources[0].uuid));
58 filters: [needsUserProfileLink],
63 name: ContextMenuActionNames.ACTIVATE_USER,
65 execute: (dispatch, resources) => {
66 dispatch<any>(openActivateDialog(resources[0].uuid));
68 filters: [isAdmin, canActivateUser],
71 name: ContextMenuActionNames.SETUP_USER,
73 execute: (dispatch, resources) => {
74 dispatch<any>(openSetupDialog(resources[0].uuid));
76 filters: [isAdmin, canSetupUser],
79 name: ContextMenuActionNames.DEACTIVATE_USER,
80 icon: DeactivateUserIcon,
81 execute: (dispatch, resources) => {
82 dispatch<any>(openDeactivateDialog(resources[0].uuid));
84 filters: [isAdmin, canDeactivateUser],
87 name: ContextMenuActionNames.LOGIN_AS_USER,
89 execute: (dispatch, resources) => {
90 dispatch<any>(loginAs(resources[0].uuid));
92 filters: [isAdmin, isOtherUser],