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