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 resources.forEach((resource) => dispatch<any>(openUserAttributes(resource.uuid)));
41 execute: (dispatch, resources) => {
42 resources.forEach((resource) => dispatch<any>(openUserProjects(resource.uuid)));
48 execute: (dispatch, resources) => {
49 resources.forEach((resource) => dispatch<any>(openAdvancedTabDialog(resource.uuid)));
53 name: 'Account Settings',
55 execute: (dispatch, resources) => {
56 resources.forEach((resource) => dispatch<any>(navigateToUserProfile(resource.uuid)));
58 filters: [needsUserProfileLink],
63 name: 'Activate User',
65 execute: (dispatch, resources) => {
66 resources.forEach((resource) => dispatch<any>(openActivateDialog(resource.uuid)));
68 filters: [isAdmin, canActivateUser],
73 execute: (dispatch, resources) => {
74 resources.forEach((resource) => dispatch<any>(openSetupDialog(resource.uuid)));
76 filters: [isAdmin, canSetupUser],
79 name: 'Deactivate User',
80 icon: DeactivateUserIcon,
81 execute: (dispatch, resources) => {
82 resources.forEach((resource) => dispatch<any>(openDeactivateDialog(resource.uuid)));
84 filters: [isAdmin, canDeactivateUser],
87 name: 'Login As User',
89 execute: (dispatch, resources) => {
90 resources.forEach((resource) => dispatch<any>(loginAs(resource.uuid)));
92 filters: [isAdmin, isOtherUser],