Skip to content

Commit 5ad3386

Browse files
committed
Conditionally show "Go to review" page meta forms
We don't need to show the "Go to review" button on metadata form like certificate collector's form and correction request forms. #10132
1 parent cc7c836 commit 5ad3386

File tree

5 files changed

+18
-6
lines changed

5 files changed

+18
-6
lines changed

packages/client/src/v2-events/features/events/actions/correct/request/Onboarding/Onboarding.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ export function Onboarding() {
104104
formPages={formPages}
105105
pageId={currentPageId}
106106
setFormData={(data) => setAnnotation(data)}
107+
showReviewButton={false}
107108
validateBeforeNextPage={true}
108109
validatorContext={validatorContext}
109110
onPageChange={(nextPageId: string) => {

packages/client/src/v2-events/features/events/actions/print-certificate/Pages.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ export function Pages() {
106106
})}
107107
pageId={currentPageId}
108108
setFormData={(data) => setAnnotation(data)}
109+
showReviewButton={false}
109110
validateBeforeNextPage={true}
110111
validatorContext={validatorContext}
111112
onPageChange={(nextPageId: string) => {

packages/client/src/v2-events/features/events/components/FormWizard.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export type FormWizardProps = PropsWithChildren<{
3838
/** Callback when the user submits the form wizard */
3939
onSubmit: () => void
4040
pageTitle: string
41+
showReviewButton?: boolean
4142
}>
4243

4344
export const FormWizard = ({
@@ -47,6 +48,7 @@ export const FormWizard = ({
4748
pageTitle,
4849
onNextPage,
4950
onPreviousPage,
51+
showReviewButton,
5052
continueButtonText = 'Continue'
5153
}: FormWizardProps & {
5254
continueButtonText?: string
@@ -76,9 +78,11 @@ export const FormWizard = ({
7678
>
7779
{continueButtonText}
7880
</Button>
79-
<Button size="large" type="secondary" onClick={onSubmit}>
80-
{intl.formatMessage(messages.goToReview)}
81-
</Button>
81+
{showReviewButton && (
82+
<Button size="large" type="secondary" onClick={onSubmit}>
83+
{intl.formatMessage(messages.goToReview)}
84+
</Button>
85+
)}
8286
</Stack>
8387
</Content>
8488
</Frame.Section>

packages/client/src/v2-events/features/events/components/Pages.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ interface PagesProps {
3232
form: EventState
3333
setFormData: (dec: EventState) => void
3434
pageId: string
35+
showReviewButton?: boolean
3536
formPages: PageConfig[]
3637
onPageChange: (nextPageId: string) => void
3738
onSubmit: () => void
@@ -56,6 +57,7 @@ type DeclarationProps =
5657
*/
5758
export function Pages({
5859
form,
60+
showReviewButton = true,
5961
formPages,
6062
onPageChange,
6163
onSubmit,
@@ -147,6 +149,7 @@ export function Pages({
147149
const wizardProps = {
148150
currentPage: pageIdx,
149151
pageTitle: intl.formatMessage(page.title),
152+
showReviewButton,
150153
onNextPage,
151154
onPreviousPage,
152155
onSubmit

packages/client/src/v2-events/features/events/components/VerificationWizard.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export const VerificationWizard = ({
4444
pageTitle,
4545
onNextPage,
4646
onPreviousPage,
47+
showReviewButton,
4748
pageConfig
4849
}: FormWizardProps & {
4950
pageConfig: VerificationPageConfig
@@ -125,9 +126,11 @@ export const VerificationWizard = ({
125126
{intl.formatMessage(pageConfig.actions.cancel.label)}
126127
</Button>
127128

128-
<Button size="large" type="secondary" onClick={onSubmit}>
129-
{intl.formatMessage(formWizardMessages.goToReview)}
130-
</Button>
129+
{showReviewButton && (
130+
<Button size="large" type="secondary" onClick={onSubmit}>
131+
{intl.formatMessage(formWizardMessages.goToReview)}
132+
</Button>
133+
)}
131134
</Stack>
132135
</Content>
133136
</Frame.Section>

0 commit comments

Comments
 (0)