From 062d8e8cb5870ed181e66ceca19e7bab92f647da Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Tue, 1 Oct 2024 13:51:36 +0100 Subject: [PATCH 1/2] apply GEL to reps --- components/breadcrumbs.js | 40 ++++++- components/case/representation/index.js | 8 +- .../representation/representationAgent.js | 48 +++++++- .../representation/representationAppellant.js | 44 ++++++- .../representationCapacitySelection.js | 4 +- .../representation/representationElements.js | 54 ++++----- .../representationInterestedPartyPerson.js | 53 ++++++++- .../case/representation/representationLPA.js | 96 ++++++++++++++- .../representationLPACapacitySelection.js | 2 +- ...resentationLPAQuestionnaire_enforcement.js | 112 +++++++++++++----- .../representationLPAQuestionnaire_s78.js | 80 +++++++++---- components/myportal/servicebanner.js | 8 +- locales/cy/myrepresentations.json | 5 +- locales/en/myrepresentations.json | 5 +- styles/sass/welshgov/_application.scss | 28 ++++- 15 files changed, 484 insertions(+), 103 deletions(-) diff --git a/components/breadcrumbs.js b/components/breadcrumbs.js index 1f5fc375..eaa80736 100644 --- a/components/breadcrumbs.js +++ b/components/breadcrumbs.js @@ -7,11 +7,20 @@ import { connect } from "react-redux"; import { useSession } from "next-auth/react"; import { setCurrentView } from "../store/currentView/action"; +import { Field, change, reduxForm } from "redux-form"; import { setCurrentSection } from "../store/appealType/action"; - +import { + setRepresentationCapacity, + setRepresentationSubmit, +} from "../store/currentView/action"; const Breadcrumbs = (props) => { - const { currentView, setCurrentView, setCurrentSection } = props; + const { + currentView, + setCurrentView, + setCurrentSection, + setRepresentationCapacity, + } = props; const router = useRouter(); let { t } = useTranslation(); @@ -28,7 +37,8 @@ const Breadcrumbs = (props) => {
    {router.pathname != "/myportal/[appealtypes]" && router.pathname != "/newappeal" && - router.pathname != "/newappeal/[appealtypes]" && ( + router.pathname != "/newappeal/[appealtypes]" && + router.pathname != "/myportal/representation" && (
  1. { )} {router.pathname == "/myportal/representation" && ( <> - {session != null && ( + {/* {session != null && (
  2. { props.props.currentView.caseReference .currentReference } +
  3. */} +
  4. + { + setRepresentationCapacity(); + props.updateField( + "representationForm", + "representationType", + "" + ); + }} + > + {t("common:back-link")} +
  5. )} @@ -1006,6 +1032,12 @@ const mapStateToProps = (state) => { const mapDispatchToProps = (dispatch) => { return { + updateField: (form, field, newValue) => + dispatch(change(form, field, newValue)), + setRepresentationCapacity: (representationCapacity) => { + //dispatch(reset("representationForm")); + dispatch(setRepresentationCapacity(representationCapacity)); + }, setCurrentView: (currentView) => { dispatch(setCurrentView(currentView)); }, diff --git a/components/case/representation/index.js b/components/case/representation/index.js index 7bf869e7..7407c45c 100644 --- a/components/case/representation/index.js +++ b/components/case/representation/index.js @@ -1004,9 +1004,10 @@ let MakeRepresentation = (props) => { {currentView.caseReference.caseReference}
    -
    +
    {whichControl()}
    +
    {" "}
    @@ -1073,7 +1074,7 @@ let MakeRepresentation = (props) => {
    {" "} - {typeof props.props.currentView + {/* {typeof props.props.currentView .representationCapacity != "undefined" && props.props.currentView @@ -1134,8 +1135,9 @@ let MakeRepresentation = (props) => { )} )} + ee
    - )} + )} */}
    {formObj.hasOwnProperty( "representationForm" diff --git a/components/case/representation/representationAgent.js b/components/case/representation/representationAgent.js index a84f756b..dd06600f 100644 --- a/components/case/representation/representationAgent.js +++ b/components/case/representation/representationAgent.js @@ -2,6 +2,8 @@ import useTranslation from "next-translate/useTranslation"; import { useRouter } from "next/router"; import { connect } from "react-redux"; import { Field, change, reduxForm } from "redux-form"; +import { useState } from "react"; + import { bytesToSize, getThumbnailIconByExtension } from "../../utils"; import { FileUploadField, @@ -26,6 +28,8 @@ const RepAgent = (props) => { setRepFileName, } = props; const { acceptedFiles, getRootProps, getInputProps } = useDropzone(); + const [savingStatus, setSavingStatus] = useState(false); + setRepFileName(formObj.representationForm.values); const files = acceptedFiles.map((file) => ( @@ -98,7 +102,9 @@ const RepAgent = (props) => { options={["Yes", "No"]} id="representationOnBehalfOf" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderCondtionalRadioList} validate={[required]} legend={ @@ -211,7 +217,7 @@ const RepAgent = (props) => { > {t("common:continue-button")} - {router.query.state != "edit" && ( + {/* {router.query.state != "edit" && ( { setRepresentationCapacity(); @@ -225,6 +231,44 @@ const RepAgent = (props) => { > {t("common:back-link")} + )} */} + {savingStatus ? ( + + {router.locale == "cy" + ? "Nôl data" + : "Saving data"} + { + + ) : ( + )}
    diff --git a/components/case/representation/representationAppellant.js b/components/case/representation/representationAppellant.js index 7f93a23e..21d0033a 100644 --- a/components/case/representation/representationAppellant.js +++ b/components/case/representation/representationAppellant.js @@ -3,6 +3,7 @@ import { useRouter } from "next/router"; import React from "react"; import { connect } from "react-redux"; import { Field, change, reduxForm } from "redux-form"; +import { useState } from "react"; import { bytesToSize, getThumbnailIconByExtension } from "../../utils"; import { @@ -31,6 +32,7 @@ const RepAppellant = (props) => { setRepFileName, } = props; const { acceptedFiles, getRootProps, getInputProps } = useDropzone(); + const [savingStatus, setSavingStatus] = useState(false); setRepFileName(formObj.representationForm.values); @@ -53,7 +55,6 @@ const RepAppellant = (props) => { > {t("myrepresentations:kind-of-rep-label")} - { > {t("common:continue-button")} - {router.query.state != "edit" && ( + {/* {router.query.state != "edit" && ( { setRepresentationCapacity(); @@ -207,6 +208,45 @@ const RepAppellant = (props) => { > {t("common:back-link")} + )} */} + + {savingStatus ? ( + + {router.locale == "cy" + ? "Nôl data" + : "Saving data"} + { + + ) : ( + )} diff --git a/components/case/representation/representationCapacitySelection.js b/components/case/representation/representationCapacitySelection.js index aa843568..1e396958 100644 --- a/components/case/representation/representationCapacitySelection.js +++ b/components/case/representation/representationCapacitySelection.js @@ -56,7 +56,9 @@ let RepCapacitySelection = (props) => { options={capacityOptionsArr} id="representationCapacity" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderRadioListWithText} validate={[required]} /> diff --git a/components/case/representation/representationElements.js b/components/case/representation/representationElements.js index a415f182..0cc34aa2 100644 --- a/components/case/representation/representationElements.js +++ b/components/case/representation/representationElements.js @@ -155,7 +155,7 @@ export const RenderRadioListWithText = ({ className={ custom.inline == true ? "govuk-radios govuk-radios--inline govuk-radios--small " - : "govuk-radios govuk-radios--small govuk-grid-column-full" + : "govuk-radios govuk-radios--small govuk-grid-column-full conditionalText" } > {Object.keys(options).map((key, index) => ( @@ -164,39 +164,28 @@ export const RenderRadioListWithText = ({ data-children-count={key} key={key} > - - - +
    + + +
    {value === options[key] && (
    - {
    {t( - "newappeal:new-appeal-fileupload-drop-label" + "myrepresentations:fileupload-drop-label" )}
    ( {t( - "newappeal:new-appeal-fileupload-file-list-label" + "myrepresentations:fileupload-file-list-label" )} ) diff --git a/components/case/representation/representationInterestedPartyPerson.js b/components/case/representation/representationInterestedPartyPerson.js index 0d556c9f..373282a1 100644 --- a/components/case/representation/representationInterestedPartyPerson.js +++ b/components/case/representation/representationInterestedPartyPerson.js @@ -3,6 +3,8 @@ import { useRouter } from "next/router"; import { useDropzone } from "react-dropzone"; import { connect } from "react-redux"; import { Field, change, reduxForm } from "redux-form"; +import { useState } from "react"; + import { FileUploadField, RenderCondtionalRadioList, @@ -25,6 +27,7 @@ const RepInterestedPartyPerson = (props) => { const required = (value) => (value ? undefined : "Required"); const { acceptedFiles, getRootProps, getInputProps } = useDropzone(); + const [savingStatus, setSavingStatus] = useState(false); setRepFileName(formObj.representationForm.values); @@ -60,7 +63,9 @@ const RepInterestedPartyPerson = (props) => { datafieldname="representationType" validate={[required]} optionsArr={interestedPersonRepresentationArr} - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} /> ) : ( @@ -98,7 +103,9 @@ const RepInterestedPartyPerson = (props) => { options={["Yes", "No"]} id="representationOnBehalfOf" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderCondtionalRadioList} validate={[required]} legend={ @@ -172,7 +179,7 @@ const RepInterestedPartyPerson = (props) => { > {t("common:continue-button")} - + {/* { setRepresentationCapacity(); @@ -190,7 +197,45 @@ const RepInterestedPartyPerson = (props) => { className="govuk-link" > {t("case:summary-back-button-label")} - + */} + {savingStatus ? ( + + {router.locale == "cy" + ? "Nôl data" + : "Saving data"} + { + + ) : ( + + )}
    )} diff --git a/components/case/representation/representationLPA.js b/components/case/representation/representationLPA.js index cd015ea1..fc4323b9 100644 --- a/components/case/representation/representationLPA.js +++ b/components/case/representation/representationLPA.js @@ -5,6 +5,8 @@ import { useRouter } from "next/router"; import { useDropzone } from "react-dropzone"; import { connect } from "react-redux"; import { Field, change, formValueSelector, reduxForm } from "redux-form"; +import { useState } from "react"; + import { FileUploadField, RenderMultiline, @@ -38,6 +40,8 @@ let RepLPA = (props) => { updateRepresentation, } = props; const { acceptedFiles, getRootProps, getInputProps } = useDropzone(); + const [savingStatus, setSavingStatus] = useState(false); + const files = acceptedFiles.map((file) => (
  6. {file.path} - {file.size} bytes @@ -405,6 +409,51 @@ let RepLPA = (props) => { Back )} + + {savingStatus ? ( + + {router.locale == "cy" + ? "Nôl data" + : "Saving data"} + { + + ) : ( + + )} )}{" "} {(typeof props.representationType != "undefined" || @@ -418,7 +467,7 @@ let RepLPA = (props) => { > {t("common:continue-button")} - {router.query.state != "edit" && ( + {/* {router.query.state != "edit" && ( { //setRepresentationCapacity(); @@ -430,8 +479,51 @@ let RepLPA = (props) => { }} className="govuk-link" > - {t("common:back-link")} + {t("common:back-link")}www + )} */} + {savingStatus ? ( + + {router.locale == "cy" + ? "Nôl data" + : "Saving data"} + { + + ) : ( + )} )} diff --git a/components/case/representation/representationLPACapacitySelection.js b/components/case/representation/representationLPACapacitySelection.js index d5bd531a..bfc2260e 100644 --- a/components/case/representation/representationLPACapacitySelection.js +++ b/components/case/representation/representationLPACapacitySelection.js @@ -54,7 +54,7 @@ let RepLPACapacitySelection = (props) => { id="representationCapacity" //className="govuk-radios__input " errorMsg={t( - "newappeal:select-an-option-label" + "myrepresentations:select-an-option-label" )} component="input" validate={[required]} diff --git a/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_enforcement.js b/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_enforcement.js index c26214b3..344ef934 100644 --- a/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_enforcement.js +++ b/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_enforcement.js @@ -176,7 +176,9 @@ let Enforcement_Questionnaire = (props) => { ]} id="enterNeighbouringLandToViewSite" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={ @@ -203,7 +205,9 @@ let Enforcement_Questionnaire = (props) => { ]} id="enterNeighbouringLandAccessRequired" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={ @@ -230,7 +234,9 @@ let Enforcement_Questionnaire = (props) => { ]} id="healthAndSafetyIssues" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={ @@ -305,7 +311,9 @@ let Enforcement_Questionnaire = (props) => { ]} id="feeExempt" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={ @@ -340,7 +348,9 @@ let Enforcement_Questionnaire = (props) => { ]} id="previousGrantedCerts" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={ @@ -365,7 +375,9 @@ let Enforcement_Questionnaire = (props) => { ]} id="stopNoticeServed" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={ @@ -390,7 +402,9 @@ let Enforcement_Questionnaire = (props) => { ]} id="relatedCases" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={ @@ -415,7 +429,9 @@ let Enforcement_Questionnaire = (props) => { ]} id="previousEnforcement" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={ @@ -440,7 +456,9 @@ let Enforcement_Questionnaire = (props) => { ]} id="subjectArticle4" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={ @@ -465,7 +483,9 @@ let Enforcement_Questionnaire = (props) => { ]} id="previousPDRRestriction" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={ @@ -584,7 +604,9 @@ let Enforcement_Questionnaire = (props) => { ]} id="ROW" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={ @@ -609,7 +631,9 @@ let Enforcement_Questionnaire = (props) => { ]} id="conservationArea" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={ @@ -634,7 +658,9 @@ let Enforcement_Questionnaire = (props) => { ]} id="affectListedBuilding" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={ @@ -659,7 +685,9 @@ let Enforcement_Questionnaire = (props) => { ]} id="TPO" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={ @@ -684,7 +712,9 @@ let Enforcement_Questionnaire = (props) => { ]} id="natureConservationSite" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={ @@ -709,7 +739,9 @@ let Enforcement_Questionnaire = (props) => { ]} id="protectedSpecies" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={ @@ -753,7 +785,9 @@ let Enforcement_Questionnaire = (props) => { ]} id="floodingIssue" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={ @@ -778,7 +812,9 @@ let Enforcement_Questionnaire = (props) => { ]} id="governmentDepartmentComments" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={ @@ -817,7 +853,9 @@ let Enforcement_Questionnaire = (props) => { ]} id="developmentCarriedOutInAccordance" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={t( @@ -870,7 +908,9 @@ let Enforcement_Questionnaire = (props) => { ]} id="developmentAnyOtherConditions" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={ @@ -906,7 +946,9 @@ let Enforcement_Questionnaire = (props) => { ]} id="copyOfEnforcementNotice" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={ @@ -931,7 +973,9 @@ let Enforcement_Questionnaire = (props) => { ]} id="enforcementNoticePlan" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={ @@ -956,7 +1000,9 @@ let Enforcement_Questionnaire = (props) => { ]} id="listOfNotifiedOfEnforcement" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={ @@ -981,7 +1027,9 @@ let Enforcement_Questionnaire = (props) => { ]} id="copyOfLetterOfAppealNotification" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={ @@ -1006,7 +1054,9 @@ let Enforcement_Questionnaire = (props) => { ]} id="lpaEIAOS" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={ @@ -1031,7 +1081,9 @@ let Enforcement_Questionnaire = (props) => { ]} id="detailsOfOtherAppeals" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={ @@ -1056,7 +1108,9 @@ let Enforcement_Questionnaire = (props) => { ]} id="detailsOfPreviousAppeals" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={ @@ -1081,7 +1135,9 @@ let Enforcement_Questionnaire = (props) => { ]} id="otherRelevantInformation" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={ diff --git a/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_s78.js b/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_s78.js index fe2af58d..fc82c2d0 100644 --- a/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_s78.js +++ b/components/case/representation/representationQuestionnaires/representationLPAQuestionnaire_s78.js @@ -209,7 +209,9 @@ let S78_Questionnaire = (props) => { ]} id="enterNeighbouringLandToViewSite" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={ @@ -236,7 +238,9 @@ let S78_Questionnaire = (props) => { ]} id="enterNeighbouringLandAccessRequired" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={ @@ -263,7 +267,9 @@ let S78_Questionnaire = (props) => { ]} id="healthAndSafetyIssues" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={ @@ -427,7 +433,9 @@ let S78_Questionnaire = (props) => { ]} id="ROW" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={ @@ -452,7 +460,9 @@ let S78_Questionnaire = (props) => { ]} id="conservationArea" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={ @@ -477,7 +487,9 @@ let S78_Questionnaire = (props) => { ]} id="affectListedBuilding" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={ @@ -502,7 +514,9 @@ let S78_Questionnaire = (props) => { ]} id="TPO" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={ @@ -527,7 +541,9 @@ let S78_Questionnaire = (props) => { ]} id="natureConservationSite" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={ @@ -552,7 +568,9 @@ let S78_Questionnaire = (props) => { ]} id="protectedSpecies" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={ @@ -594,7 +612,9 @@ let S78_Questionnaire = (props) => { ]} id="governmentDepartmentComments" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={ @@ -650,7 +670,9 @@ let S78_Questionnaire = (props) => { ]} id="developmentCarriedOutInAccordance" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={t( @@ -705,7 +727,9 @@ let S78_Questionnaire = (props) => { ]} id="developmentAnyOtherConditions" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={ @@ -741,7 +765,9 @@ let S78_Questionnaire = (props) => { ]} id="copyOfApplicantsCertificate" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={t( @@ -765,7 +791,9 @@ let S78_Questionnaire = (props) => { ]} id="advertismentGiven" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={t( @@ -789,7 +817,9 @@ let S78_Questionnaire = (props) => { ]} id="copyOfLetterOfAppealNotification" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={t( @@ -813,7 +843,9 @@ let S78_Questionnaire = (props) => { ]} id="lpaEIAOS" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={t( @@ -837,7 +869,9 @@ let S78_Questionnaire = (props) => { ]} id="advertismentConsentDiscontinuanceNotice" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={t( @@ -861,7 +895,9 @@ let S78_Questionnaire = (props) => { ]} id="detailsOfOtherAppeals" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={t( @@ -885,7 +921,9 @@ let S78_Questionnaire = (props) => { ]} id="detailsOfPreviousAppeals" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={t( @@ -909,7 +947,9 @@ let S78_Questionnaire = (props) => { ]} id="otherRelevantInformation" className="govuk-radios__input" - errorMsg={t("newappeal:select-an-option-label")} + errorMsg={t( + "myrepresentations:select-an-option-label" + )} component={RenderLPACondtionalRadioList} validate={[required]} legend={t( diff --git a/components/myportal/servicebanner.js b/components/myportal/servicebanner.js index 5ea5967e..7f411afd 100644 --- a/components/myportal/servicebanner.js +++ b/components/myportal/servicebanner.js @@ -22,9 +22,10 @@ const ServiceBanner = (props) => { console.info("////////////\n" + "logout" + "\n////////////"); window.localStorage.clear(), destroyCookie(null, "next-auth.csrf-token"), - destroyCookie(null, "next-auth.callback-url"), - destroyCookie(null, "pedw_locale"), - destroyCookie(null, "pinsUser"), + { path: "/" }, + destroyCookie(null, "next-auth.callback-url", { path: "/" }), + destroyCookie(null, "pedw_locale", { path: "/" }), + destroyCookie(null, "pinsUser", { path: "/" }), signOut({ callbackUrl: "/logout" }); }; @@ -32,6 +33,7 @@ const ServiceBanner = (props) => { "/myportal/[appealtypes]", "/newappeal", "/newappeal/[appealtypes]", + "/myportal/representation", ]; return (
    diff --git a/locales/cy/myrepresentations.json b/locales/cy/myrepresentations.json index 368b8a66..dce3288f 100644 --- a/locales/cy/myrepresentations.json +++ b/locales/cy/myrepresentations.json @@ -19,6 +19,8 @@ "publish-policy-label": "Sylwch y gall yr holl sylwadau gael eu cyhoeddi yn unol â'n Polisi Cyhoeddi. Os bydd eich sylw yn cynnwys unrhyw wybodaeth sensitif neu wybodaeth a allai fod yn ddifenwol, efallai y caiff ei olygu cyn ei gyhoeddi. Os yw'n cynnwys cynnwys hiliol, enllibus neu sarhaus caiff ei ddychwelyd atoch a gofynnir i chi ddarparu fersiwn ddiwygiedig.", "questionnaire-publish-policy-label": "Sylwch y gall holl ddogfennau holiadur gael eu cyhoeddi yn unol â'n Polisi Cyhoeddi. Os bydd eich holiadur yn cynnwys unrhyw wybodaeth sensitif neu wybodaeth a allai fod yn ddifenwol, efallai y caiff ei olygu cyn ei gyhoeddi", "add-files-label": "Ychwanegwch eich ffeiliau", + "fileupload-drop-label": "Llusgwch a gollwng eich ffeiliau yma.", + "fileupload-file-list-label": "Dim ond ffeiliau .pdf, .doc, .docx, .tif, .tiff, .jpeg, .jpg neu .zip a dderbynnir", "capacity-para-one": "Mae'r ffurflen hon yn eich galluogi i gyflwyno sylwadau ar achos i Benderfyniadau Cynllunio ac Amgylchedd Cymru.", "capacity-para-two": "Sylwch fod angen gwneud sylwadau gan bartïon â diddordeb o fewn yr amserlen. Mae hwn i'w weld ar y \"Crynodeb Achos\" tudalen. Gall sylwadau a gyflwynir ar ôl y dyddiad hwn gael eu hystyried yn annilys.", "capacity-select-your-details": "Eich manylion", @@ -215,5 +217,6 @@ "statement-date-label": "Dyddiad", "statement-onbehalf-label": "Ar ran", "final-comments-label": "Sylwadau terfynol", - "representation-type": "Math o gynrychiolaeth" + "representation-type": "Math o gynrychiolaeth", + "select-an-option-label": "Dewiswch opsiwn" } \ No newline at end of file diff --git a/locales/en/myrepresentations.json b/locales/en/myrepresentations.json index fb4a88f2..e1c9005c 100644 --- a/locales/en/myrepresentations.json +++ b/locales/en/myrepresentations.json @@ -19,6 +19,8 @@ "publish-policy-label": "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.", "questionnaire-publish-policy-label": "Please note that all questionnaire documents may be published in line with our Publishing Policy. Should your questionnaire include any sensitive information or potentially defamatory information, it may be redacted before publishing", "add-files-label": "Add your files", + "fileupload-drop-label": "Drag and drop your files here.", + "fileupload-file-list-label": "Only .pdf, .doc, .docx, .tif, .tiff, .jpeg, .jpg or .zip files will be accepted", "capacity-para-one": "This form enables you to submit comments on a case to Planning and Environment Decisions Wales.", "capacity-para-two": "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.", "capacity-select-your-details": "Your details", @@ -216,5 +218,6 @@ "statement-date-label": "Date", "statement-onbehalf-label": "On behalf of", "final-comments-label": "Final comments", - "representation-type": "Representation type" + "representation-type": "Representation type", + "select-an-option-label": "Select an option" } \ No newline at end of file diff --git a/styles/sass/welshgov/_application.scss b/styles/sass/welshgov/_application.scss index 3b70119c..e550726b 100644 --- a/styles/sass/welshgov/_application.scss +++ b/styles/sass/welshgov/_application.scss @@ -415,6 +415,21 @@ a.longLinkBreak { padding-left: 0px !important; } + .conditionalElement { + display: flex; + } + + .conditionalText { + .govuk-radios__item.govuk-grid-column-full { + display: flex; + flex-direction: column; + } + + .govuk-label { + padding-left: 0px; + } + } + .govuk-radios--small .govuk-radios__item:hover .govuk-radios__input:not(:disabled)+.govuk-radios__label:before { box-shadow: 0 0 0 5px $lightgrey; } @@ -434,8 +449,9 @@ a.longLinkBreak { label { margin-top: 0px; - background-color: $lightgrey_semi; + // background-color: $lightgrey_semi; padding: 20px 20px 20px 50px; + width: 100%; &:before { top: 18px; @@ -470,6 +486,16 @@ a.longLinkBreak { } } +#rep-form .wgForm { + margin-left: 0; + + @media screen and (max-width: 900px) { + width: 100%; + } + + width:75% +} + .newAppealForm { background: $lightgrey_offwhite; padding: 20px; From 9509971ffd45acfe260b7285fea14968cef9decd Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Tue, 1 Oct 2024 13:51:54 +0100 Subject: [PATCH 2/2] Advanced search error --- .env.local | 44 +++++++------------ pages/api/endpoint/getadvancedsearch_api.js | 5 ++- .../endpoint/getadvancedsearchpaged_api.js | 6 +-- 3 files changed, 21 insertions(+), 34 deletions(-) diff --git a/.env.local b/.env.local index 482406d2..10bb2a17 100644 --- a/.env.local +++ b/.env.local @@ -26,6 +26,13 @@ RELAYPATH = "ar-hc-lz-pedw-cnr-uks-01" //RELAYURI = "test-pedw-ns.servicebus.windows.net" //RELAYPATH = "test-pedw-hc" +//New Test +CLIENT_ID = d40b9373-96c2-4b04-8bd8-c2a2fe6444c1 +CLIENT_SECRET = 6hT8Q~glL~jloWpGmvXw3UY37QFwjUE0r._jobEM +RELAY_ROOT = https://ar-ns-lz-pedw-test-uks-01.servicebus.windows.net/ar-hc-lz-pedw-test-uks-01/ +RELAYURI = "ar-ns-lz-pedw-test-uks-01.servicebus.windows.net" +RELAYPATH = "ar-hc-lz-pedw-test-uks-01" + //Preprod Oauth WGO //CLIENT_ID = ab6c4678-b31a-4eb3-b429-e039120e488a @@ -92,9 +99,9 @@ AZURE_TENANT_ID = $TENANT AZURE_CLIENT_SECRET = $CLIENT_SECRET // CNR key -AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwcnruks" -AZURE_STORAGE_ACCOUNT_KEY = hRffHq4IwctpaTKdS/U33Xq6nyTDF1t++WJgIwsw7gzstktZin/rRwbTIAL9KKqesVsK7EHrTTG6+ASt4+7skw== -AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwcnruks.blob.core.windows.net +# AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwcnruks" +# AZURE_STORAGE_ACCOUNT_KEY = hRffHq4IwctpaTKdS/U33Xq6nyTDF1t++WJgIwsw7gzstktZin/rRwbTIAL9KKqesVsK7EHrTTG6+ASt4+7skw== +# AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwcnruks.blob.core.windows.net // dev key @@ -108,6 +115,11 @@ AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwcnruks.blob.core.windows.net //AZURE_STORAGE_ACCOUNT_KEY = iEQKwh4TB9BT63pU5a6+ivn6ItiDkuIkYCrUwjm9STJTdMBOKWUT06EEcP8pcy/qeQ89ogK75mFQ+AStT53G/g== //AZURE_PEDW_STORAGE_ENDPOINT = https://pedwtest.blob.core.windows.net +// New test key +AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwtestuks" +AZURE_STORAGE_ACCOUNT_KEY = bqJAz5pYQVGee8dnVhlsqW+xHwinNTjgY2AmojNyB+d4uAotMR20WcO4Op13yB+9dFaXAkkjtIA4+AStHT/IYg== +AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwtestuks.blob.core.windows.net + // preprod key //AZURE_STORAGE_ACCOUNT_NAME = "pedwpp" @@ -126,33 +138,7 @@ AZURE_PEDW_QUEUE_ENDPOINT = https://$AZURE_STORAGE_ACCOUNT_NAME.queue.core.windo //gov.notify NOTIFY_API_KEY = pedwnextauthkey-90f93710-9dae-423e-aea1-11eccd0dc132-0c9469d9-d671-444d-9e9d-3e5a62001043 - - -# //Bastion access to vnet vms -# [13:56] Suter, Matthew (COOG - DDAT - IT Services) -# Login is PEDWAdmin -# [13:57] Suter, Matthew (COOG - DDAT - IT Services) -# Pwd is -PK2_NQ-HuD2AFp - - -# [13:41] Suter, Matthew (COOG - DDAT - IT Services) -# so the admin login is PEDWSqlAdminPP -# [13:41] Suter, Matthew (COOG - DDAT - IT Services) -# password is rvJDj4ekfGSgwQpWTA38tDVJvFfSMbvmNGxd3YcII0M= - - - -# @Microsoft.KeyVault(SecretUri=https://test-pedw-kv.vault.azure.net/secrets/PEDW-FrontEnd-Test-AppReg-Secrate/) - - -# [12:24] Thompson, Phil (COOG - Planning & Environment Decisions Wales) -# {"pinswg_name":"48181 Planning Appeal E PROOF8.pdf","pinswg_DocumentIds@odata.bind":"/incidents(6CD13EF8-5BC9-ED11-A997-00224800E98C)","pinswg_isharedocumentlocations":"846040009","pinswg_isharedocumentclassification":"846040000","pinswg_uploadurl":"https://pedwinternalprod.blob.core.windows.net/crm-file-upload/6CD13EF8-5BC9-ED11-A997-00224800E98C/48181 Planning Appeal E PROOF8.pdf"} -# [12:25] Thompson, Phil (COOG - Planning & Environment Decisions Wales) -# https://crm2016.llc.gov.wales/PEDW/api/data/v8.2/pinswg_documents - -# DATABASE_URL='sqlserver://pp-pedw-sql.database.windows.net:1433;database=PEDWPreProd;user=pp-pedw-ukw;password=jscw4+896w9YaiXruOA3mtpNkio1oUZxBZcFJ9Awdz4=;encrypt=true;trustservercertificate=false;hostnameincertificate=*.database.windows.net;logintimeout=30;authentication=SqlPassword' - SHOW_DEBUG = true diff --git a/pages/api/endpoint/getadvancedsearch_api.js b/pages/api/endpoint/getadvancedsearch_api.js index 67cd2263..ec6594e9 100644 --- a/pages/api/endpoint/getadvancedsearch_api.js +++ b/pages/api/endpoint/getadvancedsearch_api.js @@ -54,6 +54,8 @@ export default async function ApiProxy(req, res) { var queryString = ""; + searchString.q = searchString.q.replace(/\'/g, "''"); + queryString += _.has(searchString, "q") && searchString.q != null ? "(contains(title, '" + @@ -79,10 +81,9 @@ export default async function ApiProxy(req, res) { : ""; //console.log(queryString); - queryString = queryString.replace(/\'/g, "''"); var queryUrl = - "incidents?$select=modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference&$expand=primarycontactid($select=fullname)&$filter=" + + "incidents?$select=modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title,_primarycontactid_value,pinswg_lpareference&$expand=primarycontactid($select=fullname)&$filter=" + queryString + " pinswg_appealcasetype ne null and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true"; diff --git a/pages/api/endpoint/getadvancedsearchpaged_api.js b/pages/api/endpoint/getadvancedsearchpaged_api.js index 0a7fc956..3a3c293d 100644 --- a/pages/api/endpoint/getadvancedsearchpaged_api.js +++ b/pages/api/endpoint/getadvancedsearchpaged_api.js @@ -89,6 +89,8 @@ export default async function ApiProxy(req, res) { var queryString = ""; + searchString.q = searchString.q.replace(/\'/g, "''"); + queryString += _.has(searchString, "q") && searchString.q != null ? "(contains(title, '" + @@ -113,10 +115,8 @@ export default async function ApiProxy(req, res) { ? " statuscode eq " + searchString.statuscode + " and" : ""; - queryString = queryString.replace(/\'/g, "''"); - var queryUrl = - "incidents?$select=modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference&$expand=primarycontactid($select=fullname)&$filter=" + + "incidents?$select=modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title,_primarycontactid_value,pinswg_lpareference&$expand=primarycontactid($select=fullname)&$filter=" + queryString + " pinswg_appealcasetype ne null and pinswg_publishtoweb eq true&$orderby=" + orderby +