From 066c2178f99f8fb5c818bc453b49ba8341d440a6 Mon Sep 17 00:00:00 2001 From: Stephen Smith Date: Thu, 24 Mar 2022 15:05:25 -0400 Subject: [PATCH] 18559: Add basic field validation for profile email Arvados-DCO-1.1-Signed-off-by: Stephen Smith --- src/validators/validators.tsx | 1 + src/views/user-profile-panel/user-profile-panel-root.tsx | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/validators/validators.tsx b/src/validators/validators.tsx index 81fed2cc..b781a3a9 100644 --- a/src/validators/validators.tsx +++ b/src/validators/validators.tsx @@ -31,6 +31,7 @@ export const PROCESS_DESCRIPTION_VALIDATION = [maxLength(255)]; export const REPOSITORY_NAME_VALIDATION = [require, maxLength(255)]; export const USER_EMAIL_VALIDATION = [require, maxLength(255)]; +export const PROFILE_EMAIL_VALIDATION = [maxLength(255)]; export const USER_LENGTH_VALIDATION = [maxLength(255)]; export const SSH_KEY_PUBLIC_VALIDATION = [require, isRsaKey, maxLength(1024)]; 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 82c20728..4572a352 100644 --- a/src/views/user-profile-panel/user-profile-panel-root.tsx +++ b/src/views/user-profile-panel/user-profile-panel-root.tsx @@ -23,7 +23,7 @@ import { import { ArvadosTheme } from 'common/custom-theme'; import { User } from "models/user"; import { DataTableDefaultView } from 'components/data-table-default-view/data-table-default-view'; -import { MY_ACCOUNT_VALIDATION } from "validators/validators"; +import { PROFILE_EMAIL_VALIDATION } from "validators/validators"; import { USER_PROFILE_PANEL_ID } from 'store/user-profile/user-profile-actions'; import { noop } from 'lodash'; import { GroupsIcon } from 'components/icon/icon'; @@ -229,6 +229,7 @@ export const UserProfilePanelRoot = withStyles(styles)( name="prefs.profile.organization_email" component={TextField as any} disabled={!this.props.isAdmin && !this.props.isSelf} + validate={PROFILE_EMAIL_VALIDATION} /> -- 2.30.2