export const USERS_PANEL_ID = 'usersPanel';
export const USER_ATTRIBUTES_DIALOG = 'userAttributesDialog';
export const USER_CREATE_FORM_NAME = 'userCreateFormName';
+export const USER_MANAGE_DIALOG = 'userManageDialog';
export interface UserCreateFormDialogData {
email: string;
dispatch(dialogActions.OPEN_DIALOG({ id: USER_ATTRIBUTES_DIALOG, data }));
};
+export const openUserManage = (uuid: string) =>
+ (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+ const { resources } = getState();
+ const data = getResource<UserResource>(uuid)(resources);
+ dispatch(dialogActions.OPEN_DIALOG({ id: USER_MANAGE_DIALOG, data }));
+ };
+
export const openUserCreateDialog = () =>
async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
const userUuid = await services.authService.getUuid();
import { ContextMenuActionSet } from "~/views-components/context-menu/context-menu-action-set";
import { AdvancedIcon, ProjectIcon, AttributesIcon, UserPanelIcon } from "~/components/icon/icon";
import { openAdvancedTabDialog } from '~/store/advanced-tab/advanced-tab';
-import { openUserAttributes, openUserProjects } from "~/store/users/users-actions";
+import { openUserAttributes, openUserProjects, openUserManage } from "~/store/users/users-actions";
export const userActionSet: ContextMenuActionSet = [[{
name: "Attributes",
execute: (dispatch, { uuid }) => {
dispatch<any>(openAdvancedTabDialog(uuid));
}
-},
-{
+}, {
name: "Manage",
icon: UserPanelIcon,
execute: (dispatch, { uuid }) => {
- dispatch<any>(openAdvancedTabDialog(uuid));
+ dispatch<any>(openUserManage(uuid));
}
}]];
--- /dev/null
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import * as React from "react";
+import { Dialog, DialogTitle, DialogContent, DialogActions, Button, Typography } from "@material-ui/core";
+import { WithDialogProps } from "~/store/dialog/with-dialog";
+import { withDialog } from '~/store/dialog/with-dialog';
+import { WithStyles, withStyles } from '@material-ui/core/styles';
+import { ArvadosTheme } from '~/common/custom-theme';
+import { compose } from "redux";
+import { USER_MANAGE_DIALOG } from "~/store/users/users-actions";
+import { UserResource } from "~/models/user";
+
+type CssRules = 'spacing';
+
+const styles = withStyles<CssRules>((theme: ArvadosTheme) => ({
+ spacing: {
+ paddingBottom: theme.spacing.unit * 2,
+ paddingTop: theme.spacing.unit * 2,
+ }
+}));
+
+interface UserManageDataProps {
+ data: UserResource;
+}
+
+type UserManageProps = UserManageDataProps & WithStyles<CssRules>;
+
+export const UserManageDialog = compose(
+ withDialog(USER_MANAGE_DIALOG),
+ styles)(
+ (props: WithDialogProps<UserManageProps> & UserManageProps) =>
+ <Dialog open={props.open}
+ onClose={props.closeDialog}
+ fullWidth
+ maxWidth="md">
+ <DialogTitle>{`Manage - ${props.data.firstName} ${props.data.lastName}`}</DialogTitle>
+ <DialogContent>
+ <Typography variant="body2" className={props.classes.spacing}>
+ As an admin, you can log in as this user. When you’ve finished, you will need to log out and log in again with your own account.
+ </Typography>
+ <Button variant="contained" color="primary">
+ {`LOG IN AS ${props.data.firstName} ${props.data.lastName}`}
+ </Button>
+ <Typography variant="body2" className={props.classes.spacing}>
+ As an admin, you can setup a shell account for this user. The login name is automatically generated from the user's e-mail address.
+ </Typography>
+ <Button variant="contained" color="primary">
+ {`SETUP SHELL ACCOUNT FOR ${props.data.firstName} ${props.data.lastName}`}
+ </Button>
+ </DialogContent>
+ <DialogActions>
+ <Button
+ variant='flat'
+ color='primary'
+ onClick={props.closeDialog}>
+ Close
+ </Button>
+ </DialogActions>
+ </Dialog>
+ );
import { UserAttributesDialog } from '~/views-components/user-dialog/attributes-dialog';
import { CreateUserDialog } from '~/views-components/dialog-forms/create-user-dialog';
import { HelpApiClientAuthorizationDialog } from '~/views-components/api-client-authorizations-dialog/help-dialog';
+import { UserManageDialog } from '~/views-components/user-dialog/manage-dialog';
type CssRules = 'root' | 'container' | 'splitter' | 'asidePanel' | 'contentWrapper' | 'content';
<UpdateProcessDialog />
<UpdateProjectDialog />
<UserAttributesDialog />
+ <UserManageDialog />
<VirtualMachineAttributesDialog />
</Grid>
);
\ No newline at end of file