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";
20 import { canActivateUser, canDeactivateUser, canSetupUser, isAdmin, needsUserProfileLink, isOtherUser } from "store/context-menu/context-menu-filters";
22 export const userActionSet: ContextMenuActionSet = [[{
25 execute: (dispatch, { uuid }) => {
26 dispatch<any>(openUserAttributes(uuid));
31 execute: (dispatch, { uuid }) => {
32 dispatch<any>(openUserProjects(uuid));
37 execute: (dispatch, { uuid }) => {
38 dispatch<any>(openAdvancedTabDialog(uuid));
41 name: "Account Settings",
43 execute: (dispatch, { uuid }) => {
44 dispatch<any>(navigateToUserProfile(uuid));
46 filters: [needsUserProfileLink]
48 name: "Activate User",
50 execute: (dispatch, { uuid }) => {
51 dispatch<any>(openActivateDialog(uuid));
60 execute: (dispatch, { uuid }) => {
61 dispatch<any>(openSetupDialog(uuid));
68 name: "Deactivate User",
69 icon: DeactivateUserIcon,
70 execute: (dispatch, { uuid }) => {
71 dispatch<any>(openDeactivateDialog(uuid));
78 name: "Login As User",
80 execute: (dispatch, { uuid }) => {
81 dispatch<any>(loginAs(uuid));