Merge branch 'Development' into SIPS-Development
This commit is contained in:
@@ -19,7 +19,7 @@ import { setCurrentPage } from "../../store/currentView/action";
|
||||
import { setDocumentDetails } from "../../store/searchOutput/action";
|
||||
|
||||
const DocumentDetails = (props) => {
|
||||
let { t } = useTranslation();
|
||||
let { t, lang } = useTranslation();
|
||||
const firstRender = useRef(false);
|
||||
const {
|
||||
incidentid,
|
||||
@@ -419,7 +419,7 @@ const DocumentDetails = (props) => {
|
||||
] +
|
||||
'")].value_cy',
|
||||
json: transLookup,
|
||||
sanbox: {},
|
||||
eval: true,
|
||||
})
|
||||
: detailsObj[
|
||||
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
|
||||
@@ -507,7 +507,7 @@ const DocumentDetails = (props) => {
|
||||
</p>
|
||||
<div>
|
||||
<button onClick={clearCheckboxes}>
|
||||
{t("case:documents-clear-filter-label")}
|
||||
{t("search:clear-filter-button-label")}
|
||||
</button>
|
||||
</div>
|
||||
<div className="govuk-checkboxes govuk-checkboxes--small">
|
||||
@@ -584,8 +584,8 @@ const DocumentDetails = (props) => {
|
||||
'$..[?(@ && @.value=="' +
|
||||
item.pinswg_isharedocumentlocationsLabel +
|
||||
'")].value_cy',
|
||||
jsonL: transLookup,
|
||||
sanbox: {},
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
: item.pinswg_isharedocumentlocationsLabel ||
|
||||
t(
|
||||
@@ -611,7 +611,7 @@ const DocumentDetails = (props) => {
|
||||
setCurrentPage(1);
|
||||
}}
|
||||
>
|
||||
{t("case:documents-filter-button")}
|
||||
{t("search:filter-documents-label")}
|
||||
</button>
|
||||
</div>
|
||||
{documentDetailsObj["@odata.count"] > 5 && (
|
||||
@@ -1068,6 +1068,7 @@ const DocumentDetails = (props) => {
|
||||
orderByState,
|
||||
getDocumentTypes,
|
||||
getDocumentResults,
|
||||
lang,
|
||||
]);
|
||||
return (
|
||||
<div className="govuk-grid-row">
|
||||
|
||||
@@ -65,6 +65,7 @@ let MakeRepresentation = (props) => {
|
||||
showQuestionnaireSection,
|
||||
initialValues,
|
||||
setCurrentReference,
|
||||
ticketnumber,
|
||||
} = props;
|
||||
const formObj = props.props.form;
|
||||
let setCaseQueryObj = props[currentType] || {};
|
||||
@@ -427,6 +428,12 @@ let MakeRepresentation = (props) => {
|
||||
currentType={currentType}
|
||||
casesObj={casesObj}
|
||||
caseReference={caseReference}
|
||||
ticketnumber={ticketnumber}
|
||||
setRepFileName={setRepFileName}
|
||||
updateRepresentation={updateRepresentation}
|
||||
setSavingStatus={setSavingStatus}
|
||||
savingStatus={savingStatus}
|
||||
setCurrentReference={setCurrentReference}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -590,6 +597,26 @@ let MakeRepresentation = (props) => {
|
||||
return deduplicate(mergedFiles);
|
||||
};
|
||||
|
||||
const buildAddressStr = (detailsObj) => {
|
||||
const toTitleCase = (str) =>
|
||||
str.toLowerCase().replace(/\b\w/g, (char) => char.toUpperCase());
|
||||
|
||||
return [
|
||||
detailsObj?.pinswg_siteaddressline1 ||
|
||||
detailsObj?.pinswg_addressline1,
|
||||
detailsObj?.pinswg_siteaddressline2 ||
|
||||
detailsObj?.pinswg_addressline2,
|
||||
detailsObj?.pinswg_siteaddresstown ||
|
||||
detailsObj?.pinswg_addresstown,
|
||||
detailsObj?.pinswg_siteaddresspostcode ||
|
||||
detailsObj?.pinswg_postcode,
|
||||
detailsObj?.pinswg_siteaddresscounty ||
|
||||
detailsObj?.pinswg_addresscounty,
|
||||
]
|
||||
.filter((v) => !!v && v.trim()) // remove empty/whitespace-only values
|
||||
.map((v) => toTitleCase(v.trim())) // title-case each segment
|
||||
.join(" ");
|
||||
};
|
||||
const updateRepresentation = async (
|
||||
values,
|
||||
sendSavedEmail,
|
||||
|
||||
@@ -197,7 +197,8 @@ const RepAgent = (props) => {
|
||||
"myrepresentations:add-files-label"
|
||||
)}
|
||||
ticketnumber={
|
||||
props.props.caseReference
|
||||
props.currentView.caseReference
|
||||
.ticketnumber
|
||||
}
|
||||
hint={"sdsd"}
|
||||
fileList={
|
||||
|
||||
@@ -189,7 +189,10 @@ const RepAppellant = (props) => {
|
||||
label={t(
|
||||
"myrepresentations:add-files-label"
|
||||
)}
|
||||
ticketnumber={props.props.caseReference}
|
||||
ticketnumber={
|
||||
props.currentView.caseReference
|
||||
.ticketnumber
|
||||
}
|
||||
hint={"sdsd"}
|
||||
fileList={
|
||||
props.currentView.fileList
|
||||
|
||||
@@ -36,6 +36,9 @@ let RepCapacitySelection = (props) => {
|
||||
currentType={currentType}
|
||||
casesObj={casesObj}
|
||||
caseReference={props.props.caseReference}
|
||||
ticketnumber={
|
||||
props.props.currentView.caseReference.ticketnumber
|
||||
}
|
||||
searchResultsObj={props.props.searchResultsObj}
|
||||
myRepresentations={props.props.myRepresentations}
|
||||
props={props}
|
||||
|
||||
@@ -65,7 +65,7 @@ const RepComplete = (props) => {
|
||||
),
|
||||
sendRepCompleteMessage(
|
||||
props.props.props.props.accountDetails.containerID,
|
||||
props.props.currentView.caseReference.currentReference,
|
||||
props.props.currentView.caseReference.ticketnumber,
|
||||
props.repFormData.repfile_name
|
||||
),
|
||||
sendEmail(templateId, emailAddress, personalisation, reference),
|
||||
|
||||
@@ -10,7 +10,7 @@ const RepDetails = (props) => {
|
||||
|
||||
const { currentType, casesObj, appealType } = props;
|
||||
|
||||
let { caseReference } = props;
|
||||
let { caseReference, ticketnumber } = props;
|
||||
|
||||
let setCaseDetailsObj = router.query.hasOwnProperty("state")
|
||||
? router.query.state == "edit"
|
||||
@@ -29,7 +29,7 @@ const RepDetails = (props) => {
|
||||
: caseReference;
|
||||
|
||||
detailsObj = jsonpath({
|
||||
path: '$..[?(@ && @.pinswg_name=="' + caseReference + '")]',
|
||||
path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
|
||||
json: setCaseDetailsObj,
|
||||
eval: true,
|
||||
});
|
||||
|
||||
@@ -189,7 +189,8 @@ const RepInterestedPartyPerson = (props) => {
|
||||
"myrepresentations:add-files-label"
|
||||
)}
|
||||
ticketnumber={
|
||||
props.props.caseReference
|
||||
props.currentView.caseReference
|
||||
.ticketnumber
|
||||
}
|
||||
hint={"sdsd"}
|
||||
fileList={
|
||||
|
||||
@@ -354,7 +354,7 @@ let RepLPA = (props) => {
|
||||
"myrepresentations:add-files-label"
|
||||
)}
|
||||
ticketnumber={
|
||||
props.props.caseReference
|
||||
props.currentView.caseReference.ticketnumber
|
||||
}
|
||||
hint={"sdsd"}
|
||||
fileList={
|
||||
|
||||
@@ -34,6 +34,7 @@ let RepLPACapacitySelection = (props) => {
|
||||
casesObj={casesObj}
|
||||
detailsObj={detailsObj}
|
||||
caseReference={props.props.caseReference}
|
||||
ticketnumber={props.props.ticketnumber}
|
||||
searchResultsObj={props.props.searchResultsObj}
|
||||
props={props.props}
|
||||
/>{" "}
|
||||
|
||||
@@ -8,7 +8,7 @@ const RepLPADetails = (props) => {
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
|
||||
const { currentType, casesObj, caseReference } = props;
|
||||
const { currentType, casesObj, caseReference, ticketnumber } = props;
|
||||
|
||||
let setCaseDetailsObj = router.query.hasOwnProperty("state")
|
||||
? router.query.state == "edit"
|
||||
@@ -21,7 +21,7 @@ const RepLPADetails = (props) => {
|
||||
var detailsObj = {};
|
||||
|
||||
detailsObj = jsonpath({
|
||||
path: '$..[?(@ && @.pinswg_name=="' + caseReference + '")]',
|
||||
path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
|
||||
json: setCaseDetailsObj,
|
||||
eval: true,
|
||||
});
|
||||
|
||||
@@ -84,7 +84,10 @@ const RepLandOwner = (props) => {
|
||||
label={t(
|
||||
"myrepresentations:add-files-label"
|
||||
)}
|
||||
ticketnumber={props.props.caseReference}
|
||||
ticketnumber={
|
||||
props.currentView.caseReference
|
||||
.ticketnumber
|
||||
}
|
||||
hint={"sdsd"}
|
||||
fileList={[]}
|
||||
setFilesForRepresentation={[]}
|
||||
|
||||
+4
-1
@@ -1213,7 +1213,10 @@ let Enforcement_Questionnaire = (props) => {
|
||||
name={"representationDocuments"}
|
||||
id={"representationDocuments"}
|
||||
label={t("myrepresentations:add-files-label")}
|
||||
ticketnumber={props.props.props.caseReference}
|
||||
ticketnumber={
|
||||
props.props.currentView.caseReference
|
||||
.ticketnumber
|
||||
}
|
||||
hint={"sdsd"}
|
||||
fileList={
|
||||
props.currentView.fileList
|
||||
|
||||
+4
-1
@@ -1022,7 +1022,10 @@ let S78_Questionnaire = (props) => {
|
||||
name={"representationDocuments"}
|
||||
id={"representationDocuments"}
|
||||
label={t("myrepresentations:add-files-label")}
|
||||
ticketnumber={props.props.props.caseReference}
|
||||
ticketnumber={
|
||||
props.props.currentView.caseReference
|
||||
.ticketnumber
|
||||
}
|
||||
hint={"sdsd"}
|
||||
fileList={
|
||||
props.currentView.fileList
|
||||
|
||||
@@ -76,6 +76,7 @@ const CaseSummary = (props) => {
|
||||
currentView,
|
||||
messagesObj,
|
||||
docsOffline,
|
||||
ticketnumber,
|
||||
} = props;
|
||||
|
||||
let appealTypeID = props.appealTypeID || router.query.appealType;
|
||||
@@ -233,13 +234,13 @@ const CaseSummary = (props) => {
|
||||
|
||||
currentType == "searchResultsObj"
|
||||
? (casesObj = jsonpath({
|
||||
path: '$..[?(@ && @.title=="' + caseReference + '")]',
|
||||
path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
|
||||
json: searchResultsObj,
|
||||
eval: true,
|
||||
}))
|
||||
: currentType == "watchedCases"
|
||||
? (casesObj = jsonpath({
|
||||
path: '$..[?(@ && @.pinswg_title=="' + caseReference + '")]',
|
||||
path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
|
||||
json: setCaseQueryObj,
|
||||
eval: true,
|
||||
}))
|
||||
@@ -251,7 +252,7 @@ const CaseSummary = (props) => {
|
||||
}))
|
||||
: currentType == "directResultsObj"
|
||||
? (casesObj = jsonpath({
|
||||
path: '$..[?(@ && @.ticketnumber=="' + caseReference + '")]',
|
||||
path: '$..[?(@ && @.ticketnumber=="' + ticketnumber + '")]',
|
||||
json: setCaseQueryObj,
|
||||
eval: true,
|
||||
}))
|
||||
@@ -1867,7 +1868,10 @@ const CaseSummary = (props) => {
|
||||
id="case-documents"
|
||||
>
|
||||
<Documents
|
||||
incidentid={props.incidentid}
|
||||
incidentid={
|
||||
props.incidentid ||
|
||||
setCaseQueryObj.value[0].incidentid
|
||||
}
|
||||
caseReference={props.caseReference}
|
||||
searchResultsObj={props.searchResultsObj}
|
||||
searchDetailsObj={props.searchDetailsObj}
|
||||
@@ -1937,7 +1941,9 @@ const CaseSummary = (props) => {
|
||||
currentView,
|
||||
showMap
|
||||
) {
|
||||
const id = getFormCollectionByID(appealTypeID).PrimaryIdAttribute;
|
||||
const id = getFormCollectionByID(
|
||||
appealTypeID || setCaseQueryObj.value[0].pinswg_appealcasetype
|
||||
).PrimaryIdAttribute;
|
||||
|
||||
const Component = CaseTypes[capitalizeFirstLetter(id)];
|
||||
|
||||
@@ -1955,7 +1961,9 @@ const CaseSummary = (props) => {
|
||||
|
||||
useEffect(() => {
|
||||
const linkCaseObj = async () => {
|
||||
let docObj = await getLinkedCases(incidentid).then((data) => {
|
||||
let docObj = await getLinkedCases(
|
||||
incidentid || setCaseQueryObj.value[0].incidentid
|
||||
).then((data) => {
|
||||
//console.log(data);
|
||||
setCurrentLinkedCases(data);
|
||||
return data;
|
||||
|
||||
@@ -129,7 +129,6 @@ const Pinswg_dnsid = (props) => {
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user