diff --git a/components/case/representation/index.js b/components/case/representation/index.js index c45243c8..a2287144 100644 --- a/components/case/representation/index.js +++ b/components/case/representation/index.js @@ -72,6 +72,8 @@ let MakeRepresentation = (props) => { let setCaseQueryObj = props[currentType] || {}; var casesObj = {}; + const [showQuestionnaireSection, setShowQuestionnaireSection] = useState(1); + const isLPA = props.props.accountDetails.accountDetails[ "pinswg_typeofinvolvement@OData.Community.Display.V1.FormattedValue" @@ -231,6 +233,10 @@ let MakeRepresentation = (props) => { currentView={currentView} setSubmitBack={setSubmitBack} props={props} + setShowQuestionnaireSection={ + setShowQuestionnaireSection + } + showQuestionnaireSection={showQuestionnaireSection} /> ); break; @@ -621,7 +627,7 @@ let MakeRepresentation = (props) => {
{" "}
-
+

Timetable

@@ -670,333 +676,412 @@ let MakeRepresentation = (props) => { formObj["representationForm"].values .representationType == "Questionnaire" && ( - + +
  • = + 7 + ? " sectionComplete" + : " sectionIncomplete") + } + aria-current="step" + data-show="" + id="check-youre-allowed-to-drive" + > + +
  • + +
    + )}
    diff --git a/components/case/representation/representationLPA.js b/components/case/representation/representationLPA.js index 13fb9f36..76346ec9 100644 --- a/components/case/representation/representationLPA.js +++ b/components/case/representation/representationLPA.js @@ -22,7 +22,7 @@ import { import { useDropzone } from "react-dropzone"; import { select } from "xpath"; import jsonpath from "jsonpath"; - +import { useState } from "react"; import Enforcement_Questionnaire from "./representationQuestionnaires/representationLPAQuestionnaire_enforcement"; import S78_Qquestionnaire from "./representationQuestionnaires/representationLPAQuestionnaire_s78"; @@ -39,6 +39,8 @@ let RepLPA = (props) => { currentView, procedureTypeValue, onBehalfOfLPA, + setShowQuestionnaireSection, + showQuestionnaireSection, } = props; const { acceptedFiles, getRootProps, getInputProps } = useDropzone(); const files = acceptedFiles.map((file) => ( @@ -68,6 +70,10 @@ let RepLPA = (props) => { props.props.props.accountDetails.containerID } currentView={currentView} + showQuestionnaireSection={showQuestionnaireSection} + setShowQuestionnaireSection={ + setShowQuestionnaireSection + } /> ); break; @@ -82,6 +88,10 @@ let RepLPA = (props) => { props.props.props.accountDetails.containerID } currentView={currentView} + showQuestionnaireSection={showQuestionnaireSection} + setShowQuestionnaireSection={ + setShowQuestionnaireSection + } /> ); break; @@ -131,7 +141,10 @@ let RepLPA = (props) => { <>

    - Representation from an LPA for a{" "} + {typeof props.representationType != "undefined" + ? props.representationType + : "Representation"}{" "} + from an LPA for a{" "} { getFormCollectionByID( currentView.caseReference.appealType @@ -139,21 +152,23 @@ let RepLPA = (props) => { }

    -
    - - -
    + {typeof props.representationType == "undefined" && ( +
    + + +
    + )}
    @@ -219,14 +234,56 @@ let RepLPA = (props) => {
    - - {/* + {showQuestionnaireSection < 7 && ( + { + setShowQuestionnaireSection( + showQuestionnaireSection + 1 + ); + }} + className="govuk-button" + > + Next section + + )} + {showQuestionnaireSection == 7 && ( + + )} + {showQuestionnaireSection > 1 && ( + { + setShowQuestionnaireSection( + showQuestionnaireSection - 1 + ); + }} + className="govuk-link" + > + Back + + )} + + )}{" "} + {typeof props.representationType != "undefined" && + props.representationType != "Questionnaire" && ( + <> + + {/* { setRepresentationSubmit(false); @@ -235,15 +292,16 @@ let RepLPA = (props) => { > Continue */} - - { - //setRepresentationCapacity(); - }} - className="govuk-link" - > - Back - + { + //setRepresentationCapacity(); + }} + className="govuk-link" + > + Back + + + )}
    diff --git a/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_enforcement.js b/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_enforcement.js index bce13bb5..1bf4936e 100644 --- a/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_enforcement.js +++ b/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_enforcement.js @@ -861,7 +861,7 @@ let Enforcement_Questionnaire = (props) => {
    - {onBehalfOfLPA} seww + {onBehalfOfLPA} { currentView, procedureTypeValue, onBehalfOfLPA, + showQuestionnaireSection, } = props; const { acceptedFiles, getRootProps, getInputProps } = useDropzone(); const files = acceptedFiles.map((file) => ( @@ -72,7 +73,13 @@ let S78_Questionnaire = (props) => { resultsObj = jsonpath.query( setCaseResultssObj, - '$..[?(@.ticketnumber=="' + + "$..[?(@." + + (router.query.hasOwnProperty("state") + ? router.query.state == "edit" + ? "caseRef" + : "ticketnumber" + : "ticketnumber") + + '=="' + currentView.caseReference.currentReference + '")]' ); @@ -84,82 +91,236 @@ let S78_Questionnaire = (props) => { <> {props.representationTypeValue} {props.procedureTypeValue} - -
    -

    - Appeal procedure and site visit{" "} -

    -
    -
    - 1. PEDW Reference:{" "} - {currentView.caseReference.currentReference} + {showQuestionnaireSection == 1 && ( +
    +

    + Appeal procedure and site visit{" "} +

    +
    +
    + 1. PEDW Reference:{" "} + {currentView.caseReference.currentReference} +
    -
    -
    -
    - 2. LPA reference: {resultsObj.pinswg_lpareference} +
    +
    + 2. LPA reference: {resultsObj.pinswg_lpareference} +
    -
    -
    -
    - 4. Appeal type:{" "} - { - getFormCollectionByID( - currentView.caseReference.appealType - ).value - } +
    +
    + 4. Appeal type:{" "} + { + getFormCollectionByID( + currentView.caseReference.appealType + ).value + } +
    -
    -
    -
    - 3. Site Address:{" "} - {detailsObj.pinswg_siteaddressline1 + - " " + - detailsObj.pinswg_siteaddressline2 + - " " + - detailsObj.pinswg_siteaddresstown + - " " + - detailsObj.pinswg_siteaddresspostcode} +
    +
    + 3. Site Address:{" "} + {detailsObj.pinswg_siteaddressline1 + + " " + + detailsObj.pinswg_siteaddressline2 + + " " + + detailsObj.pinswg_siteaddresstown + + " " + + detailsObj.pinswg_siteaddresspostcode} +
    -
    -
    - - {(procedureTypeValue == "Hearing" || - procedureTypeValue == "Inquiry") && ( +
    + {(procedureTypeValue == "Hearing" || + procedureTypeValue == "Inquiry") && ( + + )} + + + +
    + +
    +
    + +
    +
    + +
    + +
    + +
    +
    +
    + )} + {showQuestionnaireSection == 2 && ( +
    +

    Supporting documents

    +
    + - )} - +
    +
    + +
    +
    + +
    +
    + )} + {showQuestionnaireSection == 3 && ( +
    +

    + Statutory considerations +

    + {
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    + +
    + +
    +
    + )} + {showQuestionnaireSection == 4 && ( +
    +

    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): +
    + + + +
    + +
    + + + +
    + +
    +
    + )} + {showQuestionnaireSection == 5 && ( +
    +

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

    + +
    +
    +
    +
    + +
    +
    +
    -
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + )} + {showQuestionnaireSection == 6 && ( +
    + {" "} +
    + +
    +
    + )} + {showQuestionnaireSection == 7 && ( +
    +

    Declaration

    +
    +
    -
    - -
    -

    Supporting documents

    -
    - -
    -
    - -
    -
    - -
    - -
    -
    -

    Statutory considerations

    - - -
    +
    + {onBehalfOfLPA} + +
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    - -
    - -
    -
    -
    -

    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/pages/myportal/representation.js b/pages/myportal/representation.js index 9c132f17..08d19508 100644 --- a/pages/myportal/representation.js +++ b/pages/myportal/representation.js @@ -69,13 +69,6 @@ const Home = (props) => { if (status === "loading") { return ; } - // console.log("unauthenticated path:", router.asPath); - // if (status === "unauthenticated") { - // console.log("unauthenticated path:", router.asPath); - // signIn("email", { callbackUrl: router.asPath }); - // //router.push("/auth/signin"); - // return ; - // } return (