1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { ContextMenuActionSet } 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 = [
34 execute: (dispatch, resources) => {
35 dispatch<any>(openUserAttributes(resources[0].uuid));
41 execute: (dispatch, resources) => {
42 dispatch<any>(openUserProjects(resources[0].uuid));
48 execute: (dispatch, resources) => {
49 dispatch<any>(openAdvancedTabDialog(resources[0].uuid));
53 name: 'Account Settings',
55 execute: (dispatch, resources) => {
56 dispatch<any>(navigateToUserProfile(resources[0].uuid));
58 filters: [needsUserProfileLink],
63 name: 'Activate User',
65 execute: (dispatch, resources) => {
66 dispatch<any>(openActivateDialog(resources[0].uuid));
68 filters: [isAdmin, canActivateUser],
73 execute: (dispatch, resources) => {
74 dispatch<any>(openSetupDialog(resources[0].uuid));
76 filters: [isAdmin, canSetupUser],
79 name: 'Deactivate User',
80 icon: DeactivateUserIcon,
81 execute: (dispatch, resources) => {
82 dispatch<any>(openDeactivateDialog(resources[0].uuid));
84 filters: [isAdmin, canDeactivateUser],
87 name: 'Login As User',
89 execute: (dispatch, resources) => {
90 dispatch<any>(loginAs(resources[0].uuid));
92 filters: [isAdmin, isOtherUser],