Merged PR 1321: UAT fixes
Related work items: #12870, #12872, #12877, #12883
This commit is contained in:
+8
-2
@@ -1847,12 +1847,18 @@ export const createContainerProxy = (containerName) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const sendCaseCompleteMessage = async (containerID, caseReference) => {
|
export const sendCaseCompleteMessage = async (
|
||||||
|
containerID,
|
||||||
|
caseReference,
|
||||||
|
typeofinvolvement
|
||||||
|
) => {
|
||||||
var queryUrl =
|
var queryUrl =
|
||||||
"/api/file/createappealcompletemessage_api?container=" +
|
"/api/file/createappealcompletemessage_api?container=" +
|
||||||
containerID +
|
containerID +
|
||||||
"&tempcaseref=" +
|
"&tempcaseref=" +
|
||||||
caseReference;
|
caseReference +
|
||||||
|
"&inv=" +
|
||||||
|
typeofinvolvement;
|
||||||
|
|
||||||
var config = {
|
var config = {
|
||||||
method: "get",
|
method: "get",
|
||||||
|
|||||||
@@ -173,7 +173,9 @@ const RenderPickList = ({
|
|||||||
id={datafieldname}
|
id={datafieldname}
|
||||||
name={datafieldname}
|
name={datafieldname}
|
||||||
>
|
>
|
||||||
<option>Select...</option>
|
<option value="" disabled defaultValue>
|
||||||
|
{t("common:drop-down-select")}
|
||||||
|
</option>
|
||||||
{Object.keys(optionsArr).map((key, index) => {
|
{Object.keys(optionsArr).map((key, index) => {
|
||||||
return (
|
return (
|
||||||
<option
|
<option
|
||||||
|
|||||||
@@ -51,12 +51,20 @@ const RenderTextfield = ({
|
|||||||
<label className="govuk-label " htmlFor={id} id={id + "_label"}>
|
<label className="govuk-label " htmlFor={id} id={id + "_label"}>
|
||||||
{FieldsTranslations(label)}
|
{FieldsTranslations(label)}
|
||||||
</label>
|
</label>
|
||||||
{touched && error && (
|
{!custom.hasOwnProperty("showErrorBottom")
|
||||||
<span id={id + "-error"} className="govuk-error-message">
|
? touched &&
|
||||||
<span className="govuk-visually-hidden">Error:</span>{" "}
|
error && (
|
||||||
{error}
|
<span
|
||||||
</span>
|
id={id + "-error"}
|
||||||
)}
|
className="govuk-error-message"
|
||||||
|
>
|
||||||
|
<span className="govuk-visually-hidden">
|
||||||
|
Error:
|
||||||
|
</span>{" "}
|
||||||
|
{error}
|
||||||
|
</span>
|
||||||
|
)
|
||||||
|
: ""}
|
||||||
<input
|
<input
|
||||||
{...input}
|
{...input}
|
||||||
type={custom.type}
|
type={custom.type}
|
||||||
@@ -76,6 +84,20 @@ const RenderTextfield = ({
|
|||||||
: undefined
|
: undefined
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
{custom.hasOwnProperty("showErrorBottom")
|
||||||
|
? touched &&
|
||||||
|
error && (
|
||||||
|
<span
|
||||||
|
id={id + "-error"}
|
||||||
|
className="govuk-error-message"
|
||||||
|
>
|
||||||
|
<span className="govuk-visually-hidden">
|
||||||
|
Error:
|
||||||
|
</span>{" "}
|
||||||
|
{error}
|
||||||
|
</span>
|
||||||
|
)
|
||||||
|
: ""}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
@@ -2037,7 +2059,7 @@ const renderField = ({ input, label, type, meta: { touched, error } }) => (
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
const RenderSubFields = ({ fields }) => {
|
const RenderSubFields = ({ fields, meta: { touched, error }, ...custom }) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
|
|
||||||
let subTitle = fields.name.split("pinswg_")[1];
|
let subTitle = fields.name.split("pinswg_")[1];
|
||||||
@@ -2045,12 +2067,16 @@ const RenderSubFields = ({ fields }) => {
|
|||||||
const checkValue = (value) => {
|
const checkValue = (value) => {
|
||||||
let errors;
|
let errors;
|
||||||
|
|
||||||
// Check for emojis using a regular expression
|
if (!value) {
|
||||||
const emojiRegex =
|
errors = t("newappeal:is-required-label");
|
||||||
/[\u{1F600}-\u{1F64F}\u{1F300}-\u{1F5FF}\u{1F680}-\u{1F6FF}\u{1F700}-\u{1F77F}\u{1F780}-\u{1F7FF}\u{1F800}-\u{1F8FF}\u{1F900}-\u{1F9FF}\u{1FA00}-\u{1FA6F}\u{1FA70}-\u{1FAFF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}\u{2300}-\u{23FF}\u{2B50}\u{1F004}-\u{1F0CF}\u{1F0A0}-\u{1F0A5}\u{1F170}-\u{1F251}]/gu;
|
} else {
|
||||||
|
// Check for emojis using a regular expression
|
||||||
|
const emojiRegex =
|
||||||
|
/[\u{1F600}-\u{1F64F}\u{1F300}-\u{1F5FF}\u{1F680}-\u{1F6FF}\u{1F700}-\u{1F77F}\u{1F780}-\u{1F7FF}\u{1F800}-\u{1F8FF}\u{1F900}-\u{1F9FF}\u{1FA00}-\u{1FA6F}\u{1FA70}-\u{1FAFF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}\u{2300}-\u{23FF}\u{2B50}\u{1F004}-\u{1F0CF}\u{1F0A0}-\u{1F0A5}\u{1F170}-\u{1F251}]/gu;
|
||||||
|
|
||||||
if (emojiRegex.test(value)) {
|
if (emojiRegex.test(value)) {
|
||||||
errors = "Emojis are not allowed";
|
errors = "Emojis are not allowed";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return errors;
|
return errors;
|
||||||
@@ -2065,6 +2091,7 @@ const RenderSubFields = ({ fields }) => {
|
|||||||
{subTitle == "owners" ? "Owners" : "Tenant"} #
|
{subTitle == "owners" ? "Owners" : "Tenant"} #
|
||||||
{index + 1}
|
{index + 1}
|
||||||
</h4>
|
</h4>
|
||||||
|
|
||||||
<div className="fieldArrayContainer">
|
<div className="fieldArrayContainer">
|
||||||
<Field
|
<Field
|
||||||
id={`${member}.${fields.name}`}
|
id={`${member}.${fields.name}`}
|
||||||
@@ -2078,6 +2105,7 @@ const RenderSubFields = ({ fields }) => {
|
|||||||
: "Tenant name"
|
: "Tenant name"
|
||||||
}
|
}
|
||||||
className="govuk-input govuk-input--width-10"
|
className="govuk-input govuk-input--width-10"
|
||||||
|
showErrorBottom={true}
|
||||||
/>
|
/>
|
||||||
<Field
|
<Field
|
||||||
name={`${member}.dateserved`}
|
name={`${member}.dateserved`}
|
||||||
@@ -2088,6 +2116,7 @@ const RenderSubFields = ({ fields }) => {
|
|||||||
dateEnd={"0"}
|
dateEnd={"0"}
|
||||||
className="govuk-input govuk-input--width-10"
|
className="govuk-input govuk-input--width-10"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
title="Remove"
|
title="Remove"
|
||||||
@@ -2100,15 +2129,18 @@ const RenderSubFields = ({ fields }) => {
|
|||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
<button
|
<br />
|
||||||
type="button"
|
{fields.length < custom.maxSubField && (
|
||||||
className="govuk-link fieldArrayLink"
|
<button
|
||||||
onClick={() => fields.push({})}
|
type="button"
|
||||||
>
|
className="govuk-link fieldArrayLink"
|
||||||
{subTitle == "owners"
|
onClick={() => fields.push({})}
|
||||||
? "Add Owners"
|
>
|
||||||
: t("newappeal:new-appeal-add-tenant-label")}
|
{subTitle == "owners"
|
||||||
</button>
|
? "Add Owners"
|
||||||
|
: t("newappeal:new-appeal-add-tenant-label")}
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
</ul>
|
</ul>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -2123,6 +2155,7 @@ export const FieldArrayForm = (props) => {
|
|||||||
parentFieldShowOnValue,
|
parentFieldShowOnValue,
|
||||||
parentField,
|
parentField,
|
||||||
maxFieldLength,
|
maxFieldLength,
|
||||||
|
maxSubField,
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
var showIfHasParentShowValue =
|
var showIfHasParentShowValue =
|
||||||
@@ -2143,7 +2176,11 @@ export const FieldArrayForm = (props) => {
|
|||||||
<>
|
<>
|
||||||
{" "}
|
{" "}
|
||||||
{showIfHasParentShowValue && (
|
{showIfHasParentShowValue && (
|
||||||
<FieldArray name={name} component={RenderSubFields} />
|
<FieldArray
|
||||||
|
name={name}
|
||||||
|
component={RenderSubFields}
|
||||||
|
maxSubField={maxSubField}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -58,8 +58,6 @@ const AwaitingSubmissionFromBlob = (props) => {
|
|||||||
return { ...item1, ...item2 };
|
return { ...item1, ...item2 };
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(mergedArray);
|
|
||||||
|
|
||||||
showTopThreeArr = mergedArray;
|
showTopThreeArr = mergedArray;
|
||||||
|
|
||||||
showTopThreeArr = sortByISODate(showTopThreeArr, "createdon");
|
showTopThreeArr = sortByISODate(showTopThreeArr, "createdon");
|
||||||
|
|||||||
@@ -96,8 +96,6 @@ const TopThree = (props) => {
|
|||||||
return { ...item1, ...item2 };
|
return { ...item1, ...item2 };
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(mergedArray);
|
|
||||||
|
|
||||||
showTopThreeArr = mergedArray;
|
showTopThreeArr = mergedArray;
|
||||||
|
|
||||||
showTopThreeArr = sortByISODate(showTopThreeArr, "createdon");
|
showTopThreeArr = sortByISODate(showTopThreeArr, "createdon");
|
||||||
|
|||||||
@@ -145,7 +145,9 @@ let BuildCheckSection = (props) => {
|
|||||||
console.log("have generated pdf:", data);
|
console.log("have generated pdf:", data);
|
||||||
sendCaseCompleteMessage(
|
sendCaseCompleteMessage(
|
||||||
props.props.accountDetails.containerID,
|
props.props.accountDetails.containerID,
|
||||||
props.appealType.caseReference.ticketnumber
|
props.appealType.caseReference.ticketnumber,
|
||||||
|
props.props.accountDetails.accountDetails
|
||||||
|
.pinswg_typeofinvolvement
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
|||||||
@@ -227,6 +227,7 @@ export default function BuildField(props) {
|
|||||||
formProps={props.props.props.props.form}
|
formProps={props.props.props.props.form}
|
||||||
parentField={props.parentField}
|
parentField={props.parentField}
|
||||||
parentFieldShowOnValue={props.parentFieldShowOnValue}
|
parentFieldShowOnValue={props.parentFieldShowOnValue}
|
||||||
|
maxSubField={props.maxSubField}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
case "{9EF39988-22BB-4f0b-BBBE-64B5A3748AEE}":
|
case "{9EF39988-22BB-4f0b-BBBE-64B5A3748AEE}":
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ export default function BuildRow(props) {
|
|||||||
var fieldtype = xpath.select("//@classid", doc);
|
var fieldtype = xpath.select("//@classid", doc);
|
||||||
var validation = xpath.select("//@validation", doc);
|
var validation = xpath.select("//@validation", doc);
|
||||||
var maxFieldLength = xpath.select("//@maxFieldLength", doc);
|
var maxFieldLength = xpath.select("//@maxFieldLength", doc);
|
||||||
|
var maxSubField = xpath.select("//@maxsubfield", doc);
|
||||||
var datafieldname = xpath.select("//@datafieldname", doc);
|
var datafieldname = xpath.select("//@datafieldname", doc);
|
||||||
var datafieldcontent = xpath.select(
|
var datafieldcontent = xpath.select(
|
||||||
"//@datafieldcontent",
|
"//@datafieldcontent",
|
||||||
@@ -74,6 +75,9 @@ export default function BuildRow(props) {
|
|||||||
maxFieldLength =
|
maxFieldLength =
|
||||||
!_.isEmpty(maxFieldLength) && maxFieldLength[0].value;
|
!_.isEmpty(maxFieldLength) && maxFieldLength[0].value;
|
||||||
|
|
||||||
|
maxSubField =
|
||||||
|
!_.isEmpty(maxSubField) && maxSubField[0].value;
|
||||||
|
|
||||||
parentField =
|
parentField =
|
||||||
!_.isEmpty(parentField) && parentField[0].value;
|
!_.isEmpty(parentField) && parentField[0].value;
|
||||||
|
|
||||||
@@ -164,6 +168,7 @@ export default function BuildRow(props) {
|
|||||||
setFilesForAppeal={
|
setFilesForAppeal={
|
||||||
props.props.setFilesForAppeal
|
props.props.setFilesForAppeal
|
||||||
}
|
}
|
||||||
|
maxSubField={maxSubField}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
// } else {
|
// } else {
|
||||||
|
|||||||
@@ -123,13 +123,13 @@ let CompleteAppeal = (props) => {
|
|||||||
{t("newappeal:new-appeal-complete-paragraph-2")}
|
{t("newappeal:new-appeal-complete-paragraph-2")}
|
||||||
</p>
|
</p>
|
||||||
<p className="govuk-body">
|
<p className="govuk-body">
|
||||||
{t("newappeal:new-appeal-complete-paragraph-3")}:
|
{t("newappeal:new-appeal-complete-paragraph-3")}
|
||||||
<Link href={"mailto:" + t("home:login-contact-email")}>
|
<Link href={"mailto:" + t("home:login-contact-email")}>
|
||||||
{t("home:login-contact-email")}
|
{t("home:login-contact-email")}
|
||||||
</Link>
|
</Link>
|
||||||
</p>
|
</p>
|
||||||
<p className="govuk-body">
|
<p className="govuk-body">
|
||||||
{t("newappeal:new-appeal-complete-paragraph-4")}:
|
{t("newappeal:new-appeal-complete-paragraph-4")}
|
||||||
{router.locale == "cy" ? (
|
{router.locale == "cy" ? (
|
||||||
<Link href="https://www.llyw.cymru/diweddariad-i-wasanaeth-penderfyniadau-cynllunio-ac-amgylchedd-cymru-pcac">
|
<Link href="https://www.llyw.cymru/diweddariad-i-wasanaeth-penderfyniadau-cynllunio-ac-amgylchedd-cymru-pcac">
|
||||||
https://www.llyw.cymru/diweddariad-i-wasanaeth-penderfyniadau-cynllunio-ac-amgylchedd-cymru-pcac
|
https://www.llyw.cymru/diweddariad-i-wasanaeth-penderfyniadau-cynllunio-ac-amgylchedd-cymru-pcac
|
||||||
|
|||||||
@@ -148,7 +148,7 @@
|
|||||||
<labels>
|
<labels>
|
||||||
<label description="Owners" />
|
<label description="Owners" />
|
||||||
</labels>
|
</labels>
|
||||||
<control id="pinswg_owners" parentField="pinswg_ownershipcertificate" parentFieldShowOnValue="846040002" classid="{0273EDBD-AC1D-40d3-9FB2-095C621B552D}" datafieldname="pinswg_owners" disabled="false" />
|
<control id="pinswg_owners" parentField="pinswg_ownershipcertificate" parentFieldShowOnValue="846040002" classid="{0273EDBD-AC1D-40d3-9FB2-095C621B552D}" datafieldname="pinswg_owners" disabled="false" maxsubfield="5" />
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<labels>
|
<labels>
|
||||||
@@ -160,7 +160,7 @@
|
|||||||
<labels>
|
<labels>
|
||||||
<label description="Tenants name" />
|
<label description="Tenants name" />
|
||||||
</labels>
|
</labels>
|
||||||
<control id="pinswg_agriculturaltenant" parentField="pinswg_agriculturalholding" parentFieldShowOnValue="846040000" classid="{0273EDBD-AC1D-40d3-9FB2-095C621B552D}" datafieldname="pinswg_agriculturaltenantname" disabled="false" />
|
<control id="pinswg_agriculturaltenant" parentField="pinswg_agriculturalholding" parentFieldShowOnValue="846040000" classid="{0273EDBD-AC1D-40d3-9FB2-095C621B552D}" datafieldname="pinswg_agriculturaltenantname" disabled="false" maxsubfield="5" />
|
||||||
</row>
|
</row>
|
||||||
</rows>
|
</rows>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ ApiProxy.use(middleware);
|
|||||||
ApiProxy.get(async (req, res) => {
|
ApiProxy.get(async (req, res) => {
|
||||||
var containerName = req.query.container;
|
var containerName = req.query.container;
|
||||||
var tempCaseRef = req.query.tempcaseref;
|
var tempCaseRef = req.query.tempcaseref;
|
||||||
|
var typeofinvolvement = req.query.inv;
|
||||||
var checkHash = req.query.hash;
|
var checkHash = req.query.hash;
|
||||||
|
|
||||||
console.log("/////Create Case Message:\n", tempCaseRef, "\n//////////////");
|
console.log("/////Create Case Message:\n", tempCaseRef, "\n//////////////");
|
||||||
@@ -62,15 +63,25 @@ ApiProxy.get(async (req, res) => {
|
|||||||
getCaseBlob(containerName, tempCaseRef, caseObj).then(() => {
|
getCaseBlob(containerName, tempCaseRef, caseObj).then(() => {
|
||||||
let contactId = caseObj["customerid_contact@odata.bind"];
|
let contactId = caseObj["customerid_contact@odata.bind"];
|
||||||
contactId = contactId.match(/\(([^)]+)\)/);
|
contactId = contactId.match(/\(([^)]+)\)/);
|
||||||
updateAccount(
|
|
||||||
contactId[1],
|
if (typeofinvolvement != 846040000) {
|
||||||
{
|
updateAccount(
|
||||||
"pinswg_typeofinvolvement": 846040001,
|
contactId[1],
|
||||||
},
|
{
|
||||||
true
|
"pinswg_typeofinvolvement": 846040001,
|
||||||
).then((data) => {
|
},
|
||||||
console.log("uopdated account: ", data);
|
true
|
||||||
});
|
).then((data) => {
|
||||||
|
console.log(
|
||||||
|
"uopdated account : " +
|
||||||
|
contactId +
|
||||||
|
" \nfrom: " +
|
||||||
|
data.pinswg_typeofinvolvement +
|
||||||
|
"\nto: " +
|
||||||
|
typeofinvolvement
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
createCaseCompleteMessage(containerName, tempCaseRef);
|
createCaseCompleteMessage(containerName, tempCaseRef);
|
||||||
return res.status(200).json({
|
return res.status(200).json({
|
||||||
|
|||||||
Reference in New Issue
Block a user