X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/a1e2b8ba77e4a7273940a3fc542bc42e282618a7..0e86ce9638f17cf801b6dbf08e6dfd91edf89153:/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 994a7819..283b9acc 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 { require } from "~/validators/require"; +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'; @@ -45,111 +45,120 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ } }); -export interface MyAccountPanelRootActionProps {} +export interface MyAccountPanelRootActionProps { } export interface MyAccountPanelRootDataProps { isPristine: boolean; isValid: boolean; initialValues?: User; + localCluster: string; } -export const MY_ACCOUNT_FORM = 'myAccountForm'; - -const FILES_FIELD_VALIDATION = [require]; +const RoleTypes = [ + { key: 'Bio-informatician', value: 'Bio-informatician' }, + { key: 'Data Scientist', value: 'Data Scientist' }, + { key: 'Analyst', value: 'Analyst' }, + { key: 'Researcher', value: 'Researcher' }, + { key: 'Software Developer', value: 'Software Developer' }, + { key: 'System Administrator', value: 'System Administrator' }, + { key: 'Other', value: 'Other' } +]; type MyAccountPanelRootProps = InjectedFormProps & MyAccountPanelRootDataProps & WithStyles; +type LocalClusterProp = { localCluster: string }; +const renderField: React.ComponentType = ({ input, localCluster }) => ( + {localCluster === input.value.substring(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 - User profile + + Logged in as +
- - - - - - - - - - - - - - - - - - - Organization - - + + + + + + + + + + + + - - - - - - - - - + + - + + + + + Role + + + + + + - + - -
-
;} -); \ No newline at end of file + + + ; + } +);