Merged PR 1420: PII-UAT 070225

Related work items: #12956
This commit is contained in:
Robert Bond
2025-02-11 12:36:30 +00:00
22 changed files with 213 additions and 76 deletions
+7 -2
View File
@@ -479,6 +479,8 @@ let MakeRepresentation = (props) => {
/>; />;
break; break;
case "appellant": case "appellant":
case "apelydd":
case "Apelydd":
case t( case t(
"myrepresentations:capacity-options-arr-appellant" "myrepresentations:capacity-options-arr-appellant"
).toLocaleLowerCase(): ).toLocaleLowerCase():
@@ -543,6 +545,8 @@ let MakeRepresentation = (props) => {
); );
break; break;
case "agent": case "agent":
case "Asiant":
case "asiant":
case t( case t(
"myrepresentations:capacity-options-arr-agent" "myrepresentations:capacity-options-arr-agent"
).toLowerCase(): ).toLowerCase():
@@ -873,7 +877,7 @@ let MakeRepresentation = (props) => {
useSaveStatus && useSaveStatus &&
router.replace( router.replace(
router.locale != "en" router.locale != "en"
? router.locale + "/myportal" ? "/" + router.locale + "/fymhorth"
: "/myportal" : "/myportal"
)) ))
: useSaveStatus : useSaveStatus
@@ -884,7 +888,7 @@ let MakeRepresentation = (props) => {
uploadRepresentationFiles(values), uploadRepresentationFiles(values),
router.replace( router.replace(
router.locale != "en" router.locale != "en"
? router.locale + "/myportal" ? "/" + router.locale + "/fymhorth"
: "/myportal" : "/myportal"
)) ))
: Object.assign(values, { : Object.assign(values, {
@@ -1188,6 +1192,7 @@ let MakeRepresentation = (props) => {
</h1> </h1>
<div id="rep-form"> <div id="rep-form">
<div className="govuk-grid-column-three-quarters wgForm"> <div className="govuk-grid-column-three-quarters wgForm">
www
{whichControl()} {whichControl()}
</div> </div>
@@ -132,9 +132,10 @@ const RepAgent = (props) => {
)} )}
component={RenderCondtionalRadioList} component={RenderCondtionalRadioList}
validate={[required]} validate={[required]}
legend={ legend={t("case:representation-onbehalfof")}
"Are you acting on behalf of a company, group or organisation?" hint={t(
} "myrepresentations:representation-onbehalfof-hint"
)}
/> />
</div> </div>
</div> </div>
@@ -220,7 +220,12 @@ const RepCompleteSubmit = (props) => {
function showRepsEnded(endDate) { function showRepsEnded(endDate) {
let date = new Date(); let date = new Date();
date = new Date(date.toDateString()); date = new Date(date.toDateString());
const end = new Date(endDate); let end = new Date(endDate);
end.setUTCHours(23);
end.setUTCMinutes(59);
end.setUTCSeconds(59);
end.toISOString();
return end > date ? false : true; return end > date ? false : true;
} }
@@ -301,8 +301,7 @@ export const RenderCondtionalRadioList = ({
</legend> </legend>
<div id={id + "-hint"} className="govuk-hint"> <div id={id + "-hint"} className="govuk-hint">
e.g. "Owners of Numbers 1-5 High Street", or "Mr and Mrs {custom.hint}
Smith" or "The executors of Mr Evans' estate"
</div> </div>
<div className="govuk-radios"> <div className="govuk-radios">
{Object.keys(options).map((key, index) => ( {Object.keys(options).map((key, index) => (
@@ -325,44 +324,46 @@ export const RenderCondtionalRadioList = ({
className="govuk-label govuk-radios__label" className="govuk-label govuk-radios__label"
htmlFor={id + "_" + index} htmlFor={id + "_" + index}
> >
{options[key]} {options[key] == "Yes"
? t(
"myrepresentations:questionnaire-yes"
)
: t(
"myrepresentations:questionnaire-no"
)}
</label> </label>
</div> </div>
{value == {value == "Yes" && options[key] == "Yes" && (
t("myrepresentations:questionnaire-yes") && <div
options[key] == className="govuk-radios__conditional "
t( id={"conditional-" + id}
"myrepresentations:questionnaire-yes" >
) && (
<div <div
className="govuk-radios__conditional " className="govuk-form-group"
id={"conditional-" + id} key={"yes_group_" + key}
> >
<div <label
className="govuk-form-group" className="govuk-label"
key={"yes_group_" + key} htmlFor={id + "_details"}
> >
<label {t(
className="govuk-label" "myrepresentations:representation-onbehalfof-label"
htmlFor={id + "_details"} )}
> </label>
Enter the name of the <Field
company/group/organisation className="govuk-input govuk-!-width-one-half"
</label> id={id + "_details"}
<Field name={id + "_details"}
className="govuk-input govuk-!-width-one-half" component={RenderTextfield}
id={id + "_details"} type="text"
name={id + "_details"} validate={[required]}
component={RenderTextfield} errorMsg={t(
type="text" "myrepresentations:is-required-label"
validate={[required]} )}
errorMsg={t( />
"myrepresentations:is-required-label"
)}
/>
</div>
</div> </div>
)} </div>
)}
</div> </div>
))} ))}
</div> </div>
@@ -540,6 +541,13 @@ export const RenderPickList = ({
: optionsArr[key] == : optionsArr[key] ==
"Final comments" "Final comments"
? "Sylwadau terfynol" ? "Sylwadau terfynol"
: optionsArr[key] ==
"Written representations"
? "Sylwadau ysgrifenedig"
: optionsArr[key] == "Inquiry"
? "Ymchwiliad"
: optionsArr[key] == "Hearing"
? "Gwrandawiad"
: optionsArr[key] : optionsArr[key]
: optionsArr[key]} : optionsArr[key]}
</option> </option>
@@ -1211,13 +1219,20 @@ export const RenderFileUpload = (field) => {
{uploadCountMessage > 0 && {uploadCountMessage > 0 &&
completedUploadFiles == false && ( completedUploadFiles == false && (
<div className="govuk-body govuk-!-font-size-14"> <div className="govuk-body govuk-!-font-size-14">
Uploading {uploadCountMessage} files{" "} {t("home:uploading-files-label", {
number: uploadCountMessage,
})}
</div> </div>
)} )}
{completedUploadFiles > 0 && {completedUploadFiles > 0 &&
uploadCountMessage > 0 && ( uploadCountMessage > 0 && (
<div className="govuk-body govuk-!-font-size-14"> <div className="govuk-body govuk-!-font-size-14">
{uploadCountMessage} files uploaded{" "} {t(
"home:completed-uploading-files-label",
{
number: uploadCountMessage,
}
)}
</div> </div>
)} )}
</section> </section>
@@ -1261,7 +1276,9 @@ export const RenderFileUpload = (field) => {
</p> </p>
) : ( ) : (
<p className="govuk-body textloading govuk-!-font-size-14"> <p className="govuk-body textloading govuk-!-font-size-14">
Uploading... {t(
"home:uploading-files-progress-label"
)}
</p> </p>
)} )}
</div> </div>
@@ -1290,7 +1307,7 @@ export const RenderFileUpload = (field) => {
blob.path.split("/")[1] blob.path.split("/")[1]
); );
}} }}
title="Remove this file" title={t("home:remove-this-file-label")}
> >
&minus; &minus;
</span> </span>
@@ -127,7 +127,12 @@ const RepInterestedPartyPerson = (props) => {
name="representationOnBehalfOf" name="representationOnBehalfOf"
datafieldname="representationOnBehalfOf" datafieldname="representationOnBehalfOf"
// label="In what capacity do you wish to make representations on this case?" // label="In what capacity do you wish to make representations on this case?"
options={["Yes", "No"]} options={[
t(
"myrepresentations:questionnaire-yes"
),
t("myrepresentations:questionnaire-no"),
]}
id="representationOnBehalfOf" id="representationOnBehalfOf"
className="govuk-radios__input" className="govuk-radios__input"
errorMsg={t( errorMsg={t(
@@ -135,9 +140,10 @@ const RepInterestedPartyPerson = (props) => {
)} )}
component={RenderCondtionalRadioList} component={RenderCondtionalRadioList}
validate={[required]} validate={[required]}
legend={ legend={t("case:representation-onbehalfof")}
"Are you acting on behalf of a company, group or organisation?" hint={t(
} "myrepresentations:representation-onbehalfof-hint"
)}
/> />
</div> </div>
</div> </div>
@@ -225,7 +225,8 @@ let RepLPA = (props) => {
{!_.has( {!_.has(
formObj["representationForm"], formObj["representationForm"],
["values", "representationType"] || ["values", "representationType"] ||
typeof props.representationType != "undefined" typeof props.currentView.caseReference.repDetails !=
"undefined"
) ? ( ) ? (
<> <>
<label <label
+13 -4
View File
@@ -2126,13 +2126,20 @@ const RenderFileUpload = (field) => {
{uploadCountMessage > 0 && {uploadCountMessage > 0 &&
completedUploadFiles == false && ( completedUploadFiles == false && (
<div className="govuk-body govuk-!-font-size-14"> <div className="govuk-body govuk-!-font-size-14">
Uploading {uploadCountMessage} files{" "} {t("home:uploading-files-label", {
number: uploadCountMessage,
})}
</div> </div>
)} )}
{completedUploadFiles > 0 && {completedUploadFiles > 0 &&
uploadCountMessage > 0 && ( uploadCountMessage > 0 && (
<div className="govuk-body govuk-!-font-size-14"> <div className="govuk-body govuk-!-font-size-14">
{uploadCountMessage} files uploaded{" "} {t(
"home:completed-uploading-files-label",
{
number: uploadCountMessage,
}
)}
</div> </div>
)} )}
</section> </section>
@@ -2188,7 +2195,9 @@ const RenderFileUpload = (field) => {
</p> </p>
) : ( ) : (
<p className="govuk-body textloading govuk-!-font-size-14"> <p className="govuk-body textloading govuk-!-font-size-14">
Uploading... {t(
"home:uploading-files-progress-label"
)}{" "}
</p> </p>
)} )}
</div> </div>
@@ -2223,7 +2232,7 @@ const RenderFileUpload = (field) => {
field.ticketnumber field.ticketnumber
); );
}} }}
title="Remove this file " title={t("home:remove-this-file-label")}
> >
&minus; &minus;
</span> </span>
@@ -288,7 +288,10 @@ const AwaitingSubmissionFromBlob = (props) => {
</div> </div>
)} )}
<div className="cardModuleReference"> <div className="cardModuleReference">
<b>LPA:</b> <b>
{router.locale == "cy" ? "ACLl" : "LPA"}
:
</b>
{router.locale == "cy" {router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
+1 -1
View File
@@ -394,7 +394,7 @@ const TopThree = (props) => {
</div> </div>
)} )}
<div className="cardModuleReference"> <div className="cardModuleReference">
<b>LPA:</b> <b>{router.locale == "cy" ? "ACLl" : "LPA"}:</b>
{router.locale == "cy" {router.locale == "cy"
? jsonpath( ? jsonpath(
'$..[?(@.value=="' + '$..[?(@.value=="' +
+20 -3
View File
@@ -285,10 +285,27 @@ const TopThree = (props) => {
'$..[?(@.value=="' + '$..[?(@.value=="' +
showTopThreeArr[key] showTopThreeArr[key]
.representationCapacity + .representationCapacity +
'")].value_cy', '" ||@.value_cy=="' +
showTopThreeArr[key]
.representationCapacity +
'" )].value_cy',
transLookup transLookup
) )
: showTopThreeArr[key].representationCapacity || ""} : jsonpath(
'$..[?(@.value_cy=="' +
showTopThreeArr[key]
.representationCapacity +
'")].value',
transLookup
).length > 0
? jsonpath(
'$..[?(@.value_cy=="' +
showTopThreeArr[key]
.representationCapacity +
'")].value',
transLookup
)
: showTopThreeArr[key].representationCapacity}
</div> </div>
<div className="cardModuleReference"> <div className="cardModuleReference">
<b>{t("myportal:date-raised")}:</b> <b>{t("myportal:date-raised")}:</b>
@@ -296,7 +313,7 @@ const TopThree = (props) => {
{repRaisedDate(showTopThreeArr[key].repfile_name)} {repRaisedDate(showTopThreeArr[key].repfile_name)}
</div>{" "} </div>{" "}
<div className="cardModuleReference"> <div className="cardModuleReference">
<b>LPA:</b> <b>{router.locale == "cy" ? "ACLl" : "LPA"}:</b>
{" "} {" "}
{router.locale == "cy" {router.locale == "cy"
+1 -1
View File
@@ -292,7 +292,7 @@ let BuildSection = (props) => {
useSaveStatus && useSaveStatus &&
router.replace( router.replace(
router.locale != "en" router.locale != "en"
? "/" + router.locale + "/myportal" ? "/" + router.locale + "/fymhorth"
: "/myportal" : "/myportal"
); );
}; };
+8 -2
View File
@@ -1664,7 +1664,10 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
<Text <Text
style={{ style={{
color: "#757575", color: "#757575",
width: "310", width:
docProps.locale == "cy"
? "290"
: "310",
fontSize: 12, fontSize: 12,
padding: 5, padding: 5,
border: 1, border: 1,
@@ -1686,7 +1689,10 @@ export const EnforcementQuestionnaire_pdf = ({ docProps }) => {
> >
<Text <Text
style={{ style={{
width: "40", width:
docProps.locale == "cy"
? "60"
: "40",
fontSize: 12, fontSize: 12,
marginLeft: 10, marginLeft: 10,
}} }}
+8 -2
View File
@@ -473,7 +473,10 @@ export const finalComments_pdf = ({ docProps }) => {
<Text <Text
style={{ style={{
color: "#757575", color: "#757575",
width: "310", width:
docProps.locale == "cy"
? "290"
: "310",
fontSize: 12, fontSize: 12,
padding: 5, padding: 5,
border: 1, border: 1,
@@ -494,7 +497,10 @@ export const finalComments_pdf = ({ docProps }) => {
> >
<Text <Text
style={{ style={{
width: "40", width:
docProps.locale == "cy"
? "60"
: "40",
fontSize: 12, fontSize: 12,
marginLeft: 10, marginLeft: 10,
}} }}
@@ -1450,7 +1450,10 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
<Text <Text
style={{ style={{
color: "#757575", color: "#757575",
width: "310", width:
docProps.locale == "cy"
? "290"
: "310",
fontSize: 12, fontSize: 12,
padding: 5, padding: 5,
border: 1, border: 1,
@@ -1472,7 +1475,10 @@ export const lpaQuestionnaire_pdf = ({ docProps }) => {
> >
<Text <Text
style={{ style={{
width: "40", width:
docProps.locale == "cy"
? "60"
: "40",
fontSize: 12, fontSize: 12,
marginLeft: 10, marginLeft: 10,
}} }}
+9 -2
View File
@@ -473,7 +473,10 @@ export const statement_pdf = ({ docProps }) => {
<Text <Text
style={{ style={{
color: "#757575", color: "#757575",
width: "310", width:
docProps.locale == "cy"
? "290"
: "310",
fontSize: 12, fontSize: 12,
padding: 5, padding: 5,
border: 1, border: 1,
@@ -493,8 +496,12 @@ export const statement_pdf = ({ docProps }) => {
}} }}
> >
<Text <Text
wrap={true}
style={{ style={{
width: "40", width:
docProps.locale == "cy"
? "60"
: "40",
fontSize: 12, fontSize: 12,
marginLeft: 10, marginLeft: 10,
}} }}
+27
View File
@@ -8,6 +8,7 @@ import {
getPortalModuleDetails, getPortalModuleDetails,
} from "../../actions"; } from "../../actions";
import data from "../../data/collections.json"; import data from "../../data/collections.json";
import { useRouter } from "next/router";
import xpath from "xpath"; import xpath from "xpath";
@@ -644,3 +645,29 @@ export const updateLinks = (jsonObj) => {
return jsonObj; return jsonObj;
}; };
export const whichRepType = (props) => {
const router = useRouter();
const { locale } = router;
let repType;
let whichBaseType =
props.currentView?.caseReference.repDetails.representationType ||
formObj.representationForm.values.representationType;
switch (whichBaseType) {
case "Statement":
repType = router.locale == "cy" ? "Datganiad" : "Statment";
break;
case "Questionnaire":
repType = router.locale == "cy" ? "Holiadur" : "Questionnaire";
break;
case "Final comments":
repType =
router.locale == "cy" ? "Sylwadau terfynol" : "Final comments";
break;
default:
// code block
}
return repType;
};
+4
View File
@@ -611,6 +611,10 @@
{ {
"value": "Interested Party", "value": "Interested Party",
"value_cy": "Parti â Buddiant" "value_cy": "Parti â Buddiant"
},
{
"value": "LPA",
"value_cy": "ACLl"
} }
], ],
"representation-type": [ "representation-type": [
+6 -1
View File
@@ -39,7 +39,12 @@ module.exports = {
"/case/*": ["case", "home"], "/case/*": ["case", "home"],
"/case/[ticketnumber]": ["case", "home"], "/case/[ticketnumber]": ["case", "home"],
"/case/id/[incident]": ["case", "home"], "/case/id/[incident]": ["case", "home"],
"/myportal/representation": ["case", "myrepresentations", "common"], "/myportal/representation": [
"case",
"myrepresentations",
"common",
"home",
],
"/myportal/error": ["myportal", "common"], "/myportal/error": ["myportal", "common"],
"/myportal/case/id/[incident]": ["case", "home"], "/myportal/case/id/[incident]": ["case", "home"],
"/myportal/addresssearch": ["search", "case", "myportal"], "/myportal/addresssearch": ["search", "case", "myportal"],
+5 -1
View File
@@ -42,5 +42,9 @@
"dns-card-paragraph": "Mae Datblygiad o Arwyddocâd Cenedlaethol yn fath o gais cynllunio ar gyfer prosiect seilwaith mawr sydd o bwysigrwydd cenedlaethol.", "dns-card-paragraph": "Mae Datblygiad o Arwyddocâd Cenedlaethol yn fath o gais cynllunio ar gyfer prosiect seilwaith mawr sydd o bwysigrwydd cenedlaethol.",
"dns-card-button": "Gweld pob cais", "dns-card-button": "Gweld pob cais",
"logging-in-heading": "Rydym yn dilysu eich cyfrif. Arhoswch a pheidiwch ag adnewyddu'r dudalen", "logging-in-heading": "Rydym yn dilysu eich cyfrif. Arhoswch a pheidiwch ag adnewyddu'r dudalen",
"logging-in-paragraph": "Arhoswch os gwelwch yn dda..." "logging-in-paragraph": "Arhoswch os gwelwch yn dda...",
"uploading-files-progress-label": "Wrthi'n llwytho i fyny...",
"uploading-files-label": "Wrthi'n uwchlwytho {{number}} ffeil",
"completed-uploading-files-label": "{{number}} ffeil wedi'u huwchlwytho",
"remove-this-file-label": "Tynnu'r ffeil hon"
} }
+7 -5
View File
@@ -46,10 +46,10 @@
"rep-complete-para-three": "Byddwch yn derbyn cadarnhad yn fuan a anfonir at y cyfeiriad e-bost a roddwyd gennych.", "rep-complete-para-three": "Byddwch yn derbyn cadarnhad yn fuan a anfonir at y cyfeiriad e-bost a roddwyd gennych.",
"lpa-capacity-para-one": "Maer ffurflen hon yn eich galluogi i gyflwyno datganiadau, sylwadau a holiaduron ar achos i Benderfyniadau Cynllunio ac Amgylchedd Cymru.", "lpa-capacity-para-one": "Maer ffurflen hon yn eich galluogi i gyflwyno datganiadau, sylwadau a holiaduron ar achos i Benderfyniadau Cynllunio ac Amgylchedd Cymru.",
"s78-section-heading-one": "Y weithdrefn apelio ac ymweliad safle", "s78-section-heading-one": "Y weithdrefn apelio ac ymweliad safle",
"s78-section-question-1": "Cyfeirnod PCAC:", "s78-section-question-1": "Cyfeirnod PCAC",
"s78-section-question-2": "Cyfeirnod yr ACLl:", "s78-section-question-2": "Cyfeirnod yr ACLl",
"s78-section-question-4": "Math o apêl:", "s78-section-question-4": "Math o apêl",
"s78-section-question-3": "Cyfeiriad y Safle:", "s78-section-question-3": "Cyfeiriad y Safle",
"s78-section-question-5": "Pa weithdrefn ydych chi'n credu y dylai'r apêl ei dilyn?", "s78-section-question-5": "Pa weithdrefn ydych chi'n credu y dylai'r apêl ei dilyn?",
"s78-section-question-6": "A fydd angen i'r Arolygydd fynd i mewn i safle/eiddo'r apêl?", "s78-section-question-6": "A fydd angen i'r Arolygydd fynd i mewn i safle/eiddo'r apêl?",
"s78-section-question-7": "A ydych chi'n credu bod angen i'r Arolygydd fynd ar dir/eiddo preifat cyfagos i weld y safle?", "s78-section-question-7": "A ydych chi'n credu bod angen i'r Arolygydd fynd ar dir/eiddo preifat cyfagos i weld y safle?",
@@ -237,5 +237,7 @@
"rep-finalising-label": "Wrthi'n uwchlwytho ffeiliau ar hyn o bryd ac yn cwblhau eich cyflwyniad cynrychioliad ", "rep-finalising-label": "Wrthi'n uwchlwytho ffeiliau ar hyn o bryd ac yn cwblhau eich cyflwyniad cynrychioliad ",
"rep-wait-label": "Arhoswch os gwelwch yn dda", "rep-wait-label": "Arhoswch os gwelwch yn dda",
"rep-period-passed-heading": "Mae'r cyfnod cynrychioli wedi mynd heibio", "rep-period-passed-heading": "Mae'r cyfnod cynrychioli wedi mynd heibio",
"rep-period-notice-label": "Aeth y dyddiad dyledus ar gyfer y sylw hwn heibio. Ni allwch gyflwyno'r wybodaeth a ddarparwyd gennych mwyach." "rep-period-notice-label": "Aeth y dyddiad dyledus ar gyfer y sylw hwn heibio. Ni allwch gyflwyno'r wybodaeth a ddarparwyd gennych mwyach.",
"representation-onbehalfof-hint": " e.e. \"Perchnogion Rhifau 1-5 Stryd Fawr\", neu \"Mr a Mrs Smith\" neu \"ysgutorion ystâd Mr Evans\"",
"representation-onbehalfof-label": "Rhowch enw'r cwmni/grŵp/sefydliad"
} }
+5 -1
View File
@@ -42,5 +42,9 @@
"dns-card-paragraph": "A Development of National Significance is a type of planning application for a large infrastructure project of national importance.", "dns-card-paragraph": "A Development of National Significance is a type of planning application for a large infrastructure project of national importance.",
"dns-card-button": "View all applications", "dns-card-button": "View all applications",
"logging-in-heading": "We are authenticating your account please wait and don't refresh", "logging-in-heading": "We are authenticating your account please wait and don't refresh",
"logging-in-paragraph": "Please wait..." "logging-in-paragraph": "Please wait...",
"uploading-files-progress-label": "Uploading...",
"uploading-files-label": "Uploading {{number}} files",
"completed-uploading-files-label": "{{number}} files uploaded",
"remove-this-file-label": "Remove this file"
} }
+3 -1
View File
@@ -237,5 +237,7 @@
"rep-finalising-label": "Currently uploading files and finalising your representation submission", "rep-finalising-label": "Currently uploading files and finalising your representation submission",
"rep-wait-label": "Please wait", "rep-wait-label": "Please wait",
"rep-period-passed-heading": "Representation period has passed", "rep-period-passed-heading": "Representation period has passed",
"rep-period-notice-label": "The due date for this representation passed. You can no longer submit the information you have provided." "rep-period-notice-label": "The due date for this representation passed. You can no longer submit the information you have provided.",
"representation-onbehalfof-hint": "e.g. \"Owners of Numbers 1-5 High Street\", or \"Mr and Mrs Smith\" or \"The executors of Mr Evans' estate\"",
"representation-onbehalfof-label": "Enter the name of the company/group/organisation"
} }