From: Stephen Smith Date: Mon, 14 Mar 2022 21:06:11 +0000 (-0400) Subject: 18559: Show read-only profile values without input fields X-Git-Tag: 2.4.0~1^2~29 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/514574540614593941c39592d9f9972f770e0cb7 18559: Show read-only profile values without input fields Arvados-DCO-1.1-Signed-off-by: Stephen Smith --- 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 76cad8a5..2176b323 100644 --- a/src/views/user-profile-panel/user-profile-panel-root.tsx +++ b/src/views/user-profile-panel/user-profile-panel-root.tsx @@ -31,7 +31,7 @@ import { DataColumns } from 'components/data-table/data-table'; import { ResourceLinkHeadUuid, ResourceLinkHeadPermissionLevel, ResourceLinkHead, ResourceLinkDelete, ResourceLinkTailIsVisible } from 'views-components/data-explorer/renderers'; import { createTree } from 'models/tree'; -type CssRules = 'root' | 'adminRoot' | 'gridItem' | 'label' | 'title' | 'description' | 'actions' | 'content'; +type CssRules = 'root' | 'adminRoot' | 'gridItem' | 'label' | 'readOnlyValue' | 'title' | 'description' | 'actions' | 'content'; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ root: { @@ -46,7 +46,11 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ marginBottom: 20 }, label: { - fontSize: '0.675rem' + fontSize: '0.675rem', + color: theme.palette.grey['600'] + }, + readOnlyValue: { + fontSize: '0.875rem', }, title: { fontSize: '1.1rem', @@ -137,6 +141,19 @@ export const userProfileGroupsColumns: DataColumns = [ }, ]; +const ReadOnlyField = withStyles(styles)( + (props: ({ label: string, input: {value: string} }) & WithStyles ) => ( + + + {props.label} + + + {props.input.value} + + + ) +); + export const UserProfilePanelRoot = withStyles(styles)( class extends React.Component { state = { @@ -162,7 +179,7 @@ export const UserProfilePanelRoot = withStyles(styles)( @@ -170,7 +187,7 @@ export const UserProfilePanelRoot = withStyles(styles)( @@ -178,7 +195,7 @@ export const UserProfilePanelRoot = withStyles(styles)( @@ -186,7 +203,7 @@ export const UserProfilePanelRoot = withStyles(styles)( @@ -196,7 +213,6 @@ export const UserProfilePanelRoot = withStyles(styles)( name="prefs.profile.organization" component={TextField as any} validate={MY_ACCOUNT_VALIDATION} - required disabled={!this.props.isAdmin && !this.props.isSelf} /> @@ -206,7 +222,6 @@ export const UserProfilePanelRoot = withStyles(styles)( name="prefs.profile.organization_email" component={TextField as any} validate={MY_ACCOUNT_VALIDATION} - required disabled={!this.props.isAdmin && !this.props.isSelf} />