18559: Add basic validation to url field
authorStephen Smith <stephen@curii.com>
Thu, 31 Mar 2022 02:17:30 +0000 (22:17 -0400)
committerStephen Smith <stephen@curii.com>
Thu, 31 Mar 2022 02:17:30 +0000 (22:17 -0400)
Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen@curii.com>

src/validators/validators.tsx
src/views/user-profile-panel/user-profile-panel-root.tsx

index b781a3a97f199960297de1691bafd9e86f830ff6..6e72ef689829ef3aad0b6cc1c265d0467491ee21 100644 (file)
@@ -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 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)];
 export const USER_LENGTH_VALIDATION = [maxLength(255)];
 
 export const SSH_KEY_PUBLIC_VALIDATION = [require, isRsaKey, maxLength(1024)];
index 531d3bdbfbcd092bdeccdb3794e4d7571c8835a9..acb1c16178cf1a424665ae134f734860cd29d755 100644 (file)
@@ -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';
 } 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';
 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}
                                             name="prefs.profile.website_url"
                                             component={TextField as any}
                                             disabled={!this.props.isAdmin && !this.props.isSelf}
+                                            validate={PROFILE_URL_VALIDATION}
                                         />
                                     </Grid>
                                     <Grid item sm={12}>
                                         />
                                     </Grid>
                                     <Grid item sm={12}>