X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/d839ac44e90bfca5e07e8cc5ddf56c30deabc008..148f9fba3eede1027ceb07657c4c7eaaa244d6d8:/src/views/user-profile-panel/user-profile-panel-root.tsx diff --git a/src/views/user-profile-panel/user-profile-panel-root.tsx b/src/views/user-profile-panel/user-profile-panel-root.tsx index f89ca5c5..53c0799f 100644 --- a/src/views/user-profile-panel/user-profile-panel-root.tsx +++ b/src/views/user-profile-panel/user-profile-panel-root.tsx @@ -24,18 +24,16 @@ import { IconButton, } from '@material-ui/core'; import { ArvadosTheme } from 'common/custom-theme'; -import { DataTableDefaultView } from 'components/data-table-default-view/data-table-default-view'; -import { PROFILE_EMAIL_VALIDATION } from "validators/validators"; +import { PROFILE_EMAIL_VALIDATION, PROFILE_URL_VALIDATION } from "validators/validators"; import { USER_PROFILE_PANEL_ID } from 'store/user-profile/user-profile-actions'; import { noop } from 'lodash'; -import { CopyIcon, DetailsIcon, GroupsIcon, MoreOptionsIcon } from 'components/icon/icon'; +import { DetailsIcon, GroupsIcon, MoreOptionsIcon } from 'components/icon/icon'; import { DataColumns } from 'components/data-table/data-table'; -import { ResourceLinkHeadUuid, ResourceLinkHeadPermissionLevel, ResourceLinkHead, ResourceLinkDelete, ResourceLinkTailIsVisible } from 'views-components/data-explorer/renderers'; +import { ResourceLinkHeadUuid, ResourceLinkHeadPermissionLevel, ResourceLinkHead, ResourceLinkDelete, ResourceLinkTailIsVisible, UserResourceAccountStatus } from 'views-components/data-explorer/renderers'; import { createTree } from 'models/tree'; import { getResource, ResourcesState } from 'store/resources/resources'; -import { snackbarActions, SnackbarKind } from 'store/snackbar/snackbar-actions'; -import CopyToClipboard from 'react-copy-to-clipboard'; import { DefaultView } from 'components/default-view/default-view'; +import { CopyToClipboardSnackbar } from 'components/copy-to-clipboard-snackbar/copy-to-clipboard-snackbar'; type CssRules = 'root' | 'emptyRoot' | 'gridItem' | 'label' | 'readOnlyValue' | 'title' | 'description' | 'actions' | 'content' | 'copyIcon'; @@ -188,14 +186,6 @@ export const UserProfilePanelRoot = withStyles(styles)( this.setState({ value: TABS.PROFILE}); } - onCopy = (message: string) => { - this.props.dispatch(snackbarActions.OPEN_SNACKBAR({ - message, - hideDuration: 2000, - kind: SnackbarKind.SUCCESS - })); - } - render() { if (this.props.isInaccessible) { return ( @@ -214,27 +204,26 @@ export const UserProfilePanelRoot = withStyles(styles)( {this.state.value === TABS.PROFILE && - + {this.props.userUuid} - - - this.onCopy!("Copied")}> - - - - + - - - this.handleContextMenu(event, this.props.userUuid)}> - - - + + + + + + this.handleContextMenu(event, this.props.userUuid)}> + + + + +
@@ -243,16 +232,16 @@ export const UserProfilePanelRoot = withStyles(styles)( @@ -304,7 +293,7 @@ export const UserProfilePanelRoot = withStyles(styles)( name="prefs.profile.website_url" component={TextField as any} disabled={!this.props.isAdmin && !this.props.isSelf} - + validate={PROFILE_URL_VALIDATION} /> @@ -337,11 +326,8 @@ export const UserProfilePanelRoot = withStyles(styles)( paperProps={{ elevation: 0, }} - dataTableDefaultView={ - - } /> + defaultViewIcon={GroupsIcon} + defaultViewMessages={['Group list is empty.']} /> } ; }