From c4fcb6fa5605ac78d37ac081a246a29fea1f7331 Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Tue, 24 Oct 2023 08:37:22 +0100 Subject: [PATCH] reps questionnaire progress panel --- .../representation/representationAgent.js | 280 +++-- .../representation/representationAppellant.js | 233 ++-- .../representationCapacitySelection.js | 2 +- .../representationInterestedPartyPerson.js | 199 ++-- .../case/representation/representationLPA.js | 1053 +++-------------- .../representationLPACapacitySelection.js | 2 +- .../representationLPAQuestionnaire_s78.js | 2 + components/case/summary.js | 9 +- 8 files changed, 509 insertions(+), 1271 deletions(-) diff --git a/components/case/representation/representationAgent.js b/components/case/representation/representationAgent.js index f365c23d..3c8ccdfa 100644 --- a/components/case/representation/representationAgent.js +++ b/components/case/representation/representationAgent.js @@ -41,29 +41,28 @@ const RepAgent = (props) => { const required = (value) => (value ? undefined : "Required"); return ( -
-
-
-

- Representation from an Agent -

+ <> +
+

+ Representation from an Agent +

-
- - -
+
+ +
- {/*
+
+ {/*
{ />
*/} -
-
- -
+
+
+
+
-
-
-

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

-
-
- My comments are set out in: -
-
- -

- Please note that all representations may be - published in line with our Publishing - Policy. Should your representation include - any sensitive information or potentially - defamatory information, it may be redacted - before publishing. If it contains racist, - libellous or offensive content it will be - returned to you and you will be asked to - provide an amended version.{" "} - - https://gov.wales/planning-and-environment-decisions-wales-publishing-policy-html - -

-
+
+
+

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

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

+ Please note that all representations may be + published in line with our Publishing Policy. + Should your representation include any sensitive + information or potentially defamatory + information, it may be redacted before + publishing. If it contains racist, libellous or + offensive content it will be returned to you and + you will be asked to provide an amended version.{" "} + + https://gov.wales/planning-and-environment-decisions-wales-publishing-policy-html + +

+
+
+ +
+ {props.currentView.caseReference.hasOwnProperty( + "repDetails" + ) && + props.currentView.caseReference.repDetails.filesList + .length > 0 ? (
- -
- {props.currentView.caseReference.hasOwnProperty( - "repDetails" - ) && - props.currentView.caseReference.repDetails.filesList - .length > 0 ? ( -
- {props.currentView.caseReference.repDetails.filesList.map( - (blob, i) => ( -
- {blob.name} + {props.currentView.caseReference.repDetails.filesList.map( + (blob, i) => ( +
+ {blob.name} - - {blob.name} ( - {bytesToSize(blob.size)}) - -
- ) - )} -
- ) : ( - "" - )} -
-
{" "} -
- + ) : ( + "" + )} +
+
{" "} +
+
-
+ ); }; diff --git a/components/case/representation/representationAppellant.js b/components/case/representation/representationAppellant.js index 9e628db9..520d6add 100644 --- a/components/case/representation/representationAppellant.js +++ b/components/case/representation/representationAppellant.js @@ -44,34 +44,33 @@ const RepAppellant = (props) => { // console.log(props); return ( -
-
-
-
-

- Representation for an Appellant -

- + <> +
+
+

+ Representation from an Appellant +

+ - {typeof props.representationType == "undefined" ? ( - - ) : ( -

{props.representationType}

- )} -
+ {typeof props.representationType == "undefined" ? ( + + ) : ( +

{props.representationType}

+ )}
+
- {/*
+ {/*
{
*/} -
-
-

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

-
-
- My comments are set out in: -
-
- - {RepresentationGuidanceText( - formObj.representationForm.values.appealType +
+
+

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

+
+
+ My comments are set out in: +
+
+ + {RepresentationGuidanceText( + formObj.representationForm.values.appealType + )} +
+
+ +
+ {props.currentView.caseReference.hasOwnProperty( + "repDetails" + ) && + props.currentView.caseReference.repDetails.filesList + .length > 0 ? ( +
+ {props.currentView.caseReference.repDetails.filesList.map( + (blob, i) => ( +
+ {blob.name} + + + {blob.name} ( + {bytesToSize(blob.size)}) + +
+ ) )}
-
- -
- {props.currentView.caseReference.hasOwnProperty( - "repDetails" - ) && - props.currentView.caseReference.repDetails.filesList - .length > 0 ? ( -
- {props.currentView.caseReference.repDetails.filesList.map( - (blob, i) => ( -
- {blob.name} - - - {blob.name} ( - {bytesToSize(blob.size)}) - -
- ) - )} -
- ) : ( - "" - )} -
-
{" "} -
-
-
- - {/* +
{" "} +
+
-
+ ); }; diff --git a/components/case/representation/representationCapacitySelection.js b/components/case/representation/representationCapacitySelection.js index 44dc9667..bfd2921d 100644 --- a/components/case/representation/representationCapacitySelection.js +++ b/components/case/representation/representationCapacitySelection.js @@ -53,7 +53,7 @@ let RepCapacitySelection = (props) => { props={props} />{" "}
-
+

Your details - {props.firstValue} diff --git a/components/case/representation/representationInterestedPartyPerson.js b/components/case/representation/representationInterestedPartyPerson.js index 6621ef8a..813a35a0 100644 --- a/components/case/representation/representationInterestedPartyPerson.js +++ b/components/case/representation/representationInterestedPartyPerson.js @@ -32,103 +32,101 @@ const RepInterestedPartyPerson = (props) => { )); return ( -
-
-
-

- Representation from an Interested Party/Person -

+ <> +
+

+ Representation from an Interested Party/Person +

-
- - -
+
+ +
+
-
-
- -
+
+
+
+
-
-
-

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

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

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

+
+
+ My comments are set out in: +
+
+ +
-
- -
-
-
{" "} -
+
+ +
+
+
{" "} +
- + ); }; diff --git a/components/case/representation/representationLPA.js b/components/case/representation/representationLPA.js index c98c804d..13fb9f36 100644 --- a/components/case/representation/representationLPA.js +++ b/components/case/representation/representationLPA.js @@ -14,13 +14,14 @@ import { RenderRichMultiline, RenderDatePicker, } from "./representationElements"; -import { getFormCollectionByID } from "../../utils"; +import { getFormCollectionByID, formatDates } from "../../utils"; import { setRepresentationCapacity, setRepresentationSubmit, } from "../../../store/currentView/action"; import { useDropzone } from "react-dropzone"; import { select } from "xpath"; +import jsonpath from "jsonpath"; import Enforcement_Questionnaire from "./representationQuestionnaires/representationLPAQuestionnaire_enforcement"; import S78_Qquestionnaire from "./representationQuestionnaires/representationLPAQuestionnaire_s78"; @@ -52,6 +53,14 @@ let RepLPA = (props) => { console.log("curr"); switch (currentView.caseReference.appealType) { case 846040000: + case 846040001: + case 846040006: + case 846040025: + case 846040004: + case 846040018: + case 846040003: + case 846040009: + case 846040008: return ( { break; case 846040005: + case 846040006: + case 846040007: return ( { } }; + let setCaseDetailsObj = router.query.hasOwnProperty("state") + ? router.query.state == "edit" + ? props.props.myRepresentations.myRepresentations + : props.props.searchResultsObj.searchDetailsObj + : props.props.searchResultsObj.searchDetailsObj; + + var detailsObj = {}; + + detailsObj = jsonpath.query( + setCaseDetailsObj, + '$..[?(@.pinswg_name=="' + + currentView.caseReference.currentReference + + '")]' + ); + + let setCaseResultssObj = router.query.hasOwnProperty("state") + ? router.query.state == "edit" + ? props.props.myRepresentations.myRepresentations + : props.props.searchResultsObj.searchResultsObj + : props.props.searchResultsObj.searchResultsObj; + + detailsObj = detailsObj[0]; + + var resultsObj = {}; + + resultsObj = jsonpath.query( + setCaseResultssObj, + '$..[?(@.pinswg_name=="' + + currentView.caseReference.currentReference + + '")]' + ); + resultsObj = resultsObj[0]; + + //console.log(resultsObj, detailsObj); + return ( -
-
-
-

- Representation from an LPA for a{" "} - { - getFormCollectionByID( - currentView.caseReference.appealType - ).value - } -

+ <> +
+

+ Representation from an LPA for a{" "} + { + getFormCollectionByID( + currentView.caseReference.appealType + ).value + } +

-
- - -
+
+ +
- {/*
-
- -
-
*/} +
-
-
- {typeof props.representationType != "undefined" && - (props.representationType != "Questionnaire" ? ( - <> -

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

-
+
+ {typeof props.representationType != "undefined" && + (props.representationType != "Questionnaire" ? ( + <> +

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

+
+
-
- My comments are set out in: -
-
- -
-
-
- {" "} -
- -
-
- - ) : ( - whichQuestionnaire() - // <> - //
- //

- // Appeal procedure and site visit{" "} - //

- //
- // - // {(procedureTypeValue == "Hearing" || - // procedureTypeValue == - // "Inquiry") && ( - // - // )} - - // - - //
- // - //
- //
- // - //
- //
- // - //
- - //
- // - //
- //
- //
- //
- //

- // Supporting documents{" "} - //

- //
- // - //
- //
- // - //
- //
- // - //
- // - //
- - //
- //

- // Statutory considerations - //

- // - - //
- // - //
- //
- // - //
- //
- // - //
- //
- // - //
- //
- // - //
- //
- // - //
- // - //
- // - //
- //
- //
- //

- // Suggested conditions - //

- //
- // 24. Review the following standard - // conditions and advise whether they - // would be necessary if - // permission/consent is granted (not - // applicable to Advertisement consent - // proposals): - //
- - // - - //
- // - //
- // - // - - //
- // - //
- //
- //
- //

- // Before sending, have you attached or - // provided a web link to: - //

- - //
- // - //
- //
- // - //
- //
- // - //
- //
- // - //
- //
- // - //
- //
- // - //
- //
- // - //
- //
- // - //
- //
- //
- //

- // Declaration - //

- //
- // - //
- - //
- // {onBehalfOfLPA} seww - // - //
- // - //
- - //
- // {" "} - //
- // - //
- //
- // - ))} -
{" "} -
- +
-
+ ); }; diff --git a/components/case/representation/representationLPACapacitySelection.js b/components/case/representation/representationLPACapacitySelection.js index a3e88cf4..d18b8e08 100644 --- a/components/case/representation/representationLPACapacitySelection.js +++ b/components/case/representation/representationLPACapacitySelection.js @@ -53,7 +53,7 @@ let RepLPACapacitySelection = (props) => { props={props.props} />{" "}
-
+
{/*

Your details - {props.firstValue} diff --git a/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_s78.js b/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_s78.js index 1624bfb3..89aa54dd 100644 --- a/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_s78.js +++ b/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_s78.js @@ -78,6 +78,8 @@ let S78_Questionnaire = (props) => { ); resultsObj = resultsObj[0]; + console.log(resultsObj); + return ( <> {props.representationTypeValue} diff --git a/components/case/summary.js b/components/case/summary.js index 1e509aea..a965a1a5 100644 --- a/components/case/summary.js +++ b/components/case/summary.js @@ -415,10 +415,9 @@ const CaseSummary = (props) => {
{_.has(detailsObj, "pinswg_startdate") && - hasEndDate && showReps( detailsObj.pinswg_startdate, - detailsObj.pinswg_representation_period_end_date + detailsObj.pinswg_finalcommentsduedate ) && ( <> {
{_.has(detailsObj, "pinswg_startdate") && - hasEndDate && showRepsEnded( detailsObj.pinswg_startdate, - detailsObj.pinswg_representation_period_end_date + detailsObj.pinswg_finalcommentsduedate ) && (
{t( @@ -564,7 +562,7 @@ const CaseSummary = (props) => { )} {formatDates( - detailsObj.pinswg_representation_period_end_date + detailsObj.pinswg_finalcommentsduedate )}
)} @@ -1030,7 +1028,6 @@ const CaseSummary = (props) => { date = new Date(date.toDateString()); const start = new Date(startDate); const end = new Date(endDate); - return date > start && date > end ? true : false; }