From 436277da3c5ec6923417bb5704bb01fd32fc449c Mon Sep 17 00:00:00 2001 From: Saswata Mukherjee Date: Wed, 12 May 2021 08:34:38 +0530 Subject: [PATCH] Fix MyHub input validation Signed-off-by: Saswata Mukherjee --- .../src/views/MyHub/MyHubConnect/index.tsx | 14 ++++++++++++-- .../frontend/src/views/MyHub/MyHubEdit/index.tsx | 16 +++++++++++++--- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/litmus-portal/frontend/src/views/MyHub/MyHubConnect/index.tsx b/litmus-portal/frontend/src/views/MyHub/MyHubConnect/index.tsx index 9155b997a33..a96993610fe 100644 --- a/litmus-portal/frontend/src/views/MyHub/MyHubConnect/index.tsx +++ b/litmus-portal/frontend/src/views/MyHub/MyHubConnect/index.tsx @@ -31,7 +31,10 @@ import { } from '../../../models/graphql/user'; import { history } from '../../../redux/configureStore'; import { getProjectID, getProjectRole } from '../../../utils/getSearchParams'; -import { validateStartEmptySpacing } from '../../../utils/validate'; +import { + isValidWebUrl, + validateStartEmptySpacing, +} from '../../../utils/validate'; import useStyles from './styles'; interface GitHub { @@ -445,7 +448,14 @@ const MyHub: React.FC = () => {
- + {t('myhub.connectHubPage.submitBtn')}
diff --git a/litmus-portal/frontend/src/views/MyHub/MyHubEdit/index.tsx b/litmus-portal/frontend/src/views/MyHub/MyHubEdit/index.tsx index 568e25c8aeb..44a209a2de1 100644 --- a/litmus-portal/frontend/src/views/MyHub/MyHubEdit/index.tsx +++ b/litmus-portal/frontend/src/views/MyHub/MyHubEdit/index.tsx @@ -29,7 +29,10 @@ import { import { HubStatus } from '../../../models/redux/myhub'; import { history } from '../../../redux/configureStore'; import { getProjectID, getProjectRole } from '../../../utils/getSearchParams'; -import { validateStartEmptySpacing } from '../../../utils/validate'; +import { + isValidWebUrl, + validateStartEmptySpacing, +} from '../../../utils/validate'; import useStyles from './styles'; interface MyHubParams { @@ -385,7 +388,7 @@ const MyHub: React.FC = () => { {!copying ? (
copy @@ -415,7 +418,14 @@ const MyHub: React.FC = () => {
- + {t('myhub.editPage.submit')}