// 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, Grid } 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_ATTRIBUTES_DIALOG } from "~/store/users/users-actions"; import { UserResource } from "~/models/user"; type CssRules = 'rightContainer' | 'leftContainer' | 'spacing'; const styles = withStyles((theme: ArvadosTheme) => ({ rightContainer: { textAlign: 'right', paddingRight: theme.spacing.unit * 2, color: theme.palette.grey["500"] }, leftContainer: { textAlign: 'left', paddingLeft: theme.spacing.unit * 2 }, spacing: { paddingTop: theme.spacing.unit * 2 }, })); interface UserAttributesDataProps { data: UserResource; } type UserAttributesProps = UserAttributesDataProps & WithStyles; export const UserAttributesDialog = compose( withDialog(USER_ATTRIBUTES_DIALOG), styles)( (props: WithDialogProps & UserAttributesProps) => Attributes {props.data && attributes(props.data, props.classes)} ); const attributes = (user: UserResource, classes: any) => { const { uuid, ownerUuid, createdAt, modifiedAt, modifiedByClientUuid, modifiedByUserUuid, firstName, lastName, href, identityUrl, username } = user; return ( {firstName && First name} {lastName && Last name} {ownerUuid && Owner uuid} {createdAt && Created at} {modifiedAt && Modified at} {modifiedByUserUuid && Modified by user uuid} {modifiedByClientUuid && Modified by client uuid} {uuid && uuid} {href && Href} {identityUrl && Identity url} {username && Username} {firstName} {lastName} {ownerUuid} {createdAt} {modifiedAt} {modifiedByUserUuid} {modifiedByClientUuid} {uuid} {href} {identityUrl} {username} ); };