refactor appeal for new and resume
This commit is contained in:
@@ -204,7 +204,7 @@ export default function BuildField(props) {
|
||||
uploadCount={uploadCount}
|
||||
setFileCount={setFileCount}
|
||||
setUploadCount={setUploadCount}
|
||||
props={props?.props?.props}
|
||||
props={props?.props?.props?.props}
|
||||
/>
|
||||
</div>
|
||||
),
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
// components/newappeal/constants.js
|
||||
export const SECTION_COMPLETE = 9999;
|
||||
@@ -0,0 +1,48 @@
|
||||
// components/newappeal/NewAppealFlow.js
|
||||
import React from "react";
|
||||
import BuildCheckSection from "./buildchecksection";
|
||||
import BuildSection from "./buildsection";
|
||||
import CompleteAppeal from "./complete";
|
||||
import { SECTION_COMPLETE } from "./constants";
|
||||
|
||||
export default function NewAppealFlow({
|
||||
formXML,
|
||||
sectionCount,
|
||||
currentSection,
|
||||
onSubmit,
|
||||
formTitle,
|
||||
mandatoryFieldsData,
|
||||
propsForChildren,
|
||||
docsOffline,
|
||||
}) {
|
||||
if (currentSection === SECTION_COMPLETE) {
|
||||
return <CompleteAppeal props={propsForChildren} />;
|
||||
}
|
||||
|
||||
if (currentSection === sectionCount + 1) {
|
||||
return (
|
||||
<BuildCheckSection
|
||||
formXML={formXML}
|
||||
sectionCount={sectionCount}
|
||||
onSubmit={onSubmit}
|
||||
formTitle={formTitle}
|
||||
appealType={propsForChildren.appealType}
|
||||
props={propsForChildren}
|
||||
key={1}
|
||||
mandatoryFieldsData={mandatoryFieldsData}
|
||||
docsOffline={docsOffline}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<BuildSection
|
||||
formXML={formXML}
|
||||
sectionCount={sectionCount}
|
||||
onSubmit={onSubmit}
|
||||
formTitle={formTitle}
|
||||
mandatoryFieldsData={mandatoryFieldsData}
|
||||
props={propsForChildren}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
// components/newappeal/NewAppealPageShell.js
|
||||
import React from "react";
|
||||
import Head from "next/head";
|
||||
import { useRouter } from "next/router";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
|
||||
import Breadcrumbs from "../breadcrumbs";
|
||||
import CookieBanner from "../cookieBanner";
|
||||
import Footer from "../footer";
|
||||
import Header from "../header";
|
||||
import TimeOut from "../timeout";
|
||||
import ServiceBanner from "../myportal/servicebanner";
|
||||
|
||||
export default function NewAppealPageShell({
|
||||
appealtypes,
|
||||
formTitle,
|
||||
footerLinks,
|
||||
children,
|
||||
propsForFooter,
|
||||
propsForServiceBanner,
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Head>
|
||||
<title>
|
||||
{t("newappeal:page-title")} - {t("common:service-name")}
|
||||
</title>
|
||||
|
||||
{/* Keep your existing meta structure */}
|
||||
<link
|
||||
rel="canonical"
|
||||
href={t("common:gov-wales-link") + router.asPath}
|
||||
/>
|
||||
<meta
|
||||
key="og:locale"
|
||||
property="og:locale"
|
||||
content={router.locale}
|
||||
/>
|
||||
<meta
|
||||
key="og:site_name"
|
||||
property="og:site_name"
|
||||
content={t("common:service-name")}
|
||||
/>
|
||||
<meta
|
||||
key="twitter:site"
|
||||
property="twitter:site"
|
||||
content="@UKGovWales"
|
||||
/>
|
||||
<meta
|
||||
name="description"
|
||||
content={t("common:service-description")}
|
||||
/>
|
||||
<meta
|
||||
property="og:site_name"
|
||||
content={t("common:gov-wales-label")}
|
||||
/>
|
||||
<meta property="og:title" content={t("newappeal:page-title")} />
|
||||
<meta
|
||||
property="og:description"
|
||||
content={t("common:service-description")}
|
||||
/>
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:url" content={t("common:gov-wales-link")} />
|
||||
<meta
|
||||
property="og:image"
|
||||
content="https://gov.wales/themes/custom/govwales/images/content/og-global-1200.png"
|
||||
/>
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta
|
||||
name="twitter:title"
|
||||
content={t("common:gov-wales-label")}
|
||||
/>
|
||||
<meta
|
||||
name="twitter:url"
|
||||
content={t("common:gov-wales-link") + router.asPath}
|
||||
/>
|
||||
<meta
|
||||
name="twitter:image"
|
||||
content="https://gov.wales/themes/custom/govwales/images/content/og-global-120.png"
|
||||
/>
|
||||
</Head>
|
||||
|
||||
<div id="page_wrapper">
|
||||
<CookieBanner />
|
||||
<Header />
|
||||
|
||||
<div className="govuk-width-container">
|
||||
<Breadcrumbs slug={appealtypes} formTitle={formTitle} />
|
||||
<ServiceBanner props={propsForServiceBanner} />
|
||||
|
||||
<main
|
||||
className="govuk-main-wrapper--auto-spacing"
|
||||
id="main-content"
|
||||
role="main"
|
||||
>
|
||||
{children}
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<Footer
|
||||
footerLinks={footerLinks}
|
||||
ticketnumber={propsForFooter}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<TimeOut />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user