X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/d4f479b1c2bd4bb67d5e69f792b503f375d6dfc9..58db72fee358d5987139a1b8526c0ca873e07dbf:/src/views/my-account-panel/my-account-panel-root.tsx diff --git a/src/views/my-account-panel/my-account-panel-root.tsx b/src/views/my-account-panel/my-account-panel-root.tsx index e728c4eb..02a8ba67 100644 --- a/src/views/my-account-panel/my-account-panel-root.tsx +++ b/src/views/my-account-panel/my-account-panel-root.tsx @@ -2,10 +2,10 @@ // // SPDX-License-Identifier: AGPL-3.0 -import * as React from 'react'; -import { Field, InjectedFormProps } from "redux-form"; -import { TextField } from "~/components/text-field/text-field"; -import { NativeSelectField } from "~/components/select-field/select-field"; +import React from 'react'; +import { Field, InjectedFormProps, WrappedFieldProps } from "redux-form"; +import { TextField } from "components/text-field/text-field"; +import { NativeSelectField } from "components/select-field/select-field"; import { StyleRulesCallback, WithStyles, @@ -17,9 +17,9 @@ import { Grid, InputLabel } from '@material-ui/core'; -import { ArvadosTheme } from '~/common/custom-theme'; -import { User } from "~/models/user"; -import { MY_ACCOUNT_VALIDATION } from "~/validators/validators"; +import { ArvadosTheme } from 'common/custom-theme'; +import { User } from "models/user"; +import { MY_ACCOUNT_VALIDATION } from "validators/validators"; type CssRules = 'root' | 'gridItem' | 'label' | 'title' | 'actions'; @@ -51,6 +51,7 @@ export interface MyAccountPanelRootDataProps { isPristine: boolean; isValid: boolean; initialValues?: User; + localCluster: string; } const RoleTypes = [ @@ -65,26 +66,25 @@ const RoleTypes = [ type MyAccountPanelRootProps = InjectedFormProps & MyAccountPanelRootDataProps & WithStyles; +type LocalClusterProp = { localCluster: string }; +const renderField: React.ComponentType = ({ input, localCluster }) => ( + {localCluster === input.value.substr(0, 5) ? "" : "federated"} user {input.value} +); + export const MyAccountPanelRoot = withStyles(styles)( - ({ classes, isValid, handleSubmit, reset, isPristine, invalid, submitting }: MyAccountPanelRootProps) => { + ({ classes, isValid, handleSubmit, reset, isPristine, invalid, submitting, localCluster }: MyAccountPanelRootProps) => { return + + Logged in as +
- - - - @@ -92,7 +92,7 @@ export const MyAccountPanelRoot = withStyles(styles)( @@ -100,7 +100,7 @@ export const MyAccountPanelRoot = withStyles(styles)( @@ -108,7 +108,7 @@ export const MyAccountPanelRoot = withStyles(styles)( @@ -116,7 +116,7 @@ export const MyAccountPanelRoot = withStyles(styles)( @@ -125,7 +125,7 @@ export const MyAccountPanelRoot = withStyles(styles)( @@ -135,7 +135,7 @@ export const MyAccountPanelRoot = withStyles(styles)( @@ -143,7 +143,7 @@ export const MyAccountPanelRoot = withStyles(styles)( @@ -154,7 +154,7 @@ export const MyAccountPanelRoot = withStyles(styles)( type="submit" disabled={isPristine || invalid || submitting}> Save changes - +