From 8426035efad90f0745bf1c3e43da3027ef5c2805 Mon Sep 17 00:00:00 2001 From: Stephen Smith Date: Wed, 30 Mar 2022 22:17:30 -0400 Subject: [PATCH] 18559: Add basic validation to url field 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 b781a3a9..6e72ef68 100644 --- a/src/validators/validators.tsx +++ b/src/validators/validators.tsx @@ -32,6 +32,7 @@ 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 PROFILE_URL_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 531d3bdb..acb1c161 100644 --- a/src/views/user-profile-panel/user-profile-panel-root.tsx +++ b/src/views/user-profile-panel/user-profile-panel-root.tsx @@ -25,7 +25,7 @@ import { } 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 { DetailsIcon, GroupsIcon, MoreOptionsIcon } from 'components/icon/icon'; @@ -289,6 +289,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} /> -- 2.30.2