diff --git a/components/breadcrumbs.js b/components/breadcrumbs.js index 7252cf66..3dd9a0b3 100644 --- a/components/breadcrumbs.js +++ b/components/breadcrumbs.js @@ -50,9 +50,15 @@ const Breadcrumbs = (props) => {
  • - + - {t("common:service-name")} + {router.pathname.includes("dns") + ? t("dnsCommon:service-name") + : t("common:service-name")}
  • @@ -167,7 +173,31 @@ const Breadcrumbs = (props) => {
  • - Case Reference: CAS-00010-J9W6L5 + Case Reference:{" "} + { + props.props.currentView.caseReference + .currentReference + } +
  • + + ) : ( + "" + )} + {router.pathname == "/representation" ? ( + <> +
  • + + + My Portal + + +
  • +
  • + Make representation for:{" "} + { + props.props.currentView.caseReference + .currentReference + }
  • ) : ( @@ -214,6 +244,73 @@ const Breadcrumbs = (props) => { ) : ( "" )} + {router.pathname == "/dns" ? ( + <> +
  • + + + {t("dnsCommon:service-name")} + + +
  • + + ) : ( + "" + )} + {router.pathname == "/dns/application-process" ? ( + <> +
  • + Guidance +
  • + + ) : ( + "" + )} + {router.pathname == "/dns/help" ? ( + <> +
  • + Help +
  • + + ) : ( + "" + )} + {router.pathname == "/dns/contact-us" ? ( + <> +
  • + Contact us +
  • + + ) : ( + "" + )} + {router.pathname == "/dns/applications" ? ( + <> +
  • + {t("dnsApplications:page-title")} +
  • + + ) : ( + "" + )} + {router.pathname == "/dns/application-view" ? ( + <> +
  • + + + {t( + "dnsApplicationView:page-parent-title" + )} + + +
  • +
  • + TWA - Morlais Demonstration Zone +
  • + + ) : ( + "" + )} {!_.isEmpty(slug) ? ( <>
  • diff --git a/components/case.js b/components/case.js index b55d1f58..4984fd98 100644 --- a/components/case.js +++ b/components/case.js @@ -5,7 +5,7 @@ import useTranslation from "next-translate/useTranslation"; import Summary from "./case/summary"; import Documents from "./case/documents"; -export default function CaseSummary({ children, pages }) { +const CaseSummary = (props) => { let { t } = useTranslation(); const router = useRouter(); @@ -19,10 +19,21 @@ export default function CaseSummary({ children, pages }) { >
    - +
    ); -} +}; + +export default CaseSummary; diff --git a/components/case/representation/index copy.js b/components/case/representation/index copy.js new file mode 100644 index 00000000..454e8cda --- /dev/null +++ b/components/case/representation/index copy.js @@ -0,0 +1,212 @@ +import Link from "next/link"; +import { useState, useEffect } from "react"; +import { useRouter } from "next/router"; +import useTranslation from "next-translate/useTranslation"; +import jsonpath from "jsonpath"; +import _ from "lodash"; +import { Field, FieldArray, reduxForm, formValueSelector } from "redux-form"; +import { connect } from "react-redux"; +import { useDropzone } from "react-dropzone"; + +import { setRepresentationCapacity } from "../../../store/currentView/action"; +import RepCapacitySelection from "./representationCapacitySelection"; +import RepDetails from "./representationDetails"; +import RepAppellant from "./representationAppellant"; +import RepAgent from "./representationAgent"; +import RepInterestedPartyPerson from "./representationInterestedPartyPerson"; +import RepLandOwner from "./representationLandowner"; +import { + RenderPickList, + RenderRadioList, + RenderTextfield, +} from "./representationElements"; + +let MakeRepresentation = (props) => { + let { t } = useTranslation(); + const { acceptedFiles, getRootProps, getInputProps } = useDropzone(); + + const [clearRepForm, setClearRepForm] = useState(false); + + const router = useRouter(); + const { locale } = router; + const { + caseReference, + myCases, + myRepresentations, + watchedCases, + awaitingSubmission, + searchResultsObj, + currentType, + currentView, + setRepresentationCapacity, + } = props; + const formObj = props.props.form; + let setCaseQueryObj = props[currentType]; + var casesObj = {}; + + currentType == "searchResultsObj" + ? (casesObj = jsonpath.query( + setCaseQueryObj, + '$..[?(@.title=="' + caseReference + '")]' + )) + : (casesObj = jsonpath.query( + setCaseQueryObj, + '$..[?(@.reference=="' + caseReference + '")]' + )); + + casesObj = Object.assign({}, ...casesObj); + + const capacityOptionsArr = [ + "Appellant", + "Agent", + "Interested Party/Person", + "Land Owner", + ]; + + const appellantApplicantRepresentationArr = [ + "Other", + "Statement", + "Statement of common ground", + "Written statement of evidence", + ]; + + const interestedPersonRepresentationArr = [ + "Interested Party/Person correspondence", + ]; + + const landOwnerRepresentationArr = [ + "Other", + "Statement", + "Written statement of evidence", + ]; + + const repCapacityType = () => { + currentView.representationCapacity == false + ? false + : _.isEmpty(formObj["representationForm"]) + ? false + : _.isEmpty(formObj["representationForm"].values) + ? false + : _.isEmpty( + formObj["representationForm"].values.representationCapacity + ) + ? setRepresentationCapacity(false) + : setRepresentationCapacity( + formObj["representationForm"].values.representationCapacity + .replace(/[\s\-\+\(\)\,\/]/g, "") + .toLowerCase() + ); + + return currentView.representationCapacity; + }; + + const whichControl = () => { + repCapacityType(); + switch (currentView.representationCapacity) { + case false: + return ( + + ); + break; + case "appellant": + setRepresentationCapacity("appellant"); + return ( + + ); + break; + case "agent": + setRepresentationCapacity("agent"); + return ( + + ); + break; + case "interestedpartyperson": + setRepresentationCapacity("interestedpartyperson"); + return ( + + ); + break; + case "landowner": + setRepresentationCapacity("landowner"); + return ( + + ); + break; + default: + return ( + + ); + } + }; + + return ( +
    + {whichControl()} - {props.firstValue} +
    + ); +}; + +const mapStateToProps = (state) => { + return { + search: state.search, + searchResultsObj: state.searchResultsObj, + formData: state.formData, + appealType: state.appealType, + currentView: state.currentView, + //form: state.form, + }; +}; + +const mapDispatchToProps = (dispatch) => { + return { + setRepresentationCapacity: (representationCapacity) => { + dispatch(setRepresentationCapacity(representationCapacity)); + }, + }; +}; + +const selector = formValueSelector("representationForm"); + +export default connect( + mapStateToProps, + mapDispatchToProps +)( + reduxForm({ + form: "representationForm", + destroyOnUnmount: false, + })(MakeRepresentation) +); diff --git a/components/case/representation/index.js b/components/case/representation/index.js new file mode 100644 index 00000000..15f7bd1f --- /dev/null +++ b/components/case/representation/index.js @@ -0,0 +1,299 @@ +import Link from "next/link"; +import { useState, useEffect } from "react"; +import { useRouter } from "next/router"; +import useTranslation from "next-translate/useTranslation"; +import jsonpath from "jsonpath"; +import _ from "lodash"; +import { + Field, + FieldArray, + reduxForm, + formValueSelector, + reset, +} from "redux-form"; +import { connect } from "react-redux"; +import { useDropzone } from "react-dropzone"; + +import { + setRepresentationCapacity, + setRepresentationSubmit, + setSubmitBack, + setRepresentationSubmitConfirmation, +} from "../../../store/currentView/action"; +import RepCapacitySelection from "./representationCapacitySelection"; +import RepDetails from "./representationDetails"; +import RepAppellant from "./representationAppellant"; +import RepAgent from "./representationAgent"; +import RepInterestedPartyPerson from "./representationInterestedPartyPerson"; +import RepLandOwner from "./representationLandowner"; +import RepCompleteSubmit from "./representationCompleteSubmit"; + +import { + RenderPickList, + RenderRadioList, + RenderTextfield, +} from "./representationElements"; + +let MakeRepresentation = (props) => { + let { t } = useTranslation(); + const { acceptedFiles, getRootProps, getInputProps } = useDropzone(); + + const [clearRepForm, setClearRepForm] = useState(false); + + const router = useRouter(); + const { locale } = router; + const { + caseReference, + myCases, + myRepresentations, + watchedCases, + awaitingSubmission, + searchResultsObj, + currentType, + currentView, + setRepresentationCapacity, + setRepresentationSubmit, + setSubmitBack, + handleSubmit, + setRepresentationSubmitConfirmation, + } = props; + const formObj = props.props.form; + let setCaseQueryObj = props[currentType]; + var casesObj = {}; + + currentType == "searchResultsObj" + ? (casesObj = jsonpath.query( + setCaseQueryObj, + '$..[?(@.title=="' + caseReference + '")]' + )) + : (casesObj = jsonpath.query( + setCaseQueryObj, + '$..[?(@.reference=="' + caseReference + '")]' + )); + + casesObj = Object.assign({}, ...casesObj); + + const capacityOptionsArr = [ + "Appellant", + "Agent", + "Interested Party/Person", + "Land Owner", + ]; + + const appellantApplicantRepresentationArr = [ + "Other", + "Statement", + "Statement of common ground", + "Written statement of evidence", + ]; + + const interestedPersonRepresentationArr = [ + "Interested Party/Person correspondence", + ]; + + const landOwnerRepresentationArr = [ + "Other", + "Statement", + "Written statement of evidence", + ]; + + const repCapacityType = () => { + return _.isEmpty(formObj["representationForm"]) + ? false + : _.isEmpty(formObj["representationForm"].values) + ? false + : _.isEmpty( + formObj["representationForm"].values.representationCapacity + ) + ? false + : formObj["representationForm"].values.representationCapacity + .replace(/[\s\-\+\(\)\,\/]/g, "") + .toLowerCase(); + }; + + const whichControl = () => { + switch (currentView.representationCapacity) { + case false: + return ( + + ); + break; + case "appellant": + //setRepresentationCapacity("appellant"); + return ( + + ); + break; + case "agent": + //setRepresentationCapacity("agent"); + return ( + + ); + break; + case "interestedpartyperson": + // setRepresentationCapacity("interestedpartyperson"); + return ( + + ); + break; + case "landowner": + //setRepresentationCapacity("landowner"); + return ( + + ); + break; + default: + return ( + + ); + } + }; + + const onHandleSubmit = (values) => { + console.log( + values.representationCapacity, + currentView.representationCapacity + ); + + // console.log(_.isEmpty(currentView.representationCapacity)); + // console.log( + // values.representationCapacity + // .replace(/[\s\-\+\(\)\,\/]/g, "") + // .toLowerCase() == currentView.representationCapacity + // ); + + _.isEmpty(currentView.representationCapacity) + ? setRepresentationCapacity( + values.representationCapacity + .replace(/[\s\-\+\(\)\,\/]/g, "") + .toLowerCase() + ) + : setRepresentationSubmit(true); + }; + + const repForm = props.props.form; + + return ( +
    + {repForm["representationForm.submitSucceeded"] == true ? ( + + ) : ( +
    + {whichControl()} +
    + )} + + {console.log("is submitted", currentView.representationSubmit)} +
    + ); +}; + +const mapStateToProps = (state) => { + return { + search: state.search, + searchResultsObj: state.searchResultsObj, + formData: state.formData, + appealType: state.appealType, + currentView: state.currentView, + //form: state.form, + }; +}; + +const mapDispatchToProps = (dispatch) => { + return { + setRepresentationCapacity: (representationCapacity) => { + dispatch(setRepresentationCapacity(representationCapacity)); + dispatch(reset("representationForm")); + }, + setRepresentationSubmit: (representationSubmit) => { + dispatch(setRepresentationSubmit(representationSubmit)); + }, + setSubmitBack: () => { + dispatch(setRepresentationSubmit(false)); + }, + setRepresentationSubmitConfirmation: () => { + dispatch(setRepresentationSubmitConfirmation(true)); + }, + }; +}; + +const selector = formValueSelector("representationForm"); + +export default connect( + mapStateToProps, + mapDispatchToProps +)( + reduxForm({ + form: "representationForm", + destroyOnUnmount: false, + })(MakeRepresentation) +); diff --git a/components/case/representation/representationAgent.js b/components/case/representation/representationAgent.js new file mode 100644 index 00000000..741448ef --- /dev/null +++ b/components/case/representation/representationAgent.js @@ -0,0 +1,235 @@ +import Link from "next/link"; +import { useRouter } from "next/router"; +import useTranslation from "next-translate/useTranslation"; +import { Field, reduxForm } from "redux-form"; +import { + RenderPickList, + RenderTextfield, + RenderRadioList, + RenderMultiline, +} from "./representationElements"; +import { + setRepresentationCapacity, + setRepresentationSubmit, +} from "../../../store/currentView/action"; +import { useDropzone } from "react-dropzone"; + +const RepAgent = (props) => { + let { t } = useTranslation(); + + const router = useRouter(); + const { locale } = router; + const { + formObj, + appellantApplicantRepresentationArr, + setRepresentationCapacity, + setRepresentationSubmit, + currentView, + } = props; + const { acceptedFiles, getRootProps, getInputProps } = useDropzone(); + const files = acceptedFiles.map((file) => ( +
  • + {file.path} - {file.size} bytes +
  • + )); + + return ( +
    +
    +
    +

    Representation - agent

    + +
    + + +
    +
    +
    +
    + +
    +
    +
    +
    +

    + You can enter your comments in the space provided or + attach a separate document. +

    +
    +
    + My comments are set out in:* +
    +
    +
    + + +
    +
    +
    + +
    +
    +
    + + +
    +
    +
    +
    +
    + +

    + Drag and drop files here or + click to select files +

    +
    + +
    +
    +
    +
    +
    +
    {" "} +
    +
    +
    + + {/* { + setRepresentationSubmit(false); + }} + className="govuk-button" + > + Continue + */} + + { + setRepresentationCapacity("false"); + }} + className="govuk-link" + > + Back + +
    +
    +
    +
    + ); +}; + +export default RepAgent; diff --git a/components/case/representation/representationAppellant.js b/components/case/representation/representationAppellant.js new file mode 100644 index 00000000..6e2305f7 --- /dev/null +++ b/components/case/representation/representationAppellant.js @@ -0,0 +1,238 @@ +import Link from "next/link"; +import { connect } from "react-redux"; +import { useRouter } from "next/router"; +import useTranslation from "next-translate/useTranslation"; +import { Field, reduxForm, reset } from "redux-form"; +import { + RenderPickList, + RenderTextfield, + RenderRadioList, + RenderMultiline, +} from "./representationElements"; +import { useDropzone } from "react-dropzone"; +import { + setRepresentationCapacity, + setRepresentationSubmit, +} from "../../../store/currentView/action"; + +const RepAppellant = (props) => { + let { t } = useTranslation(); + + const router = useRouter(); + const { locale } = router; + const { + formObj, + appellantApplicantRepresentationArr, + setRepresentationCapacity, + setRepresentationSubmit, + currentView, + } = props; + const { acceptedFiles, getRootProps, getInputProps } = useDropzone(); + const files = acceptedFiles.map((file) => ( +
  • + {file.path} - {file.size} bytes +
  • + )); + + return ( +
    +
    +
    +

    + Representation - appellantApplicant +

    + +
    + + +
    +
    +
    +
    + +
    +
    +
    +
    +

    + You can enter your comments in the space provided or + attach a separate document. +

    +
    +
    + My comments are set out in:* +
    +
    +
    + + +
    +
    +
    + +
    +
    +
    + + +
    +
    +
    +
    +
    + +

    + Drag and drop files here or + click to select files +

    +
    + +
    +
    +
    +
    +
    +
    {" "} +
    +
    +
    + {currentView.representationCapacity} + + {/* { + setRepresentationSubmit(false); + }} + className="govuk-button" + > + Continue + */} + { + setRepresentationCapacity(false); + }} + className="govuk-link" + > + Back + +
    +
    +
    +
    + ); +}; + +export default RepAppellant; diff --git a/components/case/representation/representationCapacitySelection.js b/components/case/representation/representationCapacitySelection.js new file mode 100644 index 00000000..16ac04d6 --- /dev/null +++ b/components/case/representation/representationCapacitySelection.js @@ -0,0 +1,88 @@ +import Link from "next/link"; +import { connect } from "react-redux"; +import { useRouter } from "next/router"; +import useTranslation from "next-translate/useTranslation"; +import { + Field, + reduxForm, + formValueSelector, + handleSubmit, + reset, +} from "redux-form"; +import { + RenderPickList, + RenderTextfield, + RenderRadioList, + RenderMultiline, +} from "./representationElements"; +import { useDropzone } from "react-dropzone"; +import RepDetails from "./representationDetails"; +import { setRepresentationCapacity } from "../../../store/currentView/action"; + +let RepCapacitySelection = (props) => { + let { t } = useTranslation(); + + const router = useRouter(); + const { locale } = router; + const { + formObj, + capacityOptionsArr, + currentType, + casesObj, + validate, + handleSubmit, + } = props; + const { acceptedFiles, getRootProps, getInputProps } = useDropzone(); + const files = acceptedFiles.map((file) => ( +
  • + {file.path} - {file.size} bytes +
  • + )); + + const required = (value) => (value ? undefined : "Required"); + + return ( + <> + {" "} +
    +
    +
    +

    + Your details - {props.firstValue} +

    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + + ); +}; + +export default RepCapacitySelection; diff --git a/components/case/representation/representationComplete.js b/components/case/representation/representationComplete.js new file mode 100644 index 00000000..b05e74e9 --- /dev/null +++ b/components/case/representation/representationComplete.js @@ -0,0 +1,76 @@ +import Link from "next/link"; +import { useRouter } from "next/router"; +import useTranslation from "next-translate/useTranslation"; +import { Field, reduxForm } from "redux-form"; +import { + RenderPickList, + RenderTextfield, + RenderRadioList, + RenderMultiline, +} from "./representationElements"; +import { + setRepresentationCapacity, + setRepresentationSubmit, + setSubmitBack, +} from "../../../store/currentView/action"; +import { useDropzone } from "react-dropzone"; + +const RepComplete = (props) => { + let { t } = useTranslation(); + + const router = useRouter(); + const { locale } = router; + const { + formObj, + appellantApplicantRepresentationArr, + setRepresentationCapacity, + setRepresentationSubmit, + currentView, + setSubmitBack, + setRepresentationSubmitConfirmation, + } = props; + const { acceptedFiles, getRootProps, getInputProps } = useDropzone(); + const files = acceptedFiles.map((file) => ( +
  • + {file.path} - {file.size} bytes +
  • + )); + + return ( +
    +
    +
    +

    + Submission of Representation +

    +

    + Thank you for submitting your representation(s) using + the Appeals Casework Portal. +

    + +

    + Please remember that any supporting documentation needs + to be received by us within the appropriate deadline for + the case. Anything you send to us must be clearly marked + with the case reference number and the site address + (including the postcode, where known). +

    + +

    + You will shortly receive confirmation to the email + address you have provided. +

    +
    +
    +
    + + Continue + +
    +
    +
    +
    + ); +}; + +export default RepComplete; diff --git a/components/case/representation/representationCompleteSubmit.js b/components/case/representation/representationCompleteSubmit.js new file mode 100644 index 00000000..0cd6acaa --- /dev/null +++ b/components/case/representation/representationCompleteSubmit.js @@ -0,0 +1,122 @@ +import Link from "next/link"; +import { useRouter } from "next/router"; +import useTranslation from "next-translate/useTranslation"; +import { Field, reduxForm } from "redux-form"; +import { + RenderPickList, + RenderTextfield, + RenderRadioList, + RenderMultiline, +} from "./representationElements"; +import { + setRepresentationCapacity, + setRepresentationSubmit, + setSubmitBack, + setRepresentationSubmitConfirmation, +} from "../../../store/currentView/action"; +import { useDropzone } from "react-dropzone"; +import RepComplete from "./representationComplete"; + +const RepCompleteSubmit = (props) => { + let { t } = useTranslation(); + + const router = useRouter(); + const { locale } = router; + const { + formObj, + appellantApplicantRepresentationArr, + setRepresentationCapacity, + setRepresentationSubmit, + currentView, + setSubmitBack, + setRepresentationSubmitConfirmation, + } = props; + const { acceptedFiles, getRootProps, getInputProps } = useDropzone(); + const files = acceptedFiles.map((file) => ( +
  • + {file.path} - {file.size} bytes +
  • + )); + + return ( + <> + {currentView.representationSubmitConfirmation == true ? ( + + ) : ( +
    +
    +
    +

    Submit

    +

    + The gathering and subsequent processing of the + personal data supplied by you in this form, is + in accordance with the terms of our registration + under the Data Protection Act 2018. +

    + +

    + The Planning Inspectorate takes its data + protection responsibilities for the information + you provide us with very seriously. To find out + more about how we use and manage your personal + data, please go to our privacy notice. +

    + +

    + I confirm that all sections of this form have + been fully completed and that the details are + correct to the best of my knowledge. +

    + +
    + + {/* */} +
    +
    +
    + +
    +
    +
    + )} + + ); +}; + +export default RepCompleteSubmit; diff --git a/components/case/representation/representationDetails.js b/components/case/representation/representationDetails.js new file mode 100644 index 00000000..1351092b --- /dev/null +++ b/components/case/representation/representationDetails.js @@ -0,0 +1,84 @@ +import Link from "next/link"; +import { useRouter } from "next/router"; +import useTranslation from "next-translate/useTranslation"; +import { Field, reduxForm } from "redux-form"; +import { RenderPickList, RenderTextfield } from "./representationElements"; + +const RepDetails = (props) => { + let { t } = useTranslation(); + + const router = useRouter(); + const { locale } = router; + + const { currentType, casesObj } = props; + + return ( + <> + {" "} +
    +
    +

    + Make a representation +

    + +
    +
    +
    + Appeal Reference +
    +
    + {currentType == "searchResultsObj" + ? casesObj.title + : casesObj.reference} +
    +
    +
    +
    + {t("case:summary-applicant-label")} +
    +
    + {casesObj.appellantApplicant || ""} +
    +
    +
    +
    + {t("case:summary-agent-label")} +
    +
    + Mr A Agent +
    +
    +
    +
    + {t("case:summary-site-address-label")} +
    +
    + {casesObj.address1 || ""} +
    + {casesObj.town || ""} + +
    + {casesObj.postcode || ""} +
    +
    +
    +
    +
    +

    + This form enables you to submit comments on a case to + The Planning Inspectorate.{" "} +

    +

    + Please note that comments from interested parties need + to be made within the timetable. This can be found on + the previous ‘Case Summary‘ page. Comments + submitted after this date may be considered invalid and + returned to the sender. +

    +
    +
    + + ); +}; + +export default RepDetails; diff --git a/components/case/representation/representationElements.js b/components/case/representation/representationElements.js new file mode 100644 index 00000000..a4fb778b --- /dev/null +++ b/components/case/representation/representationElements.js @@ -0,0 +1,194 @@ +import { Field, reduxForm } from "redux-form"; +import router from "next/router"; +import React, { useState } from "react"; + +export const RenderRadioList = ({ + datafieldname, + name, + label, + id, + errorMsg, + options, + input: { onChange, value }, + meta: { touched, error }, + ...custom +}) => { + const required = (value) => (value ? undefined : "Required"); + + return ( + <> +
    +
    + + + + {touched && error && ( + + + Error: + {" "} + {errorMsg} + + )} +
    + {Object.keys(options).map((key, index) => ( +
    + + +
    + ))} +
    +
    +
    + + ); +}; + +export const RenderPickList = ({ + datafieldname, + name, + label, + input, + optionsArr, + meta: { touched, errorStr }, +}) => { + return ( +
    + + + {touched && errorStr && {errorStr}} +
    + ); +}; + +export const RenderTextfield = ({ + id, + rows, + datafieldname, + name, + label, + input, + errorMsg, + type, + className, + meta: { touched, error }, + ...custom +}) => { + return ( + <> + + {touched && error && ( + + Error:{" "} + {errorMsg} + + )} + + + ); +}; + +export const RenderMultiline = ({ + id, + className, + rows, + datafieldname, + name, + label, + input, + meta: { touched, error }, + ...custom +}) => { + return ( + <> + + + ); +}; + +export function MultiLinefield(props) { + const { name, label } = props; + + return ( +
    +

    + +

    +
    + Do not include personal or financial information, like your + National Insurance number or credit card details. +
    + + +
    + ); +} diff --git a/components/case/representation/representationInterestedPartyPerson.js b/components/case/representation/representationInterestedPartyPerson.js new file mode 100644 index 00000000..d8cd747f --- /dev/null +++ b/components/case/representation/representationInterestedPartyPerson.js @@ -0,0 +1,323 @@ +import Link from "next/link"; +import { useRouter } from "next/router"; +import useTranslation from "next-translate/useTranslation"; +import { Field, reduxForm } from "redux-form"; +import { + RenderPickList, + RenderTextfield, + RenderRadioList, + RenderMultiline, +} from "./representationElements"; +import { useDropzone } from "react-dropzone"; + +const RepInterestedPartyPerson = (props) => { + let { t } = useTranslation(); + + const router = useRouter(); + const { locale } = router; + const { + formObj, + interestedPersonRepresentationArr, + setRepresentationCapacity, + setRepresentationSubmit, + } = props; + const { acceptedFiles, getRootProps, getInputProps } = useDropzone(); + const files = acceptedFiles.map((file) => ( +
  • + {file.path} - {file.size} bytes +
  • + )); + return ( +
    +
    +
    +

    + Representation - interested +

    + +
    + + +
    +
    +
    +
    + +
    +
    +
    +
    + + + +
    + e.g. ‘Owners of Numbers 1-5 High + Street‘, or ‘Mr and Mrs + Smith‘ or ‘The executors of Mr + Evans‘ estate‘ +
    +
    +
    + + +
    +
    +
    + + +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    +

    + You can enter your comments in the space + provided or attach a separate document. +

    +
    +
    + My comments are set out in:* +
    +
    +
    + + +
    +
    +
    + +
    +
    +
    + + +
    +
    +
    +
    +
    + +

    + Drag and drop files here + or click to select files +

    +
    + +
    +
    +
    +
    +
    +
    {" "} +
    + +
    +
    +
    + ); +}; + +export default RepInterestedPartyPerson; diff --git a/components/case/representation/representationLandowner.js b/components/case/representation/representationLandowner.js new file mode 100644 index 00000000..247735d7 --- /dev/null +++ b/components/case/representation/representationLandowner.js @@ -0,0 +1,230 @@ +import Link from "next/link"; +import { useRouter } from "next/router"; +import useTranslation from "next-translate/useTranslation"; +import { Field, reduxForm } from "redux-form"; +import { + RenderPickList, + RenderTextfield, + RenderRadioList, + RenderMultiline, +} from "./representationElements"; +import { useDropzone } from "react-dropzone"; +import { + setRepresentationCapacity, + setRepresentationSubmit, +} from "../../../store/currentView/action"; + +const RepLandOwner = (props) => { + let { t } = useTranslation(); + + const router = useRouter(); + const { locale } = router; + const { + formObj, + landOwnerRepresentationArr, + setRepresentationCapacity, + setRepresentationSubmit, + } = props; + const { acceptedFiles, getRootProps, getInputProps } = useDropzone(); + const files = acceptedFiles.map((file) => ( +
  • + {file.path} - {file.size} bytes +
  • + )); + + return ( +
    +
    +
    +

    + Representation - landowner +

    + +
    + + +
    +
    +
    +
    + +
    +
    +
    +
    +

    + You can enter your comments in the space provided or + attach a separate document. +

    +
    +
    + My comments are set out in:* +
    +
    +
    + + +
    +
    +
    + +
    +
    +
    + + +
    +
    +
    +
    +
    + +

    + Drag and drop files here or + click to select files +

    +
    + +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    + ); +}; + +export default RepLandOwner; diff --git a/components/case/summary.js b/components/case/summary.js index 3d98b971..02521be7 100644 --- a/components/case/summary.js +++ b/components/case/summary.js @@ -1,18 +1,48 @@ import Link from "next/link"; import { useRouter } from "next/router"; import useTranslation from "next-translate/useTranslation"; +import jsonpath from "jsonpath"; +import _ from "lodash"; -export default function CaseSummary() { +const CaseSummary = (props) => { let { t } = useTranslation(); const router = useRouter(); const { locale } = router; + const { + caseReference, + myCases, + myRepresentations, + watchedCases, + awaitingSubmission, + searchResultsObj, + currentType, + } = props; + + let setCaseQueryObj = props[currentType]; + var casesObj = {}; + + currentType == "searchResultsObj" + ? (casesObj = jsonpath.query( + setCaseQueryObj, + '$..[?(@.title=="' + caseReference + '")]' + )) + : (casesObj = jsonpath.query( + setCaseQueryObj, + '$..[?(@.reference=="' + caseReference + '")]' + )); + + casesObj = Object.assign({}, ...casesObj); + return (

    - Reference: CAS-00010-J9W6L5 + Reference:{" "} + {currentType == "searchResultsObj" + ? casesObj.title + : casesObj.reference}

    @@ -21,7 +51,7 @@ export default function CaseSummary() { {t("case:summary-applicant-label")}
    - Mr J Pocknell + {casesObj.appellantApplicant || ""}
    @@ -29,7 +59,7 @@ export default function CaseSummary() { {t("case:summary-agent-label")}
    - Mr Cos Polito + Mr A Agent
    @@ -37,11 +67,12 @@ export default function CaseSummary() { {t("case:summary-site-address-label")}
    - 72 Guild Street + {casesObj.address1 || ""}
    - London + {casesObj.town || ""} +
    - SE23 6FH + {casesObj.postcode || ""}
    @@ -50,16 +81,17 @@ export default function CaseSummary() {
    @@ -78,7 +110,9 @@ export default function CaseSummary() { {t("case:summary-case-type-label")}
    - Planning Appeal (W){" "} + {casesObj[ + "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue" + ] || "N/A"}
    @@ -86,7 +120,7 @@ export default function CaseSummary() { {t("case:summary-lpa-label")}
    - Hastings Borough Council + {casesObj.lpaname || ""}
    @@ -96,8 +130,8 @@ export default function CaseSummary() { )}
    - Erection of a two-storey chalet - style detached dwelling + {casesObj.caseDetails.caseSummary || + ""}
    @@ -108,7 +142,8 @@ export default function CaseSummary() {
    {" "} - Neale Oliver + {casesObj.caseDetails.caseOfficer || + ""}
    @@ -116,7 +151,8 @@ export default function CaseSummary() { {t("case:summary-procedure-label")}
    - Written representations + {casesObj.caseDetails.procedure || + ""}
    @@ -124,7 +160,9 @@ export default function CaseSummary() { {t("case:summary-status-label")}
    - In Progress + {casesObj[ + "statuscode@OData.Community.Display.V1.FormattedValue" + ] || ""}
    @@ -132,10 +170,13 @@ export default function CaseSummary() { {t("case:summary-decision-label")}
    - Allowed + {casesObj.caseDetails.decision || + ""} +
    - 3272770 Appeal Decision.pdf + {casesObj.caseDetails + .outcome_document || ""}
    @@ -147,7 +188,8 @@ export default function CaseSummary() { )}
    - Not Linked + {casesObj.caseDetails + .caseLinkStatus || ""}
    @@ -157,7 +199,8 @@ export default function CaseSummary() { )}
    - 0 + {casesObj.caseDetails.linkedCases || + ""}
    @@ -176,7 +219,8 @@ export default function CaseSummary() { {t("case:summary-start-date-label")}
    - 26-May-21 + {casesObj.caseDates.start_date || + "N/A"}
    @@ -187,7 +231,8 @@ export default function CaseSummary() { )}
    - 02-Jun-21 + {casesObj.caseDates + .questionnaireDue || "N/A"}
    @@ -198,7 +243,8 @@ export default function CaseSummary() { )}
    - 30-Jun-21 + {casesObj.caseDates.statementsDue || + "N/A"}
    @@ -209,7 +255,9 @@ export default function CaseSummary() { )}
    - 30-Jun-21 + {casesObj.caseDates + .interestedPartyCommentsdue || + "N/A"}
    @@ -220,7 +268,9 @@ export default function CaseSummary() { )}
    - 14-Jul-21 + {casesObj.caseDates + .appellantLPAFinalCommentsdue || + "N/A"}
    @@ -231,7 +281,8 @@ export default function CaseSummary() { )}
    - N/A + {casesObj.caseDates + .inquiryEvidenceDue || "N/A"}
    @@ -240,7 +291,8 @@ export default function CaseSummary() { {t("case:summary-event-date-label")}
    - Date arranged + {casesObj.caseDates.eventDate || + "N/A"}
    @@ -251,7 +303,8 @@ export default function CaseSummary() { )}
    - Not yet decided + {casesObj.caseDates.decisionDate || + "N/A"}
    @@ -273,4 +326,6 @@ export default function CaseSummary() { */} ); -} +}; + +export default CaseSummary; diff --git a/components/dns/applications/applicationSideBar.js b/components/dns/applications/applicationSideBar.js new file mode 100644 index 00000000..94e1c210 --- /dev/null +++ b/components/dns/applications/applicationSideBar.js @@ -0,0 +1,106 @@ +import Link from "next/link"; +import { useRouter } from "next/router"; +import { useContext } from "react"; +import useTranslation from "next-translate/useTranslation"; + +const ApplicationSideBar = (props) => { + let { t } = useTranslation(); + + const router = useRouter(); + const { locale } = router; + + return ( + <> +
    +
    +

    About this application

    +

    + The Project will provide a consented area for the + installation and commercial demonstration of multiple + arrays of tidal energy devices, to a maximum installed + capacity of 240 Megawatts (MW). +

    +
    +
    +
    +
    +
    +

    Application location

    +
    + +
    +

    + The location shown on the map is approximate at this + stage +

    +
    +
    +
    +
    +
    +

    Contact Information

    +

    + Planning Inspectorate case team: +
    + + TWA.morlaistidalarray@planninginspectorate.gov.uk + +

    +

    + Tel: 0303 444 5940 +

    +

    + Developer:
    + Graham Morley +
    + Tel: +44 (0) 1248 725 713 +

    +
    +
    +
    +
    +
    +

    Email updates

    +

    + Sign up using email address to receive updates about + this application +

    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + + ); +}; + +export default ApplicationSideBar; diff --git a/components/dns/applications/applicationSummary.js b/components/dns/applications/applicationSummary.js new file mode 100644 index 00000000..45346c29 --- /dev/null +++ b/components/dns/applications/applicationSummary.js @@ -0,0 +1,63 @@ +import Link from "next/link"; +import { useRouter } from "next/router"; +import { useContext } from "react"; +import useTranslation from "next-translate/useTranslation"; + +const ApplicationSummary = (props) => { + let { t } = useTranslation(); + + const router = useRouter(); + const { locale } = router; + + return ( + <> +
    +
    +

    TWA - Morlais Demonstration Zone

    +
    +
    +
    +
    +

    + by Menter Mon
    + Type: Generating Stations +

    +
    + + + + Information + + The Inspector’s report into the above has now been + formally submitted to the Welsh Government for + consideration. +
    + + 05 October 2020 + +
    +
    +
    +
    +

    + Stage:
    + Next Stage: Decision +
    + Reference: TWA/3234121 +
    + Developer: Menter Mon +
    + Procedure: Inquiry +

    +
    +
    + + ); +}; + +export default ApplicationSummary; diff --git a/components/dns/applications/applicationTabs.js b/components/dns/applications/applicationTabs.js new file mode 100644 index 00000000..64de5c2c --- /dev/null +++ b/components/dns/applications/applicationTabs.js @@ -0,0 +1,151 @@ +import Link from "next/link"; +import { useRouter } from "next/router"; +import { useContext } from "react"; +import { useState } from "react"; +import useTranslation from "next-translate/useTranslation"; +import ApplicationTabsTimeLine from "./applicationTabsTimeline"; +import ApplicationSideBar from "./applicationSideBar"; +import ApplicationTabsDocuments from "./applicationTabsDocuments"; +import ApplicationTabsComments from "./applicationTabsComments"; +import ApplicationTabsRegistrationForm from "./applicationTabsRegistrationForm"; + +const ApplicationTabs = (props) => { + let { t } = useTranslation(); + + const router = useRouter(); + const { locale } = router; + + const [showTab, setShowTab] = useState(1); + + let selectTab = (tabID) => { + setShowTab(tabID); + console.log(showTab); + }; + + return ( + <> +
    +

    Contents

    + +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + + ); +}; + +export default ApplicationTabs; diff --git a/components/dns/applications/applicationTabsComments.js b/components/dns/applications/applicationTabsComments.js new file mode 100644 index 00000000..9f015862 --- /dev/null +++ b/components/dns/applications/applicationTabsComments.js @@ -0,0 +1,30 @@ +import Link from "next/link"; +import { useRouter } from "next/router"; +import { useContext } from "react"; +import useTranslation from "next-translate/useTranslation"; + +const ApplicationTabsComments = (props) => { + let { t } = useTranslation(); + + const router = useRouter(); + const { locale } = router; + + return ( + <> +
    +
    +

    + Representations received regarding XXXXXXXX XXXXXXXX + XXXXXXX Order +

    +

    + No comments have been received as yet. Any we receive + will be published on this page. +

    +
    +
    + + ); +}; + +export default ApplicationTabsComments; diff --git a/components/dns/applications/applicationTabsDocuments.js b/components/dns/applications/applicationTabsDocuments.js new file mode 100644 index 00000000..98a9675c --- /dev/null +++ b/components/dns/applications/applicationTabsDocuments.js @@ -0,0 +1,385 @@ +import Link from "next/link"; +import { useRouter } from "next/router"; +import { useContext } from "react"; +import useTranslation from "next-translate/useTranslation"; +import { + Accordion, + AccordionItem, + AccordionItemHeading, + AccordionItemButton, + AccordionItemPanel, +} from "react-accessible-accordion"; +// import "react-accessible-accordion/dist/fancy-example.css"; + +const ApplicationTabsDocuments = (props) => { + let { t } = useTranslation(); + + const router = useRouter(); + const { locale } = router; + + return ( + <> +
    +
    +

    + Filter documents by Application stage +

    + + + + + Pre Application (0) + + + + All documents +
    +
    +
    + + + + Developer's Application (174) + + + + All documents + + + + + Pre Application{" "} + + + + All documents +
    +
    +
    + + + + Developer's Application + + + + All documents + + + + + + Pre Application{" "} + + + + All documents + + +
    +
    +
    + + + + Acceptance (0) + + + + All documents + + + + + + Examination (0) + + + + All documents + + + + + + Decision (0) + + + + All documents + + + + + + Decided (0) + + + + All documents + + +
    +
    +
    +
    +
    +

    + Showing 1 to 10 of 54 entries +

    +
    + +
    + +
    +
    +
    +
    +
    +
    +
    + + Core Documents List v14 + + (Document Size: 715 KB) +
    +
    +
    + Examination > Inquiry Documents + > Administration +
    +
    + Published: 17/05/2021 +
    +
    +
    +
    +
    + + Core Documents List v14 + + (Document Size: 715 KB) +
    +
    +
    + Examination > Inquiry Documents + > Administration +
    +
    + Published: 17/05/2021 +
    +
    +
    + +
    +
    + + Core Documents List v14 + + (Document Size: 715 KB) +
    +
    +
    + Examination > Inquiry Documents + > Administration +
    +
    + Published: 17/05/2021 +
    +
    +
    +
    +
    + + Core Documents List v14 + + (Document Size: 715 KB) +
    +
    +
    + Examination > Inquiry Documents + > Administration +
    +
    + Published: 17/05/2021 +
    +
    +
    +
    +
    + + Core Documents List v14 + + (Document Size: 715 KB) +
    +
    +
    + Examination > Inquiry Documents + > Administration +
    +
    + Published: 17/05/2021 +
    +
    +
    +
    +
    + + Core Documents List v14 + + (Document Size: 715 KB) +
    +
    +
    + Examination > Inquiry Documents + > Administration +
    +
    + Published: 17/05/2021 +
    +
    +
    +
    +
    + + Core Documents List v14 + + (Document Size: 715 KB) +
    +
    +
    + Examination > Inquiry Documents + > Administration +
    +
    + Published: 17/05/2021 +
    +
    +
    +
    +
    + + Core Documents List v14 + + (Document Size: 715 KB) +
    +
    +
    + Examination > Inquiry Documents + > Administration +
    +
    + Published: 17/05/2021 +
    +
    +
    +
    +
    + + Core Documents List v14 + + (Document Size: 715 KB) +
    +
    +
    + Examination > Inquiry Documents + > Administration +
    +
    + Published: 17/05/2021 +
    +
    +
    +
    +
    + + Core Documents List v14 + + (Document Size: 715 KB) +
    +
    +
    + Examination > Inquiry Documents + > Administration +
    +
    + Published: 17/05/2021 +
    +
    +
    +
    +
    +
    +
    +
    +

    + Previous 1{" "} + + 2 + {" "} + + 3 + {" "} + + 4 + {" "} + + 5 + {" "} + Next +

    +
    +
    +
    +
    + + ); +}; + +export default ApplicationTabsDocuments; diff --git a/components/dns/applications/applicationTabsRegistrationForm.js b/components/dns/applications/applicationTabsRegistrationForm.js new file mode 100644 index 00000000..ac8fa71f --- /dev/null +++ b/components/dns/applications/applicationTabsRegistrationForm.js @@ -0,0 +1,23 @@ +import Link from "next/link"; +import { useRouter } from "next/router"; +import { useContext } from "react"; +import useTranslation from "next-translate/useTranslation"; + +const ApplicationTabsRegistrationForm = (props) => { + let { t } = useTranslation(); + + const router = useRouter(); + const { locale } = router; + + return ( + <> +
    +
    +

    Registration form

    +
    +
    + + ); +}; + +export default ApplicationTabsRegistrationForm; diff --git a/components/dns/applications/applicationTabsTimeline.js b/components/dns/applications/applicationTabsTimeline.js new file mode 100644 index 00000000..19160f81 --- /dev/null +++ b/components/dns/applications/applicationTabsTimeline.js @@ -0,0 +1,145 @@ +import Link from "next/link"; +import { useRouter } from "next/router"; +import { useContext } from "react"; +import useTranslation from "next-translate/useTranslation"; + +const ApplicationTabsTimeLine = (props) => { + let { t } = useTranslation(); + + const router = useRouter(); + const { locale } = router; + + return ( + <> +
    +
    +

    Transport & Works Act

    +

    + Lorem ipsum dolor sit amet, consectetur adipiscing elit. + Integer in malesuada ligula, sit amet placerat enim. + Suspendisse porta velit auctor enim pretium, et interdum + lectus mollis. Fusce et consectetur nisl. Donec viverra + lectus massa, nec tincidunt orci euismod vel. +

    +
    +
    +
    +
    +
    +

    Timeline

    +
    + +

    + The Inspector’s report into the above has now + been formally submitted to the Welsh Government + for consideration. +

    +

    + 05 October 2020 +

    +
    +
    + +

    + The Procedure for this Transport and Works Act + Application was formally determined, on the + 07/08/2020, as an Inquiry.
    +
    + Statements of Case from the Applicant, each + Statutory Objector and each other person or body + who have indicated that they wish to provide + oral evidence at the Inquiry are required by + 18/09/2020. +

    +

    + 05 October 2020 +

    +
    +
    + +

    + The Inspector’s report into the above has now + been formally submitted to the Welsh Government + for consideration. +

    +

    + 05 October 2020 +

    +
    +
    + +

    + The Inspector’s report into the above has now + been formally submitted to the Welsh Government + for consideration. +

    +

    + 05 October 2020 +

    +
    +
    + +

    + The Procedure for this Transport and Works Act + Application was formally determined, on the + 07/08/2020, as an Inquiry.
    +
    + Statements of Case from the Applicant, each + Statutory Objector and each other person or body + who have indicated that they wish to provide + oral evidence at the Inquiry are required by + 18/09/2020. +

    +

    + 05 October 2020 +

    +
    +
    + +

    + The Inspector’s report into the above has now + been formally submitted to the Welsh Government + for consideration. +

    +

    + 05 October 2020 +

    +
    +
    +
    +
    + + ); +}; + +export default ApplicationTabsTimeLine; diff --git a/components/dns/applications/applicationsIntro.js b/components/dns/applications/applicationsIntro.js new file mode 100644 index 00000000..883f4f06 --- /dev/null +++ b/components/dns/applications/applicationsIntro.js @@ -0,0 +1,56 @@ +import Link from "next/link"; +import { useRouter } from "next/router"; +import { useContext } from "react"; +import useTranslation from "next-translate/useTranslation"; + +const ApplicationIntro = (props) => { + let { t } = useTranslation(); + + const router = useRouter(); + const { locale } = router; + + return ( +
    +
    +

    + {t("dnsApplications:page-title")} +

    +

    + {t("dnsApplications:page-intro-paragraph-1")} +

    +
      +
    • {t("dnsApplications:page-intro-list-item-1")}
    • + +
    • {t("dnsApplications:page-intro-list-item-2")}
    • + +
    • {t("dnsApplications:page-intro-list-item-3")}
    • +
    +

    + {t("dnsApplications:page-intro-paragraph-2")}{" "} + + + {t("dnsApplications:page-intro-paragraph-2-link")} + + + . +

    +
    +
    +
    + +
    +
    +
    + ); +}; + +export default ApplicationIntro; diff --git a/components/dns/applications/applicationsList.js b/components/dns/applications/applicationsList.js new file mode 100644 index 00000000..eea1451b --- /dev/null +++ b/components/dns/applications/applicationsList.js @@ -0,0 +1,513 @@ +import Link from "next/link"; +import { useRouter } from "next/router"; +import { useContext } from "react"; +import useTranslation from "next-translate/useTranslation"; + +const ApplicationList = (props) => { + let { t } = useTranslation(); + + const router = useRouter(); + const { locale } = router; + + return ( + <> +
    +
    +
    + +
    +
    +
    +
    +
    +

    + {t("dnsCommon:result-list-showing-label", { + recordIndex: "1", + pagingIndex: "10", + totalRecords: "55", + })} +

    +
    +
    +
    +
    +
    +
    +
    + {t( + "dnsApplications:result-list-heading-label-reference" + )} +
    +
    + {t( + "dnsApplications:result-list-heading-label-application" + )} +
    +
    + {t( + "dnsApplications:result-list-heading-label-developer" + )} +
    +
    + {t( + "dnsApplications:result-list-heading-label-type" + )} +
    +
    + {t( + "dnsApplications:result-list-heading-label-status" + )} +
    +
    +
    +
    + + {t( + "dnsApplications:result-list-heading-label-reference" + )} + : + + CAS-00009-W8N6W4 +
    +
    + + + + {t( + "dnsApplications:result-list-heading-label-application" + )} + :{" "} + + TWA - Morlais Demonstration Zone + + +
    +
    + + {t( + "dnsApplications:result-list-heading-label-developer" + )} + : + + Menter Mon +
    +
    + + {t( + "dnsApplications:result-list-heading-label-type" + )} + : + + Energy +
    +
    + + {t( + "dnsApplications:result-list-heading-label-status" + )} + : + + Recommendation +
    +
    +
    +
    + + {t( + "dnsApplications:result-list-heading-label-reference" + )} + : + + CAS-00009-W8N6W4 +
    +
    + + + + {t( + "dnsApplications:result-list-heading-label-application" + )} + :{" "} + + TWA - Morlais Demonstration Zone + + +
    +
    + + {t( + "dnsApplications:result-list-heading-label-developer" + )} + : + + Menter Mon +
    +
    + + {t( + "dnsApplications:result-list-heading-label-type" + )} + : + + Energy +
    +
    + + {t( + "dnsApplications:result-list-heading-label-status" + )} + : + + Recommendation +
    +
    +
    +
    + + {t( + "dnsApplications:result-list-heading-label-reference" + )} + : + + CAS-00009-W8N6W4 +
    +
    + + + + {t( + "dnsApplications:result-list-heading-label-application" + )} + :{" "} + + TWA - Morlais Demonstration Zone + + +
    +
    + + {t( + "dnsApplications:result-list-heading-label-developer" + )} + : + + Menter Mon +
    +
    + + {t( + "dnsApplications:result-list-heading-label-type" + )} + : + + Energy +
    +
    + + {t( + "dnsApplications:result-list-heading-label-status" + )} + : + + Recommendation +
    +
    +
    +
    + + {t( + "dnsApplications:result-list-heading-label-reference" + )} + : + + CAS-00009-W8N6W4 +
    +
    + + + + {t( + "dnsApplications:result-list-heading-label-application" + )} + :{" "} + + TWA - Morlais Demonstration Zone + + +
    +
    + + {t( + "dnsApplications:result-list-heading-label-developer" + )} + : + + Menter Mon +
    +
    + + {t( + "dnsApplications:result-list-heading-label-type" + )} + : + + Energy +
    +
    + + {t( + "dnsApplications:result-list-heading-label-status" + )} + : + + Recommendation +
    +
    +
    +
    + + {t( + "dnsApplications:result-list-heading-label-reference" + )} + : + + CAS-00009-W8N6W4 +
    +
    + + + + {t( + "dnsApplications:result-list-heading-label-application" + )} + :{" "} + + TWA - Morlais Demonstration Zone + + +
    +
    + + {t( + "dnsApplications:result-list-heading-label-developer" + )} + : + + Menter Mon +
    +
    + + {t( + "dnsApplications:result-list-heading-label-type" + )} + : + + Energy +
    +
    + + {t( + "dnsApplications:result-list-heading-label-status" + )} + : + + Recommendation +
    +
    +
    +
    + + {t( + "dnsApplications:result-list-heading-label-reference" + )} + : + + CAS-00009-W8N6W4 +
    +
    + + + + {t( + "dnsApplications:result-list-heading-label-application" + )} + :{" "} + + TWA - Morlais Demonstration Zone + + +
    +
    + + {t( + "dnsApplications:result-list-heading-label-developer" + )} + : + + Menter Mon +
    +
    + + {t( + "dnsApplications:result-list-heading-label-type" + )} + : + + Energy +
    +
    + + {t( + "dnsApplications:result-list-heading-label-status" + )} + : + + Recommendation +
    +
    +
    +
    + + {t( + "dnsApplications:result-list-heading-label-reference" + )} + : + + CAS-00009-W8N6W4 +
    +
    + + + + {t( + "dnsApplications:result-list-heading-label-application" + )} + :{" "} + + TWA - Morlais Demonstration Zone + + +
    +
    + + {t( + "dnsApplications:result-list-heading-label-developer" + )} + : + + Menter Mon +
    +
    + + {t( + "dnsApplications:result-list-heading-label-type" + )} + : + + Energy +
    +
    + + {t( + "dnsApplications:result-list-heading-label-status" + )} + : + + Recommendation +
    +
    +
    +
    + + {t( + "dnsApplications:result-list-heading-label-reference" + )} + : + + CAS-00009-W8N6W4 +
    +
    + + + + {t( + "dnsApplications:result-list-heading-label-application" + )} + :{" "} + + TWA - Morlais Demonstration Zone + + +
    +
    + + {t( + "dnsApplications:result-list-heading-label-developer" + )} + : + + Menter Mon +
    +
    + + {t( + "dnsApplications:result-list-heading-label-type" + )} + : + + Energy +
    +
    + + {t( + "dnsApplications:result-list-heading-label-status" + )} + : + + Recommendation +
    +
    +
    +
    +
    +
    +
    +

    + {t("dnsCommon:result-list-previous-label")}{" "} + 1{" "} + + 2 + {" "} + + 3 + {" "} + + 4 + {" "} + + 5 + {" "} + + {t("dnsCommon:result-list-next-label")} + +

    +
    +
    + + ); +}; + +export default ApplicationList; diff --git a/components/dns/homepage/applicationsForComment.js b/components/dns/homepage/applicationsForComment.js new file mode 100644 index 00000000..e8f7262b --- /dev/null +++ b/components/dns/homepage/applicationsForComment.js @@ -0,0 +1,30 @@ +import Link from "next/link"; +import { useRouter } from "next/router"; +import useTranslation from "next-translate/useTranslation"; + +const ApplicationsForComment = (props) => { + let { t } = useTranslation(); + + const router = useRouter(); + const { locale } = router; + return ( +
    +

    + {t("dnsHome:applications-for-comment-title")} +

    +
    + +
    +
    + ); +}; + +export default ApplicationsForComment; diff --git a/components/dns/homepage/dnsLinks.js b/components/dns/homepage/dnsLinks.js new file mode 100644 index 00000000..ec4aeac4 --- /dev/null +++ b/components/dns/homepage/dnsLinks.js @@ -0,0 +1,75 @@ +import Link from "next/link"; +import { useRouter } from "next/router"; +import useTranslation from "next-translate/useTranslation"; + +const DNSLinks = (props) => { + let { t } = useTranslation(); + + const router = useRouter(); + const { locale } = router; + return ( +
    +
    + +
    +
    + +
    +
    + ); +}; + +export default DNSLinks; diff --git a/components/dns/homepage/latestApplications.js b/components/dns/homepage/latestApplications.js new file mode 100644 index 00000000..422aea48 --- /dev/null +++ b/components/dns/homepage/latestApplications.js @@ -0,0 +1,50 @@ +import Link from "next/link"; +import { useRouter } from "next/router"; +import useTranslation from "next-translate/useTranslation"; + +const LatestApplications = (props) => { + let { t } = useTranslation(); + + const router = useRouter(); + const { locale } = router; + return ( +
    +

    + {" "} + {t("dnsHome:latest-applications-title")} +

    +
    + +
    +
    + ); +}; + +export default LatestApplications; diff --git a/components/dns/homepage/titleContent.js b/components/dns/homepage/titleContent.js new file mode 100644 index 00000000..594ed44b --- /dev/null +++ b/components/dns/homepage/titleContent.js @@ -0,0 +1,133 @@ +import Link from "next/link"; +import { useState } from "react"; +import { useRouter } from "next/router"; +import useTranslation from "next-translate/useTranslation"; +import AutoSuggest from "react-autosuggest"; + +const dnsSites = [ + { id: 1, name: "30MW Energy Plant - Wrexham" }, + { id: 1, name: "Abertillery Wind Farm" }, + { id: 1, name: "Alaw Mon Solar Farm" }, + { id: 1, name: "Alwen Forest - Wind" }, + { id: 1, name: "Blackberry Lane Solar Park" }, + { id: 1, name: "Bretton Hall Solar Farm" }, + { id: 1, name: "Brynllewelyn Farm - Renewable Energy Project" }, + { id: 1, name: "Brynrhyd Solar Farm" }, + { id: 1, name: "Brynwell Farm Renewable Energy Hub" }, + { id: 1, name: "Buttington Quarry - ERF" }, + { id: 1, name: "Coed Darcy - STOR" }, + { id: 1, name: "Coity Road - STOR" }, + { id: 1, name: "Craig Y Perchyll Solar" }, + { id: 1, name: "Egnedol - Sustainable Energy" }, + { id: 1, name: "Elwy Solar Energy" }, + { id: 1, name: "Erebus - Floating Offshore Wind Demonstration Project" }, + { id: 1, name: "Felindre Road - STOR" }, + { id: 1, name: "Gaerwen Wind Farm" }, + { id: 1, name: "Garn Fach Wind Farm" }, + { id: 1, name: "Holyhead Harbour Revision Order" }, + { id: 1, name: "Holyhead Marina Harbour Revision Order" }, + { id: 1, name: "Holyhead Waterfront Regeneration Scheme HRO" }, + { id: 1, name: "Legacy Substation Gas Peaking Plant" }, + { id: 1, name: "Llantarnam - SToR" }, + { id: 1, name: "Llanwern - Solar" }, + { id: 1, name: "Lluest y Gwynt Wind Farm" }, + { id: 1, name: "Llynfi Energy Recovery Facility" }, + { id: 1, name: "Manmoel Wind Farm" }, + { id: 1, name: "Môn Solar Farm" }, + { id: 1, name: "Mor Hafren: Energy Recovery Facility" }, + { id: 1, name: "Mynydd Carn-y-Cefn Wind Farm" }, + { id: 1, name: "Mynydd Llanhilleth Wind Farm" }, + { id: 1, name: "Pancross & Oaklands Solar Farm" }, + { id: 1, name: "Parc Dyffryn Solar Park" }, + { id: 1, name: "Parc Solar Traffwll" }, + { id: 1, name: "Pen March Wind Farm" }, + { id: 1, name: "Pen-y-Fan - Power Plant" }, + { id: 1, name: "Pencaerlan Solar Farm" }, + { id: 1, name: "Penderi Solar Farm" }, + { id: 1, name: "Penpergwm Solar Farm" }, + { id: 1, name: "Pentre Bach Solar Farm" }, + { id: 1, name: "Plas Power Estate Solar Farm" }, + { id: 1, name: "Project Valorous" }, + { id: 1, name: "Rhoscrowther Wind Farm" }, + { id: 1, name: "Rush Wall Solar Park Ltd" }, + { id: 1, name: "Sudbrook - Peaking Gas" }, + { id: 1, name: "TWA - Morlais Demonstration Zone" }, + { id: 1, name: "Twyn Hywel Energy Park" }, + { id: 1, name: "Tycroes Solar" }, + { id: 1, name: "Upper Ogmore - Wind Turbines" }, + { id: 1, name: "Valero - Cogeneration Facility" }, + { id: 1, name: "Vattenfall - Renewable Energy" }, + { id: 1, name: "Wauntysswg - Solar" }, + { id: 1, name: "Wentlooge - renewable energy hub" }, + { id: 1, name: "Y Bryn Wind Farm" }, +]; + +const lowerCasedCompanies = dnsSites.map((company) => { + return { + id: company.id, + name: company.name, + }; +}); + +const TitleContent = (props) => { + let { t } = useTranslation(); + + const router = useRouter(); + const { locale } = router; + + const [value, setValue] = useState(""); + const [suggestions, setSuggestions] = useState([]); + + function getSuggestions(value) { + return lowerCasedCompanies.filter((company) => + company.name.toLowerCase().includes(value.trim().toLowerCase()) + ); + } + + return ( +
    +

    + {t("dnsCommon:service-name")} +

    +
    +

    {t("dnsHome:title-paragraph")}

    +
    +
    + setSuggestions([])} + onSuggestionsFetchRequested={({ value }) => { + console.log(value); + setValue(value); + setSuggestions(getSuggestions(value)); + }} + onSuggestionSelected={(_, { suggestionValue }) => + console.log("Selected: " + suggestionValue) + } + getSuggestionValue={(suggestion) => suggestion.name} + renderSuggestion={(suggestion) => ( + {suggestion.name} + )} + inputProps={{ + className: "govuk-input govuk-!-font-size-16", + placeholder: t( + "dnsHome:title-application-search-placeholder" + ), + value: value, + onChange: (_, { newValue, method }) => { + setValue(newValue); + }, + }} + highlightFirstSuggestion={true} + /> + + + {t("dnsHome:title-application-search-button")} + + +
    +
    + ); +}; + +export default TitleContent; diff --git a/components/dns/main.js b/components/dns/main.js new file mode 100644 index 00000000..cc66c90c --- /dev/null +++ b/components/dns/main.js @@ -0,0 +1,40 @@ +import Link from "next/link"; +import { useRouter } from "next/router"; +import { useContext } from "react"; +import useTranslation from "next-translate/useTranslation"; +import TitleContent from "./homepage/titleContent"; +import LatestApplications from "./homepage/latestApplications"; +import DNSLinks from "./homepage/dnsLinks"; +import ApplicationsForComment from "./homepage/applicationsForComment"; + +export default function Main({ children, pages }) { + let { t } = useTranslation(); + + const router = useRouter(); + const { locale } = router; + + return ( +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    + ); +} diff --git a/components/footer.js b/components/footer.js index fbccab2a..803574e9 100644 --- a/components/footer.js +++ b/components/footer.js @@ -1,6 +1,7 @@ import Link from "next/link"; import { useRouter } from "next/router"; import useTranslation from "next-translate/useTranslation"; +import { useState } from "react"; export default function Footer(props) { let { t } = useTranslation(); @@ -18,102 +19,186 @@ export default function Footer(props) { )); + const [showShareState, setShowShareState] = useState(false); + + let shareState = () => { + showShareState == true + ? setShowShareState(false) + : setShowShareState(true); + }; + return ( - + + ); } diff --git a/components/header.js b/components/header.js index fa6b92d2..d45e79c5 100644 --- a/components/header.js +++ b/components/header.js @@ -8,7 +8,25 @@ const Header = (props) => { const router = useRouter(); const { locale } = router; - const { setLogout } = props; + const { setLogout, serviceName } = props; + const noSignoutLink = [ + "/", + "/logout", + "/dns", + "/dns/application-process", + "/dns/help", + "/dns/contact-us", + "/dns/applications", + "/dns/application-view", + ]; + const hasContactLink = [ + "/dns", + "/dns/application-process", + "/dns/help", + "/dns/contact-us", + "/dns/applications", + "/dns/application-view", + ]; return (
    {
    { + window.localStorage.clear(); + }} className="govuk-header__link govuk-header__link--service-name" > - {t("common:service-name")} + {serviceName || t("common:service-name")}
    @@ -95,14 +116,30 @@ const Header = (props) => {
    - {router.pathname != "/" || - router.pathname != "/logout" ? ( - + {hasContactLink.includes(router.pathname) == true ? ( + - {t("common:signout-label")} + Contact ) : ( "" )} + {noSignoutLink.includes(router.pathname) == true ? ( + "" + ) : ( + + { + window.localStorage.clear(); + }} + className="govuk-header__link govuk-!-margin-right-3" + > + {t("common:signout-label")} + + + )}
    -
    +
    { showTopThree={ props.awaitingSubmission.awaitingSubmission } + topThreeType={"awaitingSubmission"} />
    diff --git a/components/myportal/mycases.js b/components/myportal/mycases.js index 3bb6f969..5d0b55aa 100644 --- a/components/myportal/mycases.js +++ b/components/myportal/mycases.js @@ -18,7 +18,10 @@ const MyCases = (props) => { {t("myportal:mycases-card-title")}
    - +
    diff --git a/components/myportal/myrepresentations.js b/components/myportal/myrepresentations.js index 213cc402..3f1a1cf3 100644 --- a/components/myportal/myrepresentations.js +++ b/components/myportal/myrepresentations.js @@ -21,6 +21,7 @@ const MyRepresentations = (props) => {
    diff --git a/components/myportal/topthree.js b/components/myportal/topthree.js index a5dc42b2..fc4bba22 100644 --- a/components/myportal/topthree.js +++ b/components/myportal/topthree.js @@ -1,35 +1,79 @@ import Link from "next/link"; import { useRouter } from "next/router"; import useTranslation from "next-translate/useTranslation"; +import { setCurrentReference } from "../../store/currentView/action"; +import { connect } from "react-redux"; const TopThree = (props) => { let { t } = useTranslation(); - const { showTopThree } = props; + const { showTopThree, setCurrentReference, topThreeType } = props; const router = useRouter(); const { locale } = router; let topthreeRow = []; - for (var i = 0; i < 3; i++) - topthreeRow.push( -
    -
    -
    - Case reference:{" "} - - {props.showTopThree.value[i].reference} - -
    -
    - Address: {props.showTopThree.value[i].address} + for (var i = 0; i < 3; i++) { + (function (i) { + topthreeRow.push( +
    +
    + + {topThreeType != "awaitingSubmission" ? ( +
    + Address: + {showTopThree.value[i].address1} +
    + ) : ( + "" + )} + + {topThreeType == "awaitingSubmission" ? ( +
    + Make Representation on Case Incomplete, not + submitted +
    + ) : ( + "" + )}
    +
    -
    -
    - ); + ); + })(i); + } return <>{topthreeRow}; }; -export default TopThree; +const mapDispatchToProps = (dispatch) => { + return { + setCurrentReference: (currentReference) => { + dispatch(setCurrentReference(currentReference)); + }, + }; +}; + +export default connect(null, mapDispatchToProps)(TopThree); diff --git a/components/myportal/viewall.js b/components/myportal/viewall.js index a7245150..4455ad35 100644 --- a/components/myportal/viewall.js +++ b/components/myportal/viewall.js @@ -1,9 +1,13 @@ import Link from "next/link"; import { useRouter } from "next/router"; import useTranslation from "next-translate/useTranslation"; +import { setCurrentReference } from "../../store/currentView/action"; +import { connect } from "react-redux"; + +const ViewAllResults = (props) => { + const { searchString, searchResultsObj, currentView, setCurrentReference } = + props; -export default function ViewAllResults(props) { - const { searchString, searchResultsObj, currentView } = props; let { t } = useTranslation(); const router = useRouter(); @@ -18,7 +22,15 @@ export default function ViewAllResults(props) {
    - + { + setCurrentReference({ + "currentReference": + resultsArr[index].reference, + "currentType": currentView.viewKey, + }); + }} + > Case Reference: @@ -102,12 +114,25 @@ export default function ViewAllResults(props) { ); -} +}; + +const mapDispatchToProps = (dispatch) => { + return { + setCurrentReference: (currentReference) => { + dispatch(setCurrentReference(currentReference)); + }, + }; +}; + +export default connect(null, mapDispatchToProps)(ViewAllResults); diff --git a/components/myportal/watchedcases.js b/components/myportal/watchedcases.js index 84978e3f..de0cee07 100644 --- a/components/myportal/watchedcases.js +++ b/components/myportal/watchedcases.js @@ -19,7 +19,10 @@ const WatchedCases = (props) => { {t("myportal:watchedcases-card-title")}
    - +
    diff --git a/components/newappeal/createCase.js b/components/newappeal/createCase.js index f80c367e..5450063b 100644 --- a/components/newappeal/createCase.js +++ b/components/newappeal/createCase.js @@ -157,17 +157,52 @@ let CreateCase = (props) => { return ( ); })} diff --git a/components/representation.js b/components/representation.js new file mode 100644 index 00000000..e202abf4 --- /dev/null +++ b/components/representation.js @@ -0,0 +1,38 @@ +import Link from "next/link"; +import { useRouter } from "next/router"; +import { useContext } from "react"; +import useTranslation from "next-translate/useTranslation"; +import Summary from "./case/representation"; + +const CaseSummary = (props) => { + let { t } = useTranslation(); + + const router = useRouter(); + const { locale } = router; + + return ( +
    +
    +
    + +
    +
    +
    + ); +}; + +export default CaseSummary; diff --git a/components/search/searchresults.js b/components/search/searchresults.js index 7dcfd6c8..ebbfb932 100644 --- a/components/search/searchresults.js +++ b/components/search/searchresults.js @@ -1,18 +1,20 @@ import Link from "next/link"; import { useRouter } from "next/router"; import useTranslation from "next-translate/useTranslation"; +import { setCurrentReference } from "../../store/currentView/action"; +import { connect } from "react-redux"; -export default function SearchResults(props) { - const { searchString, searchResultsObj } = props; +const SearchResults = (props) => { + const { searchString, searchResultsObj, setCurrentReference } = props; let { t } = useTranslation(); const router = useRouter(); const { locale } = router; - var resultsArr = props.searchResultsObj.searchResultsObj.value || [{}]; + var resultsArr = searchResultsObj.value || [{}]; const resultRow = Object.keys(resultsArr).map((key, index) => {
    -
    +
    @@ -58,15 +60,13 @@ export default function SearchResults(props) {

    {t("search:searchresults-count-label", { - count: props.searchResultsObj.searchResultsObj[ - "@odata.count" - ].toString(), + count: searchResultsObj["@odata.count"].toString(), })} . You searched for "{searchString}"

    ); -} +}; + +const mapDispatchToProps = (dispatch) => { + return { + setCurrentReference: (currentReference) => { + dispatch(setCurrentReference(currentReference)); + }, + }; +}; + +export default connect(null, mapDispatchToProps)(SearchResults); diff --git a/components/searchresults.js b/components/searchresults.js index c42e37cb..f55a274d 100644 --- a/components/searchresults.js +++ b/components/searchresults.js @@ -20,7 +20,10 @@ export default function Search(props) { >
    - +
    diff --git a/i18n.json b/i18n.json index 3f1e7543..c8b814d2 100644 --- a/i18n.json +++ b/i18n.json @@ -29,6 +29,9 @@ "/case": [ "case" ], + "/representation": [ + "case" + ], "/newappeal": [ "newappeal" ], @@ -37,6 +40,21 @@ ], "/newappeal/*": [ "newappeal" + ], + "/dns/*": [ + "dnsCommon" + ], + "/dns": [ + "dnsCommon", + "dnsHome" + ], + "/dns/applications": [ + "dnsCommon", + "dnsApplications" + ], + "/dns/application-view": [ + "dnsCommon", + "dnsApplicationView" ] } } \ No newline at end of file diff --git a/locales/cy/common.json b/locales/cy/common.json index 426633bf..80655000 100644 --- a/locales/cy/common.json +++ b/locales/cy/common.json @@ -13,5 +13,8 @@ "footer-accessibility-link": "Hygyrchedd", "footer-feedback-link": "Adborth", "mobile-nav-label": "Dewislen", - "signout-label": "Cofrestrwch allan" + "signout-label": "Cofrestrwch allan", + "back-to-top-link": "Nôl i dop y dudalen", + "social-bar-share-link": "Rhannu’r dudalen hon", + "social-bar-share-via-link": "Rhannu’r dudalen hon ar" } \ No newline at end of file diff --git a/locales/cy/dnsApplicationView.json b/locales/cy/dnsApplicationView.json new file mode 100644 index 00000000..9928509d --- /dev/null +++ b/locales/cy/dnsApplicationView.json @@ -0,0 +1,3 @@ +{ + "page-parent-title": "Tudalen Ceisiadau" +} \ No newline at end of file diff --git a/locales/cy/dnsApplications.json b/locales/cy/dnsApplications.json new file mode 100644 index 00000000..519ff63b --- /dev/null +++ b/locales/cy/dnsApplications.json @@ -0,0 +1,14 @@ +{ + "page-title": "Tudalen Ceisiadau", + "page-intro-paragraph-1": "Y ceisiadau a restrir yw’r rhai:", + "page-intro-list-item-1": "Lle mae’r datblygwr wedi hysbysu’r Arolygiaeth Gynllunio yn ysgrifenedig eu bod yn bwriadu cyflwyno cais i ni yn y dyfodol", + "page-intro-list-item-2": "Lle cafodd cais ei wneud eisoes i’r Arolygiaeth Gynllunio ac mae’n mynd drwy’r broses archwilio", + "page-intro-list-item-3": "Lle penderfynwyd ar y cynnig.", + "page-intro-paragraph-2": "Defnyddiwch y tabl isod i ddod o hyd i geisiadau fesul cam neu fath. Fel arall, defnyddiwch y map trwy glicio ar y marcwyr i fynd i’r dudalen geisiadau. Mae rhestr o ddigwyddiadau a therfynau amser allweddol ar gyfer pob cais ar gael ar ein ", + "page-intro-paragraph-2-link": "tudalen galendr", + "result-list-heading-label-reference": "Cyfeirnod", + "result-list-heading-label-application": "Cais", + "result-list-heading-label-developer": "Datblygwr", + "result-list-heading-label-type": "Math", + "result-list-heading-label-status": "Statws" +} \ No newline at end of file diff --git a/locales/cy/dnsCommon.json b/locales/cy/dnsCommon.json new file mode 100644 index 00000000..b9d52db9 --- /dev/null +++ b/locales/cy/dnsCommon.json @@ -0,0 +1,9 @@ +{ + "service-name": "Datblygiadau o Arwyddocâd Cenedlaethol", + "result-list-show-label": "Dangos", + "result-list-entries-label": "o gofnodion", + "result-list-showing-label": "Dangos {{recordIndex}} i {{pagingIndex}} o {{totalRecords}} o gofnodion", + "result-list-search-label": "Hidlo", + "result-list-previous-label": "Blaenorol", + "result-list-next-label": "Nesaf" +} \ No newline at end of file diff --git a/locales/cy/dnsHome.json b/locales/cy/dnsHome.json new file mode 100644 index 00000000..380771f1 --- /dev/null +++ b/locales/cy/dnsHome.json @@ -0,0 +1,15 @@ +{ + "title-paragraph": "Mae Datblygiad o Arwyddocâd Cenedlaethol (DAC) yn fath o gais cynllunio ar gyfer prosiect seilwaith mawr sydd o bwysigrwydd cenedlaethol yng Nghymru. Yn y fan hon, gallwch gael gwybod am geisiadau DAC arfaethedig. Rheolir y safle hwn gan yr Arolygiaeth Gynllunio.", + "title-application-search-placeholder": "Chwilio enw'r cais", + "title-application-search-button": "Chwilio", + "links-applications-title": "Ceisiadau", + "links-applications-intro-paragraph": "Rhestr o’r holl Ddatblygiadau o Arwyddocâd Cenedlaethol sydd eisoes wedi cael eu cyflwyno a’r rhai hynny rydym yn disgwyl iddynt gael eu cyflwyno.", + "links-help-title": "Cymorth", + "links-help-intro-paragraph": "Gwybodaeth am y wefan hon.", + "links-guidance-title": "Canllawiau", + "links-guidance-intro-paragraph": "Trosolwg a chanllawiau manwl ar y broses ymgeisio ar gyfer Datblygiadau o Arwyddocâd Cenedlaethol.", + "links-contactus-title": "Cysylltu â ni", + "links-contactus-intro-paragraph": "Cysylltu â ni.", + "latest-applications-title": "Ceisiadau Diweddaraf", + "applications-for-comment-title": "Ceisiadau sy’n agored ar gyfer sylwadau" +} \ No newline at end of file diff --git a/locales/en/common.json b/locales/en/common.json index 930c5fe9..26798d7f 100644 --- a/locales/en/common.json +++ b/locales/en/common.json @@ -13,5 +13,8 @@ "footer-accessibility-link": "Accessibility", "footer-feedback-link": "Feedback", "mobile-nav-label": "Menu", - "signout-label": "Sign out" + "signout-label": "Sign out", + "back-to-top-link": "Back to top", + "social-bar-share-link": "Share this page", + "social-bar-share-via-link": "Share this page via" } \ No newline at end of file diff --git a/locales/en/dnsApplicationView.json b/locales/en/dnsApplicationView.json new file mode 100644 index 00000000..be66b419 --- /dev/null +++ b/locales/en/dnsApplicationView.json @@ -0,0 +1,3 @@ +{ + "page-parent-title": "Applications" +} \ No newline at end of file diff --git a/locales/en/dnsApplications.json b/locales/en/dnsApplications.json new file mode 100644 index 00000000..57527e82 --- /dev/null +++ b/locales/en/dnsApplications.json @@ -0,0 +1,14 @@ +{ + "page-title": "Applications", + "page-intro-paragraph-1": "The applications listed are those:", + "page-intro-list-item-1": "Where the developer has advised the Planning Inspectorate in writing that they intend to submit an application to us in the future", + "page-intro-list-item-2": "Where an application has already been made to the Planning Inspectorate and is undergoing the examination process", + "page-intro-list-item-3": "Where a proposal has been decided.", + "page-intro-paragraph-2": "Use the table below to find applications by stage or type. Alternatively, use the map by clicking on the markers to go to the applications page. A list of key events and deadlines for all applications is available on our ", + "page-intro-paragraph-2-link": "calendar page", + "result-list-heading-label-reference": "Reference", + "result-list-heading-label-application": "Application", + "result-list-heading-label-developer": "Developer", + "result-list-heading-label-type": "Type", + "result-list-heading-label-status": "Status" +} \ No newline at end of file diff --git a/locales/en/dnsCommon.json b/locales/en/dnsCommon.json new file mode 100644 index 00000000..44cd86d6 --- /dev/null +++ b/locales/en/dnsCommon.json @@ -0,0 +1,9 @@ +{ + "service-name": "Developments of National Significance", + "result-list-show-label": "Show", + "result-list-entries-label": "entries", + "result-list-showing-label": "Showing {{recordIndex}} to {{pagingIndex}} of {{totalRecords}} entries", + "result-list-search-label": "Search", + "result-list-previous-label": "Previous", + "result-list-next-label": "Next" +} \ No newline at end of file diff --git a/locales/en/dnsHome.json b/locales/en/dnsHome.json new file mode 100644 index 00000000..6776d01f --- /dev/null +++ b/locales/en/dnsHome.json @@ -0,0 +1,15 @@ +{ + "title-paragraph": "A Development of National Significance (DNS) is a type of planning application for a large infrastructure project of national importance in Wales. Here you can find out about proposed DNS applications. This site is managed by the Planning Inspectorate.", + "title-application-search-placeholder": "Search application name", + "title-application-search-button": "Go", + "links-applications-title": "Applications", + "links-applications-intro-paragraph": "A list of all the Developments of National Significance that have already been submitted and those we are expecting to be submitted.", + "links-help-title": "Help", + "links-help-intro-paragraph": "Information about this website.", + "links-guidance-title": "Guidance", + "links-guidance-intro-paragraph": "An overview and detailed guidance on the Developments of National Significance application process", + "links-contactus-title": "Contact us", + "links-contactus-intro-paragraph": "How to get in touch with The Planning Inspectorate.", + "latest-applications-title": "Latest applications", + "applications-for-comment-title": "Applications open for comments" +} \ No newline at end of file diff --git a/package.json b/package.json index 14186c7e..8cba5ebe 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "scripts": { "dev": "next dev", "dev:app": "node ./server/server.js && yarn lint:js", - "build": "NODE_ENV=production node_modules/next/dist/bin/next build --debug", + "build": "NODE_ENV=production node_modules/next/dist/bin/next build", "start": "node_modules/next/dist/bin/next start" }, "dependencies": { @@ -29,16 +29,19 @@ "next-translate": "^1.0.7", "pm2": "^5.1.0", "react": "17.0.2", + "react-accessible-accordion": "^3.3.5", + "react-autosuggest": "^10.1.0", "react-cookie-consent": "^6.2.4", "react-datepicker": "^4.1.1", "react-dom": "17.0.2", + "react-dropzone": "^11.3.4", "react-redux": "^7.2.4", "react-xml-parser": "^1.1.8", "redux-devtools-extension": "^2.13.9", "redux-form": "^8.3.7", "redux-persist": "^6.0.0", "redux-thunk": "^2.3.0", - "sass": "^1.35.1", + "sass": "1.32", "sass-loader": "^12.1.0", "swr": "^0.5.6", "webpack": "^5.40.0", @@ -52,4 +55,4 @@ "eslint-config-next": "^11.0.1", "prettier": "2.3.2" } -} +} \ No newline at end of file diff --git a/pages/404.js b/pages/404.js index 8ba64663..0741e8ec 100644 --- a/pages/404.js +++ b/pages/404.js @@ -1,13 +1,42 @@ // 404.js import Link from "next/link"; +import Head from "next/head"; +import Header from "../components/header"; +import Banner from "../components/banner"; +import CookieBanner from "../components/cookieBanner"; +import useTranslation from "next-translate/useTranslation"; +import Footer from "../components/footer"; + +const FourOhFour = (props) => { + let { t, lang } = useTranslation(); + const { footerLinks, pages } = props; -export default function FourOhFour() { return ( - <> -

    404 - Page Not Found

    - - Go back home - - +
    + + + {t("case:page-title")} - {t("common:service-name")} + + +
    + +
    +
    +
    +
    +
    +

    404 - Page Not Found

    + + Go back home + +
    +
    +
    +
    +
    +
    +
    ); -} +}; + +export default FourOhFour; diff --git a/pages/_document.js b/pages/_document.js index 237f4716..8338c6fe 100644 --- a/pages/_document.js +++ b/pages/_document.js @@ -22,7 +22,7 @@ class MyDocument extends Document { return ( - + {!process.browser && (