From 9e9a168460c84d88876ae366f09dba46901e0b75 Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Fri, 30 Jul 2021 14:24:22 +0100 Subject: [PATCH 1/9] wrapped calls in promise all --- components/header.js | 17 +++++++++++++++-- package.json | 4 ++-- pages/myportal/index.js | 15 +++++++++++---- pages/newappeal/[appealtypes].js | 8 +++++--- pages/newappeal/index.js | 8 ++++---- store/store.js | 7 ++++++- 6 files changed, 43 insertions(+), 16 deletions(-) diff --git a/components/header.js b/components/header.js index fa6b92d2..f4fcf1d9 100644 --- a/components/header.js +++ b/components/header.js @@ -65,6 +65,9 @@ const Header = (props) => {
{ + window.localStorage.clear(); + }} className="govuk-header__link govuk-header__link--service-name" > @@ -102,7 +105,12 @@ const Header = (props) => { ) : (
  • - + { + window.localStorage.clear(); + }} + className="govuk-header__link " + > {t("common:signout-label")} @@ -152,7 +160,12 @@ const Header = (props) => { {router.pathname != "/" || router.pathname != "/logout" ? ( - + { + window.localStorage.clear(); + }} + className="govuk-header__link govuk-!-margin-right-3" + > {t("common:signout-label")} diff --git a/package.json b/package.json index 14186c7e..15204e88 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": { @@ -52,4 +52,4 @@ "eslint-config-next": "^11.0.1", "prettier": "2.3.2" } -} +} \ No newline at end of file diff --git a/pages/myportal/index.js b/pages/myportal/index.js index 192bf766..5fcb0d75 100644 --- a/pages/myportal/index.js +++ b/pages/myportal/index.js @@ -70,10 +70,17 @@ export const getServerSideProps = wrapper.getServerSideProps( async ({ query, req, res }) => { //console.log("the query", query); - const myCases = await getMyCases(); - const myRepresentations = await getMyRepresentations(); - const watchedCases = await getWatchedCases(); - const awaitingSubmission = await getAwaitingSubmission(); + const [ + myCases, + myRepresentations, + watchedCases, + awaitingSubmission, + ] = await Promise.all([ + await getMyCases(), + await getMyRepresentations(), + await getWatchedCases(), + await getAwaitingSubmission(), + ]); store.dispatch(setMyCases(myCases)); store.dispatch(setMyRepresentations(myRepresentations)); diff --git a/pages/newappeal/[appealtypes].js b/pages/newappeal/[appealtypes].js index c8a077e3..544b1835 100644 --- a/pages/newappeal/[appealtypes].js +++ b/pages/newappeal/[appealtypes].js @@ -154,15 +154,17 @@ export const getServerSideProps = wrapper.getServerSideProps( (store) => async ({ query, req, res }) => { //console.log("the query", query); - store.dispatch(setAppealTypeID(query.appealtypes)); - const appealTypeData = await getAppealsTypes(); - const formdata = (await getFormData(query.appealtypes)) || null; + const [appealTypeData, formdata] = await Promise.all([ + await getAppealsTypes(), + await getFormData(query.appealtypes), + ]); const caseReference = createCase("asasa", "asasa"); let xmlStr = formdata; xmlStr = formdata.value[0].formxml; xmlStr = xmlStr.replace(/\\"/g, ""); + store.dispatch(setAppealTypeID(query.appealtypes)); store.dispatch(setCaseReference(caseReference)); store.dispatch(setForm(xmlStr)); store.dispatch(setAppealType(appealTypeData)); diff --git a/pages/newappeal/index.js b/pages/newappeal/index.js index e946b9fe..9363df91 100644 --- a/pages/newappeal/index.js +++ b/pages/newappeal/index.js @@ -75,10 +75,10 @@ const Home = (props) => { export const getServerSideProps = wrapper.getServerSideProps( (store) => async ({ query, req, res }) => { - const appealTypeData = await getAppealsTypes(); - const lpaData = await getLPA(); - console.log("appeal types", appealTypeData); - console.log("lpa typeswwwww", lpaData); + const [appealTypeData, lpaData] = await Promise.all([ + await getAppealsTypes(), + await getLPA(), + ]); store.dispatch(setAppealType(appealTypeData)); store.dispatch(setLPA(lpaData)); } diff --git a/store/store.js b/store/store.js index 634c5334..e59d8bdb 100644 --- a/store/store.js +++ b/store/store.js @@ -95,7 +95,11 @@ const makeStore = ({ isServer }) => { return createStore(reducer, bindMiddleware([thunkMiddleware])); } else { //If it's on client side, create a store which will persist - const { persistStore, persistReducer } = require("redux-persist"); + const { + persistStore, + persistReducer, + createMigrate, + } = require("redux-persist"); const storage = require("redux-persist/lib/storage").default; const persistConfig = { @@ -114,6 +118,7 @@ const makeStore = ({ isServer }) => { "watchedCases", "form", ], + version: 1, storage: storage, stateReconciler: autoMergeLevel2, // if needed, use a safer storage }; From 7ce4460b4722bbe4ff3ca54eea3f92138cc7eb6f Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Mon, 2 Aug 2021 16:29:13 +0100 Subject: [PATCH 2/9] added mock call for case view --- components/breadcrumbs.js | 6 +- components/case.js | 15 +- components/case/summary.js | 110 ++++++--- components/footer.js | 239 ++++++++++++------ components/loading.js | 2 +- components/myportal/awaitingsubmission.js | 1 + components/myportal/mycases.js | 5 +- components/myportal/myrepresentations.js | 1 + components/myportal/topthree.js | 72 ++++-- components/myportal/watchedcases.js | 5 +- components/searchresults.js | 18 +- pages/404.js | 45 +++- pages/api/lookups/awaitingSubmission.js | 111 +++++++++ pages/api/lookups/myCases.js | 104 +++++++- pages/api/lookups/myRepresentations.js | 116 +++++++++ pages/api/lookups/watchedCases.js | 116 +++++++++ pages/case.js | 68 +++--- pages/index.js | 23 -- pages/myportal/index.js | 1 + pages/searchresults.js | 29 --- pages/viewall.js | 22 -- store/currentView/action.js | 8 + store/currentView/reducer.js | 6 + styles/sass/welshgov/_application.scss | 279 +++++++++++++++++++++- 24 files changed, 1135 insertions(+), 267 deletions(-) diff --git a/components/breadcrumbs.js b/components/breadcrumbs.js index 7252cf66..68207f4f 100644 --- a/components/breadcrumbs.js +++ b/components/breadcrumbs.js @@ -167,7 +167,11 @@ const Breadcrumbs = (props) => {
  • - Case Reference: CAS-00010-J9W6L5 + Case Reference:{" "} + { + props.props.currentView.caseReference + .currentReference + }
  • ) : ( diff --git a/components/case.js b/components/case.js index b55d1f58..b2766fb2 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,19 @@ export default function CaseSummary({ children, pages }) { >
    - +
    ); -} +}; + +export default CaseSummary; diff --git a/components/case/summary.js b/components/case/summary.js index 3d98b971..af12264d 100644 --- a/components/case/summary.js +++ b/components/case/summary.js @@ -1,18 +1,38 @@ 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, + currentType, + } = props; + + let setCaseQueryObj = props[currentType]; + + var casesObj = jsonpath.query( + setCaseQueryObj, + '$..[?(@.reference=="' + caseReference + '")]' + ); + + casesObj = Object.assign({}, ...casesObj); + return (

    - Reference: CAS-00010-J9W6L5 + Reference: {casesObj.reference}

    @@ -21,7 +41,7 @@ export default function CaseSummary() { {t("case:summary-applicant-label")}
    - Mr J Pocknell + {casesObj.appellantApplicant}
    @@ -29,7 +49,7 @@ export default function CaseSummary() { {t("case:summary-agent-label")}
    - Mr Cos Polito + Mr A Agent
    @@ -37,11 +57,12 @@ export default function CaseSummary() { {t("case:summary-site-address-label")}
    - 72 Guild Street + {casesObj.address1}
    - London + {casesObj.town} +
    - SE23 6FH + {casesObj.postcode}
    @@ -55,11 +76,12 @@ export default function CaseSummary() { {t("case:summary-make-representation-label")} - - - {t("case:summary-back-button-label")} - - + router.back()} + className="govuk-button govuk-button--secondary" + > + {t("case:summary-back-button-label")} +
    @@ -78,7 +100,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 +110,7 @@ export default function CaseSummary() { {t("case:summary-lpa-label")}
    - Hastings Borough Council + {casesObj.lpaname}
    @@ -96,8 +120,7 @@ export default function CaseSummary() { )}
    - Erection of a two-storey chalet - style detached dwelling + {casesObj.caseDetails.caseSummary}
    @@ -108,7 +131,7 @@ export default function CaseSummary() {
    {" "} - Neale Oliver + {casesObj.caseDetails.caseOfficer}
    @@ -116,7 +139,7 @@ export default function CaseSummary() { {t("case:summary-procedure-label")}
    - Written representations + {casesObj.caseDetails.procedure}
    @@ -124,7 +147,11 @@ export default function CaseSummary() { {t("case:summary-status-label")}
    - In Progress + { + casesObj[ + "statuscode@OData.Community.Display.V1.FormattedValue" + ] + }
    @@ -132,10 +159,14 @@ export default function CaseSummary() { {t("case:summary-decision-label")}
    - Allowed + {casesObj.caseDetails.decision} +
    - 3272770 Appeal Decision.pdf + { + casesObj.caseDetails + .outcome_document + }
    @@ -147,7 +178,10 @@ export default function CaseSummary() { )}
    - Not Linked + { + casesObj.caseDetails + .caseLinkStatus + }
    @@ -157,7 +191,7 @@ export default function CaseSummary() { )}
    - 0 + {casesObj.caseDetails.linkedCases}
    @@ -176,7 +210,8 @@ export default function CaseSummary() { {t("case:summary-start-date-label")}
    - 26-May-21 + {casesObj.caseDates.start_date || + "N/A"}
    @@ -187,7 +222,8 @@ export default function CaseSummary() { )}
    - 02-Jun-21 + {casesObj.caseDates + .questionnaireDue || "N/A"}
    @@ -198,7 +234,8 @@ export default function CaseSummary() { )}
    - 30-Jun-21 + {casesObj.caseDates.statementsDue || + "N/A"}
    @@ -209,7 +246,9 @@ export default function CaseSummary() { )}
    - 30-Jun-21 + {casesObj.caseDates + .interestedPartyCommentsdue || + "N/A"}
    @@ -220,7 +259,9 @@ export default function CaseSummary() { )}
    - 14-Jul-21 + {casesObj.caseDates + .appellantLPAFinalCommentsdue || + "N/A"}
    @@ -231,7 +272,8 @@ export default function CaseSummary() { )}
    - N/A + {casesObj.caseDates + .inquiryEvidenceDue || "N/A"}
    @@ -240,7 +282,8 @@ export default function CaseSummary() { {t("case:summary-event-date-label")}
    - Date arranged + {casesObj.caseDates.eventDate || + "N/A"}
    @@ -251,7 +294,8 @@ export default function CaseSummary() { )}
    - Not yet decided + {casesObj.caseDates.decisionDate || + "N/A"}
    @@ -273,4 +317,6 @@ export default function CaseSummary() { */} ); -} +}; + +export default CaseSummary; diff --git a/components/footer.js b/components/footer.js index fbccab2a..a4ae1592 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,11 +19,80 @@ export default function Footer(props) { )); + const [showShareState, setShowShareState] = useState(false); + + let shareState = () => { + showShareState == true + ? setShowShareState(false) + : setShowShareState(true); + }; + return ( - + + ); } diff --git a/components/loading.js b/components/loading.js index cb82583e..1cba4191 100644 --- a/components/loading.js +++ b/components/loading.js @@ -11,7 +11,7 @@ export default function SkipLink(props) {
    -
    +
    { 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..8fcc98d9 100644 --- a/components/myportal/topthree.js +++ b/components/myportal/topthree.js @@ -1,35 +1,73 @@ 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/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/searchresults.js b/components/searchresults.js index c42e37cb..69889cca 100644 --- a/components/searchresults.js +++ b/components/searchresults.js @@ -20,7 +20,10 @@ export default function Search(props) { >
    - +
    diff --git a/pages/404.js b/pages/404.js index 8ba64663..54c19adc 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/api/lookups/awaitingSubmission.js b/pages/api/lookups/awaitingSubmission.js index 05f2b1d2..66f7d76f 100644 --- a/pages/api/lookups/awaitingSubmission.js +++ b/pages/api/lookups/awaitingSubmission.js @@ -11,6 +11,33 @@ const ApiResponse = (req, res) => { "postcode": "CF24 0JL", "reference": "CAS-00017-B8X7N0", "appellantApplicant": "Mrs Denise Williams", + "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue": + "Planning Appeal - S78", + "pinswg_appealcasetype": "846040000", + "statuscode@OData.Community.Display.V1.FormattedValue": "", + "statuscode": "1", + "caseDetails": { + "casetype": "", + "lpa": "", + "caseSummary": "", + "caseOfficer": "", + "procedure": "", + "status": "", + "decision": "", + "outcome_document": "", + "caseLinkStatus": "", + "linkedCases": "", + }, + "caseDates": { + "start_date": "", + "questionnaireDue": "", + "statementsDue": "", + "interestedPartyCommentsdue": "", + "appellantLPAFinalCommentsdue": "", + "inquiryEvidenceDue": "", + "eventDate": "", + "decisionDate": "", + }, }, { "@odata.etag": 'W/"547952"', @@ -21,6 +48,34 @@ const ApiResponse = (req, res) => { "postcode": "CF24 0JL", "reference": "CAS-00016-Y9K9Q0", "appellantApplicant": "Mrs Denise Williams", + "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue": + "Planning Appeal - S78", + "pinswg_appealcasetype": "846040000", + "statuscode@OData.Community.Display.V1.FormattedValue": + "In Progress", + "statuscode": "1", + "caseDetails": { + "casetype": "", + "lpa": "", + "caseSummary": "", + "caseOfficer": "", + "procedure": "", + "status": "", + "decision": "", + "outcome_document": "", + "caseLinkStatus": "", + "linkedCases": "", + }, + "caseDates": { + "start_date": "", + "questionnaireDue": "", + "statementsDue": "", + "interestedPartyCommentsdue": "", + "appellantLPAFinalCommentsdue": "", + "inquiryEvidenceDue": "", + "eventDate": "", + "decisionDate": "", + }, }, { "@odata.etag": 'W/"547952"', @@ -31,6 +86,34 @@ const ApiResponse = (req, res) => { "postcode": "CF24 0JL", "reference": "CAS-00011-K1N0J8", "appellantApplicant": "Mrs Denise Williams", + "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue": + "Planning Appeal - S78", + "pinswg_appealcasetype": "846040000", + "statuscode@OData.Community.Display.V1.FormattedValue": + "In Progress", + "statuscode": "1", + "caseDetails": { + "casetype": "", + "lpa": "", + "caseSummary": "", + "caseOfficer": "", + "procedure": "", + "status": "", + "decision": "", + "outcome_document": "", + "caseLinkStatus": "", + "linkedCases": "", + }, + "caseDates": { + "start_date": "", + "questionnaireDue": "", + "statementsDue": "", + "interestedPartyCommentsdue": "", + "appellantLPAFinalCommentsdue": "", + "inquiryEvidenceDue": "", + "eventDate": "", + "decisionDate": "", + }, }, { "@odata.etag": 'W/"547952"', @@ -41,6 +124,34 @@ const ApiResponse = (req, res) => { "postcode": "CF24 0JL", "reference": "CAS-00015-L7J9H1", "appellantApplicant": "Mrs Denise Williams", + "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue": + "Planning Appeal - S78", + "pinswg_appealcasetype": "846040000", + "statuscode@OData.Community.Display.V1.FormattedValue": + "In Progress", + "statuscode": "1", + "caseDetails": { + "casetype": "", + "lpa": "", + "caseSummary": "", + "caseOfficer": "", + "procedure": "", + "status": "", + "decision": "", + "outcome_document": "", + "caseLinkStatus": "", + "linkedCases": "", + }, + "caseDates": { + "start_date": "", + "questionnaireDue": "", + "statementsDue": "", + "interestedPartyCommentsdue": "", + "appellantLPAFinalCommentsdue": "", + "inquiryEvidenceDue": "", + "eventDate": "", + "decisionDate": "", + }, }, ], }); diff --git a/pages/api/lookups/myCases.js b/pages/api/lookups/myCases.js index ba500274..a3e14710 100644 --- a/pages/api/lookups/myCases.js +++ b/pages/api/lookups/myCases.js @@ -3,7 +3,7 @@ const ApiResponse = (req, res) => { res.json({ "value": [ { - "@odata.etag": 'W/"547952"', + "@odata.etag": "W547952", "lpaname": "Vale of Glamorgan Council", "accountid": "56e7ef63-7e64-eb11-aaba-00224800be9c", "address1": "21 Courtenay Road", @@ -17,9 +17,32 @@ const ApiResponse = (req, res) => { "statuscode@OData.Community.Display.V1.FormattedValue": "In Progress", "statuscode": "1", + "caseDetails": { + "casetype": "", + "lpa": "", + "caseSummary": + "Erection of a two-storey chalet style detached dwelling", + "caseOfficer": "Neale Oliver", + "procedure": "Written representations", + "status": "In progress", + "decision": "Allowed", + "outcome_document": "23424Appeal Decision.pdf", + "caseLinkStatus": "not linked", + "linkedCases": "none", + }, + "caseDates": { + "start_date": "26-May-21", + "questionnaireDue": "02-Jun-21", + "statementsDue": "30-Jun-21", + "interestedPartyCommentsdue": "30-Jun-21", + "appellantLPAFinalCommentsdue": "4-Jul-21", + "inquiryEvidenceDue": "N/A", + "eventDate": "Date arranged", + "decisionDate": "Not yet decided", + }, }, { - "@odata.etag": 'W/"547952"', + "@odata.etag": "W547952", "lpaname": "Bridgend CBC", "accountid": "56e7ef63-7e64-eb11-aaba-00224800be9c", "address1": "17 Colin Way", @@ -33,10 +56,33 @@ const ApiResponse = (req, res) => { "statuscode@OData.Community.Display.V1.FormattedValue": "In Progress", "statuscode": "1", + "caseDetails": { + "casetype": "", + "lpa": "", + "caseSummary": + "Erection of a two-storey chalet style detached dwelling", + "caseOfficer": "Neale Oliver", + "procedure": "Written representations", + "status": "In progress", + "decision": "Allowed", + "outcome_document": "23424Appeal Decision.pdf", + "caseLinkStatus": "not linked", + "linkedCases": "none", + }, + "caseDates": { + "start_date": "26-May-21", + "questionnaireDue": "02-Jun-21", + "statementsDue": "30-Jun-21", + "interestedPartyCommentsdue": "30-Jun-21", + "appellantLPAFinalCommentsdue": "4-Jul-21", + "inquiryEvidenceDue": "N/A", + "eventDate": "Date arranged", + "decisionDate": "Not yet decided", + }, }, { - "@odata.etag": 'W/"547952"', - "lpaname": "Cardiff County Council Planning (A)", + "@odata.etag": "W547952", + "lpaname": "Cardiff County Council Planning (A)", "accountid": "56e7ef63-7e64-eb11-aaba-00224800be9c", "address1": "120 Severn Grove", "town": "Cardiff", @@ -49,10 +95,33 @@ const ApiResponse = (req, res) => { "statuscode@OData.Community.Display.V1.FormattedValue": "In Progress", "statuscode": "1", + "caseDetails": { + "casetype": "", + "lpa": "", + "caseSummary": + "Erection of a two-storey chalet style detached dwelling", + "caseOfficer": "Neale Oliver", + "procedure": "Written representations", + "status": "In progress", + "decision": "Allowed", + "outcome_document": "23424Appeal Decision.pdf", + "caseLinkStatus": "not linked", + "linkedCases": "none", + }, + "caseDates": { + "start_date": "26-May-21", + "questionnaireDue": "02-Jun-21", + "statementsDue": "30-Jun-21", + "interestedPartyCommentsdue": "30-Jun-21", + "appellantLPAFinalCommentsdue": "4-Jul-21", + "inquiryEvidenceDue": "N/A", + "eventDate": "Date arranged", + "decisionDate": "Not yet decided", + }, }, { - "@odata.etag": 'W/"547952"', - "lpaname": "Cardiff County Council Planning", + "@odata.etag": "W547952", + "lpaname": "Cardiff County Council Planning", "accountid": "56e7ef63-7e64-eb11-aaba-00224800be9c", "address1": "25 Merches Gardens", "town": "Cardiff", @@ -65,6 +134,29 @@ const ApiResponse = (req, res) => { "statuscode@OData.Community.Display.V1.FormattedValue": "In Progress", "statuscode": "1", + "caseDetails": { + "casetype": "", + "lpa": "", + "caseSummary": + "Erection of a two-storey chalet style detached dwelling", + "caseOfficer": "Neale Oliver", + "procedure": "Written representations", + "status": "In progress", + "decision": "Allowed", + "outcome_document": "23424Appeal Decision.pdf", + "caseLinkStatus": "not linked", + "linkedCases": "none", + }, + "caseDates": { + "start_date": "26-May-21", + "questionnaireDue": "02-Jun-21", + "statementsDue": "30-Jun-21", + "interestedPartyCommentsdue": "30-Jun-21", + "appellantLPAFinalCommentsdue": "4-Jul-21", + "inquiryEvidenceDue": "N/A", + "eventDate": "Date arranged", + "decisionDate": "Not yet decided", + }, }, ], }); diff --git a/pages/api/lookups/myRepresentations.js b/pages/api/lookups/myRepresentations.js index 2aeecb07..3876449a 100644 --- a/pages/api/lookups/myRepresentations.js +++ b/pages/api/lookups/myRepresentations.js @@ -11,6 +11,35 @@ const ApiResponse = (req, res) => { "postcode": "CF24 0JL", "reference": "CAS-00009-W8N6W4", "appellantApplicant": "Mrs Denise Williams", + "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue": + "Planning Appeal - S78", + "pinswg_appealcasetype": "846040000", + "statuscode@OData.Community.Display.V1.FormattedValue": + "In Progress", + "statuscode": "1", + "caseDetails": { + "casetype": "", + "lpa": "", + "caseSummary": + "Erection of a two-storey chalet style detached dwelling", + "caseOfficer": "Neale Oliver", + "procedure": "Written representations", + "status": "In progress", + "decision": "Allowed", + "outcome_document": "23424Appeal Decision.pdf", + "caseLinkStatus": "not linked", + "linkedCases": "none", + }, + "caseDates": { + "start_date": "26-May-21", + "questionnaireDue": "02-Jun-21", + "statementsDue": "30-Jun-21", + "interestedPartyCommentsdue": "30-Jun-21", + "appellantLPAFinalCommentsdue": "4-Jul-21", + "inquiryEvidenceDue": "N/A", + "eventDate": "Date arranged", + "decisionDate": "Not yet decided", + }, }, { "@odata.etag": 'W/"547952"', @@ -21,6 +50,35 @@ const ApiResponse = (req, res) => { "postcode": "CF24 0JL", "reference": "CAS-00010-J9W6L5", "appellantApplicant": "Mrs Denise Williams", + "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue": + "Planning Appeal - S78", + "pinswg_appealcasetype": "846040000", + "statuscode@OData.Community.Display.V1.FormattedValue": + "In Progress", + "statuscode": "1", + "caseDetails": { + "casetype": "", + "lpa": "", + "caseSummary": + "Erection of a two-storey chalet style detached dwelling", + "caseOfficer": "Neale Oliver", + "procedure": "Written representations", + "status": "In progress", + "decision": "Allowed", + "outcome_document": "23424Appeal Decision.pdf", + "caseLinkStatus": "not linked", + "linkedCases": "none", + }, + "caseDates": { + "start_date": "26-May-21", + "questionnaireDue": "02-Jun-21", + "statementsDue": "30-Jun-21", + "interestedPartyCommentsdue": "30-Jun-21", + "appellantLPAFinalCommentsdue": "4-Jul-21", + "inquiryEvidenceDue": "N/A", + "eventDate": "Date arranged", + "decisionDate": "Not yet decided", + }, }, { "@odata.etag": 'W/"547952"', @@ -31,6 +89,35 @@ const ApiResponse = (req, res) => { "postcode": "CF24 0JL", "reference": "CAS-00011-K1N0J8", "appellantApplicant": "Mrs Denise Williams", + "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue": + "Planning Appeal - S78", + "pinswg_appealcasetype": "846040000", + "statuscode@OData.Community.Display.V1.FormattedValue": + "In Progress", + "statuscode": "1", + "caseDetails": { + "casetype": "", + "lpa": "", + "caseSummary": + "Erection of a two-storey chalet style detached dwelling", + "caseOfficer": "Neale Oliver", + "procedure": "Written representations", + "status": "In progress", + "decision": "Allowed", + "outcome_document": "23424Appeal Decision.pdf", + "caseLinkStatus": "not linked", + "linkedCases": "none", + }, + "caseDates": { + "start_date": "26-May-21", + "questionnaireDue": "02-Jun-21", + "statementsDue": "30-Jun-21", + "interestedPartyCommentsdue": "30-Jun-21", + "appellantLPAFinalCommentsdue": "4-Jul-21", + "inquiryEvidenceDue": "N/A", + "eventDate": "Date arranged", + "decisionDate": "Not yet decided", + }, }, { "@odata.etag": 'W/"547952"', @@ -41,6 +128,35 @@ const ApiResponse = (req, res) => { "postcode": "CF24 0JL", "reference": "CAS-00012-D9W6S8", "appellantApplicant": "Mrs Denise Williams", + "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue": + "Planning Appeal - S78", + "pinswg_appealcasetype": "846040000", + "statuscode@OData.Community.Display.V1.FormattedValue": + "In Progress", + "statuscode": "1", + "caseDetails": { + "casetype": "", + "lpa": "", + "caseSummary": + "Erection of a two-storey chalet style detached dwelling", + "caseOfficer": "Neale Oliver", + "procedure": "Written representations", + "status": "In progress", + "decision": "Allowed", + "outcome_document": "23424Appeal Decision.pdf", + "caseLinkStatus": "not linked", + "linkedCases": "none", + }, + "caseDates": { + "start_date": "26-May-21", + "questionnaireDue": "02-Jun-21", + "statementsDue": "30-Jun-21", + "interestedPartyCommentsdue": "30-Jun-21", + "appellantLPAFinalCommentsdue": "4-Jul-21", + "inquiryEvidenceDue": "N/A", + "eventDate": "Date arranged", + "decisionDate": "Not yet decided", + }, }, ], }); diff --git a/pages/api/lookups/watchedCases.js b/pages/api/lookups/watchedCases.js index 2aeecb07..3876449a 100644 --- a/pages/api/lookups/watchedCases.js +++ b/pages/api/lookups/watchedCases.js @@ -11,6 +11,35 @@ const ApiResponse = (req, res) => { "postcode": "CF24 0JL", "reference": "CAS-00009-W8N6W4", "appellantApplicant": "Mrs Denise Williams", + "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue": + "Planning Appeal - S78", + "pinswg_appealcasetype": "846040000", + "statuscode@OData.Community.Display.V1.FormattedValue": + "In Progress", + "statuscode": "1", + "caseDetails": { + "casetype": "", + "lpa": "", + "caseSummary": + "Erection of a two-storey chalet style detached dwelling", + "caseOfficer": "Neale Oliver", + "procedure": "Written representations", + "status": "In progress", + "decision": "Allowed", + "outcome_document": "23424Appeal Decision.pdf", + "caseLinkStatus": "not linked", + "linkedCases": "none", + }, + "caseDates": { + "start_date": "26-May-21", + "questionnaireDue": "02-Jun-21", + "statementsDue": "30-Jun-21", + "interestedPartyCommentsdue": "30-Jun-21", + "appellantLPAFinalCommentsdue": "4-Jul-21", + "inquiryEvidenceDue": "N/A", + "eventDate": "Date arranged", + "decisionDate": "Not yet decided", + }, }, { "@odata.etag": 'W/"547952"', @@ -21,6 +50,35 @@ const ApiResponse = (req, res) => { "postcode": "CF24 0JL", "reference": "CAS-00010-J9W6L5", "appellantApplicant": "Mrs Denise Williams", + "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue": + "Planning Appeal - S78", + "pinswg_appealcasetype": "846040000", + "statuscode@OData.Community.Display.V1.FormattedValue": + "In Progress", + "statuscode": "1", + "caseDetails": { + "casetype": "", + "lpa": "", + "caseSummary": + "Erection of a two-storey chalet style detached dwelling", + "caseOfficer": "Neale Oliver", + "procedure": "Written representations", + "status": "In progress", + "decision": "Allowed", + "outcome_document": "23424Appeal Decision.pdf", + "caseLinkStatus": "not linked", + "linkedCases": "none", + }, + "caseDates": { + "start_date": "26-May-21", + "questionnaireDue": "02-Jun-21", + "statementsDue": "30-Jun-21", + "interestedPartyCommentsdue": "30-Jun-21", + "appellantLPAFinalCommentsdue": "4-Jul-21", + "inquiryEvidenceDue": "N/A", + "eventDate": "Date arranged", + "decisionDate": "Not yet decided", + }, }, { "@odata.etag": 'W/"547952"', @@ -31,6 +89,35 @@ const ApiResponse = (req, res) => { "postcode": "CF24 0JL", "reference": "CAS-00011-K1N0J8", "appellantApplicant": "Mrs Denise Williams", + "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue": + "Planning Appeal - S78", + "pinswg_appealcasetype": "846040000", + "statuscode@OData.Community.Display.V1.FormattedValue": + "In Progress", + "statuscode": "1", + "caseDetails": { + "casetype": "", + "lpa": "", + "caseSummary": + "Erection of a two-storey chalet style detached dwelling", + "caseOfficer": "Neale Oliver", + "procedure": "Written representations", + "status": "In progress", + "decision": "Allowed", + "outcome_document": "23424Appeal Decision.pdf", + "caseLinkStatus": "not linked", + "linkedCases": "none", + }, + "caseDates": { + "start_date": "26-May-21", + "questionnaireDue": "02-Jun-21", + "statementsDue": "30-Jun-21", + "interestedPartyCommentsdue": "30-Jun-21", + "appellantLPAFinalCommentsdue": "4-Jul-21", + "inquiryEvidenceDue": "N/A", + "eventDate": "Date arranged", + "decisionDate": "Not yet decided", + }, }, { "@odata.etag": 'W/"547952"', @@ -41,6 +128,35 @@ const ApiResponse = (req, res) => { "postcode": "CF24 0JL", "reference": "CAS-00012-D9W6S8", "appellantApplicant": "Mrs Denise Williams", + "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue": + "Planning Appeal - S78", + "pinswg_appealcasetype": "846040000", + "statuscode@OData.Community.Display.V1.FormattedValue": + "In Progress", + "statuscode": "1", + "caseDetails": { + "casetype": "", + "lpa": "", + "caseSummary": + "Erection of a two-storey chalet style detached dwelling", + "caseOfficer": "Neale Oliver", + "procedure": "Written representations", + "status": "In progress", + "decision": "Allowed", + "outcome_document": "23424Appeal Decision.pdf", + "caseLinkStatus": "not linked", + "linkedCases": "none", + }, + "caseDates": { + "start_date": "26-May-21", + "questionnaireDue": "02-Jun-21", + "statementsDue": "30-Jun-21", + "interestedPartyCommentsdue": "30-Jun-21", + "appellantLPAFinalCommentsdue": "4-Jul-21", + "inquiryEvidenceDue": "N/A", + "eventDate": "Date arranged", + "decisionDate": "Not yet decided", + }, }, ], }); diff --git a/pages/case.js b/pages/case.js index cc39a64e..332f8426 100644 --- a/pages/case.js +++ b/pages/case.js @@ -35,8 +35,23 @@ const Home = (props) => {
    - - + +
    @@ -44,38 +59,21 @@ const Home = (props) => { ); }; -// export const getServerSideProps = wrapper.getServerSideProps( -// async ({ locale, store, req, res }) => { -// const token = await getToken(); -// let accessToken = token.access_token; +const mapStateToProps = (state) => { + //console.log(state); -// const apiRoot = process.browser ? window.API_ROOT : process.env.API_ROOT; + return { + currentView: state.currentView, + search: state.search, + searchResultsObj: state.searchResultsObj, + formData: state.formData, + appealType: state.appealType, + form: state.form, + myCases: state.myCases, + watchedCases: state.watchedCases, + myRepresentations: state.myRepresentations, + awaitingSubmission: state.awaitingSubmission, + }; +}; -// const [pages, footerLinks, courseListContent] = await Promise.all([ -// await getPages(accessToken, locale), -// await getFooterLinks(accessToken, locale), -// await getCourseList(accessToken, locale), -// ]); -// //const courseID = await getCourseID -// store.dispatch(setApiRoot(apiRoot)); -// store.dispatch(setPages(pages)); -// store.dispatch(setFooterLinks(footerLinks)); -// store.dispatch(setCourseListContent(courseListContent)); -// } -// ); - -// const mapStateToProps = (state) => { -// //console.log(state); - -// return { -// apiroot: state.apiroot, -// courseListContent: state.courseListContent.courseListContent, -// pages: state.pages.pages, -// footerLinks: state.footerLinks.footerLinks, -// regions: state.regions, -// sectors: state.sectors, -// form: state.form, -// }; -// }; - -export default Home; //connect(mapStateToProps)(Home); +export default connect(mapStateToProps)(Home); diff --git a/pages/index.js b/pages/index.js index 0b5bac9e..ce994446 100644 --- a/pages/index.js +++ b/pages/index.js @@ -40,27 +40,4 @@ const Home = (props) => { ); }; -// export const getServerSideProps = wrapper.getServerSideProps( -// (store) => -// async ({ query, req, res }) => { -// const incidents = await getIncidents; -// console.log(incidents); -// } -// ); - - -// const mapStateToProps = (state) => { -// //console.log(state); - -// return { -// apiroot: state.apiroot, -// courseListContent: state.courseListContent.courseListContent, -// pages: state.pages.pages, -// footerLinks: state.footerLinks.footerLinks, -// regions: state.regions, -// sectors: state.sectors, -// form: state.form, -// }; -// }; - export default Home; //connect(mapStateToProps)(Home); diff --git a/pages/myportal/index.js b/pages/myportal/index.js index 5fcb0d75..55a80b80 100644 --- a/pages/myportal/index.js +++ b/pages/myportal/index.js @@ -93,6 +93,7 @@ const mapStateToProps = (state) => { //console.log(state); return { + currentView: state.currentView, search: state.search, searchResultsObj: state.searchResultsObj, formData: state.formData, diff --git a/pages/searchresults.js b/pages/searchresults.js index 744a0cf6..5cc583c9 100644 --- a/pages/searchresults.js +++ b/pages/searchresults.js @@ -63,39 +63,10 @@ export const getServerSideProps = wrapper.getServerSideProps( } ); -// export const getServerSideProps = wrapper.getServerSideProps( -// async ({ locale, store, query, req, res }) => { -// // const token = await getToken(); -// // let accessToken = token.access_token; - -// // const apiRoot = process.browser ? window.API_ROOT : process.env.API_ROOT; - -// // const [pages, footerLinks, courseListContent] = await Promise.all([ -// // await getPages(accessToken, locale), -// // await getFooterLinks(accessToken, locale), -// // await getCourseList(accessToken, locale), -// // ]); -// // //const courseID = await getCourseID -// // store.dispatch(setApiRoot(apiRoot)); -// // store.dispatch(setPages(pages)); -// // store.dispatch(setFooterLinks(footerLinks)); -// // store.dispatch(setCourseListContent(courseListContent)); -// console.log(query); -// //store.dispatch(setSearch(query.search)); -// } -// ); - const mapStateToProps = (state) => { return { search: state.search, searchResultsObj: state.searchResultsObj, - // // apiroot: state.apiroot, - // // courseListContent: state.courseListContent.courseListContent, - // // pages: state.pages.pages, - // // footerLinks: state.footerLinks.footerLinks, - // // regions: state.regions, - // // sectors: state.sectors, - // // form: state.form, }; }; diff --git a/pages/viewall.js b/pages/viewall.js index ffdeba8a..751c2cd2 100644 --- a/pages/viewall.js +++ b/pages/viewall.js @@ -63,28 +63,6 @@ export const getServerSideProps = wrapper.getServerSideProps( } ); -// export const getServerSideProps = wrapper.getServerSideProps( -// async ({ locale, store, query, req, res }) => { -// // const token = await getToken(); -// // let accessToken = token.access_token; - -// // const apiRoot = process.browser ? window.API_ROOT : process.env.API_ROOT; - -// // const [pages, footerLinks, courseListContent] = await Promise.all([ -// // await getPages(accessToken, locale), -// // await getFooterLinks(accessToken, locale), -// // await getCourseList(accessToken, locale), -// // ]); -// // //const courseID = await getCourseID -// // store.dispatch(setApiRoot(apiRoot)); -// // store.dispatch(setPages(pages)); -// // store.dispatch(setFooterLinks(footerLinks)); -// // store.dispatch(setCourseListContent(courseListContent)); -// console.log(query); -// //store.dispatch(setSearch(query.search)); -// } -// ); - const mapStateToProps = (state) => { return { search: state.search, diff --git a/store/currentView/action.js b/store/currentView/action.js index 26b20a0e..2440f7e4 100644 --- a/store/currentView/action.js +++ b/store/currentView/action.js @@ -1,6 +1,7 @@ export const currentViewActionTypes = { GETCURRENTVIEW: "GETCURRENTVIEW", SETCURRENTVIEW: "SETCURRENTVIEW", + SETCURRENTREFERENCE: "SETCURRENTREFERENCE", }; export const getCurrentViewObj = () => (dispatch) => { @@ -15,3 +16,10 @@ export const setCurrentView = (currentView) => (dispatch) => { currentView: currentView, }); }; + +export const setCurrentReference = (caseReference) => (dispatch) => { + return dispatch({ + type: currentViewActionTypes.SETCURRENTREFERENCE, + caseReference: caseReference, + }); +}; diff --git a/store/currentView/reducer.js b/store/currentView/reducer.js index 4d9fc02f..f0ccb0fb 100644 --- a/store/currentView/reducer.js +++ b/store/currentView/reducer.js @@ -2,6 +2,7 @@ import { currentViewActionTypes } from "./action"; const currentViewInitialState = { currentView: {}, + caseReference: {}, }; export default function reducer(state = currentViewInitialState, action) { @@ -11,6 +12,11 @@ export default function reducer(state = currentViewInitialState, action) { ...state, currentView: action.currentView, }; + case currentViewActionTypes.SETCURRENTREFERENCE: + return { + ...state, + caseReference: action.caseReference, + }; default: return state; } diff --git a/styles/sass/welshgov/_application.scss b/styles/sass/welshgov/_application.scss index dd75933c..896d6074 100644 --- a/styles/sass/welshgov/_application.scss +++ b/styles/sass/welshgov/_application.scss @@ -6,10 +6,11 @@ html { .govuk-body, .govuk-body-s, .govuk-body-m, +.govuk-footer, .govuk-heading-xl, .govuk-heading-l, .govuk-heading-m, -s .govuk-header-l, +.govuk-header-l, .govuk-header-m, .govuk-header__link, .govuk-button, @@ -30,6 +31,14 @@ a { background-color: #323232; } +.govuk-breadcrumbs__link:link, +.govuk-breadcrumbs__link:visited { + color: #0360a6; + font-weight: bold; + text-decoration: none; + font-size: 16px; +} + .govuk-grid-row { @media screen and (max-width: 900px) { // margin-right: 0px; @@ -69,6 +78,14 @@ a { margin-right: auto; padding-left: 60px; padding-right: 20px; + + @media screen and (max-width: 1024px) { + padding-left: 20px; + } + @media screen and (max-width: 376px) { + padding-left: 0px; + padding-right: 0px; + } } .btn--arrow-up a { @@ -243,6 +260,8 @@ a { .govuk-footer { padding-top: 0px; + padding: 70px 0 0 0; + border: none; } #footer_logo { @@ -377,3 +396,261 @@ a { font-size: 1.1875rem; line-height: 1.3157894737; } + +//sharebar + +.btn--arrow-up a { + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg id=%22Layer_1%22 data-name=%22Layer 1%22 xmlns=%22http://www.w3.org/2000/svg%22 width=%22159.5%22 height=%22102.4%22 viewBox=%220 0 159.5 102.4%22%3E%3Ctitle%3Eblack-arrow-up%3C/title%3E%3Cpath d=%22M159.5,79.8,79.8,0,0,79.8l22.6,22.6L79.7,45.3l57.1,57.1Z%22/%3E%3C/svg%3E"); + background-size: 18px 13px; + background-position: 10px center; + background-repeat: no-repeat; + padding-left: 36px; + margin-top: 1px; +} + +.btn--arrow-hero a:hover { + color: #fff !important; +} + +ul#sharePageLinks { + display: none; +} + +ul#sharePageLinks.active { + display: block; + border: none; +} + +.block-share button, +.block-share h2 { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + border: none; + padding: 12px 12px 12px 36px; + margin: 0; + color: #323232; + font-size: 16px; + font-size: 1rem; + line-height: 17px; + line-height: 1.0625rem; + letter-spacing: -0.0208333333rem; + font-weight: bold; + float: left; + z-index: 2; + position: relative; + background-color: inherit; + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg id=%22Layer_1%22 data-name=%22Layer 1%22 xmlns=%22http://www.w3.org/2000/svg%22 width=%2217.9%22 height=%2220%22 viewBox=%220 0 17.9 20%22%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23333;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3Eshare%3C/title%3E%3Cpath class=%22cls-1%22 d=%22M15.4,14.1a3,3,0,0,0-2,.8L6.2,10.7a1.7,1.7,0,0,0,.1-.7,1.7,1.7,0,0,0-.1-.7l7.1-4.1a3,3,0,0,0,5-2.2,3,3,0,0,0-6,0,1.7,1.7,0,0,0,.1.7l-7,4.1a2.79,2.79,0,0,0-2-.8,3,3,0,1,0,0,6,2.79,2.79,0,0,0,2-.8l7.1,4.2c0,.2-.1.4-.1.7a2.9,2.9,0,0,0,5.8,0,2.84,2.84,0,0,0-2.68-3Z%22 transform=%22translate%28-0.4 0%29%22/%3E%3C/svg%3E"); + background-repeat: no-repeat; + background-position: 10px 10px; + background-size: 20px 20px; +} + +.vo_hidden, +.page-node-type-global-keyword-search + .main__body-content + #block-govwales-content + .components__form + form + .form-item + label, +.header__components .components__form form .form-item label { + border: 0; + clip: rect(0, 0, 0, 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + width: 1px; + position: absolute; +} + +.block-share { + position: relative; + float: left; + margin-right: 20px; + border: 1px solid #999999; +} + +@media screen and (min-width: 480px) { + .main__sharebar > div { + margin-bottom: 0; + } +} +.block-share.active { + border: 1px solid #999999; + background-color: #cccccc; + @media screen and (max-width: 376px) { + margin-right: 0px; + margin-bottom: 20px; + } +} + +.block-share ul { + margin: 0; + padding: 0; + float: left; + z-index: 1; + position: relative; +} + +.block-share ul li { + display: inline-block; + margin: 10px 15px; + padding: 0; +} + +.block-share ul li a { + font-size: 16px; + font-size: 1rem; + line-height: 20px; + line-height: 1.25rem; + display: block; + padding-top: 2px; + padding-left: 25px; + height: 24px; + color: #0360a6; +} + +.block-share ul li a { + font-size: 16px; + font-size: 1rem; + line-height: 20px; + line-height: 1.25rem; + display: block; + padding-top: 2px; + padding-left: 25px; + height: 24px; + background-color: inherit; + color: #0360a6; + font-weight: bold; + text-decoration: none; +} + +@media (min-width: 480px) { + .block-share ul li a { + background-size: 20px 20px; + background-position: 0 2px; + } +} +.block-share ul li a, +.block-share-top ul li a, +.page-header__block-share__list ul li a, +.page-header__block-share ul li a { + background-size: 20px 20px; + background-position: 0 6px; + height: 22px; + display: block; + @media (max-width: 376px) { + background-position: 0 2px; + } +} + +.block-share ul li a:hover, +.block-share-top ul li a:hover, +.page-header__block-share__list ul li a:hover, +.page-header__block-share ul li a:hover { + background-size: 20px 20px; + background-position: 0 6px; + @media (max-width: 376px) { + background-position: 0 2px; + } +} + +@media all and (min-width: 480px) { + .block-share ul li a, + .block-share-top ul li a, + .page-header__block-share__list ul li a, + .page-header__block-share ul li a { + background-size: 20px 20px; + background-position: 0 2px; + } + + .block-share ul li a:hover, + .block-share-top ul li a:hover, + .page-header__block-share__list ul li a:hover, + .page-header__block-share ul li a:hover { + background-size: 20px 20px; + background-position: 0px 2px; + } +} + +.block-share ul li a:focus, +.block-share-top ul li a:focus, +.page-header__block-share__list ul li a:focus, +.page-header__block-share ul li a:focus { + -webkit-box-shadow: 0 0 #ffd530, 0 2px #1f1f1f; + box-shadow: 0 0 #ffd530, 0 2px #1f1f1f; +} + +.block-share ul li a.twitter, +.block-share-top ul li a.twitter, +.page-header__block-share__list ul li a.twitter, +.page-header__block-share ul li a.twitter { + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2220%22 height=%2220%22 viewBox=%220 0 20 20%22%3E%3Ctitle%3EAsset 1%3C/title%3E%3Cpath d=%22M0,0V20H20V0ZM16,6.9v.4a8.79,8.79,0,0,1-8.7,8.8,9,9,0,0,1-4.8-1.4h.7A6.46,6.46,0,0,0,7,13.4a3.13,3.13,0,0,1-2.9-2.1c.2,0,.4.1.6.1a2.2,2.2,0,0,0,.8-.1A3.1,3.1,0,0,1,3,8.3H3a4,4,0,0,0,1.5.3,3.05,3.05,0,0,1-1-4.1A8.86,8.86,0,0,0,9.9,7.7,3,3,0,0,1,12.2,4a3.06,3.06,0,0,1,2.9.9,5,5,0,0,0,2-.8,2.91,2.91,0,0,1-1.4,1.7,6.07,6.07,0,0,0,1.8-.5A4.63,4.63,0,0,1,16,6.9Z%22 style=%22fill:%230360a6%22/%3E%3C/svg%3E"); + background-repeat: no-repeat; +} + +.block-share ul li a.twitter:hover, +.block-share-top ul li a.twitter:hover, +.page-header__block-share__list ul li a.twitter:hover, +.page-header__block-share ul li a.twitter:hover { + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2220%22 height=%2220%22 viewBox=%220 0 20 20%22%3E%3Ctitle%3EAsset 1%3C/title%3E%3Cpath d=%22M0,0V20H20V0ZM16,6.9v.4a8.79,8.79,0,0,1-8.7,8.8,9,9,0,0,1-4.8-1.4h.7A6.46,6.46,0,0,0,7,13.4a3.13,3.13,0,0,1-2.9-2.1c.2,0,.4.1.6.1a2.2,2.2,0,0,0,.8-.1A3.1,3.1,0,0,1,3,8.3H3a4,4,0,0,0,1.5.3,3.05,3.05,0,0,1-1-4.1A8.86,8.86,0,0,0,9.9,7.7,3,3,0,0,1,12.2,4a3.06,3.06,0,0,1,2.9.9,5,5,0,0,0,2-.8,2.91,2.91,0,0,1-1.4,1.7,6.07,6.07,0,0,0,1.8-.5A4.63,4.63,0,0,1,16,6.9Z%22 style=%22fill:%233b7dc5%22/%3E%3C/svg%3E"); + background-repeat: no-repeat; +} + +.block-share ul li a.twitter:focus, +.block-share-top ul li a.twitter:focus, +.page-header__block-share__list ul li a.twitter:focus, +.page-header__block-share ul li a.twitter:focus { + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2220%22 height=%2220%22 viewBox=%220 0 20 20%22%3E%3Ctitle%3EAsset 1%3C/title%3E%3Cpath d=%22M0,0V20H20V0ZM16,6.9v.4a8.79,8.79,0,0,1-8.7,8.8,9,9,0,0,1-4.8-1.4h.7A6.46,6.46,0,0,0,7,13.4a3.13,3.13,0,0,1-2.9-2.1c.2,0,.4.1.6.1a2.2,2.2,0,0,0,.8-.1A3.1,3.1,0,0,1,3,8.3H3a4,4,0,0,0,1.5.3,3.05,3.05,0,0,1-1-4.1A8.86,8.86,0,0,0,9.9,7.7,3,3,0,0,1,12.2,4a3.06,3.06,0,0,1,2.9.9,5,5,0,0,0,2-.8,2.91,2.91,0,0,1-1.4,1.7,6.07,6.07,0,0,0,1.8-.5A4.63,4.63,0,0,1,16,6.9Z%22 style=%22fill:%23111%22/%3E%3C/svg%3E "); + background-repeat: no-repeat; +} + +.block-share ul li a.facebook, +.block-share-top ul li a.facebook, +.page-header__block-share__list ul li a.facebook, +.page-header__block-share ul li a.facebook { + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2220%22 height=%2220%22 viewBox=%220 0 20 20%22%3E%3Ctitle%3Efacebook%3C/title%3E%3Cpath d=%22M0,0V20H20V0ZM15.6,5.1a.27.27,0,0,1-.3.3H14c-.9,0-1.1.3-1.1,1V7.9h2.3a.27.27,0,0,1,.3.3h0v2.5a.27.27,0,0,1-.3.3H12.9v6.2a.27.27,0,0,1-.3.3H10a.27.27,0,0,1-.3-.3V11h-2a.27.27,0,0,1-.3-.3h0V8.2a.27.27,0,0,1,.3-.3h2V6.2a3.45,3.45,0,0,1,3.1-3.7h2.4a.27.27,0,0,1,.3.3h0Z%22 style=%22fill:%230360a6%22/%3E%3C/svg%3E"); + background-repeat: no-repeat; +} + +.block-share ul li a.facebook:hover, +.block-share-top ul li a.facebook:hover, +.page-header__block-share__list ul li a.facebook:hover, +.page-header__block-share ul li a.facebook:hover { + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2220%22 height=%2220%22 viewBox=%220 0 20 20%22%3E%3Ctitle%3Efacebook_on%3C/title%3E%3Cpath d=%22M0,0V20H20V0ZM15.6,5.1a.27.27,0,0,1-.3.3H14c-.9,0-1.1.3-1.1,1V7.9h2.3a.27.27,0,0,1,.3.3h0v2.5a.27.27,0,0,1-.3.3H12.9v6.2a.27.27,0,0,1-.3.3H10a.27.27,0,0,1-.3-.3V11h-2a.27.27,0,0,1-.3-.3h0V8.2a.27.27,0,0,1,.3-.3h2V6.2a3.45,3.45,0,0,1,3.1-3.7h2.4a.27.27,0,0,1,.3.3h0Z%22 style=%22fill:%233b7dc5%22/%3E%3C/svg%3E"); + background-repeat: no-repeat; +} + +.block-share ul li a.facebook:focus, +.block-share-top ul li a.facebook:focus, +.page-header__block-share__list ul li a.facebook:focus, +.page-header__block-share ul li a.facebook:focus { + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2220%22 height=%2220%22 viewBox=%220 0 20 20%22%3E%3Ctitle%3Efacebook%3C/title%3E%3Cpath d=%22M0,0V20H20V0ZM15.6,5.1a.27.27,0,0,1-.3.3H14c-.9,0-1.1.3-1.1,1V7.9h2.3a.27.27,0,0,1,.3.3h0v2.5a.27.27,0,0,1-.3.3H12.9v6.2a.27.27,0,0,1-.3.3H10a.27.27,0,0,1-.3-.3V11h-2a.27.27,0,0,1-.3-.3h0V8.2a.27.27,0,0,1,.3-.3h2V6.2a3.45,3.45,0,0,1,3.1-3.7h2.4a.27.27,0,0,1,.3.3h0Z%22 style=%22fill:%23111%22/%3E%3C/svg%3E "); + background-repeat: no-repeat; +} + +.block-share ul li a.email, +.block-share-top ul li a.email, +.page-header__block-share__list ul li a.email, +.page-header__block-share ul li a.email { + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2220%22 height=%2220%22 viewBox=%220 0 20 20%22%3E%3Ctitle%3Eat%3C/title%3E%3Cpath d=%22M9.6,8.2a1.61,1.61,0,0,0-1.3.6,2.11,2.11,0,0,0-.5,1.3,1.75,1.75,0,0,0,.4,1.2,1.46,1.46,0,0,0,1.3.7,1.38,1.38,0,0,0,1.1-.6,2.39,2.39,0,0,0,.5-1.4,2,2,0,0,0-.6-1.5A2.39,2.39,0,0,0,9.6,8.2Z%22 style=%22fill:%230360a6%22/%3E%3Cpath d=%22M0,0V20H20V0ZM15.4,12.5l-.4.7H11.5l-.2-.6a2.73,2.73,0,0,1-1.9.8h0a2.66,2.66,0,0,1-2.2-1.1A3.46,3.46,0,0,1,7.2,8,2.87,2.87,0,0,1,9.4,7a3.55,3.55,0,0,1,1,.2c.2.1.5.2.6.4V6.8h1.5v5.3h1.6a5.75,5.75,0,0,0,.5-2.6,4,4,0,0,0-1.3-3A4.44,4.44,0,0,0,9.9,5.2,4.76,4.76,0,0,0,6.5,6.6,5.55,5.55,0,0,0,5.3,9.9a4.84,4.84,0,0,0,1.3,3.4A4.48,4.48,0,0,0,10,14.8h.2V16H10a5.62,5.62,0,0,1-4.4-1.9A6.26,6.26,0,0,1,4,9.9,5.91,5.91,0,0,1,9.9,4H10a6.56,6.56,0,0,1,4.4,1.7A5.46,5.46,0,0,1,16,9.5,8,8,0,0,1,15.4,12.5Z%22 style=%22fill:%230360a6%22/%3E%3C/svg%3E"); + background-repeat: no-repeat; +} + +.block-share ul li a.email:hover, +.block-share-top ul li a.email:hover, +.page-header__block-share__list ul li a.email:hover, +.page-header__block-share ul li a.email:hover { + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2220%22 height=%2220%22 viewBox=%220 0 20 20%22%3E%3Ctitle%3Eat_on%3C/title%3E%3Cpath d=%22M9.6,8.2a1.61,1.61,0,0,0-1.3.6,2.11,2.11,0,0,0-.5,1.3,1.75,1.75,0,0,0,.4,1.2,1.46,1.46,0,0,0,1.3.7,1.38,1.38,0,0,0,1.1-.6,2.39,2.39,0,0,0,.5-1.4,2,2,0,0,0-.6-1.5A2.39,2.39,0,0,0,9.6,8.2Z%22 style=%22fill:%233b7dc5%22/%3E%3Cpath d=%22M0,0V20H20V0ZM15.4,12.5l-.4.7H11.5l-.2-.6a2.73,2.73,0,0,1-1.9.8h0a2.66,2.66,0,0,1-2.2-1.1A3.46,3.46,0,0,1,7.2,8,2.87,2.87,0,0,1,9.4,7a3.55,3.55,0,0,1,1,.2c.2.1.5.2.6.4V6.8h1.5v5.3h1.6a5.75,5.75,0,0,0,.5-2.6,4,4,0,0,0-1.3-3A4.44,4.44,0,0,0,9.9,5.2,4.76,4.76,0,0,0,6.5,6.6,5.55,5.55,0,0,0,5.3,9.9a4.84,4.84,0,0,0,1.3,3.4A4.48,4.48,0,0,0,10,14.8h.2V16H10a5.62,5.62,0,0,1-4.4-1.9A6.26,6.26,0,0,1,4,9.9,5.91,5.91,0,0,1,9.9,4H10a6.56,6.56,0,0,1,4.4,1.7A5.46,5.46,0,0,1,16,9.5,8,8,0,0,1,15.4,12.5Z%22 style=%22fill:%233b7dc5%22/%3E%3C/svg%3E"); + background-repeat: no-repeat; +} + +.block-share ul li a.email:focus, +.block-share-top ul li a.email:focus, +.page-header__block-share__list ul li a.email:focus, +.page-header__block-share ul li a.email:focus { + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2220%22 height=%2220%22 viewBox=%220 0 20 20%22%3E%3Ctitle%3Eat%3C/title%3E%3Cpath d=%22M9.6,8.2a1.61,1.61,0,0,0-1.3.6,2.11,2.11,0,0,0-.5,1.3,1.75,1.75,0,0,0,.4,1.2,1.46,1.46,0,0,0,1.3.7,1.38,1.38,0,0,0,1.1-.6,2.39,2.39,0,0,0,.5-1.4,2,2,0,0,0-.6-1.5A2.39,2.39,0,0,0,9.6,8.2Z%22 style=%22fill:%23111%22/%3E%3Cpath d=%22M0,0V20H20V0ZM15.4,12.5l-.4.7H11.5l-.2-.6a2.73,2.73,0,0,1-1.9.8h0a2.66,2.66,0,0,1-2.2-1.1A3.46,3.46,0,0,1,7.2,8,2.87,2.87,0,0,1,9.4,7a3.55,3.55,0,0,1,1,.2c.2.1.5.2.6.4V6.8h1.5v5.3h1.6a5.75,5.75,0,0,0,.5-2.6,4,4,0,0,0-1.3-3A4.44,4.44,0,0,0,9.9,5.2,4.76,4.76,0,0,0,6.5,6.6,5.55,5.55,0,0,0,5.3,9.9a4.84,4.84,0,0,0,1.3,3.4A4.48,4.48,0,0,0,10,14.8h.2V16H10a5.62,5.62,0,0,1-4.4-1.9A6.26,6.26,0,0,1,4,9.9,5.91,5.91,0,0,1,9.9,4H10a6.56,6.56,0,0,1,4.4,1.7A5.46,5.46,0,0,1,16,9.5,8,8,0,0,1,15.4,12.5Z%22 style=%22fill:%23111%22/%3E%3C/svg%3E "); + background-repeat: no-repeat; +} From 77f02c0ebde9f467148e6256a285c4f408b43fe0 Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Mon, 2 Aug 2021 16:33:55 +0100 Subject: [PATCH 3/9] fixed compile error --- pages/404.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pages/404.js b/pages/404.js index 54c19adc..0741e8ec 100644 --- a/pages/404.js +++ b/pages/404.js @@ -22,9 +22,9 @@ const FourOhFour = (props) => {
    -
    -
    -
    +
    +
    +

    404 - Page Not Found

    Go back home From 45452aa037093b471abecf2adde622ddfa474fe9 Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Mon, 2 Aug 2021 16:34:48 +0100 Subject: [PATCH 4/9] tidyup --- pages/advancedsearch.js | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/pages/advancedsearch.js b/pages/advancedsearch.js index 8af17fa9..d93d9094 100644 --- a/pages/advancedsearch.js +++ b/pages/advancedsearch.js @@ -41,40 +41,6 @@ const Home = (props) => { ); }; -// export const getServerSideProps = wrapper.getServerSideProps( -// async ({ locale, store, req, res }) => { -// const token = await getToken(); -// let accessToken = token.access_token; - -// const apiRoot = process.browser ? window.API_ROOT : process.env.API_ROOT; - -// const [pages, footerLinks, courseListContent] = await Promise.all([ -// await getPages(accessToken, locale), -// await getFooterLinks(accessToken, locale), -// await getCourseList(accessToken, locale), -// ]); -// //const courseID = await getCourseID -// store.dispatch(setApiRoot(apiRoot)); -// store.dispatch(setPages(pages)); -// store.dispatch(setFooterLinks(footerLinks)); -// store.dispatch(setCourseListContent(courseListContent)); -// } -// ); - -// const mapStateToProps = (state) => { -// //console.log(state); - -// return { -// apiroot: state.apiroot, -// courseListContent: state.courseListContent.courseListContent, -// pages: state.pages.pages, -// footerLinks: state.footerLinks.footerLinks, -// regions: state.regions, -// sectors: state.sectors, -// form: state.form, -// }; -// }; - const mapStateToProps = (state) => { return { search: state.search, From b3fe6bf5f5c044eaf01a83cb904ace8527ca4c37 Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Mon, 9 Aug 2021 10:16:54 +0100 Subject: [PATCH 5/9] base flow for representations --- components/breadcrumbs.js | 20 ++ components/case.js | 2 + components/case/representation/index copy.js | 212 ++++++++++++ components/case/representation/index.js | 299 ++++++++++++++++ .../representation/representationAgent.js | 235 +++++++++++++ .../representation/representationAppellant.js | 238 +++++++++++++ .../representationCapacitySelection.js | 88 +++++ .../representation/representationComplete.js | 76 +++++ .../representationCompleteSubmit.js | 122 +++++++ .../representation/representationDetails.js | 84 +++++ .../representation/representationElements.js | 194 +++++++++++ .../representationInterestedPartyPerson.js | 323 ++++++++++++++++++ .../representation/representationLandowner.js | 230 +++++++++++++ components/case/summary.js | 67 ++-- components/header.js | 13 +- components/myportal/topthree.js | 8 +- components/myportal/viewall.js | 39 ++- components/newappeal/createCase.js | 55 ++- components/representation.js | 38 +++ components/search/searchresults.js | 35 +- components/searchresults.js | 2 +- i18n.json | 3 + package.json | 3 +- pages/case.js | 3 + pages/myportal/index.js | 5 + pages/newappeal/index.js | 4 + pages/representation.js | 83 +++++ pages/searchresults.js | 8 + store/currentView/action.js | 33 ++ store/currentView/reducer.js | 14 + styles/sass/welshgov/_application.scss | 22 ++ 31 files changed, 2494 insertions(+), 64 deletions(-) create mode 100644 components/case/representation/index copy.js create mode 100644 components/case/representation/index.js create mode 100644 components/case/representation/representationAgent.js create mode 100644 components/case/representation/representationAppellant.js create mode 100644 components/case/representation/representationCapacitySelection.js create mode 100644 components/case/representation/representationComplete.js create mode 100644 components/case/representation/representationCompleteSubmit.js create mode 100644 components/case/representation/representationDetails.js create mode 100644 components/case/representation/representationElements.js create mode 100644 components/case/representation/representationInterestedPartyPerson.js create mode 100644 components/case/representation/representationLandowner.js create mode 100644 components/representation.js create mode 100644 pages/representation.js diff --git a/components/breadcrumbs.js b/components/breadcrumbs.js index 68207f4f..77b5e190 100644 --- a/components/breadcrumbs.js +++ b/components/breadcrumbs.js @@ -177,6 +177,26 @@ const Breadcrumbs = (props) => { ) : ( "" )} + {router.pathname == "/representation" ? ( + <> +
  • + + + My Portal + + +
  • +
  • + Make representation for:{" "} + { + props.props.currentView.caseReference + .currentReference + } +
  • + + ) : ( + "" + )} {router.pathname == "/account/personaldetails" ? ( <>
  • diff --git a/components/case.js b/components/case.js index b2766fb2..4984fd98 100644 --- a/components/case.js +++ b/components/case.js @@ -26,6 +26,8 @@ const CaseSummary = (props) => { awaitingSubmission={props.awaitingSubmission} caseReference={props.caseReference} currentType={props.currentType} + searchResultsObj={props.searchResultsObj} + searchString={props.searchString} />
  • 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 +

    +
    + +
    +
    +
    +
    +
    +
    {" "} +
    + +
    +
    + ); +}; + +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 +

    +
    + +
    +
    +
    +
    +
    +
    {" "} +
    + +
    +
    + ); +}; + +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 af12264d..02521be7 100644 --- a/components/case/summary.js +++ b/components/case/summary.js @@ -15,15 +15,22 @@ const CaseSummary = (props) => { myRepresentations, watchedCases, awaitingSubmission, + searchResultsObj, currentType, } = props; let setCaseQueryObj = props[currentType]; + var casesObj = {}; - var casesObj = jsonpath.query( - setCaseQueryObj, - '$..[?(@.reference=="' + caseReference + '")]' - ); + currentType == "searchResultsObj" + ? (casesObj = jsonpath.query( + setCaseQueryObj, + '$..[?(@.title=="' + caseReference + '")]' + )) + : (casesObj = jsonpath.query( + setCaseQueryObj, + '$..[?(@.reference=="' + caseReference + '")]' + )); casesObj = Object.assign({}, ...casesObj); @@ -32,7 +39,10 @@ const CaseSummary = (props) => {

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

    @@ -41,7 +51,7 @@ const CaseSummary = (props) => { {t("case:summary-applicant-label")}
    - {casesObj.appellantApplicant} + {casesObj.appellantApplicant || ""}
    @@ -57,12 +67,12 @@ const CaseSummary = (props) => { {t("case:summary-site-address-label")}
    - {casesObj.address1} + {casesObj.address1 || ""}
    - {casesObj.town} + {casesObj.town || ""}
    - {casesObj.postcode} + {casesObj.postcode || ""}
    @@ -71,7 +81,7 @@ const CaseSummary = (props) => {
    - + {t("case:summary-make-representation-label")} @@ -110,7 +120,7 @@ const CaseSummary = (props) => { {t("case:summary-lpa-label")}
    - {casesObj.lpaname} + {casesObj.lpaname || ""}
    @@ -120,7 +130,8 @@ const CaseSummary = (props) => { )}
    - {casesObj.caseDetails.caseSummary} + {casesObj.caseDetails.caseSummary || + ""}
    @@ -131,7 +142,8 @@ const CaseSummary = (props) => {
    {" "} - {casesObj.caseDetails.caseOfficer} + {casesObj.caseDetails.caseOfficer || + ""}
    @@ -139,7 +151,8 @@ const CaseSummary = (props) => { {t("case:summary-procedure-label")}
    - {casesObj.caseDetails.procedure} + {casesObj.caseDetails.procedure || + ""}
    @@ -147,11 +160,9 @@ const CaseSummary = (props) => { {t("case:summary-status-label")}
    - { - casesObj[ - "statuscode@OData.Community.Display.V1.FormattedValue" - ] - } + {casesObj[ + "statuscode@OData.Community.Display.V1.FormattedValue" + ] || ""}
    @@ -159,14 +170,13 @@ const CaseSummary = (props) => { {t("case:summary-decision-label")}
    - {casesObj.caseDetails.decision} + {casesObj.caseDetails.decision || + ""}
    - { - casesObj.caseDetails - .outcome_document - } + {casesObj.caseDetails + .outcome_document || ""}
    @@ -178,10 +188,8 @@ const CaseSummary = (props) => { )}
    - { - casesObj.caseDetails - .caseLinkStatus - } + {casesObj.caseDetails + .caseLinkStatus || ""}
    @@ -191,7 +199,8 @@ const CaseSummary = (props) => { )}
    - {casesObj.caseDetails.linkedCases} + {casesObj.caseDetails.linkedCases || + ""}
    diff --git a/components/header.js b/components/header.js index f4fcf1d9..182a9fa1 100644 --- a/components/header.js +++ b/components/header.js @@ -9,6 +9,7 @@ const Header = (props) => { const router = useRouter(); const { locale } = router; const { setLogout } = props; + const noSignoutLink = ["/", "/logout"]; return (
    {
      - {router.pathname == "/logout" ? ( - "" - ) : router.pathname == "/" ? ( + {noSignoutLink.includes(router.pathname) == + true ? ( "" ) : (
    • @@ -157,8 +157,9 @@ const Header = (props) => {
    - {router.pathname != "/" || - router.pathname != "/logout" ? ( + {noSignoutLink.includes(router.pathname) == true ? ( + "" + ) : ( { @@ -169,8 +170,6 @@ const Header = (props) => { {t("common:signout-label")} - ) : ( - "" )} {
    Case reference:{" "} - + { 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/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..5ace7173 100644 --- a/components/search/searchresults.js +++ b/components/search/searchresults.js @@ -1,15 +1,17 @@ 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,9 +60,7 @@ 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}"

    @@ -91,7 +91,16 @@ export default function SearchResults(props) {
    - + { + setCurrentReference({ + "currentReference": + item.title, + "currentType": + "searchResultsObj", + }); + }} + > Case Reference: @@ -151,4 +160,14 @@ export default function SearchResults(props) {
    ); -} +}; + +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 69889cca..f55a274d 100644 --- a/components/searchresults.js +++ b/components/searchresults.js @@ -22,7 +22,7 @@ export default function Search(props) {
    diff --git a/i18n.json b/i18n.json index 3f1e7543..a506b4d8 100644 --- a/i18n.json +++ b/i18n.json @@ -29,6 +29,9 @@ "/case": [ "case" ], + "/representation": [ + "case" + ], "/newappeal": [ "newappeal" ], diff --git a/package.json b/package.json index 15204e88..2445837c 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "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", @@ -52,4 +53,4 @@ "eslint-config-next": "^11.0.1", "prettier": "2.3.2" } -} \ No newline at end of file +} diff --git a/pages/case.js b/pages/case.js index 332f8426..fb0a32c4 100644 --- a/pages/case.js +++ b/pages/case.js @@ -38,6 +38,9 @@ const Home = (props) => { { //console.log("the query", query); + res.setHeader( + "Cache-Control", + "public, s-maxage=604800, stale-while-revalidate" + ); + const [ myCases, myRepresentations, diff --git a/pages/newappeal/index.js b/pages/newappeal/index.js index 9363df91..5cb68b62 100644 --- a/pages/newappeal/index.js +++ b/pages/newappeal/index.js @@ -75,6 +75,10 @@ const Home = (props) => { export const getServerSideProps = wrapper.getServerSideProps( (store) => async ({ query, req, res }) => { + res.setHeader( + "Cache-Control", + "public, s-maxage=604800, stale-while-revalidate" + ); const [appealTypeData, lpaData] = await Promise.all([ await getAppealsTypes(), await getLPA(), diff --git a/pages/representation.js b/pages/representation.js new file mode 100644 index 00000000..4080a662 --- /dev/null +++ b/pages/representation.js @@ -0,0 +1,83 @@ +import _ from "lodash"; +import Head from "next/head"; +import Header from "../components/header"; +import Banner from "../components/banner"; +import CookieBanner from "../components/cookieBanner"; +import Breadcrumbs from "../components/breadcrumbs"; +import CaseSummary from "../components/case"; +import Footer from "../components/footer"; +import Errorpage from "../components/errorpage"; +import styles from "../styles/Home.module.css"; +import { useSelector, shallowEqual, connect } from "react-redux"; +import { wrapper } from "../store/store"; +import Cookies from "cookies"; +import { useRouter } from "next/router"; +import useTranslation from "next-translate/useTranslation"; +import Case from "../components/representation"; + +const Home = (props) => { + const { footerLinks, pages } = props; + let { t, lang } = useTranslation(); + + const router = useRouter(); + const { locale } = router; + const { appealtypes } = router.query; + + return ( +
    + + + {t("case:page-title")} - {t("common:service-name")} + + +
    + +
    +
    + + + +
    +
    +
    +
    + ); +}; + +const mapStateToProps = (state) => { + //console.log(state); + + return { + currentView: state.currentView, + search: state.search, + searchResultsObj: state.searchResultsObj, + formData: state.formData, + appealType: state.appealType, + form: state.form, + myCases: state.myCases, + watchedCases: state.watchedCases, + myRepresentations: state.myRepresentations, + awaitingSubmission: state.awaitingSubmission, + }; +}; + +export default connect(mapStateToProps)(Home); diff --git a/pages/searchresults.js b/pages/searchresults.js index 5cc583c9..5d3b4082 100644 --- a/pages/searchresults.js +++ b/pages/searchresults.js @@ -65,8 +65,16 @@ export const getServerSideProps = wrapper.getServerSideProps( const mapStateToProps = (state) => { return { + currentView: state.currentView, search: state.search, searchResultsObj: state.searchResultsObj, + formData: state.formData, + appealType: state.appealType, + form: state.form, + myCases: state.myCases, + watchedCases: state.watchedCases, + myRepresentations: state.myRepresentations, + awaitingSubmission: state.awaitingSubmission, }; }; diff --git a/store/currentView/action.js b/store/currentView/action.js index 2440f7e4..292372d3 100644 --- a/store/currentView/action.js +++ b/store/currentView/action.js @@ -2,6 +2,9 @@ export const currentViewActionTypes = { GETCURRENTVIEW: "GETCURRENTVIEW", SETCURRENTVIEW: "SETCURRENTVIEW", SETCURRENTREFERENCE: "SETCURRENTREFERENCE", + SETREPRESENTATIONCAPACITY: "SETREPRESENTATIONCAPACITY", + SETREPRESENTATIONSUBMIT: "SETREPRESENTATIONSUBMIT", + SETREPRESENTATIONSUBMITCONFIRMATION: "SETREPRESENTATIONSUBMITCONFIRMATION", }; export const getCurrentViewObj = () => (dispatch) => { @@ -23,3 +26,33 @@ export const setCurrentReference = (caseReference) => (dispatch) => { caseReference: caseReference, }); }; + +export const setRepresentationCapacity = + (representationCapacity) => (dispatch) => { + return dispatch({ + type: currentViewActionTypes.SETREPRESENTATIONCAPACITY, + representationCapacity: representationCapacity, + }); + }; + +export const setRepresentationSubmit = (representationSubmit) => (dispatch) => { + return dispatch({ + type: currentViewActionTypes.SETREPRESENTATIONSUBMIT, + representationSubmit: representationSubmit, + }); +}; + +export const setSubmitBack = (representationSubmit) => (dispatch) => { + return dispatch({ + type: currentViewActionTypes.SETREPRESENTATIONSUBMIT, + representationSubmit: representationSubmit, + }); +}; + +export const setRepresentationSubmitConfirmation = + (representationSubmitConfirmation) => (dispatch) => { + return dispatch({ + type: currentViewActionTypes.SETREPRESENTATIONSUBMITCONFIRMATION, + representationSubmitConfirmation: representationSubmitConfirmation, + }); + }; diff --git a/store/currentView/reducer.js b/store/currentView/reducer.js index f0ccb0fb..683089b6 100644 --- a/store/currentView/reducer.js +++ b/store/currentView/reducer.js @@ -3,6 +3,9 @@ import { currentViewActionTypes } from "./action"; const currentViewInitialState = { currentView: {}, caseReference: {}, + representationCapacity: {}, + representationSubmit: null, + representationSubmitConfirmation: {}, }; export default function reducer(state = currentViewInitialState, action) { @@ -17,6 +20,17 @@ export default function reducer(state = currentViewInitialState, action) { ...state, caseReference: action.caseReference, }; + case currentViewActionTypes.SETREPRESENTATIONCAPACITY: + return { + ...state, + representationCapacity: action.representationCapacity, + }; + case currentViewActionTypes.SETREPRESENTATIONSUBMITCONFIRMATION: + return { + ...state, + representationSubmitConfirmation: + action.representationSubmitConfirmation, + }; default: return state; } diff --git a/styles/sass/welshgov/_application.scss b/styles/sass/welshgov/_application.scss index 896d6074..ba9e4252 100644 --- a/styles/sass/welshgov/_application.scss +++ b/styles/sass/welshgov/_application.scss @@ -46,6 +46,10 @@ a { } } +.govuk-checkboxes__conditional--hidden { + display: none; +} + .govuk-button { background-color: $red; @@ -654,3 +658,21 @@ ul#sharePageLinks.active { background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2220%22 height=%2220%22 viewBox=%220 0 20 20%22%3E%3Ctitle%3Eat%3C/title%3E%3Cpath d=%22M9.6,8.2a1.61,1.61,0,0,0-1.3.6,2.11,2.11,0,0,0-.5,1.3,1.75,1.75,0,0,0,.4,1.2,1.46,1.46,0,0,0,1.3.7,1.38,1.38,0,0,0,1.1-.6,2.39,2.39,0,0,0,.5-1.4,2,2,0,0,0-.6-1.5A2.39,2.39,0,0,0,9.6,8.2Z%22 style=%22fill:%23111%22/%3E%3Cpath d=%22M0,0V20H20V0ZM15.4,12.5l-.4.7H11.5l-.2-.6a2.73,2.73,0,0,1-1.9.8h0a2.66,2.66,0,0,1-2.2-1.1A3.46,3.46,0,0,1,7.2,8,2.87,2.87,0,0,1,9.4,7a3.55,3.55,0,0,1,1,.2c.2.1.5.2.6.4V6.8h1.5v5.3h1.6a5.75,5.75,0,0,0,.5-2.6,4,4,0,0,0-1.3-3A4.44,4.44,0,0,0,9.9,5.2,4.76,4.76,0,0,0,6.5,6.6,5.55,5.55,0,0,0,5.3,9.9a4.84,4.84,0,0,0,1.3,3.4A4.48,4.48,0,0,0,10,14.8h.2V16H10a5.62,5.62,0,0,1-4.4-1.9A6.26,6.26,0,0,1,4,9.9,5.91,5.91,0,0,1,9.9,4H10a6.56,6.56,0,0,1,4.4,1.7A5.46,5.46,0,0,1,16,9.5,8,8,0,0,1,15.4,12.5Z%22 style=%22fill:%23111%22/%3E%3C/svg%3E "); background-repeat: no-repeat; } + +//dropzone + +.dropzone { + flex: 1; + display: flex; + flex-direction: column; + align-items: center; + padding: 20px; + border-width: 2px; + border-radius: 2px; + border-color: #eeeeee; + border-style: dashed; + background-color: #fafafa; + color: #bdbdbd; + outline: none; + transition: border 0.24s ease-in-out; +} From edb3a06076febdeeef23f74dd690ae07c95ed307 Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Mon, 9 Aug 2021 16:34:04 +0100 Subject: [PATCH 6/9] added dns landing page and others --- components/breadcrumbs.js | 50 ++- .../dns/applications/applicationsIntro.js | 44 +++ .../dns/applications/applicationsList.js | 352 ++++++++++++++++++ .../dns/homepage/applicationsForComment.js | 26 ++ components/dns/homepage/dnsLinks.js | 78 ++++ components/dns/homepage/latestApplications.js | 35 ++ components/dns/homepage/titleContent.js | 43 +++ components/dns/main.js | 40 ++ components/header.js | 42 ++- pages/dns/application-process.js | 153 ++++++++ pages/dns/applications.js | 77 ++++ pages/dns/contact-us.js | 130 +++++++ pages/dns/help.js | 125 +++++++ pages/dns/index.js | 42 +++ styles/sass/welshgov/_application.scss | 68 ++++ 15 files changed, 1300 insertions(+), 5 deletions(-) create mode 100644 components/dns/applications/applicationsIntro.js create mode 100644 components/dns/applications/applicationsList.js create mode 100644 components/dns/homepage/applicationsForComment.js create mode 100644 components/dns/homepage/dnsLinks.js create mode 100644 components/dns/homepage/latestApplications.js create mode 100644 components/dns/homepage/titleContent.js create mode 100644 components/dns/main.js create mode 100644 pages/dns/application-process.js create mode 100644 pages/dns/applications.js create mode 100644 pages/dns/contact-us.js create mode 100644 pages/dns/help.js create mode 100644 pages/dns/index.js diff --git a/components/breadcrumbs.js b/components/breadcrumbs.js index 77b5e190..36c914f9 100644 --- a/components/breadcrumbs.js +++ b/components/breadcrumbs.js @@ -50,9 +50,15 @@ const Breadcrumbs = (props) => {
  • - + - {t("common:service-name")} + {router.pathname.includes("dns") + ? "Developments of National Significance" + : t("common:service-name")}
  • @@ -238,6 +244,46 @@ const Breadcrumbs = (props) => { ) : ( "" )} + {router.pathname == "/dns" ? ( + <> +
  • + + + Developments of National Significance + + +
  • + + ) : ( + "" + )} + {router.pathname == "/dns/application-process" ? ( + <> +
  • + Guidance +
  • + + ) : ( + "" + )} + {router.pathname == "/dns/help" ? ( + <> +
  • + Help +
  • + + ) : ( + "" + )} + {router.pathname == "/dns/contact-us" ? ( + <> +
  • + Contact us +
  • + + ) : ( + "" + )} {!_.isEmpty(slug) ? ( <>
  • diff --git a/components/dns/applications/applicationsIntro.js b/components/dns/applications/applicationsIntro.js new file mode 100644 index 00000000..e38f235d --- /dev/null +++ b/components/dns/applications/applicationsIntro.js @@ -0,0 +1,44 @@ +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 ( +
    +
    +

    Applications

    +

    The applications listed are those:

    +
      +
    • + Where the developer has advised the Planning + Inspectorate in writing that they intend to submit an + application to us in the future +
    • +
    • + Where an application has already been made to the + Planning Inspectorate and is undergoing the examination + process +
    • +
    • Where a proposal has been decided.
    • +
    +

    + 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 calendar page. +

    +
    +
    + +
    +
    + ); +}; + +export default ApplicationIntro; diff --git a/components/dns/applications/applicationsList.js b/components/dns/applications/applicationsList.js new file mode 100644 index 00000000..e830e983 --- /dev/null +++ b/components/dns/applications/applicationsList.js @@ -0,0 +1,352 @@ +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 ( + <> +
    +
    + +
    +
    +
    +

    Showing 1 to 10 of 54 entries

    +
    +
    +
    +
    +
    +
    + Reference +
    +
    + Application +
    +
    + Developer{" "} +
    +
    + Type +
    +
    + Status +
    +
    +
    +
    + + Reference: + + CAS-00009-W8N6W4 +
    +
    + + + Application:{" "} + + TWA - Morlais Demonstration Zone + +
    +
    + + Developer: + + Menter Mon +
    +
    + + Type: + + Energy +
    +
    + + Status: + + Recommendation +
    +
    +
    +
    + + Reference: + + CAS-00009-W8N6W4 +
    +
    + + + Application:{" "} + + TWA - Morlais Demonstration Zone + +
    +
    + + Developer: + + Menter Mon +
    +
    + + Type: + + Energy +
    +
    + + Status: + + Recommendation +
    +
    +
    +
    + + Reference: + + CAS-00009-W8N6W4 +
    +
    + + + Application:{" "} + + TWA - Morlais Demonstration Zone + +
    +
    + + Developer: + + Menter Mon +
    +
    + + Type: + + Energy +
    +
    + + Status: + + Recommendation +
    +
    +
    +
    + + Reference: + + CAS-00009-W8N6W4 +
    +
    + + + Application:{" "} + + TWA - Morlais Demonstration Zone + +
    +
    + + Developer: + + Menter Mon +
    +
    + + Type: + + Energy +
    +
    + + Status: + + Recommendation +
    +
    +
    +
    + + Reference: + + CAS-00009-W8N6W4 +
    +
    + + + Application:{" "} + + TWA - Morlais Demonstration Zone + +
    +
    + + Developer: + + Menter Mon +
    +
    + + Type: + + Energy +
    +
    + + Status: + + Recommendation +
    +
    +
    +
    + + Reference: + + CAS-00009-W8N6W4 +
    +
    + + + Application:{" "} + + TWA - Morlais Demonstration Zone + +
    +
    + + Developer: + + Menter Mon +
    +
    + + Type: + + Energy +
    +
    + + Status: + + Recommendation +
    +
    +
    +
    + + Reference: + + CAS-00009-W8N6W4 +
    +
    + + + Application:{" "} + + TWA - Morlais Demonstration Zone + +
    +
    + + Developer: + + Menter Mon +
    +
    + + Type: + + Energy +
    +
    + + Status: + + Recommendation +
    +
    +
    +
    + + Reference: + + CAS-00009-W8N6W4 +
    +
    + + + Application:{" "} + + TWA - Morlais Demonstration Zone + +
    +
    + + Developer: + + Menter Mon +
    +
    + + Type: + + Energy +
    +
    + + Status: + + Recommendation +
    +
    +
    +
    +
    +
    +

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

    +
    + + ); +}; + +export default ApplicationList; diff --git a/components/dns/homepage/applicationsForComment.js b/components/dns/homepage/applicationsForComment.js new file mode 100644 index 00000000..7385adc2 --- /dev/null +++ b/components/dns/homepage/applicationsForComment.js @@ -0,0 +1,26 @@ +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 ( +
    +

    Applications open for comments

    + +
    + ); +}; + +export default ApplicationsForComment; diff --git a/components/dns/homepage/dnsLinks.js b/components/dns/homepage/dnsLinks.js new file mode 100644 index 00000000..e2712b4e --- /dev/null +++ b/components/dns/homepage/dnsLinks.js @@ -0,0 +1,78 @@ +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 ( +
    +
    +
      +
    • +

      + + + Applications + + +

      + A list of all the Developments of National + Significance that have already been submitted + and those we are expecting to be submitted. +

      +

      +
    • +
    • +

      + + + Help + + +

      + Information about this website. +

      +

      +
    • +
    +
    +
    +
      +
    • +

      + + + Guidance + + +

      + An overview and detailed guidance on the + Developments of National Significance + application process +

      +

      +
    • +
    • +

      + + Contact us{" "} + +

      + How to get in touch with The Planning + Inspectorate. +

      +

      +
    • +
    +
    +
    + ); +}; + +export default DNSLinks; diff --git a/components/dns/homepage/latestApplications.js b/components/dns/homepage/latestApplications.js new file mode 100644 index 00000000..e17261ec --- /dev/null +++ b/components/dns/homepage/latestApplications.js @@ -0,0 +1,35 @@ +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 ( +
    +

    Latest Applications

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

    + Developments of National Significance +

    +
    +

    + 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. +

    +
    +
    + + +
    +
    + ); +}; + +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/header.js b/components/header.js index 182a9fa1..eb9ddf8d 100644 --- a/components/header.js +++ b/components/header.js @@ -8,8 +8,23 @@ const Header = (props) => { const router = useRouter(); const { locale } = router; - const { setLogout } = props; - const noSignoutLink = ["/", "/logout"]; + const { setLogout, serviceName } = props; + const noSignoutLink = [ + "/", + "/logout", + "/dns", + "/dns/application-process", + "/dns/help", + "/dns/contact-us", + "/dns/applications", + ]; + const hasContactLink = [ + "/dns", + "/dns/application-process", + "/dns/help", + "/dns/contact-us", + "/dns/applications", + ]; return (
    { className="govuk-header__link govuk-header__link--service-name" > - {t("common:service-name")} + {serviceName || t("common:service-name")}
  • @@ -99,6 +114,18 @@ const Header = (props) => {
      + {hasContactLink.includes(router.pathname) == + true ? ( +
    • + + + Contact + + +
    • + ) : ( + "" + )} {noSignoutLink.includes(router.pathname) == true ? ( "" @@ -157,6 +184,15 @@ const Header = (props) => {
    + {hasContactLink.includes(router.pathname) == true ? ( + + + Contact + + + ) : ( + "" + )} {noSignoutLink.includes(router.pathname) == true ? ( "" ) : ( diff --git a/pages/dns/application-process.js b/pages/dns/application-process.js new file mode 100644 index 00000000..5dc77da4 --- /dev/null +++ b/pages/dns/application-process.js @@ -0,0 +1,153 @@ +import _ from "lodash"; +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 Breadcrumbs from "../../components/breadcrumbs"; +import Footer from "../../components/footer"; +import Errorpage from "../../components/errorpage"; +import styles from "../../styles/Home.module.css"; +import { useSelector, shallowEqual, connect } from "react-redux"; +import { wrapper } from "../../store/store"; +import Cookies from "cookies"; +import { useRouter } from "next/router"; +import useTranslation from "next-translate/useTranslation"; +import Main from "../../components/dns//main"; + +const Home = (props) => { + const { footerLinks, pages } = props; + let { t, lang } = useTranslation(); + + const router = useRouter(); + const { locale } = router; + const { appealtypes } = router.query; + + return ( +
    + + Developments of National Significance + +
    + +
    + +
    + + + +
    +
    +

    Guidance

    +

    + Applications for Developments of National + Significance (DNS) projects are dealt with by + the Planning Inspectorate on behalf of Welsh + Government. +

    + +

    + A DNS is a type of planning application for a + large infrastructure project of national + importance – for example, a wind farm, power + station or reservoir. +

    + +

    + A DNS differs from a normal planning application + in the way that it is decided. Instead of your + Local Planning Authority making the decision, an + Inspector examines the application and makes a + recommendation to the Welsh Minister based on + planning merits and national priorities. The + Minister then decides whether or not to grant + permission. +

    +
    +
    +

    About the process

    +

    + The DNS process is designed to encourage the + applicants on such a scheme to undertake early + engagement with: +

    +
      +
    • the relevant Local Planning Authority,
    • +
    • local communities,
    • +
    • statutory consultees and
    • +
    • other stakeholders.
    • +
    +

    + Anyone considering a DNS project should contact + the Planning Inspectorate as soon as possible + after a site has been chosen. This will ensure + that as much work can be done to reduce + objections to a scheme as possible before + submission. This in turn allows the formal + application process to be streamlined. +

    +
    +
    +

    Information and guidance

    +

    + There is a{" "} + + suite of detailed Guidance for the DNS + process + {" "} + on the Welsh Government site. The{" "} + + DNS Guide for Communities + {" "} + has been written with community groups or + interested parties who are not familiar with the + DNS process in mind. +

    +
    +
    +

    Forms

    +

    + Applicants who wish to submit a request for + Pre-Application Advice, submit formal + notification of intention to submit a DNS + application or submit an application should + contact the Planning Inspectorate: +

    + +

    + e-mail:{" "} + + dns.wales@planninginspectorate.gov.uk + +

    + +

    Telephone: 0303 444 5958

    + +

    + Interested parties who wish to make a + Representation on a DNS project that has been + formally accepted by the Planning Inspectorate + can use the Representation form and submit it + via e-mail using the relevant reference number. +

    + +

    + We strongly encourage you to discuss your + application with us in advance of submitting any + of our forms, so that we can ensure that the + resources necessary are in place and + arrangements for the invoicing of fees are in + place. If you do not provide advance notice, + this may delay the handling of your request or + the provision of our advice. +

    +
    +
    +
    +
    +
    +
    + ); +}; + +export default Home; //connect(mapStateToProps)(Home); diff --git a/pages/dns/applications.js b/pages/dns/applications.js new file mode 100644 index 00000000..6102959a --- /dev/null +++ b/pages/dns/applications.js @@ -0,0 +1,77 @@ +import _ from "lodash"; +import Head from "next/head"; +import Header from "../../components/header"; +import Banner from "../../components/banner"; +import CookieBanner from "../../components/cookieBanner"; +import Breadcrumbs from "../../components/breadcrumbs"; +import SearchResults from "../../components/searchresults"; +import Footer from "../../components/footer"; +import Errorpage from "../../components/errorpage"; +import styles from "../../styles/Home.module.css"; +import { useSelector, shallowEqual, connect } from "react-redux"; +import { wrapper } from "../../store/store"; +import Cookies from "cookies"; +import { useRouter } from "next/router"; +import useTranslation from "next-translate/useTranslation"; +import ApplicationIntro from "../../components/dns/applications/applicationsIntro"; +import ApplicationList from "../../components/dns/applications/applicationsList"; + +const Applications = (props) => { + const { footerLinks, pages } = props; + let { t, lang } = useTranslation(); + + const router = useRouter(); + const { locale } = router; + const { appealtypes } = router.query; + + return ( +
    + + + {" "} + Applications - Developments of National Significance + + +
    + +
    +
    + + +
    + + +
    +
    +
    +
    +
    + ); +}; + +export const getServerSideProps = wrapper.getServerSideProps( + (store) => + async ({ query, req, res }) => { + console.log("query-", query); + // const searchResultsObj = (await getBasicSearch(query.q)) || null; + // store.dispatch(setSearchResults(searchResultsObj)); + //store.dispatch(setSearch(query.q)); + } +); + +const mapStateToProps = (state) => { + return { + currentView: state.currentView, + search: state.search, + searchResultsObj: state.searchResultsObj, + formData: state.formData, + appealType: state.appealType, + form: state.form, + myCases: state.myCases, + watchedCases: state.watchedCases, + myRepresentations: state.myRepresentations, + awaitingSubmission: state.awaitingSubmission, + }; +}; + +export default connect(mapStateToProps)(Applications); diff --git a/pages/dns/contact-us.js b/pages/dns/contact-us.js new file mode 100644 index 00000000..574f4779 --- /dev/null +++ b/pages/dns/contact-us.js @@ -0,0 +1,130 @@ +import _ from "lodash"; +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 Breadcrumbs from "../../components/breadcrumbs"; +import Footer from "../../components/footer"; +import Errorpage from "../../components/errorpage"; +import styles from "../../styles/Home.module.css"; +import { useSelector, shallowEqual, connect } from "react-redux"; +import { wrapper } from "../../store/store"; +import Cookies from "cookies"; +import { useRouter } from "next/router"; +import useTranslation from "next-translate/useTranslation"; +import Main from "../../components/dns/main"; + +const Home = (props) => { + const { footerLinks, pages } = props; + let { t, lang } = useTranslation(); + + const router = useRouter(); + const { locale } = router; + const { appealtypes } = router.query; + + return ( +
    + + + Contact us - Developments of National Significance + + +
    + +
    + +
    + + +
    +
    +
    +

    Contact us

    +

    + We are located in The Welsh Government + Building, Cathays Park in Cardiff +

    +

    + {" "} + The Planning Inspectorate +
    + Crown Buildings
    + Welsh Government
    + Cathays Park +
    Cardiff
    + CF10 3NQ +

    +
    +
    +
    +

    + {" "} + If you are contacting us regarding a Development + of National Significance, please use the + following details: +

    +

    + Tel: 03034 445 940 +
    + E-mail: dns.wales@planninginspectorate.gov.uk +
    + Follow us on Twitter @PINSgov +

    +

    + Further information about contacting the + Planning Inspectorate customer services can be + viewed on GOV.Wales. +

    +

    + The Planning Inspectorate gives advice about + applying for a Development of National + Significance or making representations about an + application (or a proposed application) although + you should note that any advice given does not + constitute legal advice upon which you can rely + and you should obtain your own legal advice and + professional advice as required. We will protect + the privacy of any personal information which + you choose to share with us and we will not hold + the information any longer than is necessary. + See our Privacy notice on GOV.UK. +

    +

    + You should note that we have a policy commitment + to openness and transparency and you should not + provide us with confidential or commercial + information which you do not wish to be put in + the public domain. +

    +

    Feedback and complaints

    +

    + The Planning Inspectorate aims to provide the + best possible service for its customers. We try + hard to ensure that everyone is satisfied with + the service they receive. It is inevitable that + there will sometimes be concerns about the + Examination process or the appointed inspector’s + final report. We will carefully consider and + respond to any matters that you wish to raise: + contact details are on GOV.Wales. +

    +

    Press and media

    +

    + If you are a journalist please contact our press + office directly:{" "} +

    +

    + Telephone: 0303 444 5004 or 0303 444 5005
    + Email: press.office@planninginspectorate.gov.uk +

    +
    +
    +
    +
    +
    +
    + ); +}; + +export default Home; //connect(mapStateToProps)(Home); diff --git a/pages/dns/help.js b/pages/dns/help.js new file mode 100644 index 00000000..ac3103c9 --- /dev/null +++ b/pages/dns/help.js @@ -0,0 +1,125 @@ +import _ from "lodash"; +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 Breadcrumbs from "../../components/breadcrumbs"; +import Footer from "../../components/footer"; +import Errorpage from "../../components/errorpage"; +import styles from "../../styles/Home.module.css"; +import { useSelector, shallowEqual, connect } from "react-redux"; +import { wrapper } from "../../store/store"; +import Cookies from "cookies"; +import { useRouter } from "next/router"; +import useTranslation from "next-translate/useTranslation"; +import Main from "../../components/dns/main"; + +const Home = (props) => { + const { footerLinks, pages } = props; + let { t, lang } = useTranslation(); + + const router = useRouter(); + const { locale } = router; + const { appealtypes } = router.query; + + return ( +
    + + Developments of National Significance + +
    + +
    + +
    + + +
    +
    +

    Help

    +

    + Welcome to the website help page. This section + contains the following: +

    +

    + + Accessibility + +

    +

    + For information about accessing the website and + help using the site. +

    +

    + + + Terms and conditions + + +

    +

    + Outlines the terms and conditions of using the + site. +

    +

    + + Cookies + +

    +

    + Provides information on cookies and how the + website uses them. +

    +

    + + Privacy + +

    +

    View our Privacy Notice on GOV.UK.

    +

    + + Welsh language + +

    +

    + Our commitment to providing information in Welsh + under the Planning Inspectorate Welsh Language + Scheme. +

    +

    + + Sitemap + +

    +

    + A view of all the pages within the site and the + heirarchy of the site. +

    +

    + + Useful links + +

    +

    + Links to other related websites and documents. +

    +

    + + Contact + +

    +

    + Find out contact details for the Planning + Inspectorate. +

    +
    +
    {" "} +
    +
    +
    +
    + ); +}; + +export default Home; //connect(mapStateToProps)(Home); diff --git a/pages/dns/index.js b/pages/dns/index.js new file mode 100644 index 00000000..86e8ce54 --- /dev/null +++ b/pages/dns/index.js @@ -0,0 +1,42 @@ +import _ from "lodash"; +import Head from "next/head"; +import Header from "../../components/header"; +import Banner from "../../components/banner"; +import CookieBanner from "../../components/cookieBanner"; +import Breadcrumbs from "../../components/breadcrumbs"; +import Footer from "../../components/footer"; +import Errorpage from "../../components/errorpage"; +import styles from "../../styles/Home.module.css"; +import { useSelector, shallowEqual, connect } from "react-redux"; +import { wrapper } from "../../store/store"; +import Cookies from "cookies"; +import { useRouter } from "next/router"; +import useTranslation from "next-translate/useTranslation"; +import Main from "../../components/dns//main"; + +const Home = (props) => { + const { footerLinks, pages } = props; + let { t, lang } = useTranslation(); + + const router = useRouter(); + const { locale } = router; + + return ( +
    + + Developments of National Significance + +
    + +
    +
    + +
    +
    +
    +
    +
    + ); +}; + +export default Home; //connect(mapStateToProps)(Home); diff --git a/styles/sass/welshgov/_application.scss b/styles/sass/welshgov/_application.scss index ba9e4252..0dfa5637 100644 --- a/styles/sass/welshgov/_application.scss +++ b/styles/sass/welshgov/_application.scss @@ -19,6 +19,8 @@ html { .govuk-breadcrumbs__link, .govuk-fieldset__legend--s, .govuk-input, +.govuk-panel, +.govuk-panel__title, h1, h2, h3, @@ -676,3 +678,69 @@ ul#sharePageLinks.active { outline: none; transition: border 0.24s ease-in-out; } + +// dns + +.govuk-panel--header { + background-color: #8b272d; + padding: 15px; + color: #fff; + text-align: left; + margin-bottom: 0px; + + .govuk-panel__title { + font-size: 36px; + } + p { + color: #fff; + } +} + +.govuk-panel--latest { + background-color: #000; + color: #fff; + padding: 15px; + text-align: left; + margin-bottom: 0px; + + .govuk-panel__title { + font-size: 24px; + } + .govuk-heading-m { + color: #fff; + } + + .govuk-panel__body { + font-size: initial; + } + + .govuk-list li a { + color: #fff; + } +} + +.govuk-panel--dns-links { + background-color: #fff; +} + +.govuk-panel--open-for-comments { + background-color: #8b272d; + color: #fff; + padding: 15px; + text-align: left; + margin-bottom: 0px; + .govuk-panel__title { + font-size: 24px; + } + .govuk-heading-m { + color: #fff; + } + + .govuk-panel__body { + font-size: initial; + } + + .govuk-list li a { + color: #fff; + } +} From b96aa3acbef5324121cf1bdbc0063ef1e4928136 Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Tue, 10 Aug 2021 17:17:39 +0100 Subject: [PATCH 7/9] added dns record view with tabs --- components/breadcrumbs.js | 25 ++ .../dns/applications/applicationSideBar.js | 106 +++++ .../dns/applications/applicationSummary.js | 63 +++ .../dns/applications/applicationTabs.js | 151 +++++++ .../applications/applicationTabsComments.js | 30 ++ .../applications/applicationTabsDocuments.js | 385 ++++++++++++++++++ .../applicationTabsRegistrationForm.js | 23 ++ .../applications/applicationTabsTimeline.js | 145 +++++++ .../dns/applications/applicationsIntro.js | 13 +- .../dns/applications/applicationsList.js | 204 ++++++---- .../dns/homepage/applicationsForComment.js | 8 +- components/dns/homepage/dnsLinks.js | 12 +- components/dns/homepage/latestApplications.js | 20 +- components/header.js | 2 + components/search/searchresults.js | 6 +- package.json | 1 + pages/_document.js | 2 +- pages/dns/application-view.js | 81 ++++ pages/dns/contact-us.js | 36 +- public/assets/images/dns/milestone.png | Bin 0 -> 901 bytes public/assets/images/dns/notice.png | Bin 0 -> 1554 bytes styles/sass/styles.scss | 2 +- styles/sass/welshgov/_application.scss | 297 +++++++++++++- 23 files changed, 1497 insertions(+), 115 deletions(-) create mode 100644 components/dns/applications/applicationSideBar.js create mode 100644 components/dns/applications/applicationSummary.js create mode 100644 components/dns/applications/applicationTabs.js create mode 100644 components/dns/applications/applicationTabsComments.js create mode 100644 components/dns/applications/applicationTabsDocuments.js create mode 100644 components/dns/applications/applicationTabsRegistrationForm.js create mode 100644 components/dns/applications/applicationTabsTimeline.js create mode 100644 pages/dns/application-view.js create mode 100644 public/assets/images/dns/milestone.png create mode 100644 public/assets/images/dns/notice.png diff --git a/components/breadcrumbs.js b/components/breadcrumbs.js index 36c914f9..1187d45f 100644 --- a/components/breadcrumbs.js +++ b/components/breadcrumbs.js @@ -284,6 +284,31 @@ const Breadcrumbs = (props) => { ) : ( "" )} + {router.pathname == "/dns/applications" ? ( + <> +
  • + Applications +
  • + + ) : ( + "" + )} + {router.pathname == "/dns/application-view" ? ( + <> +
  • + + + Applications{" "} + + +
  • +
  • + TWA - Morlais Demonstration Zone +
  • + + ) : ( + "" + )} {!_.isEmpty(slug) ? ( <>
  • 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 ( + <> + + + ); +}; + +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 index e38f235d..d49deb10 100644 --- a/components/dns/applications/applicationsIntro.js +++ b/components/dns/applications/applicationsIntro.js @@ -35,7 +35,18 @@ const ApplicationIntro = (props) => {

  • - +
    + +
    ); diff --git a/components/dns/applications/applicationsList.js b/components/dns/applications/applicationsList.js index e830e983..cf98f5d1 100644 --- a/components/dns/applications/applicationsList.js +++ b/components/dns/applications/applicationsList.js @@ -12,31 +12,37 @@ const ApplicationList = (props) => { return ( <>
    -
    - +
    +
    + +
    -

    Showing 1 to 10 of 54 entries

    +
    +

    + Showing 1 to 10 of 54 entries +

    +
    -
    +
    -
    +
    Reference
    @@ -53,19 +59,21 @@ const ApplicationList = (props) => {
    -
    +
    Reference: CAS-00009-W8N6W4
    - - - Application:{" "} - - TWA - Morlais Demonstration Zone - + + + + Application:{" "} + + TWA - Morlais Demonstration Zone + +
    @@ -87,19 +95,21 @@ const ApplicationList = (props) => {
    -
    +
    Reference: CAS-00009-W8N6W4
    - - - Application:{" "} - - TWA - Morlais Demonstration Zone - + + + + Application:{" "} + + TWA - Morlais Demonstration Zone + +
    @@ -121,19 +131,21 @@ const ApplicationList = (props) => {
    -
    +
    Reference: CAS-00009-W8N6W4
    - - - Application:{" "} - - TWA - Morlais Demonstration Zone - + + + + Application:{" "} + + TWA - Morlais Demonstration Zone + +
    @@ -155,19 +167,21 @@ const ApplicationList = (props) => {
    -
    +
    Reference: CAS-00009-W8N6W4
    - - - Application:{" "} - - TWA - Morlais Demonstration Zone - + + + + Application:{" "} + + TWA - Morlais Demonstration Zone + +
    @@ -189,19 +203,21 @@ const ApplicationList = (props) => {
    -
    +
    Reference: CAS-00009-W8N6W4
    - - - Application:{" "} - - TWA - Morlais Demonstration Zone - + + + + Application:{" "} + + TWA - Morlais Demonstration Zone + +
    @@ -223,19 +239,21 @@ const ApplicationList = (props) => {
    -
    +
    Reference: CAS-00009-W8N6W4
    - - - Application:{" "} - - TWA - Morlais Demonstration Zone - + + + + Application:{" "} + + TWA - Morlais Demonstration Zone + +
    @@ -257,19 +275,21 @@ const ApplicationList = (props) => {
    -
    +
    Reference: CAS-00009-W8N6W4
    - - - Application:{" "} - - TWA - Morlais Demonstration Zone - + + + + Application:{" "} + + TWA - Morlais Demonstration Zone + +
    @@ -291,19 +311,21 @@ const ApplicationList = (props) => {
    -
    +
    Reference: CAS-00009-W8N6W4
    - - - Application:{" "} - - TWA - Morlais Demonstration Zone - + + + + Application:{" "} + + TWA - Morlais Demonstration Zone + +
    @@ -328,22 +350,24 @@ const ApplicationList = (props) => {
    -

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

    +
    +

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

    +
    ); diff --git a/components/dns/homepage/applicationsForComment.js b/components/dns/homepage/applicationsForComment.js index 7385adc2..c5873591 100644 --- a/components/dns/homepage/applicationsForComment.js +++ b/components/dns/homepage/applicationsForComment.js @@ -13,9 +13,11 @@ const ApplicationsForComment = (props) => { diff --git a/components/dns/homepage/dnsLinks.js b/components/dns/homepage/dnsLinks.js index e2712b4e..6312b375 100644 --- a/components/dns/homepage/dnsLinks.js +++ b/components/dns/homepage/dnsLinks.js @@ -57,12 +57,12 @@ const DNSLinks = (props) => {
  • - - Contact us{" "} - + + + Contact us{" "} + + +

    How to get in touch with The Planning Inspectorate. diff --git a/components/dns/homepage/latestApplications.js b/components/dns/homepage/latestApplications.js index e17261ec..b031da27 100644 --- a/components/dns/homepage/latestApplications.js +++ b/components/dns/homepage/latestApplications.js @@ -13,18 +13,30 @@ const LatestApplications = (props) => {

    diff --git a/components/header.js b/components/header.js index eb9ddf8d..d45e79c5 100644 --- a/components/header.js +++ b/components/header.js @@ -17,6 +17,7 @@ const Header = (props) => { "/dns/help", "/dns/contact-us", "/dns/applications", + "/dns/application-view", ]; const hasContactLink = [ "/dns", @@ -24,6 +25,7 @@ const Header = (props) => { "/dns/help", "/dns/contact-us", "/dns/applications", + "/dns/application-view", ]; return ( diff --git a/components/search/searchresults.js b/components/search/searchresults.js index 5ace7173..ebbfb932 100644 --- a/components/search/searchresults.js +++ b/components/search/searchresults.js @@ -14,7 +14,7 @@ const SearchResults = (props) => { var resultsArr = searchResultsObj.value || [{}]; const resultRow = Object.keys(resultsArr).map((key, index) => {
    -
    +
    @@ -66,7 +66,7 @@ const SearchResults = (props) => {

    -
    +
    {t("search:searchresults-case-reference-label")}
    @@ -89,7 +89,7 @@ const SearchResults = (props) => { {resultsArr.map((item, key) => { return (
    -
    +
    { diff --git a/package.json b/package.json index 2445837c..74e63f1d 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "next-translate": "^1.0.7", "pm2": "^5.1.0", "react": "17.0.2", + "react-accessible-accordion": "^3.3.5", "react-cookie-consent": "^6.2.4", "react-datepicker": "^4.1.1", "react-dom": "17.0.2", 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 && (