From 3b8aa0e2d58981302fa09311f7529910fe8b1243 Mon Sep 17 00:00:00 2001 From: Cletus Razakou Date: Thu, 3 Nov 2022 06:56:46 -0400 Subject: [PATCH 1/2] fix blink form issue --- .../TestNetCertificateProgressBar.component.tsx | 1 + .../src/modules/dashboard/certificate/registration.tsx | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/web/gds-user-ui/src/components/TestnetProgress/TestNetCertificateProgressBar.component.tsx b/web/gds-user-ui/src/components/TestnetProgress/TestNetCertificateProgressBar.component.tsx index a04beff8c..29171ee49 100644 --- a/web/gds-user-ui/src/components/TestnetProgress/TestNetCertificateProgressBar.component.tsx +++ b/web/gds-user-ui/src/components/TestnetProgress/TestNetCertificateProgressBar.component.tsx @@ -14,6 +14,7 @@ interface ProgressBarProps { registrationState?: any; } const ProgressBar = ({ onSetRegistrationState }: ProgressBarProps) => { + console.log('[ProgressBar]'); return ( <> diff --git a/web/gds-user-ui/src/modules/dashboard/certificate/registration.tsx b/web/gds-user-ui/src/modules/dashboard/certificate/registration.tsx index b906c24f6..347da36ba 100644 --- a/web/gds-user-ui/src/modules/dashboard/certificate/registration.tsx +++ b/web/gds-user-ui/src/modules/dashboard/certificate/registration.tsx @@ -57,7 +57,7 @@ const Certificate: React.FC = () => { const lastStep: number = useSelector(getLastStep); const [isResetModalOpen, setIsResetModalOpen] = useState(false); const [registrationData, setRegistrationData] = useState([]); - const [isLoading, setIsLoading] = useState(false); + const [isLoading, setIsLoading] = useState(true); const hasReachSubmitStep: boolean = useSelector( (state: RootStateOrAny) => state.stepper.hasReachSubmitStep @@ -217,7 +217,7 @@ const Certificate: React.FC = () => { }; setTimeout(() => { fetchData(); - }, 1000); + }, 3000); // eslint-disable-next-line react-hooks/exhaustive-deps }, []); From 08b0c2517007fb061258de361d9e07c5aac0afe8 Mon Sep 17 00:00:00 2001 From: Cletus Razakou Date: Thu, 3 Nov 2022 07:04:14 -0400 Subject: [PATCH 2/2] clean & updated snapshots --- .../__snapshots__/Membership.spec.tsx.snap | 18 +++++------------- .../dashboard/certificate/registration.tsx | 5 +++-- .../verify/__snapshots__/verify.spec.tsx.snap | 18 +++++------------- 3 files changed, 13 insertions(+), 28 deletions(-) diff --git a/web/gds-user-ui/src/components/Section/__tests__/__snapshots__/Membership.spec.tsx.snap b/web/gds-user-ui/src/components/Section/__tests__/__snapshots__/Membership.spec.tsx.snap index d7d412d02..fcade6eff 100644 --- a/web/gds-user-ui/src/components/Section/__tests__/__snapshots__/Membership.spec.tsx.snap +++ b/web/gds-user-ui/src/components/Section/__tests__/__snapshots__/Membership.spec.tsx.snap @@ -28,19 +28,11 @@ exports[` should match snapshot 1`] = ` - + Trisa logo diff --git a/web/gds-user-ui/src/modules/dashboard/certificate/registration.tsx b/web/gds-user-ui/src/modules/dashboard/certificate/registration.tsx index 347da36ba..c07eeeb2e 100644 --- a/web/gds-user-ui/src/modules/dashboard/certificate/registration.tsx +++ b/web/gds-user-ui/src/modules/dashboard/certificate/registration.tsx @@ -31,7 +31,8 @@ import { postRegistrationValue, getRegistrationAndStepperData } from 'modules/dashboard/registration/utils'; - +// add this line to a constant file +const WAIT_DATA_LOADING_TIME = 3000; const fieldNamesPerStepsEntries = () => Object.entries(fieldNamesPerSteps); import { isProdEnv } from 'application/config'; import { Trans } from '@lingui/react'; @@ -217,7 +218,7 @@ const Certificate: React.FC = () => { }; setTimeout(() => { fetchData(); - }, 3000); + }, WAIT_DATA_LOADING_TIME); // eslint-disable-next-line react-hooks/exhaustive-deps }, []); diff --git a/web/gds-user-ui/src/modules/verify/__snapshots__/verify.spec.tsx.snap b/web/gds-user-ui/src/modules/verify/__snapshots__/verify.spec.tsx.snap index e6d99ec07..d0e234dbb 100644 --- a/web/gds-user-ui/src/modules/verify/__snapshots__/verify.spec.tsx.snap +++ b/web/gds-user-ui/src/modules/verify/__snapshots__/verify.spec.tsx.snap @@ -28,19 +28,11 @@ exports[` should match snapshot 1`] = ` - + Trisa logo