Merged PR 2392: updated project types for new sub grid
updated project types for new sub grid Related work items: #23752
This commit is contained in:
@@ -38,6 +38,12 @@ const Pinswg_sipscase = (props) => {
|
||||
new Date(a.pinswg_newcasedeadline)
|
||||
)[0];
|
||||
|
||||
const projectTypes = Array.isArray(
|
||||
detailsObj.pinswg_sips_pinswg_sipsprojecttype
|
||||
)
|
||||
? detailsObj.pinswg_sips_pinswg_sipsprojecttype
|
||||
: [];
|
||||
|
||||
return (
|
||||
<>
|
||||
{detailsObj.pinswg_projectdescription != null ? (
|
||||
@@ -118,28 +124,40 @@ const Pinswg_sipscase = (props) => {
|
||||
}
|
||||
/>
|
||||
|
||||
{hasValidKey(
|
||||
detailsObj,
|
||||
"_pinswg_projecttype_value"
|
||||
) && (
|
||||
{projectTypes.length > 0 && (
|
||||
<SummaryRow
|
||||
label={"Project Type"}
|
||||
value={
|
||||
router.locale == "cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
detailsObj[
|
||||
"_pinswg_projecttype_value@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
: detailsObj[
|
||||
"_pinswg_projecttype_value@OData.Community.Display.V1.FormattedValue"
|
||||
] ||
|
||||
t(
|
||||
"case:summary-no-date-entered-label"
|
||||
)
|
||||
<>
|
||||
{projectTypes.map(
|
||||
(projectType) => {
|
||||
const projectTypeName =
|
||||
projectType.pinswg_name;
|
||||
|
||||
const translatedProjectTypeName =
|
||||
router.locale ==
|
||||
"cy"
|
||||
? jsonpath(
|
||||
'$..[?(@.value=="' +
|
||||
projectTypeName +
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
: projectTypeName;
|
||||
|
||||
return (
|
||||
<div
|
||||
key={
|
||||
projectType.pinswg_sipsprojecttypeid
|
||||
}
|
||||
>
|
||||
{translatedProjectTypeName ||
|
||||
projectTypeName}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
)}
|
||||
</>
|
||||
}
|
||||
/>
|
||||
)}
|
||||
@@ -266,7 +284,6 @@ const Pinswg_sipscase = (props) => {
|
||||
)
|
||||
}
|
||||
/>
|
||||
|
||||
{/* <SummaryRow
|
||||
label={t("case:summary-status-label")}
|
||||
value={
|
||||
|
||||
@@ -153,25 +153,56 @@ export default async function ApiProxy(req, res) {
|
||||
: "");
|
||||
|
||||
if (_.has(searchString, "projecttype")) {
|
||||
const sipsFilters = [
|
||||
"pinswg_sips_pinswg_sipsprojecttype/any(pt: pt/pinswg_sipsprojecttypeid eq " +
|
||||
searchString.projecttype +
|
||||
")"
|
||||
];
|
||||
|
||||
if (Object.prototype.hasOwnProperty.call(searchString, "q")) {
|
||||
sipsFilters.push(
|
||||
"contains(pinswg_projectname, '" +
|
||||
searchString.q.replace(/'/g, "''") +
|
||||
"')"
|
||||
);
|
||||
}
|
||||
|
||||
if (Object.prototype.hasOwnProperty.call(searchString, "lpa")) {
|
||||
sipsFilters.push(
|
||||
"_pinswg_associatedlpa_value eq " + searchString.lpa
|
||||
);
|
||||
}
|
||||
|
||||
const skipToken =
|
||||
pageNumber && pageNumber !== "1"
|
||||
? "&$skiptoken=" + '<cookie pagenumber="' + pageNumber + '" />'
|
||||
: "";
|
||||
|
||||
queryUrl =
|
||||
"pinswg_sipses?$count=true&$expand=pinswg_sipscase&$filter=_pinswg_projecttype_value eq " +
|
||||
searchString.projecttype +
|
||||
(Object.prototype.hasOwnProperty.call(searchString, "q")
|
||||
? " and contains(pinswg_projectname, '" + searchString.q + "')"
|
||||
: "") +
|
||||
(Object.prototype.hasOwnProperty.call(searchString, "lpa")
|
||||
? " and _pinswg_associatedlpa_value eq " +
|
||||
searchString.lpa +
|
||||
" "
|
||||
: "") +
|
||||
"pinswg_sipses?$count=true" +
|
||||
"&$expand=" +
|
||||
"pinswg_sipscase($select=incidentid,ticketnumber,title,statuscode,pinswg_appealcasetype,pinswg_caseaddress,pinswg_lpareference,pinswg_appellantagent,pinswg_appellantfirstname,pinswg_appellantlastname,_pinswg_associatedlpa_value)," +
|
||||
"pinswg_sips_pinswg_sipsprojecttype($select=_pinswg_sector_value,pinswg_name,pinswg_sipsprojecttypeid)" +
|
||||
"&$filter=" +
|
||||
sipsFilters.join(" and ") +
|
||||
"&$orderby=" +
|
||||
orderby +
|
||||
" " +
|
||||
fieldSort +
|
||||
(typeof pageNumber != "undefined"
|
||||
? "&$skiptoken=" +
|
||||
('<cookie pagenumber="' + pageNumber + '" />')
|
||||
: "");
|
||||
skipToken;
|
||||
|
||||
// queryUrl =
|
||||
// "pinswg_sipses?$count=true" +
|
||||
// "&$expand=pinswg_sips_pinswg_sipsprojecttype($select=_pinswg_sector_value,pinswg_name,pinswg_sipsprojecttypeid)" +
|
||||
// "&$filter=" +
|
||||
// sipsFilters.join(" and ") +
|
||||
// "&$orderby=" +
|
||||
// orderby +
|
||||
// " " +
|
||||
// fieldSort +
|
||||
// (typeof pageNumber != "undefined"
|
||||
// ? "&$skiptoken=" + '<cookie pagenumber="' + pageNumber + '" />'
|
||||
// : "");
|
||||
}
|
||||
|
||||
const relayPolicy = RELAY_POLICY_SEARCH_PAGED;
|
||||
@@ -186,7 +217,7 @@ export default async function ApiProxy(req, res) {
|
||||
let dataStr;
|
||||
_.has(data, "@odata.nextLink") === true &&
|
||||
((dataStr = JSON.stringify(data["@odata.nextLink"])),
|
||||
(data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]));
|
||||
(data["@odata.nextLink"] = dataStr.split("/v9.2/")[1]));
|
||||
|
||||
return data;
|
||||
},
|
||||
|
||||
@@ -88,7 +88,7 @@ export default async function ApiProxy(req, res) {
|
||||
navigationProperty +
|
||||
"($select=ticketnumber,statuscode)" +
|
||||
(primaryIdAttribute == "pinswg_sipscase"
|
||||
? ",pinswg_sipscase($select=ticketnumber),pinswg_CaseDeadlineExtension_pinswg_sips($select=pinswg_casedeadlineextensionid,pinswg_noofdaysextended,pinswg_reasonforextension,pinswg_agreedorimposedextension,pinswg_newcasedeadline),pinswg_sips_pinswg_sipsevent($select=pinswg_enddateofevent,pinswg_eventpublishflag,pinswg_linktotheevent,pinswg_linktotheeventstreamwelsh,pinswg_name,pinswg_dateeventrequested,pinswg_typeofevent,createdon,modifiedon)"
|
||||
? ",pinswg_sipscase($select=ticketnumber),pinswg_CaseDeadlineExtension_pinswg_sips($select=pinswg_casedeadlineextensionid,pinswg_noofdaysextended,pinswg_reasonforextension,pinswg_agreedorimposedextension,pinswg_newcasedeadline),pinswg_sips_pinswg_sipsevent($select=pinswg_enddateofevent,pinswg_eventpublishflag,pinswg_linktotheevent,pinswg_linktotheeventstreamwelsh,pinswg_name,pinswg_dateeventrequested,pinswg_typeofevent,createdon,modifiedon),pinswg_sips_pinswg_sipsprojecttype($select=pinswg_sipsprojecttypeid,pinswg_name,_pinswg_sector_value)"
|
||||
: "");
|
||||
|
||||
queryUrl = queryUrl + getSelectQuery(appealTypeName);
|
||||
|
||||
+2
-2
@@ -10,9 +10,9 @@
|
||||
"strict": false,
|
||||
"noEmit": true,
|
||||
"incremental": true,
|
||||
"module": "esnext",
|
||||
"module": "Node16",
|
||||
"esModuleInterop": true,
|
||||
"moduleResolution": "node",
|
||||
"moduleResolution": "Node16",
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"jsx": "preserve"
|
||||
|
||||
Reference in New Issue
Block a user