@@ -6,6 +6,7 @@ import Link from "next/link";
|
|||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import PaginationControl from "../../../components/search/pagination";
|
import PaginationControl from "../../../components/search/pagination";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
|
import transLookup from "../../../data/lookuptranslations.json";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
setSearchResults,
|
setSearchResults,
|
||||||
@@ -15,6 +16,7 @@ import {
|
|||||||
import { getDetailsProxy, getSearchDetailsPaged, hasOwn } from "../../utils";
|
import { getDetailsProxy, getSearchDetailsPaged, hasOwn } from "../../utils";
|
||||||
import { getAdvancedSearchPaged } from "../../../actions/services/searchService";
|
import { getAdvancedSearchPaged } from "../../../actions/services/searchService";
|
||||||
import { getNewAppealsPage } from "../../../actions/services/adminService";
|
import { getNewAppealsPage } from "../../../actions/services/adminService";
|
||||||
|
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
import {
|
import {
|
||||||
setCurrentPage,
|
setCurrentPage,
|
||||||
setCurrentReference
|
setCurrentReference
|
||||||
@@ -416,20 +418,14 @@ function AppealsTab(props) {
|
|||||||
{hasOwn(item, [
|
{hasOwn(item, [
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||||
])
|
])
|
||||||
? router.locale == "cy"
|
? resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: item[
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
item[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: item[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||||
] || "N/A"
|
],
|
||||||
|
locale: router.locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: "N/A"
|
||||||
|
})
|
||||||
: ""}
|
: ""}
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
@@ -439,20 +435,14 @@ function AppealsTab(props) {
|
|||||||
)}
|
)}
|
||||||
:
|
:
|
||||||
</span>
|
</span>
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: item[
|
||||||
path:
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
item[
|
locale: router.locale,
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: "N/A"
|
||||||
'")].value_cy',
|
})}
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: item[
|
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || "N/A"}
|
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
<span className="results-visually-hidden">
|
<span className="results-visually-hidden">
|
||||||
@@ -462,20 +452,14 @@ function AppealsTab(props) {
|
|||||||
:
|
:
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: item[
|
||||||
path:
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
item[
|
locale: router.locale,
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: "N/A"
|
||||||
'")].value_cy',
|
})}
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: item[
|
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || "N/A"}
|
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
{item[
|
{item[
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ import { getNewDocumentsPaged } from "../../../actions/services/adminService";
|
|||||||
import { setCurrentPage } from "../../../store/currentView/action";
|
import { setCurrentPage } from "../../../store/currentView/action";
|
||||||
|
|
||||||
import { setDocumentDetails } from "../../../store/searchOutput/action";
|
import { setDocumentDetails } from "../../../store/searchOutput/action";
|
||||||
|
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
|
|
||||||
const getDocumentTypes = [
|
const getDocumentTypes = [
|
||||||
{
|
{
|
||||||
"Value": 846040009,
|
"Value": 846040009,
|
||||||
@@ -397,19 +399,11 @@ const DocumentsTab = (props) => {
|
|||||||
className="govuk-label-s govuk-checkboxes__label"
|
className="govuk-label-s govuk-checkboxes__label"
|
||||||
htmlFor={item.Value}
|
htmlFor={item.Value}
|
||||||
>
|
>
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: item.Label,
|
||||||
path:
|
locale,
|
||||||
'$..[?(@ && @.value=="' +
|
translations: transLookup
|
||||||
item.Label +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: item.Label ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}{" "}
|
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@@ -470,19 +464,11 @@ const DocumentsTab = (props) => {
|
|||||||
className="govuk-label-s govuk-checkboxes__label"
|
className="govuk-label-s govuk-checkboxes__label"
|
||||||
htmlFor={"origin_" + item.Value}
|
htmlFor={"origin_" + item.Value}
|
||||||
>
|
>
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: item.Label,
|
||||||
path:
|
locale,
|
||||||
'$..[?(@ && @.value=="' +
|
translations: transLookup
|
||||||
item.Label +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: item.Label ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}{" "}
|
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@@ -822,23 +808,16 @@ const DocumentsTab = (props) => {
|
|||||||
:
|
:
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue(
|
||||||
? jsonpath({
|
{
|
||||||
path:
|
value: detailsObj[
|
||||||
'$..[?(@ && @.value=="' +
|
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
|
||||||
detailsObj[
|
],
|
||||||
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
|
locale,
|
||||||
] +
|
translations:
|
||||||
'")].value_cy',
|
transLookup
|
||||||
json: transLookup,
|
}
|
||||||
eval: true
|
)}
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-14">
|
<dd className="govuk-summary-list__value govuk-!-font-size-14">
|
||||||
<span className="results-visually-hidden">
|
<span className="results-visually-hidden">
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ export async function fetchAdminStorageData() {
|
|||||||
const limit = pLimit(5);
|
const limit = pLimit(5);
|
||||||
let data = await Promise.all(
|
let data = await Promise.all(
|
||||||
users.map(async (user) => {
|
users.map(async (user) => {
|
||||||
limit(async () => {
|
return limit(async () => {
|
||||||
const containers = await listContainersForUser(
|
const containers = await listContainersForUser(
|
||||||
blobServiceClient,
|
blobServiceClient,
|
||||||
`${user.id}`,
|
`${user.id}`,
|
||||||
|
|||||||
@@ -46,14 +46,6 @@ const Case = (props) => {
|
|||||||
mediaObj={props.mediaObj}
|
mediaObj={props.mediaObj}
|
||||||
mapTarget={props.mapTarget}
|
mapTarget={props.mapTarget}
|
||||||
/>
|
/>
|
||||||
{showRepresentations == true && (
|
|
||||||
<RepresentationList
|
|
||||||
incidentid={props.incidentid}
|
|
||||||
caseReference={props.caseReference}
|
|
||||||
representationsObj={props.representationsObj}
|
|
||||||
documentDetailsObj={props.documentDetailsObj}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
+14
-380
@@ -19,6 +19,7 @@ import { setCurrentPage } from "../../store/currentView/action";
|
|||||||
import { setDocumentDetails } from "../../store/searchOutput/action";
|
import { setDocumentDetails } from "../../store/searchOutput/action";
|
||||||
import DocumentLink from "../utils/downloads";
|
import DocumentLink from "../utils/downloads";
|
||||||
import { useDownloadQueue } from "../utils/downloadmanager";
|
import { useDownloadQueue } from "../utils/downloadmanager";
|
||||||
|
import resolveCrmDisplayValue from "../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
|
|
||||||
const DocumentDetails = (props) => {
|
const DocumentDetails = (props) => {
|
||||||
let { t, lang } = useTranslation();
|
let { t, lang } = useTranslation();
|
||||||
@@ -92,352 +93,6 @@ const DocumentDetails = (props) => {
|
|||||||
};
|
};
|
||||||
let ShowDocLinks = getDocLink(docsOffline);
|
let ShowDocLinks = getDocLink(docsOffline);
|
||||||
|
|
||||||
const DocumentView = (documentDetailsArr) => {
|
|
||||||
documentDetailsArr = documentDetailsArr.value;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<p>
|
|
||||||
{documentDetailsObj["@odata.count"] > 1
|
|
||||||
? t("case:documents-count-label-1")
|
|
||||||
: t("case:documents-count-label-1a")}{" "}
|
|
||||||
{documentDetailsObj["@odata.count"]}{" "}
|
|
||||||
{documentDetailsObj["@odata.count"] > 1
|
|
||||||
? t("case:documents-count-label-2")
|
|
||||||
: t("case:documents-count-label-2a")}
|
|
||||||
</p>
|
|
||||||
<div className="documentFilters govuk-!-margin-top-5">
|
|
||||||
<div
|
|
||||||
id="recordDocumentTypeSelect"
|
|
||||||
className="govuk-grid-row govuk-!-margin-left-0"
|
|
||||||
>
|
|
||||||
<div className="govuk-form-group">
|
|
||||||
<label
|
|
||||||
className="govuk-label-s "
|
|
||||||
htmlFor="showDocumentType"
|
|
||||||
>
|
|
||||||
{t("case:documents-show-label")}
|
|
||||||
<select
|
|
||||||
onChange={(e) => {
|
|
||||||
setSelectedDocumentType(e.target.value);
|
|
||||||
setCurrentPage(1);
|
|
||||||
}}
|
|
||||||
value={selectedDocumentType}
|
|
||||||
className="govuk-select"
|
|
||||||
id="showDocumentType"
|
|
||||||
name="showDocumentType"
|
|
||||||
>
|
|
||||||
<option value="all" key="00">
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path: '$..[?(@ && @.value=="All")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: "All"}
|
|
||||||
</option>
|
|
||||||
{documentTypes.map((item, key) => {
|
|
||||||
return (
|
|
||||||
<option
|
|
||||||
key={key}
|
|
||||||
value={
|
|
||||||
item.pinswg_isharedocumentlocations
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
item.pinswg_isharedocumentlocationsLabel +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: item.pinswg_isharedocumentlocationsLabel ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</option>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</select>
|
|
||||||
{t("case:documents-count-label-2")}
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{documentDetailsObj["@odata.count"] > 5 && (
|
|
||||||
<div
|
|
||||||
id="recordCountSelect"
|
|
||||||
className="govuk-grid-row govuk-!-margin-left-0"
|
|
||||||
>
|
|
||||||
<div className="govuk-form-group">
|
|
||||||
<label
|
|
||||||
className="govuk-label-s "
|
|
||||||
htmlFor="showNumberOfRecords"
|
|
||||||
>
|
|
||||||
{t(
|
|
||||||
"search:searchresults-show-records-label-a"
|
|
||||||
)}
|
|
||||||
<select
|
|
||||||
onChange={(e) => {
|
|
||||||
setSelectedOption(e.target.value);
|
|
||||||
setCurrentPage(1);
|
|
||||||
}}
|
|
||||||
value={selectedOption}
|
|
||||||
className="govuk-select"
|
|
||||||
id="showNumberOfRecords"
|
|
||||||
name="showNumberOfRecords"
|
|
||||||
>
|
|
||||||
<option value="5">5</option>
|
|
||||||
<option value="10">10</option>
|
|
||||||
<option value="20">20</option>
|
|
||||||
<option value="30">30</option>
|
|
||||||
<option value="50">50</option>
|
|
||||||
</select>{" "}
|
|
||||||
{t(
|
|
||||||
"search:searchresults-show-records-label-b"
|
|
||||||
)}
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
{ShowDocLinks && (
|
|
||||||
<div className="govuk-warning-text ">
|
|
||||||
<span
|
|
||||||
className="govuk-warning-text__icon"
|
|
||||||
aria-hidden="true"
|
|
||||||
>
|
|
||||||
!
|
|
||||||
</span>
|
|
||||||
<strong className="govuk-warning-text__text govuk-!-margin-top-2">
|
|
||||||
<span className="govuk-visually-hidden">
|
|
||||||
Notice
|
|
||||||
</span>
|
|
||||||
|
|
||||||
{t("case:documents-not-available-label")}
|
|
||||||
</strong>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
<dl className="documentList govuk-summary-list govuk-!-margin-bottom-9 results">
|
|
||||||
<div className="govuk-summary-list__row results-headings">
|
|
||||||
<dd className="govuk-summary-list__key govuk-!-font-size-16 ">
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
onClick={() => sortDataBy("pinswg_name")}
|
|
||||||
className={
|
|
||||||
orderByState == "pinswg_name"
|
|
||||||
? fieldSortState == "asc"
|
|
||||||
? `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortAsc`
|
|
||||||
: `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortDesc`
|
|
||||||
: `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16`
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{t("case:documents-name-label")}
|
|
||||||
</button>
|
|
||||||
</dd>
|
|
||||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
|
||||||
{/* {t("case:documents-doc-type-label")} */}
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
onClick={() =>
|
|
||||||
sortDataBy("pinswg_isharedocumentlocations")
|
|
||||||
}
|
|
||||||
className={
|
|
||||||
orderByState ==
|
|
||||||
"pinswg_isharedocumentlocations"
|
|
||||||
? fieldSortState == "asc"
|
|
||||||
? `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortAsc`
|
|
||||||
: `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortDesc`
|
|
||||||
: `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16`
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{t("case:documents-doc-type-label")}
|
|
||||||
</button>
|
|
||||||
</dd>
|
|
||||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
|
||||||
{/* {t("case:documents-date-published-label")} */}
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
onClick={() => sortDataBy("createdon")}
|
|
||||||
className={
|
|
||||||
orderByState == "createdon"
|
|
||||||
? fieldSortState == "asc"
|
|
||||||
? `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortAsc`
|
|
||||||
: `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortDesc`
|
|
||||||
: `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16`
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{t("case:documents-date-published-label")}
|
|
||||||
</button>
|
|
||||||
</dd>
|
|
||||||
{/* <dd className="govuk-summary-list__key govuk-!-font-size-16">
|
|
||||||
{t("case:documents-size-label")}
|
|
||||||
</dd> */}
|
|
||||||
</div>
|
|
||||||
{showSpinnerState == true ? (
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<div className="govuk-!-margin-top-4 govuk-!-margin-bottom-4 govuk-!-font-weight-bold govuk-!-font-size-20 ">
|
|
||||||
{t("common:spinner-fetching-data")}
|
|
||||||
<img
|
|
||||||
className="data-loading-icon"
|
|
||||||
src="/assets/images/loading.gif"
|
|
||||||
alt={
|
|
||||||
router.locale == "cy"
|
|
||||||
? "Nôl data"
|
|
||||||
: "Fetching data"
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
documentDetailsArr.map((item, key) => {
|
|
||||||
let detailsObj = jsonpath({
|
|
||||||
path:
|
|
||||||
"$..[?(@ && @._pinswg_documentids_value=='" +
|
|
||||||
incidentid +
|
|
||||||
"')]",
|
|
||||||
json: item,
|
|
||||||
sanbox: {}
|
|
||||||
});
|
|
||||||
detailsObj = item;
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
className="govuk-summary-list__row"
|
|
||||||
key={key}
|
|
||||||
>
|
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
|
||||||
{showDownloadingState === key && (
|
|
||||||
<div className="coverLoadingLink downloading">
|
|
||||||
{/* <img
|
|
||||||
className="data-loading-icon"
|
|
||||||
src="/assets/images/loading.gif"
|
|
||||||
alt={
|
|
||||||
router.locale ==
|
|
||||||
"cy"
|
|
||||||
? "Nôl data"
|
|
||||||
: "Fetching data"
|
|
||||||
}
|
|
||||||
/> */}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{!ShowDocLinks ? (
|
|
||||||
<Link
|
|
||||||
scroll={false}
|
|
||||||
href={
|
|
||||||
detailsObj.pinswg_hashlink
|
|
||||||
}
|
|
||||||
key={key}
|
|
||||||
onClick={() => {
|
|
||||||
(toggleDownLoadLink(key),
|
|
||||||
sendGAEvent(
|
|
||||||
"event",
|
|
||||||
"DownloadedFile",
|
|
||||||
{
|
|
||||||
caseReference:
|
|
||||||
props.caseReference,
|
|
||||||
filename:
|
|
||||||
detailsObj.pinswg_name
|
|
||||||
}
|
|
||||||
));
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<span className="results-visually-hidden">
|
|
||||||
{t(
|
|
||||||
"case:documents-name-label"
|
|
||||||
)}
|
|
||||||
:
|
|
||||||
</span>
|
|
||||||
{hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_name"
|
|
||||||
)
|
|
||||||
? detailsObj.pinswg_name
|
|
||||||
: ""}
|
|
||||||
</Link>
|
|
||||||
) : (
|
|
||||||
<>
|
|
||||||
<span className="results-visually-hidden">
|
|
||||||
{t(
|
|
||||||
"case:documents-name-label"
|
|
||||||
)}
|
|
||||||
:
|
|
||||||
</span>
|
|
||||||
{hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_name"
|
|
||||||
)
|
|
||||||
? detailsObj.pinswg_name
|
|
||||||
: ""}
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
|
||||||
<span className="results-visually-hidden">
|
|
||||||
{t("case:documents-doc-type-label")}
|
|
||||||
:
|
|
||||||
</span>
|
|
||||||
|
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
|
||||||
<span className="results-visually-hidden">
|
|
||||||
{t(
|
|
||||||
"case:documents-date-published-label"
|
|
||||||
)}
|
|
||||||
:
|
|
||||||
</span>
|
|
||||||
|
|
||||||
{hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_latestpublisheddate"
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_latestpublisheddate
|
|
||||||
)
|
|
||||||
: ""}
|
|
||||||
</dd>
|
|
||||||
{/* <dd className="govuk-summary-list__value govuk-!-font-size-16">
|
|
||||||
<span className="results-visually-hidden">
|
|
||||||
{t("case:documents-size-label")}:
|
|
||||||
</span>
|
|
||||||
92
|
|
||||||
</dd> */}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
})
|
|
||||||
)}
|
|
||||||
</dl>
|
|
||||||
<PaginationControl
|
|
||||||
showNoOfRecords={selectedOption}
|
|
||||||
currentPage={currentPage}
|
|
||||||
searchResultsObj={documentDetailsObj}
|
|
||||||
spinnerState={spinnerState}
|
|
||||||
orderBy={orderByState}
|
|
||||||
fieldSort={fieldSortState}
|
|
||||||
getDocumentResults={getDocumentResults}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const FilteredDocumentView = (documentDetailsArr) => {
|
const FilteredDocumentView = (documentDetailsArr) => {
|
||||||
documentDetailsArr = documentDetailsArr.value;
|
documentDetailsArr = documentDetailsArr.value;
|
||||||
|
|
||||||
@@ -547,19 +202,11 @@ const DocumentDetails = (props) => {
|
|||||||
item.pinswg_isharedocumentlocations
|
item.pinswg_isharedocumentlocations
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: item.pinswg_isharedocumentlocationsLabel,
|
||||||
path:
|
locale,
|
||||||
'$..[?(@ && @.value=="' +
|
translations: transLookup
|
||||||
item.pinswg_isharedocumentlocationsLabel +
|
})}{" "}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: item.pinswg_isharedocumentlocationsLabel ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}{" "}
|
|
||||||
- ({item.count})
|
- ({item.count})
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
@@ -817,24 +464,13 @@ const DocumentDetails = (props) => {
|
|||||||
)}
|
)}
|
||||||
:
|
:
|
||||||
</span>
|
</span>
|
||||||
|
{resolveCrmDisplayValue({
|
||||||
{router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup
|
||||||
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
|
})}
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
<span className="results-visually-hidden">
|
<span className="results-visually-hidden">
|
||||||
@@ -1047,10 +683,8 @@ const DocumentDetails = (props) => {
|
|||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
) : showFilteredDocs == "true" ? (
|
|
||||||
FilteredDocumentView(documentDetailsArr)
|
|
||||||
) : (
|
) : (
|
||||||
DocumentView(documentDetailsArr)
|
FilteredDocumentView(documentDetailsArr)
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -88,23 +88,13 @@ const RepresentationList = (props) => {
|
|||||||
{t("case:documents-doc-type-label")}:
|
{t("case:documents-doc-type-label")}:
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: detailsObj[
|
||||||
path:
|
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
sanbox: {}
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
<span className="results-visually-hidden">
|
<span className="results-visually-hidden">
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
import transLookup from "../../../data/lookuptranslations.json";
|
||||||
|
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
import SummaryCard from "../summary/components/SummaryCard";
|
import SummaryCard from "../summary/components/SummaryCard";
|
||||||
import SummaryRow from "../summary/components/SummaryRow";
|
import SummaryRow from "../summary/components/SummaryRow";
|
||||||
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
||||||
@@ -24,43 +24,30 @@ const Pinswg_advertsid = (props) => {
|
|||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-case-type-label")}
|
label={t("case:summary-case-type-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={"Specialist Case Process"}
|
label={t(
|
||||||
value={
|
"case:summary-specialist-case-process-label"
|
||||||
router.locale == "cy"
|
)}
|
||||||
? jsonpath({
|
value={resolveCrmDisplayValue({
|
||||||
path:
|
value: detailsObj[
|
||||||
'$..[?(@ && @.value=="' +
|
"pinswg_speacialistcaseprocess@OData.Community.Display.V1.FormattedValue"
|
||||||
detailsObj[
|
],
|
||||||
"pinswg_speacialistcaseprocess@OData.Community.Display.V1.FormattedValue"
|
locale,
|
||||||
] +
|
translations: transLookup,
|
||||||
'")].value_cy',
|
fallbackValue: ""
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_speacialistcaseprocess@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
@@ -80,79 +67,51 @@ const Pinswg_advertsid = (props) => {
|
|||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-eia-required-label")}
|
label={t("case:summary-eia-required-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath(
|
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-to-be-confirmed-label"
|
||||||
transLookup
|
)
|
||||||
)
|
})}
|
||||||
: detailsObj[
|
|
||||||
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-to-be-confirmed-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-procedure-label")}
|
label={t("case:summary-procedure-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-type-of-event-label")}
|
label={t("case:summary-type-of-event-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-status-label")}
|
label={t("case:summary-status-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
@@ -160,23 +119,16 @@ const Pinswg_advertsid = (props) => {
|
|||||||
{t("case:summary-decision-label")}
|
{t("case:summary-decision-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: detailsObj[
|
||||||
path:
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-no-information-to-date-label"
|
||||||
json: transLookup,
|
)
|
||||||
eval: true
|
})}
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
{/* <Link href="/">
|
{/* <Link href="/">
|
||||||
@@ -193,7 +145,9 @@ const Pinswg_advertsid = (props) => {
|
|||||||
{t("case:summary-case-link-status-label")}
|
{t("case:summary-case-link-status-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{hasOwn(casesObj, ["numberofchildincidents"])
|
{hasOwn(casesObj, [
|
||||||
|
"numberofchildincidents"
|
||||||
|
])
|
||||||
? casesObj.numberofchildincidents > 0
|
? casesObj.numberofchildincidents > 0
|
||||||
? t(
|
? t(
|
||||||
"case:summary-case-link-status-linked"
|
"case:summary-case-link-status-linked"
|
||||||
@@ -257,7 +211,10 @@ const Pinswg_advertsid = (props) => {
|
|||||||
"case:summary-questionnaire-due-date-label"
|
"case:summary-questionnaire-due-date-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={
|
||||||
hasOwn(detailsObj, "pinswg_questionnaireduedate")
|
hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_questionnaireduedate"
|
||||||
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_questionnaireduedate
|
detailsObj.pinswg_questionnaireduedate
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
import transLookup from "../../../data/lookuptranslations.json";
|
||||||
|
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
import SummaryCard from "../summary/components/SummaryCard";
|
import SummaryCard from "../summary/components/SummaryCard";
|
||||||
import SummaryRow from "../summary/components/SummaryRow";
|
import SummaryRow from "../summary/components/SummaryRow";
|
||||||
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
||||||
@@ -24,23 +24,16 @@ const Pinswg_callinss77id = (props) => {
|
|||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-case-type-label")}
|
label={t("case:summary-case-type-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-lpa-label")}
|
label={t("case:summary-lpa-label")}
|
||||||
@@ -59,110 +52,69 @@ const Pinswg_callinss77id = (props) => {
|
|||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-eia-required-label")}
|
label={t("case:summary-eia-required-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath(
|
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-to-be-confirmed-label"
|
||||||
transLookup
|
)
|
||||||
)
|
})}
|
||||||
: detailsObj[
|
|
||||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-to-be-confirmed-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-procedure-label")}
|
label={t("case:summary-procedure-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-type-of-event-label")}
|
label={t("case:summary-type-of-event-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-status-label")}
|
label={t("case:summary-status-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-decision-label")}
|
{t("case:summary-decision-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: detailsObj[
|
||||||
path:
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-no-information-to-date-label"
|
||||||
json: transLookup,
|
)
|
||||||
eval: true
|
})}
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
@@ -171,7 +123,9 @@ const Pinswg_callinss77id = (props) => {
|
|||||||
{t("case:summary-case-link-status-label")}
|
{t("case:summary-case-link-status-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{hasOwn(casesObj, ["numberofchildincidents"])
|
{hasOwn(casesObj, [
|
||||||
|
"numberofchildincidents"
|
||||||
|
])
|
||||||
? casesObj.numberofchildincidents > 0
|
? casesObj.numberofchildincidents > 0
|
||||||
? t(
|
? t(
|
||||||
"case:summary-case-link-status-linked"
|
"case:summary-case-link-status-linked"
|
||||||
@@ -234,7 +188,10 @@ const Pinswg_callinss77id = (props) => {
|
|||||||
"case:summary-questionnaire-due-date-label"
|
"case:summary-questionnaire-due-date-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={
|
||||||
hasOwn(detailsObj, "pinswg_questionnaireduedate")
|
hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_questionnaireduedate"
|
||||||
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_questionnaireduedate
|
detailsObj.pinswg_questionnaireduedate
|
||||||
)
|
)
|
||||||
@@ -247,31 +204,6 @@ const Pinswg_callinss77id = (props) => {
|
|||||||
: t("case:summary-no-date-entered-label")
|
: t("case:summary-no-date-entered-label")
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
{/* <div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-date-exported-to-iss-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_dateexportedtoiss"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_dateexportedtoiss
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_dateexportedtoiss
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div> */}
|
|
||||||
|
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-statement-due-date-label")}
|
label={t("case:summary-statement-due-date-label")}
|
||||||
@@ -328,7 +260,10 @@ const Pinswg_callinss77id = (props) => {
|
|||||||
"case:summary-applicant-final-comments-date-label"
|
"case:summary-applicant-final-comments-date-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={
|
||||||
hasOwn(detailsObj, "pinswg_finalcommentsduedate")
|
hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_finalcommentsduedate"
|
||||||
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
)
|
)
|
||||||
@@ -341,31 +276,7 @@ const Pinswg_callinss77id = (props) => {
|
|||||||
: t("case:summary-no-date-entered-label")
|
: t("case:summary-no-date-entered-label")
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
{/* <div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-inquiry-evidence-date-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_proofsofevidencewrittenstatementsofeviden"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div> */}
|
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-event-date-label")}
|
label={t("case:summary-event-date-label")}
|
||||||
value={
|
value={
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
import transLookup from "../../../data/lookuptranslations.json";
|
||||||
|
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
import SummaryCard from "../summary/components/SummaryCard";
|
import SummaryCard from "../summary/components/SummaryCard";
|
||||||
import SummaryRow from "../summary/components/SummaryRow";
|
import SummaryRow from "../summary/components/SummaryRow";
|
||||||
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
||||||
@@ -24,23 +24,16 @@ const Pinswg_commonlandid = (props) => {
|
|||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-case-type-label")}
|
label={t("case:summary-case-type-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-lpa-label")}
|
label={t("case:summary-lpa-label")}
|
||||||
@@ -59,110 +52,69 @@ const Pinswg_commonlandid = (props) => {
|
|||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-eia-required-label")}
|
label={t("case:summary-eia-required-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath(
|
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-to-be-confirmed-label"
|
||||||
transLookup
|
)
|
||||||
)
|
})}
|
||||||
: detailsObj[
|
|
||||||
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-to-be-confirmed-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-procedure-label")}
|
label={t("case:summary-procedure-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-type-of-event-label")}
|
label={t("case:summary-type-of-event-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-status-label")}
|
label={t("case:summary-status-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-decision-label")}
|
{t("case:summary-decision-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: detailsObj[
|
||||||
path:
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-no-information-to-date-label"
|
||||||
json: transLookup,
|
)
|
||||||
eval: true
|
})}
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
@@ -171,7 +123,9 @@ const Pinswg_commonlandid = (props) => {
|
|||||||
{t("case:summary-case-link-status-label")}
|
{t("case:summary-case-link-status-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{hasOwn(casesObj, ["numberofchildincidents"])
|
{hasOwn(casesObj, [
|
||||||
|
"numberofchildincidents"
|
||||||
|
])
|
||||||
? casesObj.numberofchildincidents > 0
|
? casesObj.numberofchildincidents > 0
|
||||||
? t(
|
? t(
|
||||||
"case:summary-case-link-status-linked"
|
"case:summary-case-link-status-linked"
|
||||||
@@ -203,26 +157,14 @@ const Pinswg_commonlandid = (props) => {
|
|||||||
label={t(
|
label={t(
|
||||||
"case:summary-case-relevant-authoritylabel"
|
"case:summary-case-relevant-authoritylabel"
|
||||||
)}
|
)}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_relevantauthorityname"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.pinswg_lpa=="' +
|
locale,
|
||||||
detailsObj.pinswg_relevantauthorityname +
|
translations: transLookup,
|
||||||
'")].value_cy',
|
fallbackValue: ""
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.pinswg_lpa=="' +
|
|
||||||
detailsObj.pinswg_relevantauthorityname +
|
|
||||||
'")].value',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
}) ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
</dl>
|
</dl>
|
||||||
</SummaryCard>
|
</SummaryCard>
|
||||||
@@ -260,7 +202,10 @@ const Pinswg_commonlandid = (props) => {
|
|||||||
"case:summary-questionnaire-due-date-label"
|
"case:summary-questionnaire-due-date-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={
|
||||||
hasOwn(detailsObj, "pinswg_questionnaireduedate")
|
hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_questionnaireduedate"
|
||||||
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_questionnaireduedate
|
detailsObj.pinswg_questionnaireduedate
|
||||||
)
|
)
|
||||||
@@ -331,7 +276,10 @@ const Pinswg_commonlandid = (props) => {
|
|||||||
"case:summary-applicant-final-comments-date-label"
|
"case:summary-applicant-final-comments-date-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={
|
||||||
hasOwn(detailsObj, "pinswg_finalcommentsduedate")
|
hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_finalcommentsduedate"
|
||||||
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
)
|
)
|
||||||
@@ -344,31 +292,7 @@ const Pinswg_commonlandid = (props) => {
|
|||||||
: t("case:summary-no-date-entered-label")
|
: t("case:summary-no-date-entered-label")
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
{/* <div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-inquiry-evidence-date-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_proofsofevidencewrittenstatementsofeviden"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div> */}
|
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-event-date-label")}
|
label={t("case:summary-event-date-label")}
|
||||||
value={
|
value={
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
import transLookup from "../../../data/lookuptranslations.json";
|
||||||
|
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
import SummaryCard from "../summary/components/SummaryCard";
|
import SummaryCard from "../summary/components/SummaryCard";
|
||||||
import SummaryRow from "../summary/components/SummaryRow";
|
import SummaryRow from "../summary/components/SummaryRow";
|
||||||
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
||||||
@@ -24,23 +24,16 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
|
|||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-case-type-label")}
|
label={t("case:summary-case-type-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-lpa-label")}
|
label={t("case:summary-lpa-label")}
|
||||||
@@ -59,110 +52,69 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
|
|||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-eia-required-label")}
|
label={t("case:summary-eia-required-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath(
|
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-to-be-confirmed-label"
|
||||||
transLookup
|
)
|
||||||
)
|
})}
|
||||||
: detailsObj[
|
|
||||||
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-to-be-confirmed-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-procedure-label")}
|
label={t("case:summary-procedure-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-type-of-event-label")}
|
label={t("case:summary-type-of-event-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-status-label")}
|
label={t("case:summary-status-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-decision-label")}
|
{t("case:summary-decision-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: detailsObj[
|
||||||
path:
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-no-information-to-date-label"
|
||||||
json: transLookup,
|
)
|
||||||
eval: true
|
})}
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
@@ -171,7 +123,9 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
|
|||||||
{t("case:summary-case-link-status-label")}
|
{t("case:summary-case-link-status-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{hasOwn(casesObj, ["numberofchildincidents"])
|
{hasOwn(casesObj, [
|
||||||
|
"numberofchildincidents"
|
||||||
|
])
|
||||||
? casesObj.numberofchildincidents > 0
|
? casesObj.numberofchildincidents > 0
|
||||||
? t(
|
? t(
|
||||||
"case:summary-case-link-status-linked"
|
"case:summary-case-link-status-linked"
|
||||||
@@ -269,7 +223,10 @@ const Pinswg_communityinfrastructurelevyid = (props) => {
|
|||||||
"case:summary-applicant-final-comments-date-label"
|
"case:summary-applicant-final-comments-date-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={
|
||||||
hasOwn(detailsObj, "pinswg_finalcommentsduedate")
|
hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_finalcommentsduedate"
|
||||||
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
@@ -23,131 +22,81 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
|
|||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-case-type-label")}
|
label={t("case:summary-case-type-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-eia-required-label")}
|
label={t("case:summary-eia-required-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath(
|
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-to-be-confirmed-label"
|
||||||
transLookup
|
)
|
||||||
)
|
})}
|
||||||
: detailsObj[
|
|
||||||
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-to-be-confirmed-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-procedure-label")}
|
label={t("case:summary-procedure-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-type-of-event-label")}
|
label={t("case:summary-type-of-event-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-status-label")}
|
label={t("case:summary-status-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-decision-label")}
|
{t("case:summary-decision-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: detailsObj[
|
||||||
path:
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-no-information-to-date-label"
|
||||||
json: transLookup,
|
)
|
||||||
eval: true
|
})}
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
@@ -190,26 +139,12 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
|
|||||||
label={t(
|
label={t(
|
||||||
"case:summary-case-relevant-authoritylabel"
|
"case:summary-case-relevant-authoritylabel"
|
||||||
)}
|
)}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj.pinswg_relevantauthorityname,
|
||||||
? jsonpath({
|
locale: router.locale,
|
||||||
path:
|
translations: transLookup,
|
||||||
'$..[?(@ && @.pinswg_lpa=="' +
|
fallbackValue: ""
|
||||||
detailsObj.pinswg_relevantauthorityname +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.pinswg_lpa=="' +
|
|
||||||
detailsObj.pinswg_relevantauthorityname +
|
|
||||||
'")].value',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
}) ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
</dl>
|
</dl>
|
||||||
</SummaryCard>
|
</SummaryCard>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { JSONPath as jsonpath } from "jsonpath-plus";
|
|||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
import transLookup from "../../../data/lookuptranslations.json";
|
||||||
|
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
import SummaryCard from "../summary/components/SummaryCard";
|
import SummaryCard from "../summary/components/SummaryCard";
|
||||||
import SummaryRow from "../summary/components/SummaryRow";
|
import SummaryRow from "../summary/components/SummaryRow";
|
||||||
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
||||||
@@ -96,25 +97,16 @@ const Pinswg_dnsid = (props) => {
|
|||||||
label={t(
|
label={t(
|
||||||
"case:summary-case-type-label"
|
"case:summary-case-type-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{detailsObj.pinswg_webaddress != null && (
|
{detailsObj.pinswg_webaddress != null && (
|
||||||
@@ -175,23 +167,16 @@ const Pinswg_dnsid = (props) => {
|
|||||||
label={t(
|
label={t(
|
||||||
"case:summary-eia-required-label"
|
"case:summary-eia-required-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath(
|
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-to-be-confirmed-label"
|
||||||
transLookup
|
)
|
||||||
)
|
})}
|
||||||
: detailsObj[
|
|
||||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-to-be-confirmed-label"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t(
|
label={t(
|
||||||
@@ -200,77 +185,34 @@ const Pinswg_dnsid = (props) => {
|
|||||||
value={
|
value={
|
||||||
detailsObj.pinswg_choiceofprocedure !==
|
detailsObj.pinswg_choiceofprocedure !==
|
||||||
null
|
null
|
||||||
? router.locale == "cy"
|
? resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: detailsObj[
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_choiceofprocedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_choiceofprocedure@OData.Community.Display.V1.FormattedValue"
|
"pinswg_choiceofprocedure@OData.Community.Display.V1.FormattedValue"
|
||||||
]
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)
|
||||||
|
})
|
||||||
: t(
|
: t(
|
||||||
"case:summary-to-be-confirmed-label"
|
"case:summary-to-be-confirmed-label"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
{/* <SummaryRow
|
|
||||||
label={t("case:summary-status-label")}
|
|
||||||
value={
|
|
||||||
router.locale == "cy"
|
|
||||||
? jsonpath({path:
|
|
||||||
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
casesObj[
|
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',transLookup
|
|
||||||
)
|
|
||||||
: casesObj[
|
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-to-be-confirmed-label"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
/> */}
|
|
||||||
{/* <SummaryRow
|
|
||||||
label={t(
|
|
||||||
"case:summary-case-officer-label"
|
|
||||||
)}
|
|
||||||
value={
|
|
||||||
hasOwn(casesObj, "_ownerid_value")
|
|
||||||
? casesObj[
|
|
||||||
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
]
|
|
||||||
: ""
|
|
||||||
}
|
|
||||||
/> */}
|
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t(
|
label={t(
|
||||||
"case:summary-type-of-event-label"
|
"case:summary-type-of-event-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t(
|
label={t(
|
||||||
@@ -324,31 +266,21 @@ const Pinswg_dnsid = (props) => {
|
|||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{detailsObj.pinswg_decision !== null
|
{detailsObj.pinswg_decision !== null
|
||||||
? router.locale == "cy"
|
? resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: detailsObj[
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
]
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-no-information-to-date-label"
|
||||||
|
)
|
||||||
|
})
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-information-to-date-label"
|
"case:summary-no-information-to-date-label"
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
@@ -416,22 +348,6 @@ const Pinswg_dnsid = (props) => {
|
|||||||
) : (
|
) : (
|
||||||
""
|
""
|
||||||
)}
|
)}
|
||||||
{/* <SummaryRow
|
|
||||||
label={t(
|
|
||||||
"case:summary-case-recommendation-label"
|
|
||||||
)}
|
|
||||||
value={
|
|
||||||
router.locale == "cy"
|
|
||||||
? jsonpath({path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj.pinswg_recommendation +
|
|
||||||
'")].value_cy',
|
|
||||||
transLookup,
|
|
||||||
|
|
||||||
)
|
|
||||||
: detailsObj.pinswg_recommendation
|
|
||||||
}
|
|
||||||
/> */}
|
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -443,29 +359,6 @@ const Pinswg_dnsid = (props) => {
|
|||||||
{t("case:summary-dates-label")}
|
{t("case:summary-dates-label")}
|
||||||
</h3>
|
</h3>
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
{/* <SummaryRow
|
|
||||||
label={t(
|
|
||||||
"case:summary-valid-notice-of-intention-to-submit-an-application"
|
|
||||||
)}
|
|
||||||
value={
|
|
||||||
hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_validnoticeofintentiontosubmitanapplicati"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_validnoticeofintentiontosubmitanapplicati
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_validnoticeofintentiontosubmitanapplicati
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-awaiting-information-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-awaiting-information-label"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
/> */}
|
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t(
|
label={t(
|
||||||
"case:summary-written-acceptance-of-notice"
|
"case:summary-written-acceptance-of-notice"
|
||||||
@@ -767,27 +660,7 @@ const Pinswg_dnsid = (props) => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
{/* <SummaryRow
|
|
||||||
label={t("case:summary-suspension-dates")}
|
|
||||||
value={
|
|
||||||
hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_suspensiondates"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_suspensiondates
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_suspensiondates
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
/> */}
|
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t(
|
label={t(
|
||||||
"case:summary-inspector-report-submission-to-welsh-government"
|
"case:summary-inspector-report-submission-to-welsh-government"
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import _ from "lodash";
|
|||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
import transLookup from "../../../data/lookuptranslations.json";
|
||||||
|
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
import SummaryCard from "../summary/components/SummaryCard";
|
import SummaryCard from "../summary/components/SummaryCard";
|
||||||
import SummaryRow from "../summary/components/SummaryRow";
|
import SummaryRow from "../summary/components/SummaryRow";
|
||||||
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
||||||
@@ -67,25 +68,16 @@ const Pinswg_electricityactid = (props) => {
|
|||||||
label={t(
|
label={t(
|
||||||
"case:summary-case-type-label"
|
"case:summary-case-type-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-lpa-label")}
|
label={t("case:summary-lpa-label")}
|
||||||
@@ -106,23 +98,16 @@ const Pinswg_electricityactid = (props) => {
|
|||||||
label={t(
|
label={t(
|
||||||
"case:summary-eia-required-label"
|
"case:summary-eia-required-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath(
|
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-to-be-confirmed-label"
|
||||||
transLookup
|
)
|
||||||
)
|
})}
|
||||||
: detailsObj[
|
|
||||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-to-be-confirmed-label"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
@@ -131,9 +116,6 @@ const Pinswg_electricityactid = (props) => {
|
|||||||
)}
|
)}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{" "}
|
|
||||||
{/* {casesObj.caseDetails.caseOfficer ||
|
|
||||||
""} */}
|
|
||||||
{hasOwn(casesObj, "_ownerid_value")
|
{hasOwn(casesObj, "_ownerid_value")
|
||||||
? casesObj[
|
? casesObj[
|
||||||
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
|
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
|
||||||
@@ -145,96 +127,56 @@ const Pinswg_electricityactid = (props) => {
|
|||||||
label={t(
|
label={t(
|
||||||
"case:summary-procedure-label"
|
"case:summary-procedure-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t(
|
label={t(
|
||||||
"case:summary-type-of-event-label"
|
"case:summary-type-of-event-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-status-label")}
|
label={t("case:summary-status-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-decision-label")}
|
{t("case:summary-decision-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: detailsObj[
|
||||||
path:
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-no-date-entered-label"
|
||||||
json: transLookup,
|
)
|
||||||
eval: true
|
})}
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
@@ -283,21 +225,16 @@ const Pinswg_electricityactid = (props) => {
|
|||||||
label={t(
|
label={t(
|
||||||
"case:summary-case-recommendation-label"
|
"case:summary-case-recommendation-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_recommendation"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj.pinswg_recommendation +
|
translations: transLookup,
|
||||||
'")].value_cy',
|
fallbackValue: t(
|
||||||
json: transLookup,
|
"case:summary-no-date-entered-label"
|
||||||
eval: true
|
)
|
||||||
})
|
})}
|
||||||
: detailsObj.pinswg_recommendation ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
{detailsObj.pinswg_webaddress != null && (
|
{detailsObj.pinswg_webaddress != null && (
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
import transLookup from "../../../data/lookuptranslations.json";
|
||||||
|
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
import SummaryCard from "../summary/components/SummaryCard";
|
import SummaryCard from "../summary/components/SummaryCard";
|
||||||
import SummaryRow from "../summary/components/SummaryRow";
|
import SummaryRow from "../summary/components/SummaryRow";
|
||||||
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
||||||
@@ -24,23 +24,16 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
|
|||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-case-type-label")}
|
label={t("case:summary-case-type-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-lpa-label")}
|
label={t("case:summary-lpa-label")}
|
||||||
@@ -59,110 +52,69 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
|
|||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-eia-required-label")}
|
label={t("case:summary-eia-required-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath(
|
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-to-be-confirmed-label"
|
||||||
transLookup
|
)
|
||||||
)
|
})}
|
||||||
: detailsObj[
|
|
||||||
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-to-be-confirmed-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-procedure-label")}
|
label={t("case:summary-procedure-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-type-of-event-label")}
|
label={t("case:summary-type-of-event-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-status-label")}
|
label={t("case:summary-status-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-decision-label")}
|
{t("case:summary-decision-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: detailsObj[
|
||||||
path:
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-no-information-to-date-label"
|
||||||
json: transLookup,
|
)
|
||||||
eval: true
|
})}
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
@@ -171,7 +123,9 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
|
|||||||
{t("case:summary-case-link-status-label")}
|
{t("case:summary-case-link-status-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{hasOwn(casesObj, ["numberofchildincidents"])
|
{hasOwn(casesObj, [
|
||||||
|
"numberofchildincidents"
|
||||||
|
])
|
||||||
? casesObj.numberofchildincidents > 0
|
? casesObj.numberofchildincidents > 0
|
||||||
? t(
|
? t(
|
||||||
"case:summary-case-link-status-linked"
|
"case:summary-case-link-status-linked"
|
||||||
@@ -235,7 +189,10 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
|
|||||||
"case:summary-questionnaire-due-date-label"
|
"case:summary-questionnaire-due-date-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={
|
||||||
hasOwn(detailsObj, "pinswg_questionnaireduedate")
|
hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_questionnaireduedate"
|
||||||
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_questionnaireduedate
|
detailsObj.pinswg_questionnaireduedate
|
||||||
)
|
)
|
||||||
@@ -306,7 +263,10 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
|
|||||||
"case:summary-applicant-final-comments-date-label"
|
"case:summary-applicant-final-comments-date-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={
|
||||||
hasOwn(detailsObj, "pinswg_finalcommentsduedate")
|
hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_finalcommentsduedate"
|
||||||
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
)
|
)
|
||||||
@@ -319,31 +279,7 @@ const Pinswg_enforcementlistedbuildingconseid = (props) => {
|
|||||||
: t("case:summary-no-date-entered-label")
|
: t("case:summary-no-date-entered-label")
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
{/* <div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
{t(
|
|
||||||
"case:summary-inquiry-evidence-date-label"
|
|
||||||
)}
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_proofsofevidencewrittenstatementsofeviden"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</dd>
|
|
||||||
</div> */}
|
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-event-date-label")}
|
label={t("case:summary-event-date-label")}
|
||||||
value={
|
value={
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
import transLookup from "../../../data/lookuptranslations.json";
|
||||||
|
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
import SummaryCard from "../summary/components/SummaryCard";
|
import SummaryCard from "../summary/components/SummaryCard";
|
||||||
import SummaryRow from "../summary/components/SummaryRow";
|
import SummaryRow from "../summary/components/SummaryRow";
|
||||||
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
||||||
@@ -24,23 +24,16 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
|
|||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-case-type-label")}
|
label={t("case:summary-case-type-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-lpa-label")}
|
label={t("case:summary-lpa-label")}
|
||||||
@@ -59,110 +52,69 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
|
|||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-eia-required-label")}
|
label={t("case:summary-eia-required-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath(
|
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-to-be-confirmed-label"
|
||||||
transLookup
|
)
|
||||||
)
|
})}
|
||||||
: detailsObj[
|
|
||||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-to-be-confirmed-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-procedure-label")}
|
label={t("case:summary-procedure-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-type-of-event-label")}
|
label={t("case:summary-type-of-event-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-status-label")}
|
label={t("case:summary-status-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-decision-label")}
|
{t("case:summary-decision-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: detailsObj[
|
||||||
path:
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-no-information-to-date-label"
|
||||||
json: transLookup,
|
)
|
||||||
eval: true
|
})}
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
@@ -171,7 +123,9 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
|
|||||||
{t("case:summary-case-link-status-label")}
|
{t("case:summary-case-link-status-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{hasOwn(casesObj, ["numberofchildincidents"])
|
{hasOwn(casesObj, [
|
||||||
|
"numberofchildincidents"
|
||||||
|
])
|
||||||
? casesObj.numberofchildincidents > 0
|
? casesObj.numberofchildincidents > 0
|
||||||
? t(
|
? t(
|
||||||
"case:summary-case-link-status-linked"
|
"case:summary-case-link-status-linked"
|
||||||
@@ -235,7 +189,10 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
|
|||||||
"case:summary-questionnaire-due-date-label"
|
"case:summary-questionnaire-due-date-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={
|
||||||
hasOwn(detailsObj, "pinswg_questionnaireduedate")
|
hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_questionnaireduedate"
|
||||||
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_questionnaireduedate
|
detailsObj.pinswg_questionnaireduedate
|
||||||
)
|
)
|
||||||
@@ -306,7 +263,10 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
|
|||||||
"case:summary-applicant-final-comments-date-label"
|
"case:summary-applicant-final-comments-date-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={
|
||||||
hasOwn(detailsObj, "pinswg_finalcommentsduedate")
|
hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_finalcommentsduedate"
|
||||||
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
)
|
)
|
||||||
@@ -319,27 +279,7 @@ const Pinswg_enforcementnoticeappeals174id = (props) => {
|
|||||||
: t("case:summary-no-date-entered-label")
|
: t("case:summary-no-date-entered-label")
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
{/* <SummaryRow
|
|
||||||
label={t(
|
|
||||||
"case:summary-inquiry-evidence-date-label"
|
|
||||||
)}
|
|
||||||
value={hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_proofsofevidencewrittenstatementsofeviden"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
/> */}
|
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-event-date-label")}
|
label={t("case:summary-event-date-label")}
|
||||||
value={
|
value={
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
import transLookup from "../../../data/lookuptranslations.json";
|
||||||
|
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
import SummaryCard from "../summary/components/SummaryCard";
|
import SummaryCard from "../summary/components/SummaryCard";
|
||||||
import SummaryRow from "../summary/components/SummaryRow";
|
import SummaryRow from "../summary/components/SummaryRow";
|
||||||
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
||||||
@@ -24,23 +24,16 @@ const Pinswg_environmentalpermittingid = (props) => {
|
|||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-case-type-label")}
|
label={t("case:summary-case-type-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-lpa-label")}
|
label={t("case:summary-lpa-label")}
|
||||||
@@ -59,110 +52,69 @@ const Pinswg_environmentalpermittingid = (props) => {
|
|||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-eia-required-label")}
|
label={t("case:summary-eia-required-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath(
|
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-to-be-confirmed-label"
|
||||||
transLookup
|
)
|
||||||
)
|
})}
|
||||||
: detailsObj[
|
|
||||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-to-be-confirmed-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-procedure-label")}
|
label={t("case:summary-procedure-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-type-of-event-label")}
|
label={t("case:summary-type-of-event-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-status-label")}
|
label={t("case:summary-status-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-decision-label")}
|
{t("case:summary-decision-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: detailsObj[
|
||||||
path:
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-no-information-to-date-label"
|
||||||
json: transLookup,
|
)
|
||||||
eval: true
|
})}
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
@@ -171,7 +123,9 @@ const Pinswg_environmentalpermittingid = (props) => {
|
|||||||
{t("case:summary-case-link-status-label")}
|
{t("case:summary-case-link-status-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{hasOwn(casesObj, ["numberofchildincidents"])
|
{hasOwn(casesObj, [
|
||||||
|
"numberofchildincidents"
|
||||||
|
])
|
||||||
? casesObj.numberofchildincidents > 0
|
? casesObj.numberofchildincidents > 0
|
||||||
? t(
|
? t(
|
||||||
"case:summary-case-link-status-linked"
|
"case:summary-case-link-status-linked"
|
||||||
@@ -203,26 +157,12 @@ const Pinswg_environmentalpermittingid = (props) => {
|
|||||||
label={t(
|
label={t(
|
||||||
"case:summary-case-relevant-authoritylabel"
|
"case:summary-case-relevant-authoritylabel"
|
||||||
)}
|
)}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj.pinswg_relevantauthorityname,
|
||||||
? jsonpath({
|
locale: router.locale,
|
||||||
path:
|
translations: transLookup,
|
||||||
'$..[?(@ && @.pinswg_lpa=="' +
|
fallbackValue: ""
|
||||||
detailsObj.pinswg_relevantauthorityname +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.pinswg_lpa=="' +
|
|
||||||
detailsObj.pinswg_relevantauthorityname +
|
|
||||||
'")].value',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
}) ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
</dl>
|
</dl>
|
||||||
</SummaryCard>
|
</SummaryCard>
|
||||||
@@ -260,7 +200,10 @@ const Pinswg_environmentalpermittingid = (props) => {
|
|||||||
"case:summary-questionnaire-due-date-label"
|
"case:summary-questionnaire-due-date-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={
|
||||||
hasOwn(detailsObj, "pinswg_questionnaireduedate")
|
hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_questionnaireduedate"
|
||||||
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_questionnaireduedate
|
detailsObj.pinswg_questionnaireduedate
|
||||||
)
|
)
|
||||||
@@ -331,7 +274,10 @@ const Pinswg_environmentalpermittingid = (props) => {
|
|||||||
"case:summary-applicant-final-comments-date-label"
|
"case:summary-applicant-final-comments-date-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={
|
||||||
hasOwn(detailsObj, "pinswg_finalcommentsduedate")
|
hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_finalcommentsduedate"
|
||||||
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import SummaryCard from "../summary/components/SummaryCard";
|
|||||||
import SummaryRow from "../summary/components/SummaryRow";
|
import SummaryRow from "../summary/components/SummaryRow";
|
||||||
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
||||||
import { hasOwn } from "../../utils";
|
import { hasOwn } from "../../utils";
|
||||||
|
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
|
|
||||||
const Pinswg_harbourrevisionorderid = (props) => {
|
const Pinswg_harbourrevisionorderid = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -67,25 +68,16 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
|||||||
label={t(
|
label={t(
|
||||||
"case:summary-case-type-label"
|
"case:summary-case-type-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-lpa-label")}
|
label={t("case:summary-lpa-label")}
|
||||||
@@ -106,23 +98,16 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
|||||||
label={t(
|
label={t(
|
||||||
"case:summary-eia-required-label"
|
"case:summary-eia-required-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath(
|
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-to-be-confirmed-label"
|
||||||
transLookup
|
)
|
||||||
)
|
})}
|
||||||
: detailsObj[
|
|
||||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-to-be-confirmed-label"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
@@ -131,9 +116,6 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
|||||||
)}
|
)}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{" "}
|
|
||||||
{/* {casesObj.caseDetails.caseOfficer ||
|
|
||||||
""} */}
|
|
||||||
{hasOwn(casesObj, "_ownerid_value")
|
{hasOwn(casesObj, "_ownerid_value")
|
||||||
? casesObj[
|
? casesObj[
|
||||||
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
|
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
|
||||||
@@ -145,75 +127,43 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
|||||||
label={t(
|
label={t(
|
||||||
"case:summary-procedure-label"
|
"case:summary-procedure-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-status-label")}
|
label={t("case:summary-status-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-decision-label")}
|
{t("case:summary-decision-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: detailsObj[
|
||||||
path:
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-no-information-to-date-label"
|
||||||
json: transLookup,
|
)
|
||||||
eval: true
|
})}
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
@@ -262,21 +212,14 @@ const Pinswg_harbourrevisionorderid = (props) => {
|
|||||||
label={t(
|
label={t(
|
||||||
"case:summary-case-recommendation-label"
|
"case:summary-case-recommendation-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj.pinswg_recommendation,
|
||||||
? jsonpath({
|
locale,
|
||||||
path:
|
translations: transLookup,
|
||||||
'$..[?(@ && @.value=="' +
|
fallbackValue: t(
|
||||||
detailsObj.pinswg_recommendation +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj.pinswg_recommendation ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
{detailsObj.pinswg_webaddress != null && (
|
{detailsObj.pinswg_webaddress != null && (
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
import transLookup from "../../../data/lookuptranslations.json";
|
||||||
|
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
import SummaryCard from "../summary/components/SummaryCard";
|
import SummaryCard from "../summary/components/SummaryCard";
|
||||||
import SummaryRow from "../summary/components/SummaryRow";
|
import SummaryRow from "../summary/components/SummaryRow";
|
||||||
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
||||||
@@ -24,43 +24,30 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
|
|||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-case-type-label")}
|
label={t("case:summary-case-type-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={"Specialist Case Process"}
|
label={t(
|
||||||
value={
|
"case:summary-specialist-case-process-label"
|
||||||
router.locale == "cy"
|
)}
|
||||||
? jsonpath({
|
value={resolveCrmDisplayValue({
|
||||||
path:
|
value: detailsObj[
|
||||||
'$..[?(@ && @.value=="' +
|
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
|
||||||
detailsObj[
|
],
|
||||||
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
|
locale,
|
||||||
] +
|
translations: transLookup,
|
||||||
'")].value_cy',
|
fallbackValue: ""
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
@@ -80,110 +67,69 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
|
|||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-eia-required-label")}
|
label={t("case:summary-eia-required-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath(
|
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-to-be-confirmed-label"
|
||||||
transLookup
|
)
|
||||||
)
|
})}
|
||||||
: detailsObj[
|
|
||||||
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-to-be-confirmed-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-procedure-label")}
|
label={t("case:summary-procedure-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-type-of-event-label")}
|
label={t("case:summary-type-of-event-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-status-label")}
|
label={t("case:summary-status-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-decision-label")}
|
{t("case:summary-decision-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: detailsObj[
|
||||||
path:
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-no-information-to-date-label"
|
||||||
json: transLookup,
|
)
|
||||||
eval: true
|
})}
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
@@ -192,7 +138,9 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
|
|||||||
{t("case:summary-case-link-status-label")}
|
{t("case:summary-case-link-status-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{hasOwn(casesObj, ["numberofchildincidents"])
|
{hasOwn(casesObj, [
|
||||||
|
"numberofchildincidents"
|
||||||
|
])
|
||||||
? casesObj.numberofchildincidents > 0
|
? casesObj.numberofchildincidents > 0
|
||||||
? t(
|
? t(
|
||||||
"case:summary-case-link-status-linked"
|
"case:summary-case-link-status-linked"
|
||||||
@@ -224,26 +172,12 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
|
|||||||
label={t(
|
label={t(
|
||||||
"case:summary-case-relevant-authoritylabel"
|
"case:summary-case-relevant-authoritylabel"
|
||||||
)}
|
)}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj.pinswg_relevantauthorityname,
|
||||||
? jsonpath({
|
locale: router.locale,
|
||||||
path:
|
translations: transLookup,
|
||||||
'$..[?(@ && @.pinswg_lpa=="' +
|
fallbackValue: ""
|
||||||
detailsObj.pinswg_relevantauthorityname +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.pinswg_lpa=="' +
|
|
||||||
detailsObj.pinswg_relevantauthorityname +
|
|
||||||
'")].value',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
}) ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
</dl>
|
</dl>
|
||||||
</SummaryCard>
|
</SummaryCard>
|
||||||
@@ -281,7 +215,10 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
|
|||||||
"case:summary-questionnaire-due-date-label"
|
"case:summary-questionnaire-due-date-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={
|
||||||
hasOwn(detailsObj, "pinswg_questionnaireduedate")
|
hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_questionnaireduedate"
|
||||||
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_questionnaireduedate
|
detailsObj.pinswg_questionnaireduedate
|
||||||
)
|
)
|
||||||
@@ -352,7 +289,10 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
|
|||||||
"case:summary-applicant-final-comments-date-label"
|
"case:summary-applicant-final-comments-date-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={
|
||||||
hasOwn(detailsObj, "pinswg_finalcommentsduedate")
|
hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_finalcommentsduedate"
|
||||||
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
)
|
)
|
||||||
@@ -365,27 +305,7 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
|
|||||||
: t("case:summary-no-date-entered-label")
|
: t("case:summary-no-date-entered-label")
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
{/* <SummaryRow
|
|
||||||
label={t(
|
|
||||||
"case:summary-inquiry-evidence-date-label"
|
|
||||||
)}
|
|
||||||
value={hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_proofsofevidencewrittenstatementsofeviden"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
/> */}
|
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-event-date-label")}
|
label={t("case:summary-event-date-label")}
|
||||||
value={
|
value={
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
import transLookup from "../../../data/lookuptranslations.json";
|
||||||
|
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
import SummaryCard from "../summary/components/SummaryCard";
|
import SummaryCard from "../summary/components/SummaryCard";
|
||||||
import SummaryRow from "../summary/components/SummaryRow";
|
import SummaryRow from "../summary/components/SummaryRow";
|
||||||
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
||||||
@@ -24,23 +24,16 @@ const Pinswg_householderappealhasid = (props) => {
|
|||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-case-type-label")}
|
label={t("case:summary-case-type-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-lpa-label")}
|
label={t("case:summary-lpa-label")}
|
||||||
@@ -59,91 +52,58 @@ const Pinswg_householderappealhasid = (props) => {
|
|||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-eia-required-label")}
|
label={t("case:summary-eia-required-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath(
|
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-to-be-confirmed-label"
|
||||||
transLookup
|
)
|
||||||
)
|
})}
|
||||||
: detailsObj[
|
|
||||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-to-be-confirmed-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-procedure-label")}
|
label={t("case:summary-procedure-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-status-label")}
|
label={t("case:summary-status-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-decision-label")}
|
{t("case:summary-decision-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: detailsObj[
|
||||||
path:
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-no-information-to-date-label"
|
||||||
json: transLookup,
|
)
|
||||||
eval: true
|
})}
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
@@ -152,7 +112,9 @@ const Pinswg_householderappealhasid = (props) => {
|
|||||||
{t("case:summary-case-link-status-label")}
|
{t("case:summary-case-link-status-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{hasOwn(casesObj, ["numberofchildincidents"])
|
{hasOwn(casesObj, [
|
||||||
|
"numberofchildincidents"
|
||||||
|
])
|
||||||
? casesObj.numberofchildincidents > 0
|
? casesObj.numberofchildincidents > 0
|
||||||
? t(
|
? t(
|
||||||
"case:summary-case-link-status-linked"
|
"case:summary-case-link-status-linked"
|
||||||
@@ -216,7 +178,10 @@ const Pinswg_householderappealhasid = (props) => {
|
|||||||
"case:summary-questionnaire-due-date-label"
|
"case:summary-questionnaire-due-date-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={
|
||||||
hasOwn(detailsObj, "pinswg_questionnaireduedate")
|
hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_questionnaireduedate"
|
||||||
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_questionnaireduedate
|
detailsObj.pinswg_questionnaireduedate
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
import transLookup from "../../../data/lookuptranslations.json";
|
||||||
|
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
import SummaryCard from "../summary/components/SummaryCard";
|
import SummaryCard from "../summary/components/SummaryCard";
|
||||||
import SummaryRow from "../summary/components/SummaryRow";
|
import SummaryRow from "../summary/components/SummaryRow";
|
||||||
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
||||||
@@ -24,23 +24,16 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
|
|||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-case-type-label")}
|
label={t("case:summary-case-type-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-lpa-label")}
|
label={t("case:summary-lpa-label")}
|
||||||
@@ -59,110 +52,67 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
|
|||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-eia-required-label")}
|
label={t("case:summary-eia-required-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath(
|
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-to-be-confirmed-label"
|
||||||
transLookup
|
)
|
||||||
)
|
})}
|
||||||
: detailsObj[
|
|
||||||
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-to-be-confirmed-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-procedure-label")}
|
label={t("case:summary-procedure-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-type-of-event-label")}
|
label={t("case:summary-type-of-event-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-status-label")}
|
label={t("case:summary-status-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-decision-label")}
|
{t("case:summary-decision-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: detailsObj[
|
||||||
path:
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-no-information-to-date-label"
|
||||||
json: transLookup,
|
)
|
||||||
eval: true
|
})}
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
@@ -171,7 +121,9 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
|
|||||||
{t("case:summary-case-link-status-label")}
|
{t("case:summary-case-link-status-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{hasOwn(casesObj, ["numberofchildincidents"])
|
{hasOwn(casesObj, [
|
||||||
|
"numberofchildincidents"
|
||||||
|
])
|
||||||
? casesObj.numberofchildincidents > 0
|
? casesObj.numberofchildincidents > 0
|
||||||
? t(
|
? t(
|
||||||
"case:summary-case-link-status-linked"
|
"case:summary-case-link-status-linked"
|
||||||
@@ -235,7 +187,10 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
|
|||||||
"case:summary-questionnaire-due-date-label"
|
"case:summary-questionnaire-due-date-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={
|
||||||
hasOwn(detailsObj, "pinswg_questionnaireduedate")
|
hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_questionnaireduedate"
|
||||||
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_questionnaireduedate
|
detailsObj.pinswg_questionnaireduedate
|
||||||
)
|
)
|
||||||
@@ -306,7 +261,10 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
|
|||||||
"case:summary-applicant-final-comments-date-label"
|
"case:summary-applicant-final-comments-date-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={
|
||||||
hasOwn(detailsObj, "pinswg_finalcommentsduedate")
|
hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_finalcommentsduedate"
|
||||||
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
)
|
)
|
||||||
@@ -319,27 +277,7 @@ const Pinswg_lawfuldevelopmentcertificatappid = (props) => {
|
|||||||
: t("case:summary-no-date-entered-label")
|
: t("case:summary-no-date-entered-label")
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
{/* <SummaryRow
|
|
||||||
label={t(
|
|
||||||
"case:summary-inquiry-evidence-date-label"
|
|
||||||
)}
|
|
||||||
value={hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_proofsofevidencewrittenstatementsofeviden"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
/> */}
|
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-event-date-label")}
|
label={t("case:summary-event-date-label")}
|
||||||
value={
|
value={
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
import transLookup from "../../../data/lookuptranslations.json";
|
||||||
|
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
import SummaryCard from "../summary/components/SummaryCard";
|
import SummaryCard from "../summary/components/SummaryCard";
|
||||||
import SummaryRow from "../summary/components/SummaryRow";
|
import SummaryRow from "../summary/components/SummaryRow";
|
||||||
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
||||||
@@ -24,23 +24,16 @@ const Pinswg_ldpid = (props) => {
|
|||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-case-type-label")}
|
label={t("case:summary-case-type-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-lpa-label")}
|
label={t("case:summary-lpa-label")}
|
||||||
@@ -60,92 +53,56 @@ const Pinswg_ldpid = (props) => {
|
|||||||
|
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-procedure-label")}
|
label={t("case:summary-procedure-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-type-of-event-label")}
|
label={t("case:summary-type-of-event-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-status-label")}
|
label={t("case:summary-status-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-decision-label")}
|
{t("case:summary-decision-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: detailsObj[
|
||||||
path:
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-no-information-to-date-label"
|
||||||
json: transLookup,
|
)
|
||||||
eval: true
|
})}
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
@@ -154,7 +111,9 @@ const Pinswg_ldpid = (props) => {
|
|||||||
{t("case:summary-case-link-status-label")}
|
{t("case:summary-case-link-status-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{hasOwn(casesObj, ["numberofchildincidents"])
|
{hasOwn(casesObj, [
|
||||||
|
"numberofchildincidents"
|
||||||
|
])
|
||||||
? casesObj.numberofchildincidents > 0
|
? casesObj.numberofchildincidents > 0
|
||||||
? t(
|
? t(
|
||||||
"case:summary-case-link-status-linked"
|
"case:summary-case-link-status-linked"
|
||||||
@@ -218,7 +177,10 @@ const Pinswg_ldpid = (props) => {
|
|||||||
"case:summary-questionnaire-due-date-label"
|
"case:summary-questionnaire-due-date-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={
|
||||||
hasOwn(detailsObj, "pinswg_questionnaireduedate")
|
hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_questionnaireduedate"
|
||||||
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_questionnaireduedate
|
detailsObj.pinswg_questionnaireduedate
|
||||||
)
|
)
|
||||||
@@ -289,7 +251,10 @@ const Pinswg_ldpid = (props) => {
|
|||||||
"case:summary-applicant-final-comments-date-label"
|
"case:summary-applicant-final-comments-date-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={
|
||||||
hasOwn(detailsObj, "pinswg_finalcommentsduedate")
|
hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_finalcommentsduedate"
|
||||||
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
)
|
)
|
||||||
@@ -302,27 +267,7 @@ const Pinswg_ldpid = (props) => {
|
|||||||
: t("case:summary-no-date-entered-label")
|
: t("case:summary-no-date-entered-label")
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
{/* <SummaryRow
|
|
||||||
label={t(
|
|
||||||
"case:summary-inquiry-evidence-date-label"
|
|
||||||
)}
|
|
||||||
value={hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_proofsofevidencewrittenstatementsofeviden"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
/> */}
|
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-event-date-label")}
|
label={t("case:summary-event-date-label")}
|
||||||
value={
|
value={
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
import transLookup from "../../../data/lookuptranslations.json";
|
||||||
|
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
import SummaryCard from "../summary/components/SummaryCard";
|
import SummaryCard from "../summary/components/SummaryCard";
|
||||||
import SummaryRow from "../summary/components/SummaryRow";
|
import SummaryRow from "../summary/components/SummaryRow";
|
||||||
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
||||||
@@ -24,23 +24,16 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
|
|||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-case-type-label")}
|
label={t("case:summary-case-type-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-lpa-label")}
|
label={t("case:summary-lpa-label")}
|
||||||
@@ -59,110 +52,69 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
|
|||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-eia-required-label")}
|
label={t("case:summary-eia-required-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath(
|
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-to-be-confirmed-label"
|
||||||
transLookup
|
)
|
||||||
)
|
})}
|
||||||
: detailsObj[
|
|
||||||
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-to-be-confirmed-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-procedure-label")}
|
label={t("case:summary-procedure-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-type-of-event-label")}
|
label={t("case:summary-type-of-event-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-status-label")}
|
label={t("case:summary-status-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-decision-label")}
|
{t("case:summary-decision-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: detailsObj[
|
||||||
path:
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-no-information-to-date-label"
|
||||||
json: transLookup,
|
)
|
||||||
eval: true
|
})}
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
@@ -171,7 +123,9 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
|
|||||||
{t("case:summary-case-link-status-label")}
|
{t("case:summary-case-link-status-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{hasOwn(casesObj, ["numberofchildincidents"])
|
{hasOwn(casesObj, [
|
||||||
|
"numberofchildincidents"
|
||||||
|
])
|
||||||
? casesObj.numberofchildincidents > 0
|
? casesObj.numberofchildincidents > 0
|
||||||
? t(
|
? t(
|
||||||
"case:summary-case-link-status-linked"
|
"case:summary-case-link-status-linked"
|
||||||
@@ -235,7 +189,10 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
|
|||||||
"case:summary-questionnaire-due-date-label"
|
"case:summary-questionnaire-due-date-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={
|
||||||
hasOwn(detailsObj, "pinswg_questionnaireduedate")
|
hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_questionnaireduedate"
|
||||||
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_questionnaireduedate
|
detailsObj.pinswg_questionnaireduedate
|
||||||
)
|
)
|
||||||
@@ -306,7 +263,10 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
|
|||||||
"case:summary-applicant-final-comments-date-label"
|
"case:summary-applicant-final-comments-date-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={
|
||||||
hasOwn(detailsObj, "pinswg_finalcommentsduedate")
|
hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_finalcommentsduedate"
|
||||||
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
)
|
)
|
||||||
@@ -319,27 +279,7 @@ const Pinswg_listedbuildingandconservationrid = (props) => {
|
|||||||
: t("case:summary-no-date-entered-label")
|
: t("case:summary-no-date-entered-label")
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
{/* <SummaryRow
|
|
||||||
label={t(
|
|
||||||
"case:summary-inquiry-evidence-date-label"
|
|
||||||
)}
|
|
||||||
value={hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_proofsofevidencewrittenstatementsofeviden"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
/> */}
|
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-event-date-label")}
|
label={t("case:summary-event-date-label")}
|
||||||
value={
|
value={
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
import transLookup from "../../../data/lookuptranslations.json";
|
||||||
|
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
import SummaryCard from "../summary/components/SummaryCard";
|
import SummaryCard from "../summary/components/SummaryCard";
|
||||||
import SummaryRow from "../summary/components/SummaryRow";
|
import SummaryRow from "../summary/components/SummaryRow";
|
||||||
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
||||||
@@ -24,23 +24,16 @@ const Pinswg_maintenanceoflands217id = (props) => {
|
|||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-case-type-label")}
|
label={t("case:summary-case-type-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-lpa-label")}
|
label={t("case:summary-lpa-label")}
|
||||||
@@ -59,110 +52,69 @@ const Pinswg_maintenanceoflands217id = (props) => {
|
|||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-eia-required-label")}
|
label={t("case:summary-eia-required-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath(
|
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-to-be-confirmed-label"
|
||||||
transLookup
|
)
|
||||||
)
|
})}
|
||||||
: detailsObj[
|
|
||||||
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-to-be-confirmed-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-procedure-label")}
|
label={t("case:summary-procedure-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-type-of-event-label")}
|
label={t("case:summary-type-of-event-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-status-label")}
|
label={t("case:summary-status-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-decision-label")}
|
{t("case:summary-decision-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: detailsObj[
|
||||||
path:
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-no-information-to-date-label"
|
||||||
json: transLookup,
|
)
|
||||||
eval: true
|
})}
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
@@ -171,7 +123,9 @@ const Pinswg_maintenanceoflands217id = (props) => {
|
|||||||
{t("case:summary-case-link-status-label")}
|
{t("case:summary-case-link-status-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{hasOwn(casesObj, ["numberofchildincidents"])
|
{hasOwn(casesObj, [
|
||||||
|
"numberofchildincidents"
|
||||||
|
])
|
||||||
? casesObj.numberofchildincidents > 0
|
? casesObj.numberofchildincidents > 0
|
||||||
? t(
|
? t(
|
||||||
"case:summary-case-link-status-linked"
|
"case:summary-case-link-status-linked"
|
||||||
@@ -235,7 +189,10 @@ const Pinswg_maintenanceoflands217id = (props) => {
|
|||||||
"case:summary-questionnaire-due-date-label"
|
"case:summary-questionnaire-due-date-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={
|
||||||
hasOwn(detailsObj, "pinswg_questionnaireduedate")
|
hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_questionnaireduedate"
|
||||||
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_questionnaireduedate
|
detailsObj.pinswg_questionnaireduedate
|
||||||
)
|
)
|
||||||
@@ -306,7 +263,10 @@ const Pinswg_maintenanceoflands217id = (props) => {
|
|||||||
"case:summary-applicant-final-comments-date-label"
|
"case:summary-applicant-final-comments-date-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={
|
||||||
hasOwn(detailsObj, "pinswg_finalcommentsduedate")
|
hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_finalcommentsduedate"
|
||||||
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
import transLookup from "../../../data/lookuptranslations.json";
|
||||||
|
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
import SummaryCard from "../summary/components/SummaryCard";
|
import SummaryCard from "../summary/components/SummaryCard";
|
||||||
import SummaryRow from "../summary/components/SummaryRow";
|
import SummaryRow from "../summary/components/SummaryRow";
|
||||||
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
||||||
@@ -24,23 +24,16 @@ const Pinswg_miscellaneouscasewordid = (props) => {
|
|||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-case-type-label")}
|
label={t("case:summary-case-type-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-lpa-label")}
|
label={t("case:summary-lpa-label")}
|
||||||
@@ -59,110 +52,69 @@ const Pinswg_miscellaneouscasewordid = (props) => {
|
|||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-eia-required-label")}
|
label={t("case:summary-eia-required-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath(
|
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-to-be-confirmed-label"
|
||||||
transLookup
|
)
|
||||||
)
|
})}
|
||||||
: detailsObj[
|
|
||||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-to-be-confirmed-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-procedure-label")}
|
label={t("case:summary-procedure-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-type-of-event-label")}
|
label={t("case:summary-type-of-event-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-status-label")}
|
label={t("case:summary-status-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-decision-label")}
|
{t("case:summary-decision-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: detailsObj[
|
||||||
path:
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-no-information-to-date-label"
|
||||||
json: transLookup,
|
)
|
||||||
eval: true
|
})}
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
@@ -171,7 +123,9 @@ const Pinswg_miscellaneouscasewordid = (props) => {
|
|||||||
{t("case:summary-case-link-status-label")}
|
{t("case:summary-case-link-status-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{hasOwn(casesObj, ["numberofchildincidents"])
|
{hasOwn(casesObj, [
|
||||||
|
"numberofchildincidents"
|
||||||
|
])
|
||||||
? casesObj.numberofchildincidents > 0
|
? casesObj.numberofchildincidents > 0
|
||||||
? t(
|
? t(
|
||||||
"case:summary-case-link-status-linked"
|
"case:summary-case-link-status-linked"
|
||||||
@@ -203,26 +157,12 @@ const Pinswg_miscellaneouscasewordid = (props) => {
|
|||||||
label={t(
|
label={t(
|
||||||
"case:summary-case-relevant-authoritylabel"
|
"case:summary-case-relevant-authoritylabel"
|
||||||
)}
|
)}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj.pinswg_relevantauthorityname,
|
||||||
? jsonpath({
|
locale: router.locale,
|
||||||
path:
|
translations: transLookup,
|
||||||
'$..[?(@ && @.pinswg_lpa=="' +
|
fallbackValue: ""
|
||||||
detailsObj.pinswg_relevantauthorityname +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.pinswg_lpa=="' +
|
|
||||||
detailsObj.pinswg_relevantauthorityname +
|
|
||||||
'")].value',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
}) ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
</dl>
|
</dl>
|
||||||
</SummaryCard>
|
</SummaryCard>
|
||||||
@@ -260,7 +200,10 @@ const Pinswg_miscellaneouscasewordid = (props) => {
|
|||||||
"case:summary-questionnaire-due-date-label"
|
"case:summary-questionnaire-due-date-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={
|
||||||
hasOwn(detailsObj, "pinswg_questionnaireduedate")
|
hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_questionnaireduedate"
|
||||||
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_questionnaireduedate
|
detailsObj.pinswg_questionnaireduedate
|
||||||
)
|
)
|
||||||
@@ -331,7 +274,10 @@ const Pinswg_miscellaneouscasewordid = (props) => {
|
|||||||
"case:summary-applicant-final-comments-date-label"
|
"case:summary-applicant-final-comments-date-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={
|
||||||
hasOwn(detailsObj, "pinswg_finalcommentsduedate")
|
hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_finalcommentsduedate"
|
||||||
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
import transLookup from "../../../data/lookuptranslations.json";
|
||||||
|
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
import SummaryCard from "../summary/components/SummaryCard";
|
import SummaryCard from "../summary/components/SummaryCard";
|
||||||
import SummaryRow from "../summary/components/SummaryRow";
|
import SummaryRow from "../summary/components/SummaryRow";
|
||||||
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
||||||
@@ -24,23 +24,16 @@ const Pinswg_nonvalidationid = (props) => {
|
|||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-case-type-label")}
|
label={t("case:summary-case-type-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-lpa-label")}
|
label={t("case:summary-lpa-label")}
|
||||||
@@ -60,54 +53,34 @@ const Pinswg_nonvalidationid = (props) => {
|
|||||||
|
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-status-label")}
|
label={t("case:summary-status-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-decision-label")}
|
{t("case:summary-decision-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: detailsObj[
|
||||||
path:
|
"pinswg_decisionissued@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_decisionissued@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-no-information-to-date-label"
|
||||||
json: transLookup,
|
)
|
||||||
eval: true
|
})}
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decisionissued@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
</dl>
|
</dl>
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
import transLookup from "../../../data/lookuptranslations.json";
|
||||||
|
import pickListLookup from "../../../data/picklistLookups.json";
|
||||||
import SummaryCard from "../summary/components/SummaryCard";
|
import SummaryCard from "../summary/components/SummaryCard";
|
||||||
import SummaryRow from "../summary/components/SummaryRow";
|
import SummaryRow from "../summary/components/SummaryRow";
|
||||||
import {
|
import {
|
||||||
@@ -10,6 +10,7 @@ import {
|
|||||||
getCaseLpaDisplayLines
|
getCaseLpaDisplayLines
|
||||||
} from "../../utils/getCaseLpaDisplayValue";
|
} from "../../utils/getCaseLpaDisplayValue";
|
||||||
import { hasOwn } from "../../utils";
|
import { hasOwn } from "../../utils";
|
||||||
|
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
|
|
||||||
const Pinswg_planningappeals78id = (props) => {
|
const Pinswg_planningappeals78id = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -27,23 +28,16 @@ const Pinswg_planningappeals78id = (props) => {
|
|||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-case-type-label")}
|
label={t("case:summary-case-type-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale: router.locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-lpa-label")}
|
label={t("case:summary-lpa-label")}
|
||||||
@@ -60,115 +54,73 @@ const Pinswg_planningappeals78id = (props) => {
|
|||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-eia-required-label")}
|
label={t("case:summary-eia-required-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath(
|
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@.value=="' +
|
],
|
||||||
detailsObj[
|
locale: router.locale,
|
||||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-to-be-confirmed-label"
|
||||||
transLookup
|
)
|
||||||
)
|
})}
|
||||||
: detailsObj[
|
|
||||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-to-be-confirmed-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-procedure-label")}
|
label={t("case:summary-procedure-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale: router.locale,
|
||||||
detailsObj[
|
translations: pickListLookup
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
})}
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-type-of-event-label")}
|
label={t("case:summary-type-of-event-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale: router.locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-information-to-date-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-status-label")}
|
label={t("case:summary-status-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale: router.locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-decision-label")}
|
{t("case:summary-decision-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: detailsObj[
|
||||||
path:
|
"pinswg_dicision@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
detailsObj[
|
locale: router.locale,
|
||||||
"pinswg_dicision@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-no-information-to-date-label"
|
||||||
json: transLookup,
|
)
|
||||||
eval: true
|
})}
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_dicision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
@@ -295,43 +247,6 @@ const Pinswg_planningappeals78id = (props) => {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* <SummaryRow
|
|
||||||
label={t(
|
|
||||||
"case:summary-interested-party-date-label"
|
|
||||||
)}
|
|
||||||
value={
|
|
||||||
hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_otherpartiesstatement"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_otherpartiesstatement
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_otherpartiesstatement
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_otherpartiesstatements"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_otherpartiesstatements
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_otherpartiesstatements
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
/> */}
|
|
||||||
|
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-final-comments-date-label")}
|
label={t("case:summary-final-comments-date-label")}
|
||||||
value={
|
value={
|
||||||
@@ -351,50 +266,6 @@ const Pinswg_planningappeals78id = (props) => {
|
|||||||
: t("case:summary-no-date-entered-label")
|
: t("case:summary-no-date-entered-label")
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
{/* <SummaryRow
|
|
||||||
label={t(
|
|
||||||
"case:summary-inquiry-evidence-date-label"
|
|
||||||
)}
|
|
||||||
value={
|
|
||||||
hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_proofsofevidencewrittenstatementsofeviden"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
/> */}
|
|
||||||
{/* <SummaryRow
|
|
||||||
label={t("case:summary-event-date-label")}
|
|
||||||
value={
|
|
||||||
hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_dateeventrequested"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_dateeventrequested
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_dateeventrequested
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
/> */}
|
|
||||||
|
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-event-date-label")}
|
label={t("case:summary-event-date-label")}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
import transLookup from "../../../data/lookuptranslations.json";
|
||||||
|
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
import SummaryCard from "../summary/components/SummaryCard";
|
import SummaryCard from "../summary/components/SummaryCard";
|
||||||
import SummaryRow from "../summary/components/SummaryRow";
|
import SummaryRow from "../summary/components/SummaryRow";
|
||||||
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
||||||
@@ -24,23 +24,16 @@ const Pinswg_planningconditionss73s79id = (props) => {
|
|||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-case-type-label")}
|
label={t("case:summary-case-type-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-lpa-label")}
|
label={t("case:summary-lpa-label")}
|
||||||
@@ -59,110 +52,69 @@ const Pinswg_planningconditionss73s79id = (props) => {
|
|||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-eia-required-label")}
|
label={t("case:summary-eia-required-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath(
|
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-to-be-confirmed-label"
|
||||||
transLookup
|
)
|
||||||
)
|
})}
|
||||||
: detailsObj[
|
|
||||||
"pinswg_detailedeiascreeningrequiered@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-to-be-confirmed-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-procedure-label")}
|
label={t("case:summary-procedure-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-type-of-event-label")}
|
label={t("case:summary-type-of-event-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-status-label")}
|
label={t("case:summary-status-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-decision-label")}
|
{t("case:summary-decision-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: detailsObj[
|
||||||
path:
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-no-information-to-date-label"
|
||||||
json: transLookup,
|
)
|
||||||
eval: true
|
})}
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
@@ -171,7 +123,9 @@ const Pinswg_planningconditionss73s79id = (props) => {
|
|||||||
{t("case:summary-case-link-status-label")}
|
{t("case:summary-case-link-status-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{hasOwn(casesObj, ["numberofchildincidents"])
|
{hasOwn(casesObj, [
|
||||||
|
"numberofchildincidents"
|
||||||
|
])
|
||||||
? casesObj.numberofchildincidents > 0
|
? casesObj.numberofchildincidents > 0
|
||||||
? t(
|
? t(
|
||||||
"case:summary-case-link-status-linked"
|
"case:summary-case-link-status-linked"
|
||||||
@@ -235,7 +189,10 @@ const Pinswg_planningconditionss73s79id = (props) => {
|
|||||||
"case:summary-questionnaire-due-date-label"
|
"case:summary-questionnaire-due-date-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={
|
||||||
hasOwn(detailsObj, "pinswg_questionnaireduedate")
|
hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_questionnaireduedate"
|
||||||
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_questionnaireduedate
|
detailsObj.pinswg_questionnaireduedate
|
||||||
)
|
)
|
||||||
@@ -306,7 +263,10 @@ const Pinswg_planningconditionss73s79id = (props) => {
|
|||||||
"case:summary-applicant-final-comments-date-label"
|
"case:summary-applicant-final-comments-date-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={
|
||||||
hasOwn(detailsObj, "pinswg_finalcommentsduedate")
|
hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_finalcommentsduedate"
|
||||||
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
)
|
)
|
||||||
@@ -319,29 +279,7 @@ const Pinswg_planningconditionss73s79id = (props) => {
|
|||||||
: t("case:summary-no-date-entered-label")
|
: t("case:summary-no-date-entered-label")
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
{/* <SummaryRow
|
|
||||||
label={t(
|
|
||||||
"case:summary-inquiry-evidence-date-label"
|
|
||||||
)}
|
|
||||||
value={
|
|
||||||
hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_proofsofevidencewrittenstatementsofeviden"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
/> */}
|
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-event-date-label")}
|
label={t("case:summary-event-date-label")}
|
||||||
value={
|
value={
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
import transLookup from "../../../data/lookuptranslations.json";
|
||||||
|
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
import SummaryCard from "../summary/components/SummaryCard";
|
import SummaryCard from "../summary/components/SummaryCard";
|
||||||
import SummaryRow from "../summary/components/SummaryRow";
|
import SummaryRow from "../summary/components/SummaryRow";
|
||||||
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
||||||
@@ -24,23 +24,16 @@ const Pinswg_planningobligationappeals106id = (props) => {
|
|||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-case-type-label")}
|
label={t("case:summary-case-type-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-lpa-label")}
|
label={t("case:summary-lpa-label")}
|
||||||
@@ -59,110 +52,69 @@ const Pinswg_planningobligationappeals106id = (props) => {
|
|||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-eia-required-label")}
|
label={t("case:summary-eia-required-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath(
|
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-to-be-confirmed-label"
|
||||||
transLookup
|
)
|
||||||
)
|
})}
|
||||||
: detailsObj[
|
|
||||||
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-to-be-confirmed-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-procedure-label")}
|
label={t("case:summary-procedure-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-type-of-event-label")}
|
label={t("case:summary-type-of-event-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-status-label")}
|
label={t("case:summary-status-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-decision-label")}
|
{t("case:summary-decision-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: detailsObj[
|
||||||
path:
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-no-information-to-date-label"
|
||||||
json: transLookup,
|
)
|
||||||
eval: true
|
})}
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
@@ -171,7 +123,9 @@ const Pinswg_planningobligationappeals106id = (props) => {
|
|||||||
{t("case:summary-case-link-status-label")}
|
{t("case:summary-case-link-status-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{hasOwn(casesObj, ["numberofchildincidents"])
|
{hasOwn(casesObj, [
|
||||||
|
"numberofchildincidents"
|
||||||
|
])
|
||||||
? casesObj.numberofchildincidents > 0
|
? casesObj.numberofchildincidents > 0
|
||||||
? t(
|
? t(
|
||||||
"case:summary-case-link-status-linked"
|
"case:summary-case-link-status-linked"
|
||||||
@@ -235,7 +189,10 @@ const Pinswg_planningobligationappeals106id = (props) => {
|
|||||||
"case:summary-questionnaire-due-date-label"
|
"case:summary-questionnaire-due-date-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={
|
||||||
hasOwn(detailsObj, "pinswg_questionnaireduedate")
|
hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_questionnaireduedate"
|
||||||
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_questionnaireduedate
|
detailsObj.pinswg_questionnaireduedate
|
||||||
)
|
)
|
||||||
@@ -306,7 +263,10 @@ const Pinswg_planningobligationappeals106id = (props) => {
|
|||||||
"case:summary-applicant-final-comments-date-label"
|
"case:summary-applicant-final-comments-date-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={
|
||||||
hasOwn(detailsObj, "pinswg_finalcommentsduedate")
|
hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_finalcommentsduedate"
|
||||||
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
@@ -7,6 +6,7 @@ import SummaryCard from "../summary/components/SummaryCard";
|
|||||||
import SummaryRow from "../summary/components/SummaryRow";
|
import SummaryRow from "../summary/components/SummaryRow";
|
||||||
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
||||||
import { hasOwn } from "../../utils";
|
import { hasOwn } from "../../utils";
|
||||||
|
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
|
|
||||||
const Pinswg_rowid = (props) => {
|
const Pinswg_rowid = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -24,43 +24,30 @@ const Pinswg_rowid = (props) => {
|
|||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-case-type-label")}
|
label={t("case:summary-case-type-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={"Specialist Case Process"}
|
label={t(
|
||||||
value={
|
"case:summary-specialist-case-process-label"
|
||||||
router.locale == "cy"
|
)}
|
||||||
? jsonpath({
|
value={resolveCrmDisplayValue({
|
||||||
path:
|
value: detailsObj[
|
||||||
'$..[?(@ && @.value=="' +
|
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
|
||||||
detailsObj[
|
],
|
||||||
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
|
locale,
|
||||||
] +
|
translations: transLookup,
|
||||||
'")].value_cy',
|
fallbackValue: ""
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
@@ -80,110 +67,67 @@ const Pinswg_rowid = (props) => {
|
|||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-eia-required-label")}
|
label={t("case:summary-eia-required-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath(
|
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
t("case:summary-to-be-confirmed-label")
|
||||||
transLookup
|
)
|
||||||
)
|
})}
|
||||||
: detailsObj[
|
|
||||||
"pinswg_detailedeiascreeningrequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-to-be-confirmed-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-procedure-label")}
|
label={t("case:summary-procedure-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-type-of-event-label")}
|
label={t("case:summary-type-of-event-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-status-label")}
|
label={t("case:summary-status-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale: router.locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
t("case:summary-no-date-entered-label")
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-decision-label")}
|
{t("case:summary-decision-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: detailsObj[
|
||||||
path:
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
detailsObj[
|
locale: router.locale,
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-no-information-to-date-label"
|
||||||
json: transLookup,
|
)
|
||||||
eval: true
|
})}
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
@@ -192,7 +136,9 @@ const Pinswg_rowid = (props) => {
|
|||||||
{t("case:summary-case-link-status-label")}
|
{t("case:summary-case-link-status-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{hasOwn(casesObj, ["numberofchildincidents"])
|
{hasOwn(casesObj, [
|
||||||
|
"numberofchildincidents"
|
||||||
|
])
|
||||||
? casesObj.numberofchildincidents > 0
|
? casesObj.numberofchildincidents > 0
|
||||||
? t(
|
? t(
|
||||||
"case:summary-case-link-status-linked"
|
"case:summary-case-link-status-linked"
|
||||||
@@ -224,26 +170,12 @@ const Pinswg_rowid = (props) => {
|
|||||||
label={t(
|
label={t(
|
||||||
"case:summary-case-relevant-authoritylabel"
|
"case:summary-case-relevant-authoritylabel"
|
||||||
)}
|
)}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj.pinswg_relevantauthorityname,
|
||||||
? jsonpath({
|
locale: router.locale,
|
||||||
path:
|
translations: transLookup,
|
||||||
'$..[?(@ && @.pinswg_lpa=="' +
|
fallbackValue: ""
|
||||||
detailsObj.pinswg_relevantauthorityname +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.pinswg_lpa=="' +
|
|
||||||
detailsObj.pinswg_relevantauthorityname +
|
|
||||||
'")].value',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
}) ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
</dl>
|
</dl>
|
||||||
</SummaryCard>
|
</SummaryCard>
|
||||||
@@ -281,7 +213,10 @@ const Pinswg_rowid = (props) => {
|
|||||||
"case:summary-questionnaire-due-date-label"
|
"case:summary-questionnaire-due-date-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={
|
||||||
hasOwn(detailsObj, "pinswg_questionnaireduedate")
|
hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_questionnaireduedate"
|
||||||
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_questionnaireduedate
|
detailsObj.pinswg_questionnaireduedate
|
||||||
)
|
)
|
||||||
@@ -352,7 +287,10 @@ const Pinswg_rowid = (props) => {
|
|||||||
"case:summary-applicant-final-comments-date-label"
|
"case:summary-applicant-final-comments-date-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={
|
||||||
hasOwn(detailsObj, "pinswg_finalcommentsduedate")
|
hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_finalcommentsduedate"
|
||||||
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
)
|
)
|
||||||
@@ -365,27 +303,7 @@ const Pinswg_rowid = (props) => {
|
|||||||
: t("case:summary-no-date-entered-label")
|
: t("case:summary-no-date-entered-label")
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
{/* <SummaryRow
|
|
||||||
label={t(
|
|
||||||
"case:summary-inquiry-evidence-date-label"
|
|
||||||
)}
|
|
||||||
value={hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_proofsofevidencewrittenstatementsofeviden"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
/> */}
|
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-event-date-label")}
|
label={t("case:summary-event-date-label")}
|
||||||
value={
|
value={
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { JSONPath as jsonpath } from "jsonpath-plus";
|
|||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
import transLookup from "../../../data/lookuptranslations.json";
|
||||||
|
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
import SummaryCard from "../summary/components/SummaryCard";
|
import SummaryCard from "../summary/components/SummaryCard";
|
||||||
import SummaryRow from "../summary/components/SummaryRow";
|
import SummaryRow from "../summary/components/SummaryRow";
|
||||||
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
||||||
@@ -69,22 +70,6 @@ const Pinswg_sipscase = (props) => {
|
|||||||
)[0]
|
)[0]
|
||||||
: ""}
|
: ""}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
{/* <p className="govuk-body">
|
|
||||||
{detailsObj.pinswg_projectlocation != null
|
|
||||||
? detailsObj.pinswg_projectlocation.indexOf(
|
|
||||||
";"
|
|
||||||
) < 0
|
|
||||||
? detailsObj.pinswg_projectlocation
|
|
||||||
: router.locale == "cy"
|
|
||||||
? detailsObj.pinswg_projectlocation.split(
|
|
||||||
";"
|
|
||||||
)[1]
|
|
||||||
: detailsObj.pinswg_projectlocation.split(
|
|
||||||
";"
|
|
||||||
)[0]
|
|
||||||
: ""}
|
|
||||||
</p> */}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -106,23 +91,16 @@ const Pinswg_sipscase = (props) => {
|
|||||||
label={t(
|
label={t(
|
||||||
"case:summary-case-type-label"
|
"case:summary-case-type-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath(
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@.value=="' +
|
],
|
||||||
casesObj[
|
locale,
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-no-date-entered-label"
|
||||||
transLookup
|
)
|
||||||
)
|
})}
|
||||||
: casesObj[
|
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{projectTypes.length > 0 && (
|
{projectTypes.length > 0 && (
|
||||||
@@ -200,12 +178,7 @@ const Pinswg_sipscase = (props) => {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{/* <div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">
|
|
||||||
Project Type
|
|
||||||
</dt>
|
|
||||||
<dd className="govuk-summary-list__value"></dd>
|
|
||||||
</div> */}
|
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-lpa-label")}
|
label={t("case:summary-lpa-label")}
|
||||||
value={
|
value={
|
||||||
@@ -228,18 +201,16 @@ const Pinswg_sipscase = (props) => {
|
|||||||
value={
|
value={
|
||||||
detailsObj.pinswg_choiceofprocedure !==
|
detailsObj.pinswg_choiceofprocedure !==
|
||||||
null
|
null
|
||||||
? router.locale == "cy"
|
? resolveCrmDisplayValue({
|
||||||
? jsonpath(
|
value: detailsObj[
|
||||||
'$..[?(@.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_choiceofprocedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
transLookup
|
|
||||||
)
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_choiceofprocedure@OData.Community.Display.V1.FormattedValue"
|
"pinswg_choiceofprocedure@OData.Community.Display.V1.FormattedValue"
|
||||||
]
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)
|
||||||
|
})
|
||||||
: t(
|
: t(
|
||||||
"case:summary-to-be-confirmed-label"
|
"case:summary-to-be-confirmed-label"
|
||||||
)
|
)
|
||||||
@@ -250,18 +221,16 @@ const Pinswg_sipscase = (props) => {
|
|||||||
value={
|
value={
|
||||||
detailsObj.pinswg_essubmitted !==
|
detailsObj.pinswg_essubmitted !==
|
||||||
null
|
null
|
||||||
? router.locale == "cy"
|
? resolveCrmDisplayValue({
|
||||||
? jsonpath(
|
value: detailsObj[
|
||||||
'$..[?(@.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_essubmitted@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
transLookup
|
|
||||||
)
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_essubmitted@OData.Community.Display.V1.FormattedValue"
|
"pinswg_essubmitted@OData.Community.Display.V1.FormattedValue"
|
||||||
]
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-to-be-confirmed-label"
|
||||||
|
)
|
||||||
|
})
|
||||||
: t(
|
: t(
|
||||||
"case:summary-to-be-confirmed-label"
|
"case:summary-to-be-confirmed-label"
|
||||||
)
|
)
|
||||||
@@ -274,157 +243,41 @@ const Pinswg_sipscase = (props) => {
|
|||||||
value={
|
value={
|
||||||
detailsObj.pinswg_deemedmarinelicenseappliedfor !==
|
detailsObj.pinswg_deemedmarinelicenseappliedfor !==
|
||||||
null
|
null
|
||||||
? router.locale == "cy"
|
? resolveCrmDisplayValue({
|
||||||
? jsonpath(
|
value: detailsObj[
|
||||||
'$..[?(@.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_deemedmarinelicenseappliedfor@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
transLookup
|
|
||||||
)
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_deemedmarinelicenseappliedfor@OData.Community.Display.V1.FormattedValue"
|
"pinswg_deemedmarinelicenseappliedfor@OData.Community.Display.V1.FormattedValue"
|
||||||
]
|
],
|
||||||
: t(
|
locale,
|
||||||
"case:summary-to-be-confirmed-label"
|
translations: transLookup,
|
||||||
)
|
fallbackValue: t(
|
||||||
}
|
|
||||||
/>
|
|
||||||
{/* <SummaryRow
|
|
||||||
label={t("case:summary-status-label")}
|
|
||||||
value={
|
|
||||||
router.locale == "cy"
|
|
||||||
? jsonpath(
|
|
||||||
|
|
||||||
'$..[?(@.value=="' +
|
|
||||||
casesObj[
|
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',transLookup
|
|
||||||
)
|
|
||||||
: casesObj[
|
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-to-be-confirmed-label"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
/> */}
|
|
||||||
{/* <SummaryRow
|
|
||||||
label={t(
|
|
||||||
"case:summary-case-officer-label"
|
|
||||||
)}
|
|
||||||
value={
|
|
||||||
hasOwn(casesObj, "_ownerid_value")
|
|
||||||
? casesObj[
|
|
||||||
"_ownerid_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
]
|
|
||||||
: ""
|
|
||||||
}
|
|
||||||
/> */}
|
|
||||||
{/* <SummaryRow
|
|
||||||
label={t(
|
|
||||||
"case:summary-type-of-event-label"
|
|
||||||
)}
|
|
||||||
value={
|
|
||||||
router.locale == "cy"
|
|
||||||
? jsonpath(
|
|
||||||
'$..[?(@.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
transLookup
|
|
||||||
)
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
<SummaryRow
|
|
||||||
|
|
||||||
label={t(
|
|
||||||
"case:summary-start-event-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
value={
|
|
||||||
|
|
||||||
hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_startdateofevent"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_startdateofevent
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_startdateofevent
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/>
|
|
||||||
<SummaryRow
|
|
||||||
|
|
||||||
label={t("case:summary-event-date-label")}
|
|
||||||
|
|
||||||
value={
|
|
||||||
|
|
||||||
hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_dateeventrequested"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_dateeventrequested
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_dateeventrequested
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-to-be-confirmed-label"
|
"case:summary-to-be-confirmed-label"
|
||||||
)
|
)
|
||||||
|
})
|
||||||
: t(
|
: t(
|
||||||
"case:summary-to-be-confirmed-label"
|
"case:summary-to-be-confirmed-label"
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
/> */}
|
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-decision-label")}
|
{t("case:summary-decision-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{detailsObj.pinswg_decision !== null
|
{detailsObj.pinswg_decision !== null
|
||||||
? router.locale == "cy"
|
? resolveCrmDisplayValue({
|
||||||
? jsonpath(
|
value: detailsObj[
|
||||||
'$..[?(@.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
transLookup
|
|
||||||
)
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
]
|
],
|
||||||
|
locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: t(
|
||||||
|
"case:summary-no-information-to-date-label"
|
||||||
|
)
|
||||||
|
})
|
||||||
: t(
|
: t(
|
||||||
"case:summary-no-information-to-date-label"
|
"case:summary-no-information-to-date-label"
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<br />
|
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
@@ -492,22 +345,6 @@ const Pinswg_sipscase = (props) => {
|
|||||||
) : (
|
) : (
|
||||||
""
|
""
|
||||||
)}
|
)}
|
||||||
{/* <SummaryRow
|
|
||||||
label={t(
|
|
||||||
"case:summary-case-recommendation-label"
|
|
||||||
)}
|
|
||||||
value={
|
|
||||||
router.locale == "cy"
|
|
||||||
? jsonpath(
|
|
||||||
'$..[?(@.value=="' +
|
|
||||||
detailsObj.pinswg_recommendation +
|
|
||||||
'")].value_cy',
|
|
||||||
transLookup,
|
|
||||||
|
|
||||||
)
|
|
||||||
: detailsObj.pinswg_recommendation
|
|
||||||
}
|
|
||||||
/> */}
|
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -925,671 +762,6 @@ const Pinswg_sipscase = (props) => {
|
|||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* <div>
|
|
||||||
<h4 className="govuk-heading-s ">
|
|
||||||
EIA Screening
|
|
||||||
</h4>
|
|
||||||
|
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
|
||||||
<SummaryRow
|
|
||||||
|
|
||||||
label={"Screening start date"}
|
|
||||||
|
|
||||||
value={
|
|
||||||
|
|
||||||
hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_screeningstartdate"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_screeningstartdate
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_screeningstartdate
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-awaiting-information-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-awaiting-information-label"
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/>
|
|
||||||
<SummaryRow
|
|
||||||
|
|
||||||
label={"EIA target date"}
|
|
||||||
|
|
||||||
value={
|
|
||||||
|
|
||||||
hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_eiatargetdate"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_eiatargetdate
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_eiatargetdate
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-awaiting-information-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-awaiting-information-label"
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/>
|
|
||||||
|
|
||||||
{hasValidKey(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_targetextended"
|
|
||||||
) && (
|
|
||||||
<SummaryRow
|
|
||||||
|
|
||||||
label={"Target Extended"}
|
|
||||||
|
|
||||||
value={
|
|
||||||
|
|
||||||
hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_targetextended"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_targetextended
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_targetextended
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-awaiting-information-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-awaiting-information-label"
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
<SummaryRow
|
|
||||||
|
|
||||||
label={"Direction Issued Date"}
|
|
||||||
|
|
||||||
value={
|
|
||||||
|
|
||||||
hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_directionissueddate"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_directionissueddate
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_directionissueddate
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-awaiting-information-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-awaiting-information-label"
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/>
|
|
||||||
|
|
||||||
{hasValidKey(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_eiarequired"
|
|
||||||
) && (
|
|
||||||
<SummaryRow
|
|
||||||
|
|
||||||
label={t(
|
|
||||||
"case:summary-eia-required-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
value={
|
|
||||||
|
|
||||||
hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_eiarequired"
|
|
||||||
)
|
|
||||||
? detailsObj.pinswg_eiarequired
|
|
||||||
? router.locale ==
|
|
||||||
"cy"
|
|
||||||
? "Ie"
|
|
||||||
: "Yes"
|
|
||||||
: router.locale ==
|
|
||||||
"cy"
|
|
||||||
? "Na"
|
|
||||||
: "No"
|
|
||||||
: t(
|
|
||||||
"case:summary-awaiting-information-label"
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</dl>
|
|
||||||
</div> */}
|
|
||||||
{/* <div>
|
|
||||||
<h4 className="govuk-heading-s ">
|
|
||||||
EIA Scoping
|
|
||||||
</h4>
|
|
||||||
|
|
||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
|
||||||
<SummaryRow
|
|
||||||
|
|
||||||
label={"Scoping Start Date"}
|
|
||||||
|
|
||||||
value={
|
|
||||||
|
|
||||||
hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_scopingstartdate"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_scopingstartdate
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_scopingstartdate
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-awaiting-information-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-awaiting-information-label"
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/>
|
|
||||||
<SummaryRow
|
|
||||||
|
|
||||||
label={"Scoping Target Date"}
|
|
||||||
|
|
||||||
value={
|
|
||||||
|
|
||||||
hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_scopingtargetdate"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_scopingtargetdate
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_scopingtargetdate
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-awaiting-information-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-awaiting-information-label"
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/>
|
|
||||||
{hasValidKey(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_scopingtargetextended"
|
|
||||||
) && (
|
|
||||||
<SummaryRow
|
|
||||||
|
|
||||||
label={"Scoping Target Extended"}
|
|
||||||
|
|
||||||
value={
|
|
||||||
|
|
||||||
hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_scopingtargetextended"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_scopingtargetextended
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_scopingtargetextended
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-awaiting-information-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-awaiting-information-label"
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
<SummaryRow
|
|
||||||
|
|
||||||
label={"Scoping Outcome Issued Date"}
|
|
||||||
|
|
||||||
value={
|
|
||||||
|
|
||||||
hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_scopingoutcomeissueddate"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_scopingoutcomeissueddate
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_scopingoutcomeissueddate
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-awaiting-information-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-awaiting-information-label"
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/>
|
|
||||||
</dl>
|
|
||||||
</div> */}
|
|
||||||
{/* <dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
|
||||||
<SummaryRow
|
|
||||||
|
|
||||||
label={t(
|
|
||||||
"case:summary-date-of-submission-of-application"
|
|
||||||
)}
|
|
||||||
|
|
||||||
value={
|
|
||||||
|
|
||||||
hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_dateofsubmissionofapplication"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_dateofsubmissionofapplication
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_dateofsubmissionofapplication
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-awaiting-information-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-awaiting-information-label"
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/>
|
|
||||||
{hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_applicationacceptedasvalid"
|
|
||||||
) &&
|
|
||||||
!_.isEmpty(
|
|
||||||
detailsObj.pinswg_applicationrejectedasinvalid
|
|
||||||
) && (
|
|
||||||
<SummaryRow
|
|
||||||
|
|
||||||
label={t(
|
|
||||||
"case:summary-application-accepted-as-valid"
|
|
||||||
)}
|
|
||||||
|
|
||||||
value={
|
|
||||||
|
|
||||||
!_.isEmpty(
|
|
||||||
detailsObj.pinswg_applicationacceptedasvalid
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_applicationacceptedasvalid
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-awaiting-information-label"
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
{hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_applicationrejectedasinvalid"
|
|
||||||
) &&
|
|
||||||
!_.isEmpty(
|
|
||||||
detailsObj.pinswg_applicationrejectedasinvalid
|
|
||||||
) && (
|
|
||||||
<SummaryRow
|
|
||||||
|
|
||||||
label={t(
|
|
||||||
"case:summary-application-rejected-as-invalid"
|
|
||||||
)}
|
|
||||||
|
|
||||||
value={
|
|
||||||
|
|
||||||
!_.isEmpty(
|
|
||||||
detailsObj.pinswg_applicationrejectedasinvalid
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_applicationrejectedasinvalid
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-awaiting-information-label"
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
<SummaryRow
|
|
||||||
|
|
||||||
label={t(
|
|
||||||
"case:summary-end-of-representation-period"
|
|
||||||
)}
|
|
||||||
|
|
||||||
value={
|
|
||||||
|
|
||||||
hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_endofrepresentationperiod"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_endofrepresentationperiod
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_endofrepresentationperiod
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-awaiting-information-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-awaiting-information-label"
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/>
|
|
||||||
|
|
||||||
{hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_dateofrequesttovarytheapplication"
|
|
||||||
) &&
|
|
||||||
!_.isEmpty(
|
|
||||||
detailsObj.pinswg_dateofrequesttovarytheapplication
|
|
||||||
) && (
|
|
||||||
<SummaryRow
|
|
||||||
|
|
||||||
label={t(
|
|
||||||
"case:summary-date-of-request-to-vary"
|
|
||||||
)}
|
|
||||||
|
|
||||||
value={
|
|
||||||
|
|
||||||
!_.isEmpty(
|
|
||||||
detailsObj.pinswg_dateofrequesttovarytheapplication
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_dateofrequesttovarytheapplication
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-awaiting-information-label"
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_confirmrequesttovaryapplication"
|
|
||||||
) &&
|
|
||||||
!_.isEmpty(
|
|
||||||
detailsObj.pinswg_confirmrequesttovaryapplication
|
|
||||||
) &&
|
|
||||||
(hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_rejectrequesttovaryapplication"
|
|
||||||
) &&
|
|
||||||
_.isEmpty(
|
|
||||||
detailsObj.pinswg_rejectrequesttovaryapplication
|
|
||||||
) ? (
|
|
||||||
<SummaryRow
|
|
||||||
|
|
||||||
label={t(
|
|
||||||
"case:summary-confirm-request-to-vary-application"
|
|
||||||
)}
|
|
||||||
|
|
||||||
value={
|
|
||||||
|
|
||||||
!_.isEmpty(
|
|
||||||
detailsObj.pinswg_confirmrequesttovaryapplication
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_confirmrequesttovaryapplication
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-awaiting-information-label"
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
))}
|
|
||||||
{hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_rejectrequesttovaryapplication"
|
|
||||||
) &&
|
|
||||||
!_.isEmpty(
|
|
||||||
detailsObj.pinswg_rejectrequesttovaryapplication
|
|
||||||
) &&
|
|
||||||
(hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_confirmrequesttovaryapplication"
|
|
||||||
) &&
|
|
||||||
_.isEmpty(
|
|
||||||
detailsObj.pinswg_confirmrequesttovaryapplication
|
|
||||||
) ? (
|
|
||||||
<SummaryRow
|
|
||||||
|
|
||||||
label={t(
|
|
||||||
"case:summary-reject-request-to-vary-application"
|
|
||||||
)}
|
|
||||||
|
|
||||||
value={
|
|
||||||
|
|
||||||
!_.isEmpty(
|
|
||||||
detailsObj.pinswg_rejectrequesttovaryapplication
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_rejectrequesttovaryapplication
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-awaiting-information-label"
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
))}
|
|
||||||
{hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_suspensionstartdates"
|
|
||||||
) &&
|
|
||||||
!_.isEmpty(
|
|
||||||
detailsObj.pinswg_suspensionstartdates
|
|
||||||
) && (
|
|
||||||
<SummaryRow
|
|
||||||
|
|
||||||
label={t(
|
|
||||||
"case:summary-suspension-start-dates"
|
|
||||||
)}
|
|
||||||
|
|
||||||
value={
|
|
||||||
|
|
||||||
!_.isEmpty(
|
|
||||||
detailsObj.pinswg_suspensionstartdates
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_suspensionstartdates
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-awaiting-information-label"
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<SummaryRow
|
|
||||||
|
|
||||||
|
|
||||||
label={t(
|
|
||||||
"case:summary-suspension-end-dates"
|
|
||||||
)}
|
|
||||||
|
|
||||||
|
|
||||||
value={
|
|
||||||
|
|
||||||
|
|
||||||
hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_suspensionenddates"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_suspensionenddates
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_suspensionenddates
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-awaiting-information-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-awaiting-information-label"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/>
|
|
||||||
<SummaryRow
|
|
||||||
|
|
||||||
label={t("case:summary-report-due-by")}
|
|
||||||
|
|
||||||
value={
|
|
||||||
|
|
||||||
hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_reportdueby"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_reportdueby
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_reportdueby
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-awaiting-information-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-awaiting-information-label"
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/>
|
|
||||||
<SummaryRow
|
|
||||||
|
|
||||||
label={t("case:summary-suspension-dates")}
|
|
||||||
|
|
||||||
value={
|
|
||||||
|
|
||||||
hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_suspensiondates"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_suspensiondates
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_suspensiondates
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/>
|
|
||||||
<SummaryRow
|
|
||||||
|
|
||||||
label={t(
|
|
||||||
"case:summary-inspector-report-submission-to-welsh-government"
|
|
||||||
)}
|
|
||||||
|
|
||||||
value={
|
|
||||||
|
|
||||||
hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_inspectorreportsubmittedtowelshgovernment"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_inspectorreportsubmittedtowelshgovernment
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_inspectorreportsubmittedtowelshgovernment
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-awaiting-information-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-awaiting-information-label"
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/>
|
|
||||||
{hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_withdrawndate"
|
|
||||||
) &&
|
|
||||||
!_.isEmpty(
|
|
||||||
detailsObj.pinswg_withdrawndate
|
|
||||||
) && (
|
|
||||||
<SummaryRow
|
|
||||||
|
|
||||||
label={t(
|
|
||||||
"case:summary-withdrawn-date"
|
|
||||||
)}
|
|
||||||
|
|
||||||
value={
|
|
||||||
|
|
||||||
!_.isEmpty(
|
|
||||||
detailsObj.pinswg_withdrawndate
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_withdrawndate
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-awaiting-information-label"
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</dl> */}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -66,68 +66,43 @@ const Pinswg_transportandworkactid = (props) => {
|
|||||||
label={t(
|
label={t(
|
||||||
"case:summary-case-type-label"
|
"case:summary-case-type-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale: router.locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t(
|
label={t(
|
||||||
"case:summary-eia-required-label"
|
"case:summary-eia-required-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath(
|
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@.value=="' +
|
],
|
||||||
detailsObj[
|
locale: router.locale,
|
||||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-to-be-confirmed-label"
|
||||||
transLookup
|
)
|
||||||
)
|
})}
|
||||||
: detailsObj[
|
|
||||||
"pinswg_eiarequired@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-to-be-confirmed-label"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t(
|
label={t(
|
||||||
"case:summary-case-recommendation-label"
|
"case:summary-case-recommendation-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj.pinswg_recommendation,
|
||||||
? jsonpath({
|
locale: router.locale,
|
||||||
path:
|
translations: transLookup,
|
||||||
'$..[?(@ && @.value=="' +
|
fallbackValue: ""
|
||||||
detailsObj.pinswg_recommendation +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj.pinswg_recommendation ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
{detailsObj.pinswg_webaddress != null && (
|
{detailsObj.pinswg_webaddress != null && (
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
import transLookup from "../../../data/lookuptranslations.json";
|
||||||
|
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
import SummaryCard from "../summary/components/SummaryCard";
|
import SummaryCard from "../summary/components/SummaryCard";
|
||||||
import SummaryRow from "../summary/components/SummaryRow";
|
import SummaryRow from "../summary/components/SummaryRow";
|
||||||
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
import { getCaseLpaDisplayLines } from "../../utils/getCaseLpaDisplayValue";
|
||||||
@@ -24,23 +24,16 @@ const Pinswg_wayleaveid = (props) => {
|
|||||||
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
<dl className="govuk-summary-list govuk-!-font-size-16 govuk-!-margin-bottom-9">
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-case-type-label")}
|
label={t("case:summary-case-type-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-lpa-label")}
|
label={t("case:summary-lpa-label")}
|
||||||
@@ -59,110 +52,69 @@ const Pinswg_wayleaveid = (props) => {
|
|||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-eia-required-label")}
|
label={t("case:summary-eia-required-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath(
|
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-to-be-confirmed-label"
|
||||||
transLookup
|
)
|
||||||
)
|
})}
|
||||||
: detailsObj[
|
|
||||||
"pinswg_detailedeiascreening@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-to-be-confirmed-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-procedure-label")}
|
label={t("case:summary-procedure-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-type-of-event-label")}
|
label={t("case:summary-type-of-event-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj[
|
||||||
? jsonpath({
|
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
detailsObj[
|
translations: transLookup,
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: ""
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_typeofevent@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-status-label")}
|
label={t("case:summary-status-label")}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: casesObj[
|
||||||
? jsonpath({
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@ && @.value=="' +
|
locale,
|
||||||
casesObj[
|
translations: transLookup,
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: t(
|
||||||
] +
|
"case:summary-no-date-entered-label"
|
||||||
'")].value_cy',
|
)
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: casesObj[
|
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{t("case:summary-decision-label")}
|
{t("case:summary-decision-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: detailsObj[
|
||||||
path:
|
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
detailsObj[
|
locale,
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: t(
|
||||||
'")].value_cy',
|
"case:summary-no-information-to-date-label"
|
||||||
json: transLookup,
|
)
|
||||||
eval: true
|
})}
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-information-to-date-label"
|
|
||||||
)}
|
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
{/* <Link href="/">
|
|
||||||
<a>
|
|
||||||
{casesObj.caseDetails
|
|
||||||
.outcome_document || ""}
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
{casesObj.numberofchildincidents > 0 && (
|
{casesObj.numberofchildincidents > 0 && (
|
||||||
@@ -171,7 +123,9 @@ const Pinswg_wayleaveid = (props) => {
|
|||||||
{t("case:summary-case-link-status-label")}
|
{t("case:summary-case-link-status-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{hasOwn(casesObj, ["numberofchildincidents"])
|
{hasOwn(casesObj, [
|
||||||
|
"numberofchildincidents"
|
||||||
|
])
|
||||||
? casesObj.numberofchildincidents > 0
|
? casesObj.numberofchildincidents > 0
|
||||||
? t(
|
? t(
|
||||||
"case:summary-case-link-status-linked"
|
"case:summary-case-link-status-linked"
|
||||||
@@ -203,26 +157,12 @@ const Pinswg_wayleaveid = (props) => {
|
|||||||
label={t(
|
label={t(
|
||||||
"case:summary-case-relevant-authoritylabel"
|
"case:summary-case-relevant-authoritylabel"
|
||||||
)}
|
)}
|
||||||
value={
|
value={resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: detailsObj.pinswg_relevantauthorityname,
|
||||||
? jsonpath({
|
locale: router.locale,
|
||||||
path:
|
translations: transLookup,
|
||||||
'$..[?(@ && @.pinswg_lpa=="' +
|
fallbackValue: ""
|
||||||
detailsObj.pinswg_relevantauthorityname +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.pinswg_lpa=="' +
|
|
||||||
detailsObj.pinswg_relevantauthorityname +
|
|
||||||
'")].value',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
}) ||
|
|
||||||
t("case:summary-no-date-entered-label")
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
</dl>
|
</dl>
|
||||||
</SummaryCard>
|
</SummaryCard>
|
||||||
@@ -260,7 +200,10 @@ const Pinswg_wayleaveid = (props) => {
|
|||||||
"case:summary-questionnaire-due-date-label"
|
"case:summary-questionnaire-due-date-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={
|
||||||
hasOwn(detailsObj, "pinswg_questionnaireduedate")
|
hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_questionnaireduedate"
|
||||||
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_questionnaireduedate
|
detailsObj.pinswg_questionnaireduedate
|
||||||
)
|
)
|
||||||
@@ -331,7 +274,10 @@ const Pinswg_wayleaveid = (props) => {
|
|||||||
"case:summary-applicant-final-comments-date-label"
|
"case:summary-applicant-final-comments-date-label"
|
||||||
)}
|
)}
|
||||||
value={
|
value={
|
||||||
hasOwn(detailsObj, "pinswg_finalcommentsduedate")
|
hasOwn(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_finalcommentsduedate"
|
||||||
|
)
|
||||||
? !_.isEmpty(
|
? !_.isEmpty(
|
||||||
detailsObj.pinswg_finalcommentsduedate
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
)
|
)
|
||||||
@@ -344,27 +290,7 @@ const Pinswg_wayleaveid = (props) => {
|
|||||||
: t("case:summary-no-date-entered-label")
|
: t("case:summary-no-date-entered-label")
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
{/* <SummaryRow
|
|
||||||
label={t(
|
|
||||||
"case:summary-inquiry-evidence-date-label"
|
|
||||||
)}
|
|
||||||
value={hasOwn(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_proofsofevidencewrittenstatementsofeviden"
|
|
||||||
)
|
|
||||||
? !_.isEmpty(
|
|
||||||
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
|
|
||||||
)
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_proofsofevidencewrittenstatementsofeviden
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)
|
|
||||||
: t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
/> */}
|
|
||||||
<SummaryRow
|
<SummaryRow
|
||||||
label={t("case:summary-event-date-label")}
|
label={t("case:summary-event-date-label")}
|
||||||
value={
|
value={
|
||||||
|
|||||||
+10
-79
@@ -13,9 +13,10 @@ import SearchCases from "./myportal/searchcases";
|
|||||||
import WatchedCases from "./myportal/watchedcases";
|
import WatchedCases from "./myportal/watchedcases";
|
||||||
import MySubmittedReps from "./myportal/mysubmittedrepresentations";
|
import MySubmittedReps from "./myportal/mysubmittedrepresentations";
|
||||||
import ServiceBanner from "./myportal/servicebanner";
|
import ServiceBanner from "./myportal/servicebanner";
|
||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import transLookup from "../data/lookuptranslations.json";
|
import transLookup from "../data/lookuptranslations.json";
|
||||||
import { performPortalSignOut } from "../lib/auth/sessionClient";
|
import { performPortalSignOut } from "../lib/auth/sessionClient";
|
||||||
|
import resolveCrmDisplayValue from "../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
|
import _ from "lodash";
|
||||||
|
|
||||||
const MyPortal = (props) => {
|
const MyPortal = (props) => {
|
||||||
const { showFileUpload, showLoginCheck, docsOffline } = props;
|
const { showFileUpload, showLoginCheck, docsOffline } = props;
|
||||||
@@ -38,78 +39,17 @@ const MyPortal = (props) => {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<main className="" id="main-content" role="main">
|
<main className="" id="main-content" role="main">
|
||||||
{/* <div className="servicebanner myportal govuk-!-margin-bottom-4">
|
|
||||||
<h1>
|
|
||||||
<img
|
|
||||||
src={
|
|
||||||
router.locale == "cy"
|
|
||||||
? "/assets/images/planning-casework-cy.svg"
|
|
||||||
: "/assets/images/planning-casework-en.svg"
|
|
||||||
}
|
|
||||||
alt={
|
|
||||||
router.locale == "cy"
|
|
||||||
? "Fy mhorth"
|
|
||||||
: "My Portal"
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</h1>
|
|
||||||
|
|
||||||
<div className="serviceBanner_userDetails">
|
|
||||||
<img
|
|
||||||
className="user_logo"
|
|
||||||
src="/assets/images/user.svg"
|
|
||||||
alt={router.locale == "cy" ? "Defnyddiwr" : "User"}
|
|
||||||
/>{" "}
|
|
||||||
<div className="serviceBanner_userDetails_name">
|
|
||||||
<Link
|
|
||||||
href="/account/personaldetails"
|
|
||||||
className="govuk-button-secondary"
|
|
||||||
>
|
|
||||||
{props.accountDetails.accountDetails.firstname}{" "}
|
|
||||||
{props.accountDetails.accountDetails.lastname}
|
|
||||||
{" - "}
|
|
||||||
{
|
|
||||||
props.accountDetails.accountDetails[
|
|
||||||
"pinswg_typeofinvolvement@OData.Community.Display.V1.FormattedValue"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
</Link>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<Link
|
|
||||||
href={
|
|
||||||
router.locale == "cy"
|
|
||||||
? "/allgofnodi"
|
|
||||||
: "/logout"
|
|
||||||
}
|
|
||||||
onClick={() => {
|
|
||||||
handleLogout();
|
|
||||||
}}
|
|
||||||
className="govuk-header__link "
|
|
||||||
>
|
|
||||||
{t("common:signout-label")}
|
|
||||||
</Link>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div> */}
|
|
||||||
<ServiceBanner props={props} />
|
<ServiceBanner props={props} />
|
||||||
{isLPA && (
|
{isLPA && (
|
||||||
<div>
|
<div>
|
||||||
<h2 className="heading-small card-heading">
|
<h2 className="heading-small card-heading">
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: props.accountDetails.accountDetails[
|
||||||
path:
|
"pinswg_contact_associatedlpa@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
props.accountDetails.accountDetails[
|
locale,
|
||||||
"pinswg_contact_associatedlpa@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup
|
||||||
] +
|
})}{" "}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: props.accountDetails.accountDetails[
|
|
||||||
"pinswg_contact_associatedlpa@OData.Community.Display.V1.FormattedValue"
|
|
||||||
]}{" "}
|
|
||||||
{t("myportal:lpa-portal-heading")}
|
{t("myportal:lpa-portal-heading")}
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
@@ -121,18 +61,9 @@ const MyPortal = (props) => {
|
|||||||
{!isLPA && (
|
{!isLPA && (
|
||||||
<MakeNewAppeal docsOffline={docsOffline} />
|
<MakeNewAppeal docsOffline={docsOffline} />
|
||||||
)}
|
)}
|
||||||
{/* {props.awaitingSubmission.awaitingSubmission[
|
|
||||||
"@odata.count"
|
|
||||||
] > 0 && (
|
|
||||||
<AwaitingSubmission
|
|
||||||
awaitingSubmission={
|
|
||||||
props.awaitingSubmission
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
)} */}
|
|
||||||
|
|
||||||
{!isLPA &&
|
{!isLPA &&
|
||||||
hasOwnhas(props.awaitingSubmission, [
|
_.has(props.awaitingSubmission, [
|
||||||
"awaitingSubmissionFromBlob",
|
"awaitingSubmissionFromBlob",
|
||||||
"@odata.count"
|
"@odata.count"
|
||||||
]) &&
|
]) &&
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { Field, formValueSelector, reduxForm } from "redux-form";
|
import { Field, formValueSelector, reduxForm } from "redux-form";
|
||||||
|
|
||||||
import transLookup from "../../data/lookuptranslations.json";
|
import transLookup from "../../data/lookuptranslations.json";
|
||||||
|
import resolveCrmDisplayValue from "../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
|
|
||||||
const required = (errorMsg) => (value) =>
|
const required = (errorMsg) => (value) =>
|
||||||
value || typeof value === "number" ? undefined : errorMsg;
|
value || typeof value === "number" ? undefined : errorMsg;
|
||||||
@@ -133,22 +133,11 @@ let AdvancedSearch = (props) => {
|
|||||||
key={key}
|
key={key}
|
||||||
value={optionsObj[key].accountid}
|
value={optionsObj[key].accountid}
|
||||||
>
|
>
|
||||||
{/* {optionsObj[key].name} */}
|
{resolveCrmDisplayValue({
|
||||||
|
value: optionsObj[key].name,
|
||||||
{router.locale == "cy"
|
locale,
|
||||||
? jsonpath({
|
translations: transLookup
|
||||||
path:
|
})}
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
optionsObj[key]
|
|
||||||
.name +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: optionsObj[key].name ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</option>
|
</option>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
@@ -234,31 +223,11 @@ let AdvancedSearch = (props) => {
|
|||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{_.isEmpty(optionsObj[key])
|
{resolveCrmDisplayValue({
|
||||||
? ""
|
value: optionsObj[key].value,
|
||||||
: _.isEmpty(optionsObj[key])
|
locale,
|
||||||
? ""
|
translations: transLookup
|
||||||
: _.isEmpty(
|
})}
|
||||||
optionsObj[key]
|
|
||||||
.value
|
|
||||||
)
|
|
||||||
? ""
|
|
||||||
: router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
optionsObj[
|
|
||||||
key
|
|
||||||
].value +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: optionsObj[key]
|
|
||||||
.value ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</option>
|
</option>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
@@ -18,6 +17,7 @@ import {
|
|||||||
setCurrentReference,
|
setCurrentReference,
|
||||||
setCurrentView
|
setCurrentView
|
||||||
} from "../../store/currentView/action";
|
} from "../../store/currentView/action";
|
||||||
|
import { resolveCrmDisplayValue } from "../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
|
|
||||||
const AwaitingSubmissionFromBlob = (props) => {
|
const AwaitingSubmissionFromBlob = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -201,22 +201,14 @@ const AwaitingSubmissionFromBlob = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="cardModuleReference">
|
<div className="cardModuleReference">
|
||||||
<b>{t("myportal:appeal-type-label")}:</b>{" "}
|
<b>{t("myportal:appeal-type-label")}:</b>{" "}
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: getFormCollectionByID(
|
||||||
path:
|
showTopThreeArr[key]
|
||||||
'$..[?(@ && @.value=="' +
|
.pinswg_appealcasetype
|
||||||
getFormCollectionByID(
|
).value,
|
||||||
showTopThreeArr[key]
|
locale,
|
||||||
.pinswg_appealcasetype
|
translations: transLookup
|
||||||
).value +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: getFormCollectionByID(
|
|
||||||
showTopThreeArr[key]
|
|
||||||
.pinswg_appealcasetype
|
|
||||||
).value || ""}
|
|
||||||
</div>
|
</div>
|
||||||
<div className="cardModuleReference">
|
<div className="cardModuleReference">
|
||||||
<b>{t("myportal:case-address")}:</b>{" "}
|
<b>{t("myportal:case-address")}:</b>{" "}
|
||||||
@@ -302,20 +294,14 @@ const AwaitingSubmissionFromBlob = (props) => {
|
|||||||
{router.locale == "cy" ? "ACLl" : "LPA"}
|
{router.locale == "cy" ? "ACLl" : "LPA"}
|
||||||
:
|
:
|
||||||
</b>
|
</b>
|
||||||
{router.locale == "cy"
|
|
||||||
? jsonpath({
|
{resolveCrmDisplayValue({
|
||||||
path:
|
value: showTopThreeArr[key][
|
||||||
'$..[?(@ && @.value=="' +
|
"pinswg_lpaname"
|
||||||
showTopThreeArr[key][
|
],
|
||||||
"pinswg_lpaname"
|
locale,
|
||||||
] +
|
translations: transLookup
|
||||||
'")].value_cy',
|
})}
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: showTopThreeArr[key][
|
|
||||||
"pinswg_lpaname"
|
|
||||||
] || ""}
|
|
||||||
</div>
|
</div>
|
||||||
<div className="cardModuleReference">
|
<div className="cardModuleReference">
|
||||||
<b>{t("myportal:date-raised")}:</b>
|
<b>{t("myportal:date-raised")}:</b>
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
@@ -33,6 +32,7 @@ import { planningappeals78_pdf } from "../../components/pdftemplates/planningapp
|
|||||||
import { other_pdf } from "../../components/pdftemplates/other_pdf";
|
import { other_pdf } from "../../components/pdftemplates/other_pdf";
|
||||||
|
|
||||||
import { PDFDownloadLink, pdf } from "@react-pdf/renderer";
|
import { PDFDownloadLink, pdf } from "@react-pdf/renderer";
|
||||||
|
import resolveCrmDisplayValue from "../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
|
|
||||||
const TopThree = (props) => {
|
const TopThree = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -406,20 +406,13 @@ const TopThree = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="cardModuleReference">
|
<div className="cardModuleReference">
|
||||||
<b>{t("myportal:appeal-type-label")}:</b>{" "}
|
<b>{t("myportal:appeal-type-label")}:</b>{" "}
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: showTopThreeArr[key][
|
||||||
path:
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
showTopThreeArr[key][
|
locale,
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: showTopThreeArr[key][
|
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</div>
|
</div>
|
||||||
{/* )} */}
|
{/* )} */}
|
||||||
{/* {topThreeType != "awaitingSubmission" ? ( */}
|
{/* {topThreeType != "awaitingSubmission" ? ( */}
|
||||||
@@ -484,20 +477,13 @@ const TopThree = (props) => {
|
|||||||
)}
|
)}
|
||||||
<div className="cardModuleReference">
|
<div className="cardModuleReference">
|
||||||
<b>{router.locale == "cy" ? "ACLl" : "LPA"}:</b>
|
<b>{router.locale == "cy" ? "ACLl" : "LPA"}:</b>
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: showTopThreeArr[key][
|
||||||
path:
|
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
showTopThreeArr[key][
|
locale,
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup
|
||||||
] +
|
})}
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: showTopThreeArr[key][
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</div>
|
</div>
|
||||||
{topThreeType == "awaitingSubmission" ? (
|
{topThreeType == "awaitingSubmission" ? (
|
||||||
<div className="carModuleAddress">
|
<div className="carModuleAddress">
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
@@ -34,6 +33,7 @@ import {
|
|||||||
setWatchedCasesDetails
|
setWatchedCasesDetails
|
||||||
} from "../../store/watchedCases/action";
|
} from "../../store/watchedCases/action";
|
||||||
import { getFormCollectionByID, getDetailsProxy } from "../utils";
|
import { getFormCollectionByID, getDetailsProxy } from "../utils";
|
||||||
|
import resolveCrmDisplayValue from "../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
|
|
||||||
const TopThree = (props) => {
|
const TopThree = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -196,19 +196,6 @@ const TopThree = (props) => {
|
|||||||
<b>{showTopThreeArr[key].pinswg_name}</b>
|
<b>{showTopThreeArr[key].pinswg_name}</b>
|
||||||
) : (
|
) : (
|
||||||
<span
|
<span
|
||||||
// href="#"
|
|
||||||
// href={{
|
|
||||||
// pathname:
|
|
||||||
// router.locale == "cy"
|
|
||||||
// ? "/fymhorth/representation"
|
|
||||||
// : "/myportal/representation",
|
|
||||||
// query: {
|
|
||||||
// case: showTopThreeArr[key].ticketnumber,
|
|
||||||
// state: "edit",
|
|
||||||
// created:
|
|
||||||
// showTopThreeArr[key].repfile_name,
|
|
||||||
// },
|
|
||||||
// }}
|
|
||||||
className="govuk-link--no-underline"
|
className="govuk-link--no-underline"
|
||||||
style={{
|
style={{
|
||||||
color: "#0360a6",
|
color: "#0360a6",
|
||||||
@@ -292,54 +279,19 @@ const TopThree = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="cardModuleReference">
|
<div className="cardModuleReference">
|
||||||
<b>{t("myportal:representation-type")}:</b>
|
<b>{t("myportal:representation-type")}:</b>
|
||||||
{" "}
|
{resolveCrmDisplayValue({
|
||||||
|
value: showTopThreeArr[key].representationType,
|
||||||
{router.locale == "cy"
|
locale,
|
||||||
? jsonpath({
|
translations: transLookup
|
||||||
path:
|
})}
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
showTopThreeArr[key].representationType +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: showTopThreeArr[key].representationType || ""}
|
|
||||||
</div>
|
</div>
|
||||||
<div className="cardModuleReference">
|
<div className="cardModuleReference">
|
||||||
<b>{t("myportal:capacity")}:</b>
|
<b>{t("myportal:capacity")}:</b>
|
||||||
{" "}
|
{resolveCrmDisplayValue({
|
||||||
{router.locale == "cy"
|
value: showTopThreeArr[key].representationCapacity,
|
||||||
? jsonpath({
|
locale,
|
||||||
path:
|
translations: transLookup
|
||||||
'$..[?(@ && @.value=="' +
|
})}
|
||||||
showTopThreeArr[key]
|
|
||||||
.representationCapacity +
|
|
||||||
'" ||@.value_cy=="' +
|
|
||||||
showTopThreeArr[key]
|
|
||||||
.representationCapacity +
|
|
||||||
'" )].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value_cy=="' +
|
|
||||||
showTopThreeArr[key]
|
|
||||||
.representationCapacity +
|
|
||||||
'")].value',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
}).length > 0
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value_cy=="' +
|
|
||||||
showTopThreeArr[key]
|
|
||||||
.representationCapacity +
|
|
||||||
'")].value',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: showTopThreeArr[key].representationCapacity}
|
|
||||||
</div>
|
</div>
|
||||||
<div className="cardModuleReference">
|
<div className="cardModuleReference">
|
||||||
<b>{t("myportal:date-raised")}:</b>
|
<b>{t("myportal:date-raised")}:</b>
|
||||||
@@ -348,22 +300,13 @@ const TopThree = (props) => {
|
|||||||
</div>{" "}
|
</div>{" "}
|
||||||
<div className="cardModuleReference">
|
<div className="cardModuleReference">
|
||||||
<b>{router.locale == "cy" ? "ACLl" : "LPA"}:</b>
|
<b>{router.locale == "cy" ? "ACLl" : "LPA"}:</b>
|
||||||
{" "}
|
{resolveCrmDisplayValue({
|
||||||
|
value: showTopThreeArr[key][
|
||||||
{router.locale == "cy"
|
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
||||||
? jsonpath({
|
],
|
||||||
path:
|
locale,
|
||||||
'$..[?(@ && @.value=="' +
|
translations: transLookup
|
||||||
showTopThreeArr[key][
|
})}
|
||||||
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: showTopThreeArr[key][
|
|
||||||
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || ""}
|
|
||||||
</div>
|
</div>
|
||||||
{showTopThreeArr[key].hasOwnProperty("repComplete") && (
|
{showTopThreeArr[key].hasOwnProperty("repComplete") && (
|
||||||
<div className="cardModuleReference">
|
<div className="cardModuleReference">
|
||||||
|
|||||||
+80
-140
@@ -46,6 +46,7 @@ import {
|
|||||||
setMyRepresentations,
|
setMyRepresentations,
|
||||||
setMyRepresentationsDetails
|
setMyRepresentationsDetails
|
||||||
} from "../../store/myRepresentations/action";
|
} from "../../store/myRepresentations/action";
|
||||||
|
import resolveCrmDisplayValue from "../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
|
|
||||||
const ViewAllResults = (props) => {
|
const ViewAllResults = (props) => {
|
||||||
const {
|
const {
|
||||||
@@ -493,86 +494,66 @@ const ViewAllResults = (props) => {
|
|||||||
</span>
|
</span>
|
||||||
{isAwaitingSubmissionDetails &&
|
{isAwaitingSubmissionDetails &&
|
||||||
hasOwn(resultItem, "pinswg_lpaname")
|
hasOwn(resultItem, "pinswg_lpaname")
|
||||||
? router.locale === "cy"
|
? resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: resultItem.pinswg_lpaname,
|
||||||
path:
|
locale: router.locale,
|
||||||
'$..[?(@ && @.value=="' +
|
translations: transLookup,
|
||||||
resultItem.pinswg_lpaname +
|
fallbackValue: "N/A"
|
||||||
'")].value_cy',
|
})
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: resultItem.pinswg_lpaname || "N/A"
|
|
||||||
: ""}
|
: ""}
|
||||||
{hasOwn(resultItem, [
|
{hasOwn(resultItem, [
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||||
])
|
])
|
||||||
? router.locale === "cy"
|
? resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: resultItem[
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
resultItem[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: resultItem[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||||
] || "N/A"
|
],
|
||||||
|
locale: router.locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: "N/A"
|
||||||
|
})
|
||||||
: ""}
|
: ""}
|
||||||
{hasOwn(searchDetailsObj[key], [
|
{hasOwn(searchDetailsObj[key], [
|
||||||
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
||||||
])
|
])
|
||||||
? router.locale === "cy"
|
? resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value:
|
||||||
path:
|
searchDetailsObj[key][
|
||||||
'$..[?(@ && @.value=="' +
|
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
||||||
(searchDetailsObj[key][
|
] ||
|
||||||
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
searchDetailsObj[key]?.value[0][
|
||||||
] ||
|
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
||||||
searchDetailsObj[key]?.value[0][
|
],
|
||||||
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
locale: router.locale,
|
||||||
]) +
|
translations: transLookup,
|
||||||
'")].value_cy',
|
fallbackValue: isMyRepresentations
|
||||||
json: transLookup,
|
? searchDetailsObj[key].value
|
||||||
eval: true
|
: searchDetailsObj[key].value[0][
|
||||||
})
|
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
||||||
: isMyRepresentations
|
] || "N/A"
|
||||||
? searchDetailsObj[key].value
|
})
|
||||||
: searchDetailsObj[key].value[0][
|
|
||||||
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || "N/A"
|
|
||||||
: ""}
|
: ""}
|
||||||
{hasOwn(resultItem, [
|
{hasOwn(resultItem, [
|
||||||
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
||||||
])
|
])
|
||||||
? router.locale === "cy"
|
? resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: resultItem[
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
resultItem[
|
|
||||||
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: resultItem[
|
|
||||||
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
||||||
] || (isMyRepresentations ? "" : "N/A")
|
],
|
||||||
|
locale: router.locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: isMyRepresentations
|
||||||
|
? ""
|
||||||
|
: "N/A"
|
||||||
|
})
|
||||||
: isMyRepresentations &&
|
: isMyRepresentations &&
|
||||||
router.locale === "cy" &&
|
router.locale === "cy" &&
|
||||||
jsonpath({
|
resolveCrmDisplayValue({
|
||||||
path:
|
value: searchDetailsObj[key][
|
||||||
'$..[?(@ && @.value=="' +
|
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
||||||
searchDetailsObj[key][
|
],
|
||||||
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
locale: router.locale,
|
||||||
] +
|
translations: transLookup
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})}
|
})}
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
@@ -581,50 +562,36 @@ const ViewAllResults = (props) => {
|
|||||||
</span>
|
</span>
|
||||||
|
|
||||||
{isAwaitingSubmissionDetails
|
{isAwaitingSubmissionDetails
|
||||||
? router.locale === "cy"
|
? resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: getFormCollectionByID(
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
getFormCollectionByID(
|
|
||||||
item.pinswg_appealcasetype
|
|
||||||
).value +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: getFormCollectionByID(
|
|
||||||
item.pinswg_appealcasetype
|
item.pinswg_appealcasetype
|
||||||
).value || "N/A"
|
).value,
|
||||||
: router.locale === "cy"
|
locale: router.locale,
|
||||||
? jsonpath({
|
translations: transLookup,
|
||||||
path:
|
fallbackValue: "N/A"
|
||||||
'$..[?(@ && @.value=="' +
|
})
|
||||||
item[
|
: resolveCrmDisplayValue({
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
value: item[
|
||||||
] +
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
'")].value_cy',
|
],
|
||||||
json: transLookup,
|
locale: router.locale,
|
||||||
eval: true
|
translations: transLookup,
|
||||||
})
|
fallbackValue: isMyRepresentations
|
||||||
: item[
|
? ""
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
: "N/A"
|
||||||
] || (isMyRepresentations ? "" : "N/A")}
|
})}
|
||||||
|
|
||||||
{isMyRepresentations &&
|
{isMyRepresentations &&
|
||||||
(router.locale === "cy"
|
resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: getFormCollectionByID(
|
||||||
path:
|
searchDetailsObj[key].appealType
|
||||||
'$..[?(@ && @.value=="' +
|
).value,
|
||||||
getFormCollectionByID(
|
locale: router.locale,
|
||||||
searchDetailsObj[key].appealType
|
translations: transLookup,
|
||||||
).value +
|
fallbackValue: getFormCollectionByID(
|
||||||
'")].value_cy',
|
searchDetailsObj[key].appealType
|
||||||
json: transLookup,
|
).value
|
||||||
eval: true
|
})}
|
||||||
})[0]
|
|
||||||
: getFormCollectionByID(
|
|
||||||
searchDetailsObj[key].appealType
|
|
||||||
).value)}
|
|
||||||
{hasOwn(
|
{hasOwn(
|
||||||
searchDetailsObj[key],
|
searchDetailsObj[key],
|
||||||
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
||||||
@@ -658,41 +625,14 @@ const ViewAllResults = (props) => {
|
|||||||
}) || "N/A"
|
}) || "N/A"
|
||||||
: isMyRepresentations
|
: isMyRepresentations
|
||||||
? repRaisedDate(item.repfile_name) // ? router.locale == "cy"
|
? repRaisedDate(item.repfile_name) // ? router.locale == "cy"
|
||||||
: // ? jsonpath({path:
|
: resolveCrmDisplayValue({
|
||||||
//
|
value: item[
|
||||||
// '$..[?(@ && @.value=="' +
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
// searchDetailsObj[key].value[0][
|
],
|
||||||
// "statuscode@OData.Community.Display.V1.FormattedValue"
|
locale: router.locale,
|
||||||
// ] +
|
translations: transLookup,
|
||||||
// '")].value_cy',transLookup,
|
fallbackValue: "N/A"
|
||||||
// )
|
})}
|
||||||
// : searchDetailsObj[key].value[0][
|
|
||||||
// "statuscode@OData.Community.Display.V1.FormattedValue"
|
|
||||||
// ] || "N/A"
|
|
||||||
// : router.locale == "cy"
|
|
||||||
// ? jsonpath({path:
|
|
||||||
//
|
|
||||||
// '$..[?(@ && @.value=="' +
|
|
||||||
// item[
|
|
||||||
// "statuscode@OData.Community.Display.V1.FormattedValue"
|
|
||||||
// ] +
|
|
||||||
// '")].value_cy',transLookup,
|
|
||||||
// )
|
|
||||||
|
|
||||||
router.locale === "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
item[
|
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: item[
|
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || "N/A"}
|
|
||||||
</dd>
|
</dd>
|
||||||
{isAwaitingSubmissionDetails && (
|
{isAwaitingSubmissionDetails && (
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import {
|
|||||||
selectRowFieldType,
|
selectRowFieldType,
|
||||||
selectRowLabelDescriptions
|
selectRowLabelDescriptions
|
||||||
} from "../../lib/newappeal/formDerivation";
|
} from "../../lib/newappeal/formDerivation";
|
||||||
|
import { resolveCrmDisplayValue } from "../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
|
|
||||||
let BuildCheckRow = (props) => {
|
let BuildCheckRow = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -74,14 +75,12 @@ let BuildCheckRow = (props) => {
|
|||||||
eval: true
|
eval: true
|
||||||
});
|
});
|
||||||
|
|
||||||
let labelTrans =
|
let labelTrans = resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: label,
|
||||||
? jsonpath({
|
locale,
|
||||||
path: '$..[?(@ && @.value=="' + label + '")].value_cy',
|
translations: formObj
|
||||||
json: formObj,
|
});
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: label;
|
|
||||||
return labelTrans;
|
return labelTrans;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import DocsOfflineNotice from "./buildCheckSection/DocsOfflineNotice";
|
|||||||
import FinalisingStatePanel from "./buildCheckSection/FinalisingStatePanel";
|
import FinalisingStatePanel from "./buildCheckSection/FinalisingStatePanel";
|
||||||
import SectionReviewList from "./buildCheckSection/SectionReviewList";
|
import SectionReviewList from "./buildCheckSection/SectionReviewList";
|
||||||
import SubmitActionsPanel from "./buildCheckSection/SubmitActionsPanel";
|
import SubmitActionsPanel from "./buildCheckSection/SubmitActionsPanel";
|
||||||
|
import resolveCrmDisplayValue from "../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
|
|
||||||
let BuildCheckSection = (props) => {
|
let BuildCheckSection = (props) => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -144,14 +145,11 @@ let BuildCheckSection = (props) => {
|
|||||||
eval: true
|
eval: true
|
||||||
});
|
});
|
||||||
|
|
||||||
let labelTrans =
|
let labelTrans = resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: label,
|
||||||
? jsonpath({
|
locale,
|
||||||
path: '$..[?(@ && @.value=="' + label + '")].value_cy',
|
translations: formObj
|
||||||
json: formObj,
|
});
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: label;
|
|
||||||
return labelTrans;
|
return labelTrans;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
@@ -15,6 +14,7 @@ import {
|
|||||||
} from "../../store/appealType/action";
|
} from "../../store/appealType/action";
|
||||||
import { getFormCollectionByID, hasOwn } from "../utils";
|
import { getFormCollectionByID, hasOwn } from "../utils";
|
||||||
import Aboutyou from "./aboutyou";
|
import Aboutyou from "./aboutyou";
|
||||||
|
import resolveCrmDisplayValue from "../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
|
|
||||||
const RenderLPAList = ({
|
const RenderLPAList = ({
|
||||||
name,
|
name,
|
||||||
@@ -52,32 +52,29 @@ const RenderLPAList = ({
|
|||||||
className="govuk-select govuk-input--error"
|
className="govuk-select govuk-input--error"
|
||||||
id="lpatypes"
|
id="lpatypes"
|
||||||
name="lpatypes"
|
name="lpatypes"
|
||||||
//onChange={(e) => props.onChangeSelectLPA(e)}
|
|
||||||
>
|
>
|
||||||
<option value="" disabled defaultValue>
|
<option value="" disabled defaultValue>
|
||||||
{t("common:drop-down-select")}
|
{t("common:drop-down-select")}
|
||||||
</option>
|
</option>
|
||||||
{_.isEmpty(optionsObj)
|
|
||||||
? ""
|
{Object.keys(optionsObj || {}).map((key) => {
|
||||||
: Object.keys(optionsObj).map((key, index) => {
|
const option = optionsObj[key];
|
||||||
return (
|
|
||||||
<option
|
return (
|
||||||
key={key}
|
<option
|
||||||
value={optionsObj[key].accountid}
|
key={key}
|
||||||
>
|
value={option?.accountid || ""}
|
||||||
{router.locale == "cy"
|
>
|
||||||
? jsonpath({
|
{option?.name
|
||||||
path:
|
? resolveCrmDisplayValue({
|
||||||
'$..[?(@ && @.value=="' +
|
value: option.name,
|
||||||
optionsObj[key].name +
|
locale: router.locale,
|
||||||
'")].value_cy',
|
translations: transLookup
|
||||||
json: transLookup,
|
})
|
||||||
eval: true
|
: ""}
|
||||||
})
|
</option>
|
||||||
: optionsObj[key].name}
|
);
|
||||||
</option>
|
})}
|
||||||
);
|
|
||||||
})}
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -119,53 +116,33 @@ const RenderAppealTypeList = ({
|
|||||||
className="govuk-select"
|
className="govuk-select"
|
||||||
id="appealTypes"
|
id="appealTypes"
|
||||||
name={name}
|
name={name}
|
||||||
//onChange={(e) => props.onChangeSelectAppealType(e)}
|
|
||||||
>
|
>
|
||||||
<option value="" disabled defaultValue>
|
<option value="" disabled defaultValue>
|
||||||
{t("common:drop-down-select")}
|
{t("common:drop-down-select")}
|
||||||
</option>
|
</option>
|
||||||
{_.isEmpty(optionsObj)
|
|
||||||
? ""
|
{Object.keys(optionsObj || {}).map((key) => {
|
||||||
: Object.keys(optionsObj).map((key, index) => {
|
const option = optionsObj[key];
|
||||||
return (
|
|
||||||
<option
|
return (
|
||||||
key={key}
|
<option
|
||||||
value={
|
key={key}
|
||||||
_.isEmpty(optionsObj[key])
|
value={
|
||||||
? ""
|
option?.value
|
||||||
: _.isEmpty(optionsObj[key])
|
? option.attributevalue
|
||||||
? ""
|
: ""
|
||||||
: _.isEmpty(
|
}
|
||||||
optionsObj[key]
|
>
|
||||||
.value
|
{option?.value
|
||||||
)
|
? resolveCrmDisplayValue({
|
||||||
? ""
|
value: option.value,
|
||||||
: optionsObj[key]
|
locale: router.locale,
|
||||||
.attributevalue
|
translations: transLookup
|
||||||
}
|
})
|
||||||
>
|
: ""}
|
||||||
{_.isEmpty(optionsObj[key])
|
</option>
|
||||||
? ""
|
);
|
||||||
: _.isEmpty(optionsObj[key])
|
})}
|
||||||
? ""
|
|
||||||
: _.isEmpty(
|
|
||||||
optionsObj[key].value
|
|
||||||
)
|
|
||||||
? ""
|
|
||||||
: router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
optionsObj[key]
|
|
||||||
.value +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: optionsObj[key].value}
|
|
||||||
</option>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -305,25 +282,11 @@ function Radiofield(props) {
|
|||||||
.slice(1, props.options.length - 1)
|
.slice(1, props.options.length - 1)
|
||||||
.split(",");
|
.split(",");
|
||||||
|
|
||||||
//parentFieldShowOnValue
|
|
||||||
var showIfHasParentShowValue = parentField != false;
|
var showIfHasParentShowValue = parentField != false;
|
||||||
//debugger;
|
|
||||||
// parentField != false &&
|
|
||||||
// !_.isEmpty(formProps[form]) &&
|
|
||||||
// hasOwn(formProps[form].values, parentField) &&
|
|
||||||
// parentFieldShowOnValue.indexOf(
|
|
||||||
// formProps[form].values[parentField].toString()
|
|
||||||
// ) > -1;
|
|
||||||
|
|
||||||
(showIfHasParentShowValue == parentField) != false &&
|
(showIfHasParentShowValue == parentField) != false &&
|
||||||
showIfHasParentShowValue;
|
showIfHasParentShowValue;
|
||||||
|
|
||||||
//console.log(
|
|
||||||
// datafieldname,
|
|
||||||
// showIfHasParentShowValue,
|
|
||||||
// formProps[form].values[parentField]
|
|
||||||
// );
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{parentField != false ? (
|
{parentField != false ? (
|
||||||
@@ -466,20 +429,6 @@ let CreateCase = (props) => {
|
|||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
consoleLogger(error);
|
consoleLogger(error);
|
||||||
});
|
});
|
||||||
|
|
||||||
// router.replace(
|
|
||||||
// "/newappeal" +
|
|
||||||
// "/" +
|
|
||||||
// appTypeCollection.UrlName +
|
|
||||||
// "?lpa=" +
|
|
||||||
// values.lpaTypes +
|
|
||||||
// "&apt=" +
|
|
||||||
// values.appealTypes.split(",")[0],
|
|
||||||
// null,
|
|
||||||
// {
|
|
||||||
// shallow: true,
|
|
||||||
// }
|
|
||||||
// );
|
|
||||||
};
|
};
|
||||||
const yesNo = isWelsh ? ["Ydw", "Na"] : ["Yes", "No"];
|
const yesNo = isWelsh ? ["Ydw", "Na"] : ["Yes", "No"];
|
||||||
|
|
||||||
@@ -488,13 +437,13 @@ let CreateCase = (props) => {
|
|||||||
form = "caseForm",
|
form = "caseForm",
|
||||||
parentFieldShowOnValue = "846040004";
|
parentFieldShowOnValue = "846040004";
|
||||||
|
|
||||||
var showIfHasParentShowValue =
|
const values = formProps[form]?.values;
|
||||||
parentField != false &&
|
|
||||||
!_.isEmpty(formProps[form]) &&
|
const showIfHasParentShowValue =
|
||||||
hasOwn(formProps[form].values, parentField) &&
|
parentField !== false &&
|
||||||
parentFieldShowOnValue.indexOf(
|
values &&
|
||||||
formProps[form].values[parentField].toString()
|
hasOwn(values, parentField) &&
|
||||||
) > -1;
|
parentFieldShowOnValue.includes(values[parentField].toString());
|
||||||
|
|
||||||
(showIfHasParentShowValue == parentField) != false &&
|
(showIfHasParentShowValue == parentField) != false &&
|
||||||
showIfHasParentShowValue;
|
showIfHasParentShowValue;
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import Html from "react-pdf-html";
|
|||||||
|
|
||||||
import { DOMParser, XMLSerializer } from "@xmldom/xmldom";
|
import { DOMParser, XMLSerializer } from "@xmldom/xmldom";
|
||||||
import transLookup from "../../data/lookuptranslations.json";
|
import transLookup from "../../data/lookuptranslations.json";
|
||||||
|
import resolveCrmDisplayValue from "../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
|
|
||||||
export const AppealRow_pdf = (props) => {
|
export const AppealRow_pdf = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -435,32 +436,18 @@ export const AppealRow_pdf = (props) => {
|
|||||||
)}
|
)}
|
||||||
</Text>
|
</Text>
|
||||||
<Text style={styles.questionAnswer}>
|
<Text style={styles.questionAnswer}>
|
||||||
{locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: getPickListLabel(
|
||||||
path:
|
props.pickListData,
|
||||||
'$..[?(@ && @.value=="' +
|
datafieldname[0].value,
|
||||||
getPickListLabel(
|
props.props[
|
||||||
props.pickListData,
|
datafieldname[0]
|
||||||
datafieldname[0]
|
.value
|
||||||
.value,
|
]
|
||||||
props.props[
|
),
|
||||||
datafieldname[0]
|
locale,
|
||||||
.value
|
translations: transLookup
|
||||||
]
|
})}
|
||||||
) +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: getPickListLabel(
|
|
||||||
props.pickListData,
|
|
||||||
datafieldname[0]
|
|
||||||
.value,
|
|
||||||
props.props[
|
|
||||||
datafieldname[0]
|
|
||||||
.value
|
|
||||||
]
|
|
||||||
)}
|
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import transLookupEN from "../../locales/en/newappeal.json";
|
|||||||
import transLookup from "../../data/lookuptranslations.json";
|
import transLookup from "../../data/lookuptranslations.json";
|
||||||
import fieldLookup from "../../data/crmfieldlookuptranslations.json";
|
import fieldLookup from "../../data/crmfieldlookuptranslations.json";
|
||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
import { JSONPath as jsonpath } from "jsonpath-plus";
|
||||||
|
import resolveCrmDisplayValue from "../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
|
|
||||||
const getTrans = (locale, key) => {
|
const getTrans = (locale, key) => {
|
||||||
let jsonQuery = `$.${key}`;
|
let jsonQuery = `$.${key}`;
|
||||||
@@ -666,22 +667,12 @@ export const planningappeals78_pdf = ({ docProps, pickListData }) => {
|
|||||||
)}
|
)}
|
||||||
</Text>
|
</Text>
|
||||||
<Text style={styles.questionAnswer}>
|
<Text style={styles.questionAnswer}>
|
||||||
{/* {values.caseObj.pinswg_lpaname ||
|
{resolveCrmDisplayValue({
|
||||||
values.caseObj[
|
value: values.caseObj
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
.pinswg_lpaname,
|
||||||
]} */}
|
locale,
|
||||||
|
translations: transLookup
|
||||||
{locale == "cy"
|
})}
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
values.caseObj
|
|
||||||
.pinswg_lpaname +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: values.caseObj.pinswg_lpaname}
|
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
{/* <View
|
{/* <View
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import {
|
|||||||
deleteWatchedCases,
|
deleteWatchedCases,
|
||||||
getWatchedCasesProxy
|
getWatchedCasesProxy
|
||||||
} from "../../actions/services/portalService";
|
} from "../../actions/services/portalService";
|
||||||
|
import resolveCrmDisplayValue from "../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
import RepsOnResults from "./repsonresults";
|
import RepsOnResults from "./repsonresults";
|
||||||
import LiveLink from "./liveLink";
|
import LiveLink from "./liveLink";
|
||||||
|
|
||||||
@@ -598,39 +599,27 @@ const SearchResults = (props) => {
|
|||||||
item,
|
item,
|
||||||
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
||||||
)
|
)
|
||||||
? router.locale == "cy"
|
? resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: item[
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
item[
|
|
||||||
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: item[
|
|
||||||
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
||||||
] || "N/A"
|
],
|
||||||
|
locale: router.locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: "N/A"
|
||||||
|
})
|
||||||
: ""}
|
: ""}
|
||||||
{hasOwn(
|
{hasOwn(
|
||||||
item,
|
item,
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||||
)
|
)
|
||||||
? router.locale == "cy"
|
? resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: item[
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
item[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: item[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||||
] || "N/A"
|
],
|
||||||
|
locale: router.locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: "N/A"
|
||||||
|
})
|
||||||
: ""}
|
: ""}
|
||||||
{item?.pinswg_lpareference && (
|
{item?.pinswg_lpareference && (
|
||||||
<>
|
<>
|
||||||
@@ -653,19 +642,12 @@ const SearchResults = (props) => {
|
|||||||
)}
|
)}
|
||||||
:
|
:
|
||||||
</span>
|
</span>
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: item["pinswg_appealType"],
|
||||||
path:
|
locale: router.locale,
|
||||||
'$..[?(@ && @.value=="' +
|
translations: transLookup,
|
||||||
item[
|
fallbackValue: "N/A"
|
||||||
"pinswg_appealType"
|
})}
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: item["pinswg_appealType"] ||
|
|
||||||
"N/A"}
|
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
<span className="results-visually-hidden">
|
<span className="results-visually-hidden">
|
||||||
@@ -675,20 +657,14 @@ const SearchResults = (props) => {
|
|||||||
:
|
:
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: item[
|
||||||
path:
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
item[
|
locale: router.locale,
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: "N/A"
|
||||||
'")].value_cy',
|
})}
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: item[
|
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || "N/A"}
|
|
||||||
</dd>
|
</dd>
|
||||||
{myportal == true && (
|
{myportal == true && (
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-14 govuk-summary-list__action">
|
<dd className="govuk-summary-list__value govuk-!-font-size-14 govuk-summary-list__action">
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
@@ -7,6 +6,7 @@ import { useEffect, useState } from "react";
|
|||||||
import transLookup from "../../data/lookuptranslations.json";
|
import transLookup from "../../data/lookuptranslations.json";
|
||||||
|
|
||||||
import { getCaseStatus } from "../../actions/services/caseDirectService";
|
import { getCaseStatus } from "../../actions/services/caseDirectService";
|
||||||
|
import resolveCrmDisplayValue from "../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
|
|
||||||
const required = (errorMsg) => (value) =>
|
const required = (errorMsg) => (value) =>
|
||||||
value || typeof value === "number" ? undefined : errorMsg;
|
value || typeof value === "number" ? undefined : errorMsg;
|
||||||
@@ -282,22 +282,11 @@ let AdvancedSearch = (props) => {
|
|||||||
key={key}
|
key={key}
|
||||||
value={optionsObj[key].accountid}
|
value={optionsObj[key].accountid}
|
||||||
>
|
>
|
||||||
{/* {optionsObj[key].name} */}
|
{resolveCrmDisplayValue({
|
||||||
|
value: optionsObj[key].name,
|
||||||
{router.locale == "cy"
|
locale,
|
||||||
? jsonpath({
|
translations: transLookup
|
||||||
path:
|
})}
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
optionsObj[key]
|
|
||||||
.name +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: optionsObj[key].name ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</option>
|
</option>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
@@ -383,31 +372,11 @@ let AdvancedSearch = (props) => {
|
|||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{_.isEmpty(optionsObj[key])
|
{resolveCrmDisplayValue({
|
||||||
? ""
|
value: optionsObj[key].value,
|
||||||
: _.isEmpty(optionsObj[key])
|
locale,
|
||||||
? ""
|
translations: transLookup
|
||||||
: _.isEmpty(
|
})}
|
||||||
optionsObj[key]
|
|
||||||
.value
|
|
||||||
)
|
|
||||||
? ""
|
|
||||||
: router.locale == "cy"
|
|
||||||
? jsonpath({
|
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
optionsObj[
|
|
||||||
key
|
|
||||||
].value +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: optionsObj[key]
|
|
||||||
.value ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</option>
|
</option>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
@@ -456,69 +425,47 @@ let AdvancedSearch = (props) => {
|
|||||||
className="govuk-select"
|
className="govuk-select"
|
||||||
id={id}
|
id={id}
|
||||||
name={name}
|
name={name}
|
||||||
//onChange={(e) => props.onChangeSelectAppealType(e)}
|
|
||||||
>
|
>
|
||||||
<option value="" disabled defaultValue>
|
<option value="" disabled defaultValue>
|
||||||
{t("common:drop-down-select")}
|
{t("common:drop-down-select")}
|
||||||
</option>
|
</option>
|
||||||
{_.isEmpty(optionsObj)
|
|
||||||
? ""
|
{Object.keys(optionsObj || {}).map((key) => {
|
||||||
: Object.keys(optionsObj).map((key, index) => {
|
const option = optionsObj[key];
|
||||||
return (
|
const projectTypeId =
|
||||||
<option
|
option?.pinswg_sipsprojecttypeid;
|
||||||
key={key}
|
const projectName = option?.pinswg_name;
|
||||||
value={
|
|
||||||
_.isEmpty(optionsObj[key])
|
const cleanProjectName = projectName
|
||||||
? ""
|
? projectName
|
||||||
: _.isEmpty(
|
.replace(
|
||||||
optionsObj[key]
|
/(\band|[\s\-\+\(\),&])/g,
|
||||||
)
|
""
|
||||||
? ""
|
)
|
||||||
: _.isEmpty(
|
.toLowerCase()
|
||||||
optionsObj[key]
|
: "";
|
||||||
.pinswg_sipsprojecttypeid
|
|
||||||
)
|
return (
|
||||||
? ""
|
<option
|
||||||
: optionsObj[key]
|
key={key}
|
||||||
.pinswg_sipsprojecttypeid +
|
value={
|
||||||
"," +
|
projectTypeId && projectName
|
||||||
optionsObj[
|
? `${projectTypeId},${cleanProjectName}`
|
||||||
key
|
: ""
|
||||||
].pinswg_name
|
}
|
||||||
.replace(
|
>
|
||||||
/(\band|[\s\-\+\(\)\,\&])/g,
|
{projectName
|
||||||
""
|
? resolveCrmDisplayValue({
|
||||||
)
|
value: projectName,
|
||||||
.toLowerCase()
|
locale,
|
||||||
}
|
translations: transLookup
|
||||||
>
|
})
|
||||||
{_.isEmpty(optionsObj[key])
|
: t(
|
||||||
? ""
|
"case:summary-no-date-entered-label"
|
||||||
: _.isEmpty(optionsObj[key])
|
)}
|
||||||
? ""
|
</option>
|
||||||
: _.isEmpty(
|
);
|
||||||
optionsObj[key]
|
})}
|
||||||
.pinswg_name
|
|
||||||
)
|
|
||||||
? ""
|
|
||||||
: router.locale == "cy"
|
|
||||||
? jsonpath(
|
|
||||||
'$..[?(@.value=="' +
|
|
||||||
optionsObj[
|
|
||||||
key
|
|
||||||
]
|
|
||||||
.pinswg_name +
|
|
||||||
'")].value_cy',
|
|
||||||
transLookup
|
|
||||||
)
|
|
||||||
: optionsObj[key]
|
|
||||||
.pinswg_name ||
|
|
||||||
t(
|
|
||||||
"case:summary-no-date-entered-label"
|
|
||||||
)}
|
|
||||||
</option>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -595,7 +542,6 @@ let AdvancedSearch = (props) => {
|
|||||||
{t("search:search-title-label")}
|
{t("search:search-title-label")}
|
||||||
</h1>
|
</h1>
|
||||||
</legend>
|
</legend>
|
||||||
|
|
||||||
<Field
|
<Field
|
||||||
validate={[
|
validate={[
|
||||||
minLength(
|
minLength(
|
||||||
@@ -620,7 +566,6 @@ let AdvancedSearch = (props) => {
|
|||||||
"myportal:searchcases-card-search-example-label-2"
|
"myportal:searchcases-card-search-example-label-2"
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Field
|
<Field
|
||||||
validate={[
|
validate={[
|
||||||
minLength(
|
minLength(
|
||||||
@@ -645,7 +590,6 @@ let AdvancedSearch = (props) => {
|
|||||||
"myportal:searchcases-card-search-example-label-2"
|
"myportal:searchcases-card-search-example-label-2"
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Field
|
<Field
|
||||||
name="appealTypes"
|
name="appealTypes"
|
||||||
id="appealTypes"
|
id="appealTypes"
|
||||||
@@ -655,7 +599,6 @@ let AdvancedSearch = (props) => {
|
|||||||
label={t("search:appealtype-label")}
|
label={t("search:appealtype-label")}
|
||||||
errormsg="Appeal type is required"
|
errormsg="Appeal type is required"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{props.appealTypesValue?.split(
|
{props.appealTypesValue?.split(
|
||||||
","
|
","
|
||||||
)[0] === "846040002" && (
|
)[0] === "846040002" && (
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import {
|
|||||||
deleteWatchedCases,
|
deleteWatchedCases,
|
||||||
getWatchedCasesProxy
|
getWatchedCasesProxy
|
||||||
} from "../../actions/services/portalService";
|
} from "../../actions/services/portalService";
|
||||||
|
import resolveCrmDisplayValue from "../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
import {
|
import {
|
||||||
setCurrentPage,
|
setCurrentPage,
|
||||||
setCurrentReference
|
setCurrentReference
|
||||||
@@ -394,21 +395,14 @@ const DNSSearchResults = (props) => {
|
|||||||
});
|
});
|
||||||
detailsObj = detailsObj[0];
|
detailsObj = detailsObj[0];
|
||||||
|
|
||||||
var appType =
|
var appType = resolveCrmDisplayValue({
|
||||||
router.locale == "cy"
|
value: item[
|
||||||
? jsonpath({
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
path:
|
],
|
||||||
'$..[?(@.value=="' +
|
locale: router.locale,
|
||||||
item[
|
translations: transLookup,
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
fallbackValue: "N/A"
|
||||||
] +
|
});
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: item[
|
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || "N/A";
|
|
||||||
|
|
||||||
appType =
|
appType =
|
||||||
appType ==
|
appType ==
|
||||||
@@ -609,20 +603,14 @@ const DNSSearchResults = (props) => {
|
|||||||
detailsObj,
|
detailsObj,
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||||
)
|
)
|
||||||
? router.locale == "cy"
|
? resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: detailsObj[
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
detailsObj[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||||
] || "N/A"
|
],
|
||||||
|
locale: router.locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: "N/A"
|
||||||
|
})
|
||||||
: ""}
|
: ""}
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
@@ -632,20 +620,14 @@ const DNSSearchResults = (props) => {
|
|||||||
)}
|
)}
|
||||||
:
|
:
|
||||||
</span>
|
</span>
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: item[
|
||||||
path:
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
item[
|
locale: router.locale,
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: "N/A"
|
||||||
'")].value_cy',
|
})}
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: item[
|
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || "N/A"}
|
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
<span className="results-visually-hidden">
|
<span className="results-visually-hidden">
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ import {
|
|||||||
deleteWatchedCases,
|
deleteWatchedCases,
|
||||||
getWatchedCasesProxy
|
getWatchedCasesProxy
|
||||||
} from "../../actions/services/portalService";
|
} from "../../actions/services/portalService";
|
||||||
|
import resolveCrmDisplayValue from "../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
|
|
||||||
import { sendGAEvent } from "@next/third-parties/google";
|
import { sendGAEvent } from "@next/third-parties/google";
|
||||||
import RepsOnResults from "./repsonresults";
|
import RepsOnResults from "./repsonresults";
|
||||||
@@ -613,20 +614,14 @@ const SearchResults = (props) => {
|
|||||||
item,
|
item,
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||||
)
|
)
|
||||||
? router.locale == "cy"
|
? resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: item[
|
||||||
path:
|
|
||||||
'$..[?(@ && @.value=="' +
|
|
||||||
item[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] +
|
|
||||||
'")].value_cy',
|
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: item[
|
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||||
] || "N/A"
|
],
|
||||||
|
locale: router.locale,
|
||||||
|
translations: transLookup,
|
||||||
|
fallbackValue: "N/A"
|
||||||
|
})
|
||||||
: ""}
|
: ""}
|
||||||
{item?.pinswg_lpareference && (
|
{item?.pinswg_lpareference && (
|
||||||
<>
|
<>
|
||||||
@@ -649,39 +644,28 @@ const SearchResults = (props) => {
|
|||||||
)}
|
)}
|
||||||
:
|
:
|
||||||
</span>
|
</span>
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: item[
|
||||||
path:
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
item[
|
locale: router.locale,
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
] +
|
fallbackValue: "N/A"
|
||||||
'")].value_cy',
|
})}
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: item[
|
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || "N/A"}
|
|
||||||
|
|
||||||
{detailsObj?.pinswg_specialistcaseprocess && (
|
{detailsObj?.pinswg_specialistcaseprocess && (
|
||||||
<>
|
<>
|
||||||
<br /> <br />
|
<br /> <br />
|
||||||
<span>
|
<span>
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: detailsObj[
|
||||||
path:
|
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
],
|
||||||
detailsObj[
|
locale: router.locale,
|
||||||
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
|
translations:
|
||||||
] +
|
transLookup,
|
||||||
'")].value_cy',
|
fallbackValue: "N/A"
|
||||||
json: transLookup,
|
})}
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: detailsObj[
|
|
||||||
"pinswg_specialistcaseprocess@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || "N/A"}
|
|
||||||
</span>
|
</span>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
@@ -694,20 +678,14 @@ const SearchResults = (props) => {
|
|||||||
:
|
:
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
{router.locale == "cy"
|
{resolveCrmDisplayValue({
|
||||||
? jsonpath({
|
value: item[
|
||||||
path:
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
'$..[?(@ && @.value=="' +
|
]?.trim(),
|
||||||
item[
|
locale: router.locale,
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
translations: transLookup,
|
||||||
].trim() +
|
fallbackValue: "N/A"
|
||||||
'")].value_cy',
|
})}
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})
|
|
||||||
: item[
|
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
|
||||||
] || "N/A"}
|
|
||||||
</dd>
|
</dd>
|
||||||
{myportal == true && (
|
{myportal == true && (
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-14 govuk-summary-list__action">
|
<dd className="govuk-summary-list__value govuk-!-font-size-14 govuk-summary-list__action">
|
||||||
|
|||||||
@@ -1,17 +1,15 @@
|
|||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
import resolveCrmDisplayValue from "../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
|
|
||||||
const translateLpaName = ({ name, locale, transLookup }) => {
|
const translateLpaName = ({ name, locale, transLookup }) => {
|
||||||
if (!name) return "";
|
if (!name) return "";
|
||||||
|
|
||||||
if (locale !== "cy") return name;
|
if (locale !== "cy") return name;
|
||||||
|
|
||||||
return (
|
return resolveCrmDisplayValue({
|
||||||
jsonpath({
|
value: name,
|
||||||
path: '$..[?(@ && @.value=="' + name + '")].value_cy',
|
locale,
|
||||||
json: transLookup,
|
translations: transLookup
|
||||||
eval: true
|
});
|
||||||
})?.[0] || name
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getCaseLpaNames = ({
|
export const getCaseLpaNames = ({
|
||||||
|
|||||||
@@ -51,6 +51,55 @@ Business responsibility clarification:
|
|||||||
|
|
||||||
This architectural reference builds on those business concepts but does not replace the more detailed terminology guide in `context/business-domain-overview.md`.
|
This architectural reference builds on those business concepts but does not replace the more detailed terminology guide in `context/business-domain-overview.md`.
|
||||||
|
|
||||||
|
## CRM Display Infrastructure Status (2026-07-01)
|
||||||
|
|
||||||
|
### Stream status
|
||||||
|
|
||||||
|
**CRM Display Infrastructure: COMPLETE**
|
||||||
|
|
||||||
|
### Shared helper introduced
|
||||||
|
|
||||||
|
- `lib/i18n/crmDisplay/resolveCrmDisplayValue.js`
|
||||||
|
|
||||||
|
### Helper contract
|
||||||
|
|
||||||
|
The shared CRM display resolver should be understood as handling the standard CRM formatted/display-value translation concern only.
|
||||||
|
|
||||||
|
Current contract:
|
||||||
|
|
||||||
|
- missing CRM display value -> return `fallbackValue`
|
||||||
|
- English -> return CRM display value
|
||||||
|
- Welsh -> return translated value when available
|
||||||
|
- Welsh without translation -> return CRM display value
|
||||||
|
|
||||||
|
### Architectural responsibility
|
||||||
|
|
||||||
|
This helper centralises the standard CRM formatted/display-value translation pattern used across portal presentation surfaces.
|
||||||
|
|
||||||
|
It should be treated as the shared compatibility seam for:
|
||||||
|
|
||||||
|
- CRM formatted values
|
||||||
|
- CRM display values
|
||||||
|
- standard EN/CY display translation lookup
|
||||||
|
- existing consumer-specific absent-value fallback handling
|
||||||
|
|
||||||
|
### Boundary exclusions
|
||||||
|
|
||||||
|
The helper boundary intentionally excludes the following concerns:
|
||||||
|
|
||||||
|
- keyed lookup translation
|
||||||
|
- project-type list translation
|
||||||
|
- hyperlink / website rendering
|
||||||
|
- mixed presentation rows
|
||||||
|
- lifecycle interpretation
|
||||||
|
- status interpretation
|
||||||
|
- post-decision interpretation
|
||||||
|
- other presentation-specific derived values
|
||||||
|
|
||||||
|
These are separate architectural concerns and should not be folded into `resolveCrmDisplayValue(...)`.
|
||||||
|
|
||||||
|
If future work is needed in those areas, it should introduce a separate abstraction rather than broadening the helper.
|
||||||
|
|
||||||
## Portal API Platform Assessment Status (2026-06-20)
|
## Portal API Platform Assessment Status (2026-06-20)
|
||||||
|
|
||||||
### Stream status
|
### Stream status
|
||||||
|
|||||||
@@ -148,6 +148,27 @@ The adoption target should be explicit, such as:
|
|||||||
|
|
||||||
Do not attempt mass adoption by default.
|
Do not attempt mass adoption by default.
|
||||||
|
|
||||||
|
### CRM Display Infrastructure Rule
|
||||||
|
|
||||||
|
When rendering a standard CRM formatted/display value:
|
||||||
|
|
||||||
|
- `resolveCrmDisplayValue(...)` should be used.
|
||||||
|
|
||||||
|
Developers should not introduce new inline JSONPath lookups for the standard CRM formatted/display-value translation pattern.
|
||||||
|
|
||||||
|
If the translation concern does not match the helper boundary, it should be treated as a separate abstraction rather than extending the helper.
|
||||||
|
|
||||||
|
This includes concerns such as:
|
||||||
|
|
||||||
|
- keyed lookup translation
|
||||||
|
- list translation
|
||||||
|
- hyperlink / website rendering
|
||||||
|
- mixed presentation rows
|
||||||
|
- lifecycle interpretation
|
||||||
|
- status interpretation
|
||||||
|
- post-decision interpretation
|
||||||
|
- other derived presentation values
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 4. Branching Governance
|
## 4. Branching Governance
|
||||||
|
|||||||
@@ -190,10 +190,13 @@ Create a clearer single source of truth for CRM-driven bilingual display behavio
|
|||||||
|
|
||||||
#### Current Maturity
|
#### Current Maturity
|
||||||
|
|
||||||
- characterized
|
- completed
|
||||||
- repeated dominant pattern identified
|
- shared resolver introduced
|
||||||
- several partial abstractions already present
|
- helper test coverage added
|
||||||
- suitable for incremental implementation
|
- helper contract verified and corrected
|
||||||
|
- compatible consumers adopted across admin, search, My Portal, and summary types
|
||||||
|
- stale JSONPath import cleanup completed where safe
|
||||||
|
- behaviour-preserving migration completed
|
||||||
|
|
||||||
#### Implementation Strategy
|
#### Implementation Strategy
|
||||||
|
|
||||||
@@ -202,6 +205,34 @@ Create a clearer single source of truth for CRM-driven bilingual display behavio
|
|||||||
- adopt first in bounded, read-only display families
|
- adopt first in bounded, read-only display families
|
||||||
- preserve current fallback behaviour per consumer unless an explicit standardization decision is approved
|
- preserve current fallback behaviour per consumer unless an explicit standardization decision is approved
|
||||||
|
|
||||||
|
#### Status
|
||||||
|
|
||||||
|
Completed.
|
||||||
|
|
||||||
|
Delivered in this workstream:
|
||||||
|
|
||||||
|
- shared resolver introduced
|
||||||
|
- helper test coverage
|
||||||
|
- helper contract verified and corrected
|
||||||
|
- adoption across:
|
||||||
|
- admin
|
||||||
|
- search
|
||||||
|
- My Portal
|
||||||
|
- summary types
|
||||||
|
- stale JSONPath import cleanup
|
||||||
|
- behaviour-preserving migration
|
||||||
|
|
||||||
|
Remaining JSONPath usage in adopted areas is intentional where it falls outside the helper boundary.
|
||||||
|
|
||||||
|
That includes concerns such as:
|
||||||
|
|
||||||
|
- keyed lookup translation
|
||||||
|
- project-type list translation
|
||||||
|
- hyperlink / website rendering
|
||||||
|
- mixed presentation rows
|
||||||
|
- lifecycle / status / post-decision interpretation
|
||||||
|
- other presentation-specific derived values
|
||||||
|
|
||||||
#### Expected Maintenance Benefit
|
#### Expected Maintenance Benefit
|
||||||
|
|
||||||
- reduced duplication of display-resolution logic
|
- reduced duplication of display-resolution logic
|
||||||
|
|||||||
@@ -543,7 +543,7 @@
|
|||||||
],
|
],
|
||||||
"pinswg_lpa": [
|
"pinswg_lpa": [
|
||||||
{
|
{
|
||||||
"value": "Isle of Anglesey County Council",
|
"value": "Anglesey County Council",
|
||||||
"value_cy": "Cyngor Sir Ynys Môn",
|
"value_cy": "Cyngor Sir Ynys Môn",
|
||||||
"pinswg_lpa": 846040000
|
"pinswg_lpa": 846040000
|
||||||
},
|
},
|
||||||
@@ -1055,5 +1055,41 @@
|
|||||||
"value": "Waste Water Treatment Plants",
|
"value": "Waste Water Treatment Plants",
|
||||||
"value_cy": "Gweithfeydd Trin Dŵr Gwastraff"
|
"value_cy": "Gweithfeydd Trin Dŵr Gwastraff"
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
"pinswg_specialistcaseprocess": [
|
||||||
|
{
|
||||||
|
"value": "Advert (part 3)",
|
||||||
|
"value_cy": "Hysbyseb (rhan 3)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "Advert (part 4)",
|
||||||
|
"value_cy": "Hysbyseb (rhan 4)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "Hedgerows (Wreps & Hearings)",
|
||||||
|
"value_cy": "Gwrychoedd (Gwreiau a Gwrandawiadau"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "High Hedge Appeals (Wreps & Hearings)",
|
||||||
|
"value_cy": "Apelau Gwrychoedd Uchel (Gwreiau a Gwrandawiadau"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "TPO Appeals (Wreps)",
|
||||||
|
"value_cy": "Apelau Gorchymyn Diogelu Coed (Gwreiau)"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"procedures": [
|
||||||
|
{
|
||||||
|
"value": "Written representations",
|
||||||
|
"value_cy": "Sylwadau ysgrifenedig"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "Inquiry",
|
||||||
|
"value_cy": "Ymchwiliad"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "Hearing",
|
||||||
|
"value_cy": "Gwrandawiad"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
import { JSONPath as jsonpath } from "jsonpath-plus";
|
||||||
|
|
||||||
|
const hasValue = (value) =>
|
||||||
|
value !== null && value !== undefined && value !== "";
|
||||||
|
|
||||||
|
export const resolveCrmDisplayValue = ({
|
||||||
|
value,
|
||||||
|
locale,
|
||||||
|
translations,
|
||||||
|
fallbackValue
|
||||||
|
}) => {
|
||||||
|
if (!hasValue(value)) {
|
||||||
|
return fallbackValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (locale !== "cy") {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
const matches = jsonpath({
|
||||||
|
path: `$..[?(@ && @.value==${JSON.stringify(String(value))})].value_cy`,
|
||||||
|
json: translations,
|
||||||
|
eval: true
|
||||||
|
});
|
||||||
|
|
||||||
|
return matches[0] ?? value;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default resolveCrmDisplayValue;
|
||||||
@@ -152,5 +152,6 @@
|
|||||||
"status-title": "Statws",
|
"status-title": "Statws",
|
||||||
"status-show-all-label": "Dangoswch bob cam",
|
"status-show-all-label": "Dangoswch bob cam",
|
||||||
"status-hide-all-label": "Cuddio pob cam",
|
"status-hide-all-label": "Cuddio pob cam",
|
||||||
"project-type-label": "Math o brosiect"
|
"project-type-label": "Math o brosiect",
|
||||||
|
"summary-specialist-case-process-label": "Proses Achos Arbenigol"
|
||||||
}
|
}
|
||||||
@@ -153,5 +153,6 @@
|
|||||||
"status-title": "Status",
|
"status-title": "Status",
|
||||||
"status-show-all-label": "Show all stages",
|
"status-show-all-label": "Show all stages",
|
||||||
"status-hide-all-label": "Hide all stages",
|
"status-hide-all-label": "Hide all stages",
|
||||||
"project-type-label": "Project type"
|
"project-type-label": "Project type",
|
||||||
|
"summary-specialist-case-process-label": "Specialist Case Process"
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,7 @@ import OSPoint from "ospoint";
|
|||||||
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
import { respondError, respondSuccess } from "../middleware/apiResponse";
|
||||||
import { relayGetData } from "../middleware/relayForwarding";
|
import { relayGetData } from "../middleware/relayForwarding";
|
||||||
import transLookup from "../../../data/lookuptranslations.json";
|
import transLookup from "../../../data/lookuptranslations.json";
|
||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
import resolveCrmDisplayValue from "../../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
|
||||||
|
|
||||||
const renameKeys = (obj) => {
|
const renameKeys = (obj) => {
|
||||||
const keyMappings = {
|
const keyMappings = {
|
||||||
@@ -132,23 +132,17 @@ const renameKeys = (obj) => {
|
|||||||
renamedObj.northing = String(renamedObj.northing);
|
renamedObj.northing = String(renamedObj.northing);
|
||||||
}
|
}
|
||||||
|
|
||||||
renamedObj.lpaDisplayName_cy = jsonpath({
|
renamedObj.lpaDisplayName_cy = resolveCrmDisplayValue({
|
||||||
path:
|
value: renamedObj.lpaDisplayName,
|
||||||
'$..[?(@ && @.value=="' +
|
locale: "cy",
|
||||||
renamedObj.lpaDisplayName +
|
translations: transLookup
|
||||||
'")].value_cy',
|
});
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})[0];
|
|
||||||
|
|
||||||
renamedObj.statusCodeDescription_cy = jsonpath({
|
renamedObj.statusCodeDescription_cy = resolveCrmDisplayValue({
|
||||||
path:
|
value: renamedObj.statusCodeDescription,
|
||||||
'$..[?(@ && @.value=="' +
|
locale: "cy",
|
||||||
renamedObj.statusCodeDescription +
|
translations: transLookup
|
||||||
'")].value_cy',
|
});
|
||||||
json: transLookup,
|
|
||||||
eval: true
|
|
||||||
})[0];
|
|
||||||
|
|
||||||
return renamedObj;
|
return renamedObj;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -51,14 +51,6 @@ export default async function ApiProxy(req, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//console.log(
|
|
||||||
// '$..[?(@ && @.name="' + lpaid + '")]',
|
|
||||||
// lpaList,
|
|
||||||
// lpaid,
|
|
||||||
// "LPAGUID=",
|
|
||||||
// lpaGUID
|
|
||||||
// );
|
|
||||||
|
|
||||||
const queryUrl =
|
const queryUrl =
|
||||||
"incidents?$select=pinswg_environmentalstatementlocation,modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference,pinswg_appellantlastname,pinswg_appellantfirstname,pinswg_appellantagent,pinswg_agentfirstname,pinswg_agentlastname,pinswg_agentcompanyname&$expand=primarycontactid($select=fullname)&$filter=_pinswg_associatedlpa_value eq " +
|
"incidents?$select=pinswg_environmentalstatementlocation,modifiedon,description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value,pinswg_lpareference,pinswg_appellantlastname,pinswg_appellantfirstname,pinswg_appellantagent,pinswg_agentfirstname,pinswg_agentlastname,pinswg_agentcompanyname&$expand=primarycontactid($select=fullname)&$filter=_pinswg_associatedlpa_value eq " +
|
||||||
lpaGUID[0].accountid +
|
lpaGUID[0].accountid +
|
||||||
|
|||||||
@@ -1,369 +1,3 @@
|
|||||||
// import fs from "fs";
|
|
||||||
// import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
// import useTranslation from "next-translate/useTranslation";
|
|
||||||
// import Head from "next/head";
|
|
||||||
// import { useRouter } from "next/router";
|
|
||||||
// import { useEffect } from "react";
|
|
||||||
// import { connect } from "react-redux";
|
|
||||||
// import xpath from "xpath";
|
|
||||||
// import Breadcrumbs from "../../components/breadcrumbs";
|
|
||||||
// import CookieBanner from "../../components/cookieBanner";
|
|
||||||
// import Footer from "../../components/footer";
|
|
||||||
// import Header from "../../components/header";
|
|
||||||
// import BuildCheckSection from "../../components/newappeal/buildchecksection";
|
|
||||||
// import BuildSection from "../../components/newappeal/buildsection";
|
|
||||||
// import CompleteAppeal from "../../components/newappeal/complete";
|
|
||||||
// import TimeOut from "../../components/timeout";
|
|
||||||
|
|
||||||
// import { getSession } from "next-auth/react";
|
|
||||||
// import {
|
|
||||||
// setContainerID,
|
|
||||||
// setLoggedInUserEmail,
|
|
||||||
// setLoggedInUserId,
|
|
||||||
// setAccountDetails,
|
|
||||||
// } from "../../store/accountDetails/action";
|
|
||||||
// import {
|
|
||||||
// setAppealLPA,
|
|
||||||
// setAppealType,
|
|
||||||
// setAppealTypeID,
|
|
||||||
// setAppealTypeTitle,
|
|
||||||
// setCaseReference,
|
|
||||||
// setFilesForAppeal,
|
|
||||||
// } from "../../store/appealType/action";
|
|
||||||
// import {
|
|
||||||
// setAwaitingSubmissionDetails,
|
|
||||||
// setAwaitingSubmissionFromBlob,
|
|
||||||
// } from "../../store/awaitingSubmission/action";
|
|
||||||
// import { setCurrentView, setLocale } from "../../store/currentView/action";
|
|
||||||
// import { setForm } from "../../store/formData/action";
|
|
||||||
// import { wrapper } from "../../store/store";
|
|
||||||
// import ServiceBanner from "../../components/myportal/servicebanner";
|
|
||||||
|
|
||||||
// let Home = (props) => {
|
|
||||||
// const { footerLinks, pages, formData } = props;
|
|
||||||
// let { t, lang } = useTranslation();
|
|
||||||
|
|
||||||
// const router = useRouter();
|
|
||||||
// const { locale } = router;
|
|
||||||
// const { appealtypes } = router.query;
|
|
||||||
|
|
||||||
// useEffect(() => {
|
|
||||||
// //setFormTitle(formTitle);
|
|
||||||
// setCaseReference(router.query.casereference);
|
|
||||||
// }, []); // eslint-disable-line react-hooks/exhaustive-deps
|
|
||||||
|
|
||||||
// const formXML = props.formData.formData;
|
|
||||||
// const parser = new DOMParser();
|
|
||||||
// var doc = parser.parseFromString(formXML, "text/xml");
|
|
||||||
// var titles = xpath.select(
|
|
||||||
// "//form/tabs/tab[*]/labels/label[@description]/@description",
|
|
||||||
// doc
|
|
||||||
// );
|
|
||||||
// var sectionCount = xpath.select("/form/tabs/tab[*]", doc);
|
|
||||||
// sectionCount = sectionCount.length;
|
|
||||||
|
|
||||||
// var tabs = xpath.select("//form/tabs/tab[*]", doc);
|
|
||||||
|
|
||||||
// let optionsStr = props.appealType.appealTypeOptions.value || {};
|
|
||||||
|
|
||||||
// let selectedObj = jsonpath({
|
|
||||||
// path: "$..[?(@ && @.attributevalue=='" + router.query.apt + "')]",
|
|
||||||
// json: optionsStr,
|
|
||||||
// eval: true,
|
|
||||||
// });
|
|
||||||
|
|
||||||
// //let optionsTitleObj = [];
|
|
||||||
|
|
||||||
// //const optionsTitleObj = selectedObj.reduce(
|
|
||||||
// // (obj, arrValue) => (
|
|
||||||
// // (obj[arrValue] = arrValue
|
|
||||||
// // .replace(/(\band|[\s\-\+\(\)\,\&])/g, "")
|
|
||||||
// // .toLowerCase()
|
|
||||||
// // .slice(0, 39)),
|
|
||||||
// // obj
|
|
||||||
// // ),
|
|
||||||
// // {}
|
|
||||||
// // );
|
|
||||||
|
|
||||||
// const formTitle = selectedObj[0].value;
|
|
||||||
|
|
||||||
// const { onSubmit } = props;
|
|
||||||
|
|
||||||
// return (
|
|
||||||
// <div>
|
|
||||||
// <Head>
|
|
||||||
// <title>
|
|
||||||
// {t("newappeal:page-title")} - {t("common:service-name")}
|
|
||||||
// </title>
|
|
||||||
// <>
|
|
||||||
// <link
|
|
||||||
// rel="canonical"
|
|
||||||
// href={t("common:gov-wales-link") + router.asPath}
|
|
||||||
// />
|
|
||||||
// <meta
|
|
||||||
// key="og:locale"
|
|
||||||
// property="og:locale"
|
|
||||||
// content={router.locale}
|
|
||||||
// />
|
|
||||||
// {/* If they have a Twitter Handle, include the meta details below */}
|
|
||||||
// <meta
|
|
||||||
// key="og:site_name"
|
|
||||||
// property="og:site_name"
|
|
||||||
// content={t("common:service-name")}
|
|
||||||
// />
|
|
||||||
// <meta
|
|
||||||
// key="twitter:site"
|
|
||||||
// property="twitter:site"
|
|
||||||
// content="@UKGovWales"
|
|
||||||
// />
|
|
||||||
|
|
||||||
// <meta
|
|
||||||
// name="description"
|
|
||||||
// content={t("common:service-description")}
|
|
||||||
// />
|
|
||||||
// <meta
|
|
||||||
// property="og:site_name"
|
|
||||||
// content={t("common:gov-wales-label")}
|
|
||||||
// />
|
|
||||||
// <meta
|
|
||||||
// property="og:title"
|
|
||||||
// content={t("newappeal:page-title")}
|
|
||||||
// />
|
|
||||||
// <meta
|
|
||||||
// property="og:description"
|
|
||||||
// content={t("common:service-description")}
|
|
||||||
// />
|
|
||||||
// <meta property="og:type" content="website" />
|
|
||||||
// <meta
|
|
||||||
// property="og:url"
|
|
||||||
// content={t("common:gov-wales-link")}
|
|
||||||
// />
|
|
||||||
// <meta
|
|
||||||
// property="og:image"
|
|
||||||
// content="https://gov.wales/themes/custom/govwales/images/content/og-global-1200.png"
|
|
||||||
// />
|
|
||||||
// <meta name="twitter:card" content="summary" />
|
|
||||||
// <meta
|
|
||||||
// name="twitter:title"
|
|
||||||
// content={t("common:gov-wales-label")}
|
|
||||||
// />
|
|
||||||
// <meta
|
|
||||||
// name="twitter:url"
|
|
||||||
// content={t("common:gov-wales-link") + router.asPath}
|
|
||||||
// />
|
|
||||||
// <meta
|
|
||||||
// name="twitter:image"
|
|
||||||
// content="https://gov.wales/themes/custom/govwales/images/content/og-global-120.png"
|
|
||||||
// />
|
|
||||||
// </>
|
|
||||||
// </Head>
|
|
||||||
// <div id="page_wrapper">
|
|
||||||
// <CookieBanner />
|
|
||||||
// <Header />
|
|
||||||
|
|
||||||
// <div className="govuk-width-container">
|
|
||||||
// <Breadcrumbs slug={appealtypes} formTitle={formTitle} />
|
|
||||||
// <ServiceBanner props={props} />
|
|
||||||
// <main
|
|
||||||
// className="govuk-main-wrapper--auto-spacing"
|
|
||||||
// id="main-content"
|
|
||||||
// role="main"
|
|
||||||
// >
|
|
||||||
// {props.appealType.currentSection == 9999 ? (
|
|
||||||
// <CompleteAppeal props={props} />
|
|
||||||
// ) : props.appealType.currentSection ==
|
|
||||||
// sectionCount + 1 ? (
|
|
||||||
// <BuildCheckSection
|
|
||||||
// formXML={formXML}
|
|
||||||
// sectionCount={sectionCount}
|
|
||||||
// onSubmit={onSubmit}
|
|
||||||
// formTitle={formTitle}
|
|
||||||
// appealType={props.appealType}
|
|
||||||
// props={props}
|
|
||||||
// key={1}
|
|
||||||
// mandatoryFieldsData={
|
|
||||||
// props.formData.mandatoryFieldsData
|
|
||||||
// }
|
|
||||||
// />
|
|
||||||
// ) : (
|
|
||||||
// <>
|
|
||||||
// <BuildSection
|
|
||||||
// formXML={formXML}
|
|
||||||
// sectionCount={sectionCount}
|
|
||||||
// onSubmit={onSubmit}
|
|
||||||
// formTitle={formTitle}
|
|
||||||
// mandatoryFieldsData={
|
|
||||||
// props.formData.mandatoryFieldsData
|
|
||||||
// }
|
|
||||||
// props={props}
|
|
||||||
// />
|
|
||||||
// </>
|
|
||||||
// )}
|
|
||||||
// </main>
|
|
||||||
// </div>
|
|
||||||
// <Footer footerLinks={footerLinks} ticketnumber={props} />
|
|
||||||
// </div>
|
|
||||||
// <TimeOut />
|
|
||||||
// </div>
|
|
||||||
// );
|
|
||||||
// };
|
|
||||||
|
|
||||||
// export const getServerSideProps = wrapper.getServerSideProps(
|
|
||||||
// (store) => async (ctx) => {
|
|
||||||
// const { query, req, res } = ctx;
|
|
||||||
// getIP(req);
|
|
||||||
// const { cookies } = req;
|
|
||||||
|
|
||||||
// console.log("the query", query);
|
|
||||||
// let loggedInUser = cookies.pinsUser;
|
|
||||||
|
|
||||||
// let thisSession = await getSession(ctx);
|
|
||||||
|
|
||||||
// if (!thisSession) {
|
|
||||||
// console.log("not has sesssion.......");
|
|
||||||
// return {
|
|
||||||
// redirect: {
|
|
||||||
// destination: "/auth/signin",
|
|
||||||
// permanent: false,
|
|
||||||
// },
|
|
||||||
// };
|
|
||||||
// }
|
|
||||||
|
|
||||||
// console.log(ctx.locale);
|
|
||||||
// store.dispatch(setLocale(ctx.locale));
|
|
||||||
|
|
||||||
// let loggedInUserIdent = thisSession.user.id;
|
|
||||||
// let loggedInUserEmail = thisSession.user.email;
|
|
||||||
|
|
||||||
// //console.log("logged ident:", loggedInUserIdent);
|
|
||||||
|
|
||||||
// console.log("which appeal: ", query.appealtypes);
|
|
||||||
|
|
||||||
// const accountDetails = await getPersonalAccount(loggedInUser);
|
|
||||||
|
|
||||||
// const [appealTypeData, mandatoryFieldsData, pickListData, blobList] =
|
|
||||||
// await Promise.all([
|
|
||||||
// await getAppealsTypesForNewAppeal(),
|
|
||||||
// await getMandatoryFields(query.appealtypes),
|
|
||||||
// await getPickLists(query.appealtypes),
|
|
||||||
// await getFilesFromBlob(loggedInUserIdent, query.casereference),
|
|
||||||
// ]);
|
|
||||||
|
|
||||||
// const blobProgress = await getProgressFromBlob(
|
|
||||||
// loggedInUserIdent,
|
|
||||||
// query.casereference
|
|
||||||
// );
|
|
||||||
|
|
||||||
// //console.log("/////////\nappeal type data:", appealTypeData);
|
|
||||||
|
|
||||||
// //
|
|
||||||
// // Removed to make progress from Blob not CRM
|
|
||||||
// //
|
|
||||||
|
|
||||||
// // let searchResultsObj = await getPartSavedAppeal(query.casereference);
|
|
||||||
// // //console.log("eeee:", searchResultsObj);
|
|
||||||
// // let searchDetailsObj = await getPartSavedDetails(searchResultsObj);
|
|
||||||
|
|
||||||
// // searchDetailsObj = searchDetailsObj[0].value[0];
|
|
||||||
|
|
||||||
// // Object.keys(searchDetailsObj).forEach((key) => {
|
|
||||||
// // if (searchDetailsObj[key] === null) {
|
|
||||||
// // delete searchDetailsObj[key];
|
|
||||||
// // }
|
|
||||||
// // });
|
|
||||||
|
|
||||||
// //console.log("appeal:", searchDetailsObj);
|
|
||||||
|
|
||||||
// // searchDetailsObj = JSON.stringify(searchDetailsObj);
|
|
||||||
// // searchDetailsObj = searchDetailsObj.replace(/:true/gm, `:"Yes"`);
|
|
||||||
// // searchDetailsObj = searchDetailsObj.replace(/:false/gm, `:"No"`);
|
|
||||||
// // searchDetailsObj = JSON.parse(searchDetailsObj);
|
|
||||||
|
|
||||||
// let caseReference = {};
|
|
||||||
|
|
||||||
// caseReference.ticketnumber = query.casereference;
|
|
||||||
// caseReference.incidentid = query.inid;
|
|
||||||
// caseReference.caseDetails = blobProgress; //searchDetailsObj;
|
|
||||||
|
|
||||||
// var path = require("path");
|
|
||||||
// const configDirectory = path.resolve(process.cwd(), "data/formsxml");
|
|
||||||
// var xmlStr = fs.readFileSync(
|
|
||||||
// path.join(configDirectory, query.appealtypes + ".xml"),
|
|
||||||
// "utf8"
|
|
||||||
// );
|
|
||||||
|
|
||||||
// xmlStr = xmlStr.replace(/\t/g, "");
|
|
||||||
// xmlStr = xmlStr.replace(/\n/g, "");
|
|
||||||
// xmlStr = xmlStr.replace(/> <"/g, "><");
|
|
||||||
// xmlStr = xmlStr.toString();
|
|
||||||
|
|
||||||
// if (query.hasOwnProperty("key")) {
|
|
||||||
// const awaitingSubmissionFromBlob =
|
|
||||||
// await getAwaitingSubmissionFromBlob(thisSession.user.id);
|
|
||||||
|
|
||||||
// store.dispatch(
|
|
||||||
// setAwaitingSubmissionFromBlob(awaitingSubmissionFromBlob)
|
|
||||||
// );
|
|
||||||
|
|
||||||
// store.dispatch(
|
|
||||||
// setAwaitingSubmissionDetails(awaitingSubmissionFromBlob)
|
|
||||||
// );
|
|
||||||
// store.dispatch(
|
|
||||||
// setCurrentView({
|
|
||||||
// "viewName": "Awaiting Submission",
|
|
||||||
// "viewKey": "awaitingSubmissionDetails",
|
|
||||||
// })
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
|
|
||||||
// store.dispatch(setLoggedInUserId(loggedInUser));
|
|
||||||
// store.dispatch(setLoggedInUserEmail(loggedInUserEmail));
|
|
||||||
// store.dispatch(setAppealLPA(query.lpa));
|
|
||||||
// store.dispatch(setAppealTypeID(query.apt));
|
|
||||||
// store.dispatch(setCaseReference(caseReference));
|
|
||||||
// store.dispatch(setForm(xmlStr, mandatoryFieldsData, pickListData));
|
|
||||||
// store.dispatch(setAppealType(appealTypeData));
|
|
||||||
// store.dispatch(setContainerID(thisSession.user.id));
|
|
||||||
// store.dispatch(setAccountDetails(accountDetails));
|
|
||||||
|
|
||||||
// store.dispatch(setFilesForAppeal(blobList));
|
|
||||||
|
|
||||||
// return {
|
|
||||||
// props: { url: process.env.NEXTAUTH_URL },
|
|
||||||
// };
|
|
||||||
// }
|
|
||||||
// );
|
|
||||||
|
|
||||||
// const mapStateToProps = (state) => {
|
|
||||||
// return {
|
|
||||||
// search: state.search,
|
|
||||||
// searchResultsObj: state.searchResultsObj,
|
|
||||||
// formData: state.formData,
|
|
||||||
// appealType: state.appealType,
|
|
||||||
// form: state.form,
|
|
||||||
// accountDetails: state.accountDetails,
|
|
||||||
// awaitingSubmission: state.awaitingSubmission,
|
|
||||||
// currentView: state.currentView,
|
|
||||||
// initialValues: state.appealType.caseReference.caseDetails,
|
|
||||||
// };
|
|
||||||
// };
|
|
||||||
|
|
||||||
// const mapDispatchToProps = (dispatch) => {
|
|
||||||
// return {
|
|
||||||
// setFormTitle: (title) => {
|
|
||||||
// dispatch(setAppealTypeTitle(title));
|
|
||||||
// },
|
|
||||||
// setCaseReference: (refno) => {
|
|
||||||
// dispatch(setCaseReference(refno));
|
|
||||||
// },
|
|
||||||
// setFilesForAppeal: (blobList) => {
|
|
||||||
// dispatch(setFilesForAppeal(blobList));
|
|
||||||
// },
|
|
||||||
// };
|
|
||||||
// };
|
|
||||||
|
|
||||||
// export default connect(mapStateToProps, mapDispatchToProps)(Home);
|
|
||||||
|
|
||||||
// pages/myportal/[appealtypes].js
|
// pages/myportal/[appealtypes].js
|
||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
import { JSONPath as jsonpath } from "jsonpath-plus";
|
||||||
import xpath from "xpath";
|
import xpath from "xpath";
|
||||||
|
|||||||
@@ -1,318 +1,3 @@
|
|||||||
// import fs from "fs";
|
|
||||||
// import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
// import useTranslation from "next-translate/useTranslation";
|
|
||||||
// import Head from "next/head";
|
|
||||||
// import { useRouter } from "next/router";
|
|
||||||
// import { useEffect } from "react";
|
|
||||||
// import { connect } from "react-redux";
|
|
||||||
// import xpath from "xpath";
|
|
||||||
// import Breadcrumbs from "../../components/breadcrumbs";
|
|
||||||
// import CookieBanner from "../../components/cookieBanner";
|
|
||||||
// import Footer from "../../components/footer";
|
|
||||||
// import Header from "../../components/header";
|
|
||||||
// import BuildCheckSection from "../../components/newappeal/buildchecksection";
|
|
||||||
// import BuildSection from "../../components/newappeal/buildsection";
|
|
||||||
// import CompleteAppeal from "../../components/newappeal/complete";
|
|
||||||
// import TimeOut from "../../components/timeout";
|
|
||||||
|
|
||||||
// import { getSession } from "next-auth/react";
|
|
||||||
// import {
|
|
||||||
// setContainerID,
|
|
||||||
// setLoggedInUserEmail,
|
|
||||||
// setLoggedInUserId,
|
|
||||||
// setAccountDetails,
|
|
||||||
// } from "../../store/accountDetails/action";
|
|
||||||
// import {
|
|
||||||
// setAppealLPA,
|
|
||||||
// setAppealType,
|
|
||||||
// setAppealTypeID,
|
|
||||||
// setAppealTypeTitle,
|
|
||||||
// setCaseReference,
|
|
||||||
// } from "../../store/appealType/action";
|
|
||||||
// import { setForm } from "../../store/formData/action";
|
|
||||||
// import { wrapper } from "../../store/store";
|
|
||||||
// import ServiceBanner from "../../components/myportal/servicebanner";
|
|
||||||
|
|
||||||
// let Home = (props) => {
|
|
||||||
// const { footerLinks, pages, formData } = props;
|
|
||||||
// let { t, lang } = useTranslation();
|
|
||||||
|
|
||||||
// const router = useRouter();
|
|
||||||
// const { locale } = router;
|
|
||||||
// const { appealtypes } = router.query;
|
|
||||||
|
|
||||||
// useEffect(() => {
|
|
||||||
// //setFormTitle(formTitle);
|
|
||||||
// setCaseReference(router.query.refno);
|
|
||||||
// }, []); // eslint-disable-line react-hooks/exhaustive-deps
|
|
||||||
|
|
||||||
// const formXML = props.formData.formData;
|
|
||||||
// const parser = new DOMParser();
|
|
||||||
// var doc = parser.parseFromString(formXML, "text/xml");
|
|
||||||
// var titles = xpath.select(
|
|
||||||
// "//form/tabs/tab[*]/labels/label[@description]/@description",
|
|
||||||
// doc
|
|
||||||
// );
|
|
||||||
// var sectionCount = xpath.select("/form/tabs/tab[*]", doc);
|
|
||||||
// sectionCount = sectionCount.length;
|
|
||||||
|
|
||||||
// var tabs = xpath.select("//form/tabs/tab[*]", doc);
|
|
||||||
|
|
||||||
// let optionsStr = props.appealType.appealTypeOptions.value;
|
|
||||||
|
|
||||||
// let selectedObj = jsonpath({
|
|
||||||
// path: "$..[?(@ && @.attributevalue=='" + router.query.apt + "')]",
|
|
||||||
// json: optionsStr,
|
|
||||||
// eval: true,
|
|
||||||
// });
|
|
||||||
|
|
||||||
// //let optionsTitleObj = [];
|
|
||||||
|
|
||||||
// //const optionsTitleObj = selectedObj.reduce(
|
|
||||||
// // (obj, arrValue) => (
|
|
||||||
// // (obj[arrValue] = arrValue
|
|
||||||
// // .replace(/(\band|[\s\-\+\(\)\,\&])/g, "")
|
|
||||||
// // .toLowerCase()
|
|
||||||
// // .slice(0, 39)),
|
|
||||||
// // obj
|
|
||||||
// // ),
|
|
||||||
// // {}
|
|
||||||
// // );
|
|
||||||
|
|
||||||
// const formTitle = selectedObj[0].value;
|
|
||||||
|
|
||||||
// const { onSubmit } = props;
|
|
||||||
|
|
||||||
// return (
|
|
||||||
// <div>
|
|
||||||
// <Head>
|
|
||||||
// <title>
|
|
||||||
// {t("newappeal:page-title")} - {t("common:service-name")}
|
|
||||||
// </title>
|
|
||||||
// <>
|
|
||||||
// <link
|
|
||||||
// rel="canonical"
|
|
||||||
// href={t("common:gov-wales-link") + router.asPath}
|
|
||||||
// />
|
|
||||||
// <meta
|
|
||||||
// key="og:locale"
|
|
||||||
// property="og:locale"
|
|
||||||
// content={router.locale}
|
|
||||||
// />
|
|
||||||
// {/* If they have a Twitter Handle, include the meta details below */}
|
|
||||||
// <meta
|
|
||||||
// key="og:site_name"
|
|
||||||
// property="og:site_name"
|
|
||||||
// content={t("common:service-name")}
|
|
||||||
// />
|
|
||||||
// <meta
|
|
||||||
// key="twitter:site"
|
|
||||||
// property="twitter:site"
|
|
||||||
// content="@UKGovWales"
|
|
||||||
// />
|
|
||||||
|
|
||||||
// <meta
|
|
||||||
// name="description"
|
|
||||||
// content={t("common:service-description")}
|
|
||||||
// />
|
|
||||||
// <meta
|
|
||||||
// property="og:site_name"
|
|
||||||
// content={t("common:gov-wales-label")}
|
|
||||||
// />
|
|
||||||
// <meta
|
|
||||||
// property="og:title"
|
|
||||||
// content={t("newappeal:page-title")}
|
|
||||||
// />
|
|
||||||
// <meta
|
|
||||||
// property="og:description"
|
|
||||||
// content={t("common:service-description")}
|
|
||||||
// />
|
|
||||||
// <meta property="og:type" content="website" />
|
|
||||||
// <meta
|
|
||||||
// property="og:url"
|
|
||||||
// content={t("common:gov-wales-link")}
|
|
||||||
// />
|
|
||||||
// <meta
|
|
||||||
// property="og:image"
|
|
||||||
// content="https://gov.wales/themes/custom/govwales/images/content/og-global-1200.png"
|
|
||||||
// />
|
|
||||||
// <meta name="twitter:card" content="summary" />
|
|
||||||
// <meta
|
|
||||||
// name="twitter:title"
|
|
||||||
// content={t("common:gov-wales-label")}
|
|
||||||
// />
|
|
||||||
// <meta
|
|
||||||
// name="twitter:url"
|
|
||||||
// content={t("common:gov-wales-link") + router.asPath}
|
|
||||||
// />
|
|
||||||
// <meta
|
|
||||||
// name="twitter:image"
|
|
||||||
// content="https://gov.wales/themes/custom/govwales/images/content/og-global-120.png"
|
|
||||||
// />
|
|
||||||
// </>
|
|
||||||
// </Head>
|
|
||||||
// <div id="page_wrapper">
|
|
||||||
// <CookieBanner />
|
|
||||||
// <Header />
|
|
||||||
|
|
||||||
// <div className="govuk-width-container">
|
|
||||||
// <Breadcrumbs slug={appealtypes} formTitle={formTitle} />
|
|
||||||
// <ServiceBanner props={props} />
|
|
||||||
// <main
|
|
||||||
// className="govuk-main-wrapper--auto-spacing"
|
|
||||||
// id="main-content"
|
|
||||||
// role="main"
|
|
||||||
// >
|
|
||||||
// {props.appealType.currentSection == 9999 ? (
|
|
||||||
// <CompleteAppeal props={props} />
|
|
||||||
// ) : props.appealType.currentSection ==
|
|
||||||
// sectionCount + 1 ? (
|
|
||||||
// <BuildCheckSection
|
|
||||||
// formXML={formXML}
|
|
||||||
// sectionCount={sectionCount}
|
|
||||||
// onSubmit={onSubmit}
|
|
||||||
// formTitle={formTitle}
|
|
||||||
// appealType={props.appealType}
|
|
||||||
// props={props}
|
|
||||||
// key={1}
|
|
||||||
// mandatoryFieldsData={
|
|
||||||
// props.formData.mandatoryFieldsData
|
|
||||||
// }
|
|
||||||
// />
|
|
||||||
// ) : (
|
|
||||||
// <>
|
|
||||||
// <BuildSection
|
|
||||||
// formXML={formXML}
|
|
||||||
// sectionCount={sectionCount}
|
|
||||||
// onSubmit={onSubmit}
|
|
||||||
// formTitle={formTitle}
|
|
||||||
// mandatoryFieldsData={
|
|
||||||
// props.formData.mandatoryFieldsData
|
|
||||||
// }
|
|
||||||
// props={props}
|
|
||||||
// />
|
|
||||||
// </>
|
|
||||||
// )}
|
|
||||||
// </main>
|
|
||||||
// </div>
|
|
||||||
// <Footer footerLinks={footerLinks} ticketnumber={props} />
|
|
||||||
// </div>
|
|
||||||
// <TimeOut />
|
|
||||||
// </div>
|
|
||||||
// );
|
|
||||||
// };
|
|
||||||
|
|
||||||
// export const getServerSideProps = wrapper.getServerSideProps(
|
|
||||||
// (store) => async (ctx) => {
|
|
||||||
// const { query, req, res } = ctx;
|
|
||||||
// getIP(req);
|
|
||||||
// const { cookies } = req;
|
|
||||||
|
|
||||||
// console.log(cookies);
|
|
||||||
// console.log("the query", query);
|
|
||||||
// console.log("ref:", query.id);
|
|
||||||
// let loggedInUser = cookies.pinsUser;
|
|
||||||
|
|
||||||
// let thisSession = await getSession(ctx);
|
|
||||||
// //console.log("nextAuth Session:", thisSession);
|
|
||||||
|
|
||||||
// if (!thisSession) {
|
|
||||||
// console.log("not has sesssion.......");
|
|
||||||
// return {
|
|
||||||
// redirect: {
|
|
||||||
// destination: "/auth/signin",
|
|
||||||
// permanent: false,
|
|
||||||
// },
|
|
||||||
// };
|
|
||||||
// }
|
|
||||||
|
|
||||||
// let loggedInUserIdent = thisSession.user.id;
|
|
||||||
// let loggedInUserEmail = thisSession.user.email;
|
|
||||||
|
|
||||||
// console.log("logged ident:", loggedInUserIdent, loggedInUserEmail);
|
|
||||||
|
|
||||||
// const [
|
|
||||||
// appealTypeData,
|
|
||||||
// mandatoryFieldsData,
|
|
||||||
// pickListData,
|
|
||||||
// //blobList,
|
|
||||||
// ] = await Promise.all([
|
|
||||||
// await getAppealsTypesForNewAppeal(),
|
|
||||||
// await getMandatoryFields(query.appealtypes),
|
|
||||||
// await getPickLists(query.appealtypes),
|
|
||||||
|
|
||||||
// //await getFilesFromBlob(query.casereference),
|
|
||||||
// ]);
|
|
||||||
|
|
||||||
// const blobProgress = await getProgressFromBlob(
|
|
||||||
// loggedInUserIdent,
|
|
||||||
// query.id
|
|
||||||
// );
|
|
||||||
|
|
||||||
// const accountDetails = await getPersonalAccount(loggedInUser);
|
|
||||||
|
|
||||||
// console.log("anything here", loggedInUser, query.id, blobProgress);
|
|
||||||
|
|
||||||
// let caseReference = {};
|
|
||||||
|
|
||||||
// caseReference.ticketnumber = query.id;
|
|
||||||
// caseReference.incidentid = query.id;
|
|
||||||
// caseReference.caseDetails = blobProgress; //searchDetailsObj;
|
|
||||||
|
|
||||||
// var path = require("path");
|
|
||||||
// const configDirectory = path.resolve(process.cwd(), "data/formsxml");
|
|
||||||
// var xmlStr = fs.readFileSync(
|
|
||||||
// path.join(configDirectory, query.appealtypes + ".xml"),
|
|
||||||
// "utf8"
|
|
||||||
// );
|
|
||||||
// // xmlStr = formdata.value[0].formxml;
|
|
||||||
// xmlStr = xmlStr.replace(/\t/g, "");
|
|
||||||
// xmlStr = xmlStr.replace(/\n/g, "");
|
|
||||||
// xmlStr = xmlStr.replace(/> <"/g, "><");
|
|
||||||
// xmlStr = xmlStr.toString();
|
|
||||||
|
|
||||||
// store.dispatch(setLoggedInUserId(loggedInUser));
|
|
||||||
// store.dispatch(setLoggedInUserEmail(loggedInUserEmail));
|
|
||||||
// store.dispatch(setAppealLPA(query.lpa));
|
|
||||||
// store.dispatch(setAppealTypeID(query.apt));
|
|
||||||
// store.dispatch(setCaseReference(caseReference));
|
|
||||||
// store.dispatch(setForm(xmlStr, mandatoryFieldsData, pickListData));
|
|
||||||
// store.dispatch(setAppealType(appealTypeData));
|
|
||||||
// store.dispatch(setContainerID(thisSession.user.id));
|
|
||||||
// store.dispatch(setAccountDetails(accountDetails));
|
|
||||||
|
|
||||||
// //store.dispatch(setFilesForAppeal(blobList));
|
|
||||||
|
|
||||||
// return {
|
|
||||||
// props: { url: process.env.NEXTAUTH_URL },
|
|
||||||
// };
|
|
||||||
// }
|
|
||||||
// );
|
|
||||||
|
|
||||||
// const mapStateToProps = (state) => {
|
|
||||||
// return {
|
|
||||||
// search: state.search,
|
|
||||||
// searchResultsObj: state.searchResultsObj,
|
|
||||||
// formData: state.formData,
|
|
||||||
// appealType: state.appealType,
|
|
||||||
// form: state.form,
|
|
||||||
// accountDetails: state.accountDetails,
|
|
||||||
// };
|
|
||||||
// };
|
|
||||||
|
|
||||||
// const mapDispatchToProps = (dispatch) => {
|
|
||||||
// return {
|
|
||||||
// setFormTitle: (title) => {
|
|
||||||
// dispatch(setAppealTypeTitle(title));
|
|
||||||
// },
|
|
||||||
// setCaseReference: (refno) => {
|
|
||||||
// dispatch(setCaseReference(refno));
|
|
||||||
// },
|
|
||||||
// };
|
|
||||||
// };
|
|
||||||
|
|
||||||
// export default connect(mapStateToProps, mapDispatchToProps)(Home);
|
|
||||||
|
|
||||||
// pages/newappeal/[appealtypes].js
|
// pages/newappeal/[appealtypes].js
|
||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
import { JSONPath as jsonpath } from "jsonpath-plus";
|
||||||
import xpath from "xpath";
|
import xpath from "xpath";
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ test("case/getPortalModuleDetails uses BASE_URL route and encoded case reference
|
|||||||
assert.deepStrictEqual(normalize(result), { value: [] });
|
assert.deepStrictEqual(normalize(result), { value: [] });
|
||||||
assert.strictEqual(
|
assert.strictEqual(
|
||||||
axios.calls[0].url,
|
axios.calls[0].url,
|
||||||
"http://example.local/api/endpoint/getportalmoduledetails_api?appealType=appeal&caseReference=REF%20A/B"
|
"http://example.local/api/myportal/get-portal-module-details?appealType=appeal&caseReference=REF%20A/B"
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,181 @@
|
|||||||
|
const assert = require("assert");
|
||||||
|
const fs = require("fs");
|
||||||
|
const path = require("path");
|
||||||
|
const vm = require("vm");
|
||||||
|
const { JSONPath } = require("jsonpath-plus");
|
||||||
|
|
||||||
|
const tests = [];
|
||||||
|
const test = (name, fn) => tests.push({ name, fn });
|
||||||
|
|
||||||
|
const helperModulePath = path.join(
|
||||||
|
__dirname,
|
||||||
|
"..",
|
||||||
|
"..",
|
||||||
|
"lib",
|
||||||
|
"i18n",
|
||||||
|
"crmDisplay",
|
||||||
|
"resolveCrmDisplayValue.js"
|
||||||
|
);
|
||||||
|
|
||||||
|
const lookupTranslations = require(
|
||||||
|
path.join(__dirname, "..", "..", "data", "lookuptranslations.json")
|
||||||
|
);
|
||||||
|
|
||||||
|
const loadHelper = () => {
|
||||||
|
const source = fs.readFileSync(helperModulePath, "utf8");
|
||||||
|
|
||||||
|
const transformedSource = `${source
|
||||||
|
.replace(
|
||||||
|
/import\s+\{\s*JSONPath\s+as\s+jsonpath\s*\}\s+from\s+"jsonpath-plus";/,
|
||||||
|
'const { JSONPath: jsonpath } = require("jsonpath-plus");'
|
||||||
|
)
|
||||||
|
.replace(/export const /g, "const ")
|
||||||
|
.replace(/export default resolveCrmDisplayValue;/g, "")}
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
resolveCrmDisplayValue
|
||||||
|
};
|
||||||
|
`;
|
||||||
|
|
||||||
|
const sandbox = {
|
||||||
|
module: { exports: {} },
|
||||||
|
exports: {},
|
||||||
|
require: (modulePath) => {
|
||||||
|
if (modulePath === "jsonpath-plus") {
|
||||||
|
return { JSONPath };
|
||||||
|
}
|
||||||
|
|
||||||
|
return require(modulePath);
|
||||||
|
},
|
||||||
|
__dirname: path.dirname(helperModulePath),
|
||||||
|
__filename: helperModulePath,
|
||||||
|
console
|
||||||
|
};
|
||||||
|
|
||||||
|
vm.runInNewContext(transformedSource, sandbox, {
|
||||||
|
filename: helperModulePath
|
||||||
|
});
|
||||||
|
|
||||||
|
return sandbox.module.exports;
|
||||||
|
};
|
||||||
|
|
||||||
|
test("English with value returns value", () => {
|
||||||
|
const { resolveCrmDisplayValue } = loadHelper();
|
||||||
|
|
||||||
|
assert.strictEqual(
|
||||||
|
resolveCrmDisplayValue({
|
||||||
|
value: "Cardiff Council",
|
||||||
|
locale: "en",
|
||||||
|
translations: lookupTranslations,
|
||||||
|
fallbackValue: "Cardiff Council"
|
||||||
|
}),
|
||||||
|
"Cardiff Council"
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("Welsh with translation returns Welsh", () => {
|
||||||
|
const { resolveCrmDisplayValue } = loadHelper();
|
||||||
|
|
||||||
|
assert.strictEqual(
|
||||||
|
resolveCrmDisplayValue({
|
||||||
|
value: "Cardiff Council",
|
||||||
|
locale: "cy",
|
||||||
|
translations: lookupTranslations,
|
||||||
|
fallbackValue: "Cardiff Council"
|
||||||
|
}),
|
||||||
|
"Cyngor Caerdydd"
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("Welsh without translation returns English value", () => {
|
||||||
|
const { resolveCrmDisplayValue } = loadHelper();
|
||||||
|
|
||||||
|
assert.strictEqual(
|
||||||
|
resolveCrmDisplayValue({
|
||||||
|
value: "Not In Lookup",
|
||||||
|
locale: "cy",
|
||||||
|
translations: lookupTranslations,
|
||||||
|
fallbackValue: "To be confirmed"
|
||||||
|
}),
|
||||||
|
"Not In Lookup"
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("Missing value returns fallback", () => {
|
||||||
|
const { resolveCrmDisplayValue } = loadHelper();
|
||||||
|
|
||||||
|
assert.strictEqual(
|
||||||
|
resolveCrmDisplayValue({
|
||||||
|
locale: "cy",
|
||||||
|
translations: lookupTranslations,
|
||||||
|
fallbackValue: "N/A"
|
||||||
|
}),
|
||||||
|
"N/A"
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("Empty string returns fallback", () => {
|
||||||
|
const { resolveCrmDisplayValue } = loadHelper();
|
||||||
|
|
||||||
|
assert.strictEqual(
|
||||||
|
resolveCrmDisplayValue({
|
||||||
|
value: "",
|
||||||
|
locale: "cy",
|
||||||
|
translations: lookupTranslations,
|
||||||
|
fallbackValue: "To be confirmed"
|
||||||
|
}),
|
||||||
|
"To be confirmed"
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("Null returns fallback", () => {
|
||||||
|
const { resolveCrmDisplayValue } = loadHelper();
|
||||||
|
|
||||||
|
assert.strictEqual(
|
||||||
|
resolveCrmDisplayValue({
|
||||||
|
value: null,
|
||||||
|
locale: "cy",
|
||||||
|
translations: lookupTranslations,
|
||||||
|
fallbackValue: "To be confirmed"
|
||||||
|
}),
|
||||||
|
"To be confirmed"
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("Undefined returns fallback", () => {
|
||||||
|
const { resolveCrmDisplayValue } = loadHelper();
|
||||||
|
|
||||||
|
assert.strictEqual(
|
||||||
|
resolveCrmDisplayValue({
|
||||||
|
value: undefined,
|
||||||
|
locale: "cy",
|
||||||
|
translations: lookupTranslations,
|
||||||
|
fallbackValue: "N/A"
|
||||||
|
}),
|
||||||
|
"N/A"
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
async function run() {
|
||||||
|
let failures = 0;
|
||||||
|
|
||||||
|
for (const { name, fn } of tests) {
|
||||||
|
try {
|
||||||
|
await fn();
|
||||||
|
console.log(`✓ ${name}`);
|
||||||
|
} catch (error) {
|
||||||
|
failures += 1;
|
||||||
|
console.error(`✗ ${name}`);
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (failures > 0) {
|
||||||
|
process.exitCode = 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(`Passed ${tests.length} CRM display resolver tests.`);
|
||||||
|
}
|
||||||
|
|
||||||
|
run();
|
||||||
@@ -101,7 +101,7 @@ test("portal/createWatchedCases posts to harmonized route helper URL", async ()
|
|||||||
assert.strictEqual(requestCalls[0].method, "post");
|
assert.strictEqual(requestCalls[0].method, "post");
|
||||||
assert.strictEqual(
|
assert.strictEqual(
|
||||||
requestCalls[0].url,
|
requestCalls[0].url,
|
||||||
"/api/endpoint/createwatchedcases_api"
|
"/api/subscriptions/create-watched-case"
|
||||||
);
|
);
|
||||||
assert.deepStrictEqual(normalize(requestCalls[0].data), payload);
|
assert.deepStrictEqual(normalize(requestCalls[0].data), payload);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user