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 =
|
||||
"/api/file/createappealcompletemessage_api?container=" +
|
||||
containerID +
|
||||
"&tempcaseref=" +
|
||||
caseReference;
|
||||
caseReference +
|
||||
"&inv=" +
|
||||
typeofinvolvement;
|
||||
|
||||
var config = {
|
||||
method: "get",
|
||||
|
||||
@@ -173,7 +173,9 @@ const RenderPickList = ({
|
||||
id={datafieldname}
|
||||
name={datafieldname}
|
||||
>
|
||||
<option>Select...</option>
|
||||
<option value="" disabled defaultValue>
|
||||
{t("common:drop-down-select")}
|
||||
</option>
|
||||
{Object.keys(optionsArr).map((key, index) => {
|
||||
return (
|
||||
<option
|
||||
|
||||
@@ -51,12 +51,20 @@ const RenderTextfield = ({
|
||||
<label className="govuk-label " htmlFor={id} id={id + "_label"}>
|
||||
{FieldsTranslations(label)}
|
||||
</label>
|
||||
{touched && error && (
|
||||
<span id={id + "-error"} className="govuk-error-message">
|
||||
<span className="govuk-visually-hidden">Error:</span>{" "}
|
||||
{error}
|
||||
</span>
|
||||
)}
|
||||
{!custom.hasOwnProperty("showErrorBottom")
|
||||
? touched &&
|
||||
error && (
|
||||
<span
|
||||
id={id + "-error"}
|
||||
className="govuk-error-message"
|
||||
>
|
||||
<span className="govuk-visually-hidden">
|
||||
Error:
|
||||
</span>{" "}
|
||||
{error}
|
||||
</span>
|
||||
)
|
||||
: ""}
|
||||
<input
|
||||
{...input}
|
||||
type={custom.type}
|
||||
@@ -76,6 +84,20 @@ const RenderTextfield = ({
|
||||
: undefined
|
||||
}
|
||||
/>
|
||||
{custom.hasOwnProperty("showErrorBottom")
|
||||
? touched &&
|
||||
error && (
|
||||
<span
|
||||
id={id + "-error"}
|
||||
className="govuk-error-message"
|
||||
>
|
||||
<span className="govuk-visually-hidden">
|
||||
Error:
|
||||
</span>{" "}
|
||||
{error}
|
||||
</span>
|
||||
)
|
||||
: ""}
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
@@ -2037,7 +2059,7 @@ const renderField = ({ input, label, type, meta: { touched, error } }) => (
|
||||
</div>
|
||||
);
|
||||
|
||||
const RenderSubFields = ({ fields }) => {
|
||||
const RenderSubFields = ({ fields, meta: { touched, error }, ...custom }) => {
|
||||
let { t } = useTranslation();
|
||||
|
||||
let subTitle = fields.name.split("pinswg_")[1];
|
||||
@@ -2045,12 +2067,16 @@ const RenderSubFields = ({ fields }) => {
|
||||
const checkValue = (value) => {
|
||||
let errors;
|
||||
|
||||
// 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 (!value) {
|
||||
errors = t("newappeal:is-required-label");
|
||||
} 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)) {
|
||||
errors = "Emojis are not allowed";
|
||||
if (emojiRegex.test(value)) {
|
||||
errors = "Emojis are not allowed";
|
||||
}
|
||||
}
|
||||
|
||||
return errors;
|
||||
@@ -2065,6 +2091,7 @@ const RenderSubFields = ({ fields }) => {
|
||||
{subTitle == "owners" ? "Owners" : "Tenant"} #
|
||||
{index + 1}
|
||||
</h4>
|
||||
|
||||
<div className="fieldArrayContainer">
|
||||
<Field
|
||||
id={`${member}.${fields.name}`}
|
||||
@@ -2078,6 +2105,7 @@ const RenderSubFields = ({ fields }) => {
|
||||
: "Tenant name"
|
||||
}
|
||||
className="govuk-input govuk-input--width-10"
|
||||
showErrorBottom={true}
|
||||
/>
|
||||
<Field
|
||||
name={`${member}.dateserved`}
|
||||
@@ -2088,6 +2116,7 @@ const RenderSubFields = ({ fields }) => {
|
||||
dateEnd={"0"}
|
||||
className="govuk-input govuk-input--width-10"
|
||||
/>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
title="Remove"
|
||||
@@ -2100,15 +2129,18 @@ const RenderSubFields = ({ fields }) => {
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
className="govuk-link fieldArrayLink"
|
||||
onClick={() => fields.push({})}
|
||||
>
|
||||
{subTitle == "owners"
|
||||
? "Add Owners"
|
||||
: t("newappeal:new-appeal-add-tenant-label")}
|
||||
</button>
|
||||
<br />
|
||||
{fields.length < custom.maxSubField && (
|
||||
<button
|
||||
type="button"
|
||||
className="govuk-link fieldArrayLink"
|
||||
onClick={() => fields.push({})}
|
||||
>
|
||||
{subTitle == "owners"
|
||||
? "Add Owners"
|
||||
: t("newappeal:new-appeal-add-tenant-label")}
|
||||
</button>
|
||||
)}
|
||||
</ul>
|
||||
);
|
||||
};
|
||||
@@ -2123,6 +2155,7 @@ export const FieldArrayForm = (props) => {
|
||||
parentFieldShowOnValue,
|
||||
parentField,
|
||||
maxFieldLength,
|
||||
maxSubField,
|
||||
} = props;
|
||||
|
||||
var showIfHasParentShowValue =
|
||||
@@ -2143,7 +2176,11 @@ export const FieldArrayForm = (props) => {
|
||||
<>
|
||||
{" "}
|
||||
{showIfHasParentShowValue && (
|
||||
<FieldArray name={name} component={RenderSubFields} />
|
||||
<FieldArray
|
||||
name={name}
|
||||
component={RenderSubFields}
|
||||
maxSubField={maxSubField}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -58,8 +58,6 @@ const AwaitingSubmissionFromBlob = (props) => {
|
||||
return { ...item1, ...item2 };
|
||||
});
|
||||
|
||||
console.log(mergedArray);
|
||||
|
||||
showTopThreeArr = mergedArray;
|
||||
|
||||
showTopThreeArr = sortByISODate(showTopThreeArr, "createdon");
|
||||
|
||||
@@ -96,8 +96,6 @@ const TopThree = (props) => {
|
||||
return { ...item1, ...item2 };
|
||||
});
|
||||
|
||||
console.log(mergedArray);
|
||||
|
||||
showTopThreeArr = mergedArray;
|
||||
|
||||
showTopThreeArr = sortByISODate(showTopThreeArr, "createdon");
|
||||
|
||||
@@ -145,7 +145,9 @@ let BuildCheckSection = (props) => {
|
||||
console.log("have generated pdf:", data);
|
||||
sendCaseCompleteMessage(
|
||||
props.props.accountDetails.containerID,
|
||||
props.appealType.caseReference.ticketnumber
|
||||
props.appealType.caseReference.ticketnumber,
|
||||
props.props.accountDetails.accountDetails
|
||||
.pinswg_typeofinvolvement
|
||||
);
|
||||
})
|
||||
.then(() => {
|
||||
|
||||
@@ -227,6 +227,7 @@ export default function BuildField(props) {
|
||||
formProps={props.props.props.props.form}
|
||||
parentField={props.parentField}
|
||||
parentFieldShowOnValue={props.parentFieldShowOnValue}
|
||||
maxSubField={props.maxSubField}
|
||||
/>
|
||||
);
|
||||
case "{9EF39988-22BB-4f0b-BBBE-64B5A3748AEE}":
|
||||
|
||||
@@ -34,6 +34,7 @@ export default function BuildRow(props) {
|
||||
var fieldtype = xpath.select("//@classid", doc);
|
||||
var validation = xpath.select("//@validation", doc);
|
||||
var maxFieldLength = xpath.select("//@maxFieldLength", doc);
|
||||
var maxSubField = xpath.select("//@maxsubfield", doc);
|
||||
var datafieldname = xpath.select("//@datafieldname", doc);
|
||||
var datafieldcontent = xpath.select(
|
||||
"//@datafieldcontent",
|
||||
@@ -74,6 +75,9 @@ export default function BuildRow(props) {
|
||||
maxFieldLength =
|
||||
!_.isEmpty(maxFieldLength) && maxFieldLength[0].value;
|
||||
|
||||
maxSubField =
|
||||
!_.isEmpty(maxSubField) && maxSubField[0].value;
|
||||
|
||||
parentField =
|
||||
!_.isEmpty(parentField) && parentField[0].value;
|
||||
|
||||
@@ -164,6 +168,7 @@ export default function BuildRow(props) {
|
||||
setFilesForAppeal={
|
||||
props.props.setFilesForAppeal
|
||||
}
|
||||
maxSubField={maxSubField}
|
||||
/>
|
||||
);
|
||||
// } else {
|
||||
|
||||
@@ -123,13 +123,13 @@ let CompleteAppeal = (props) => {
|
||||
{t("newappeal:new-appeal-complete-paragraph-2")}
|
||||
</p>
|
||||
<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")}>
|
||||
{t("home:login-contact-email")}
|
||||
</Link>
|
||||
</p>
|
||||
<p className="govuk-body">
|
||||
{t("newappeal:new-appeal-complete-paragraph-4")}:
|
||||
{t("newappeal:new-appeal-complete-paragraph-4")}
|
||||
{router.locale == "cy" ? (
|
||||
<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
|
||||
|
||||
@@ -148,7 +148,7 @@
|
||||
<labels>
|
||||
<label description="Owners" />
|
||||
</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>
|
||||
<labels>
|
||||
@@ -160,7 +160,7 @@
|
||||
<labels>
|
||||
<label description="Tenants name" />
|
||||
</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>
|
||||
</rows>
|
||||
</section>
|
||||
|
||||
@@ -16,6 +16,7 @@ ApiProxy.use(middleware);
|
||||
ApiProxy.get(async (req, res) => {
|
||||
var containerName = req.query.container;
|
||||
var tempCaseRef = req.query.tempcaseref;
|
||||
var typeofinvolvement = req.query.inv;
|
||||
var checkHash = req.query.hash;
|
||||
|
||||
console.log("/////Create Case Message:\n", tempCaseRef, "\n//////////////");
|
||||
@@ -62,15 +63,25 @@ ApiProxy.get(async (req, res) => {
|
||||
getCaseBlob(containerName, tempCaseRef, caseObj).then(() => {
|
||||
let contactId = caseObj["customerid_contact@odata.bind"];
|
||||
contactId = contactId.match(/\(([^)]+)\)/);
|
||||
updateAccount(
|
||||
contactId[1],
|
||||
{
|
||||
"pinswg_typeofinvolvement": 846040001,
|
||||
},
|
||||
true
|
||||
).then((data) => {
|
||||
console.log("uopdated account: ", data);
|
||||
});
|
||||
|
||||
if (typeofinvolvement != 846040000) {
|
||||
updateAccount(
|
||||
contactId[1],
|
||||
{
|
||||
"pinswg_typeofinvolvement": 846040001,
|
||||
},
|
||||
true
|
||||
).then((data) => {
|
||||
console.log(
|
||||
"uopdated account : " +
|
||||
contactId +
|
||||
" \nfrom: " +
|
||||
data.pinswg_typeofinvolvement +
|
||||
"\nto: " +
|
||||
typeofinvolvement
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
createCaseCompleteMessage(containerName, tempCaseRef);
|
||||
return res.status(200).json({
|
||||
|
||||
Reference in New Issue
Block a user