From 461f7c472540d66fca9fd8442c7b3dfc0c2f9da8 Mon Sep 17 00:00:00 2001
From: "robert.bond@test.gov.wales"
Date: Mon, 20 Sep 2021 16:31:55 +0100
Subject: [PATCH 1/4] initial lookup translations
---
components/case/summary.js | 4 +-
components/header.js | 1 +
data/lookuptranslations.json | 181 +++++++++++++++++++++++++++++++++++
locales/cy/case.json | 1 +
locales/en/case.json | 1 +
pages/searchresults.js | 1 +
6 files changed, 188 insertions(+), 1 deletion(-)
create mode 100644 data/lookuptranslations.json
diff --git a/components/case/summary.js b/components/case/summary.js
index 87e7f3e0..e5ad44dc 100644
--- a/components/case/summary.js
+++ b/components/case/summary.js
@@ -262,7 +262,9 @@ const CaseSummary = (props) => {
? detailsObj[
"pinswg_linkedstatus@OData.Community.Display.V1.FormattedValue"
]
- : "Not linked"}
+ : t(
+ "case:summary-case-link-status-not-linked"
+ )}
diff --git a/components/header.js b/components/header.js
index 032ac1b1..d0ac40a3 100644
--- a/components/header.js
+++ b/components/header.js
@@ -20,6 +20,7 @@ const Header = (props) => {
"/dns/application-view",
"/searchresults",
"/case",
+ "advancedsearch",
];
const hasContactLink = [
"/dns",
diff --git a/data/lookuptranslations.json b/data/lookuptranslations.json
new file mode 100644
index 00000000..7fdf3517
--- /dev/null
+++ b/data/lookuptranslations.json
@@ -0,0 +1,181 @@
+{
+ "appealTypes": [
+ {
+ "value": "Planning Appeal - S78",
+ "value_cy": "Apêl Cynllunio - S78",
+ "stringmapid": "cb4aa9f2-e275-eb11-aabd-00224800be9c",
+ "attributevalue": 846040000
+ },
+ {
+ "value": "Planning Conditions - S73 + S79",
+ "value_cy": "Amodau Cynllunio - S73 + S79",
+ "stringmapid": "cc4aa9f2-e275-eb11-aabd-00224800be9c",
+ "attributevalue": 846040001
+ },
+ {
+ "value": "Planning Obligation Appeal - S106",
+ "value_cy": "Apêl Rhwymedigaeth Cynllunio - S106",
+ "stringmapid": "ce4aa9f2-e275-eb11-aabd-00224800be9c",
+ "attributevalue": 846040003
+ },
+ {
+ "value": "Householder Appeal (HAS)",
+ "value_cy": "Apêl Deiliaid Tai (HAS)",
+ "stringmapid": "cf4aa9f2-e275-eb11-aabd-00224800be9c",
+ "attributevalue": 846040004
+ },
+ {
+ "value": "Enforcement Notice Appeal - S174",
+ "value_cy": "Apêl Rhybudd Gorfodi - S174",
+ "stringmapid": "b656f05c-7f90-eb11-aac2-00224800be9c",
+ "attributevalue": 846040005
+ },
+ {
+ "value": "Enforcement Listed Building and Conservation Appeal - S39",
+ "value_cy": "Apêl Adeiladu a Chadwraeth Rhestredig Gorfodi - S39",
+ "stringmapid": "b756f05c-7f90-eb11-aac2-00224800be9c",
+ "attributevalue": 846040006
+ },
+ {
+ "value": "Maintenance of Land - S217",
+ "value_cy": "Cynnal a Chadw Tir - S217",
+ "stringmapid": "b856f05c-7f90-eb11-aac2-00224800be9c",
+ "attributevalue": 846040007
+ },
+ {
+ "value": "Lawful Development Certificate Appeal - S194 + 195",
+ "value_cy": "Apêl Tystysgrif Datblygu Cyfreithlon - S194 + 195",
+ "stringmapid": "b956f05c-7f90-eb11-aac2-00224800be9c",
+ "attributevalue": 846040008
+ },
+ {
+ "value": "Community Infrastructure Levy - S117, 118, & 119",
+ "value_cy": "Ardoll Seilwaith Cymunedol - S117, 118, & 119",
+ "stringmapid": "ba56f05c-7f90-eb11-aac2-00224800be9c",
+ "attributevalue": 846040009
+ },
+ {
+ "value": "Call-Ins - S77",
+ "value_cy": "Galw-i-Mewn - S77",
+ "stringmapid": "bb56f05c-7f90-eb11-aac2-00224800be9c",
+ "attributevalue": 846040010
+ },
+ {
+ "value": "DNS",
+ "value_cy": "DNS",
+ "stringmapid": "bc56f05c-7f90-eb11-aac2-00224800be9c",
+ "attributevalue": 846040011
+ },
+ {
+ "value": "Electricity Act",
+ "value_cy": "Deddf Trydan",
+ "stringmapid": "bd56f05c-7f90-eb11-aac2-00224800be9c",
+ "attributevalue": 846040012
+ },
+ {
+ "value": "Transport and Works Act",
+ "value_cy": "Deddf Trafnidiaeth a Gwaith",
+ "stringmapid": "be56f05c-7f90-eb11-aac2-00224800be9c",
+ "attributevalue": 846040013
+ },
+ {
+ "value": "Harbour Revision Order",
+ "value_cy": "Gorchymyn Adolygu'r Harbwr",
+ "stringmapid": "bf56f05c-7f90-eb11-aac2-00224800be9c",
+ "attributevalue": 846040014
+ },
+ {
+ "value": "ROW",
+ "value_cy": "ROW",
+ "stringmapid": "c056f05c-7f90-eb11-aac2-00224800be9c",
+ "attributevalue": 846040015
+ },
+ {
+ "value": "Common Land",
+ "value_cy": "Tir Cyffredin",
+ "stringmapid": "c156f05c-7f90-eb11-aac2-00224800be9c",
+ "attributevalue": 846040016
+ },
+ {
+ "value": "High Hedges, Tree Preservation orders, Hedgerows, Tree Replacement Notice.",
+ "value_cy": "Gwrychoedd Uchel, Gorchmynion Cadw Coed, Gwrychoedd, Rhybudd Amnewid Coed.",
+ "stringmapid": "c256f05c-7f90-eb11-aac2-00224800be9c",
+ "attributevalue": 846040017
+ },
+ {
+ "value": "Adverts",
+ "value_cy": "Hysbysebion",
+ "stringmapid": "c356f05c-7f90-eb11-aac2-00224800be9c",
+ "attributevalue": 846040018
+ },
+ {
+ "value": "Compulsory Purchase Orders",
+ "value_cy": "Gorchmynion Prynu Gorfodol",
+ "stringmapid": "c456f05c-7f90-eb11-aac2-00224800be9c",
+ "attributevalue": 846040019
+ },
+ {
+ "value": "Environmental Permitting",
+ "value_cy": "Caniatáu Amgylcheddol",
+ "stringmapid": "c556f05c-7f90-eb11-aac2-00224800be9c",
+ "attributevalue": 846040020
+ },
+ {
+ "value": "Wayleave",
+ "value_cy": "Wayleave",
+ "stringmapid": "c656f05c-7f90-eb11-aac2-00224800be9c",
+ "attributevalue": 846040021
+ },
+ {
+ "value": "Misc Casework",
+ "value_cy": "Gwaith Achos Amrywiol",
+ "stringmapid": "c756f05c-7f90-eb11-aac2-00224800be9c",
+ "attributevalue": 846040022
+ },
+ {
+ "value": "LDP",
+ "value_cy": "LDP",
+ "stringmapid": "c856f05c-7f90-eb11-aac2-00224800be9c",
+ "attributevalue": 846040023
+ },
+ {
+ "value": "Non-Validation",
+ "value_cy": "Peidio â dilysu",
+ "stringmapid": "c956f05c-7f90-eb11-aac2-00224800be9c",
+ "attributevalue": 846040024
+ },
+ {
+ "value": "Listed Building and Conservation Area Consent S73 + S79",
+ "value_cy": "Cydsyniad Ardal Adeiladu a Chadwraeth Rhestredig S73 + S79",
+ "stringmapid": "977522df-8aef-eb11-aac7-00224800be9c",
+ "attributevalue": 846040025
+ }
+ ],
+ "statusCodes": [
+ {
+ "value": "Active",
+ "value_cy": "Egnïol",
+ "statuscode": 1
+ },
+ {
+ "value": "In Progress",
+ "value_cy": "Ar y gweill",
+ "statuscode": 2
+ },
+ {
+ "value": "On Hold",
+ "value_cy": "Ar Ddal",
+ "statuscode": 3
+ },
+ {
+ "value": "Waiting for a Decision",
+ "value_cy": "Aros am Benderfyniad",
+ "statuscode": 4
+ },
+ {
+ "value": "Researching",
+ "value_cy": "Ymchwilio",
+ "statuscode": 5
+ }
+ ]
+}
diff --git a/locales/cy/case.json b/locales/cy/case.json
index d68e1689..28237029 100644
--- a/locales/cy/case.json
+++ b/locales/cy/case.json
@@ -15,6 +15,7 @@
"summary-status-label": "Statws",
"summary-decision-label": "Penderfyniad a chanlyniad",
"summary-case-link-status-label": "Statws cysylltiad yr Achos",
+ "summary-case-link-status-not-linked": "Heb gysylltiad",
"summary-linked-cases-label": "Achosion cysylltiedig",
"summary-dates-label": "Dyddiadau",
"summary-start-date-label": "Dyddiad Dechrau",
diff --git a/locales/en/case.json b/locales/en/case.json
index c9f6196c..f7a70dd3 100644
--- a/locales/en/case.json
+++ b/locales/en/case.json
@@ -15,6 +15,7 @@
"summary-status-label": "Status",
"summary-decision-label": "Decision and Outcome",
"summary-case-link-status-label": "Case Link Status",
+ "summary-case-link-status-not-linked": "Not linked",
"summary-linked-cases-label": "Linked Cases",
"summary-dates-label": "Dates",
"summary-start-date-label": "Start Date",
diff --git a/pages/searchresults.js b/pages/searchresults.js
index 512699d8..823aefed 100644
--- a/pages/searchresults.js
+++ b/pages/searchresults.js
@@ -101,6 +101,7 @@ const getSearchDetails = (searchResultsObj) => {
]
.replace(/(\band|[\s\-\+\(\)\,\&])/g, "")
.toLowerCase()
+ .slice(0, 39)
),
searchDetail.ticketnumber
)
From 597a0a91d16ab8535c35d43b2308c313badb64d5 Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Tue, 21 Sep 2021 10:16:27 +0100
Subject: [PATCH 2/4] added in welsh translations for crm values
---
components/breadcrumbs.js | 135 ++++++++++++++++++++----
components/case/summary.js | 162 +++++++++++++++++++---------
components/main.js | 2 +-
components/search/searchresults.js | 82 +++++++++++----
data/lookuptranslations.json | 163 ++++++++++++++++++++++++++++-
locales/cy/case.json | 1 +
locales/cy/common.json | 4 +-
locales/cy/search.json | 1 +
locales/en/case.json | 1 +
locales/en/common.json | 4 +-
locales/en/search.json | 1 +
11 files changed, 465 insertions(+), 91 deletions(-)
diff --git a/components/breadcrumbs.js b/components/breadcrumbs.js
index 7b51b60a..c54c3a7c 100644
--- a/components/breadcrumbs.js
+++ b/components/breadcrumbs.js
@@ -45,8 +45,10 @@ const Breadcrumbs = (props) => {
-
-
- GOV.WALES
+
+
+ {t("common:gov-wales-label")}
+
-
@@ -72,7 +74,13 @@ const Breadcrumbs = (props) => {
{router.pathname == "/myportal/searchresults" ? (
<>
-
-
+
{t("common:breadcrumb-my-portal")}
@@ -97,7 +105,13 @@ const Breadcrumbs = (props) => {
{router.pathname == "/newappeal" ? (
<>
-
-
+
{t("newappeal:parent-page-title")}
@@ -113,14 +127,26 @@ const Breadcrumbs = (props) => {
{router.pathname == "/newappeal/selectappeal" ? (
<>
-
-
+
{t("newappeal:parent-page-title")}
-
-
+
{t("newappeal:page-title")}
@@ -136,7 +162,13 @@ const Breadcrumbs = (props) => {
{router.pathname == "/viewall" ? (
<>
-
-
+
{t("common:breadcrumb-my-portal")}
@@ -152,7 +184,13 @@ const Breadcrumbs = (props) => {
{router.pathname == "/myportal/viewall" ? (
<>
-
-
+
{t("common:breadcrumb-my-portal")}
@@ -168,14 +206,26 @@ const Breadcrumbs = (props) => {
{router.pathname == "/myportal/case" ? (
<>
-
-
+
{t("common:breadcrumb-my-portal")}
-
-
+
Your cases{" "}
@@ -197,8 +247,12 @@ const Breadcrumbs = (props) => {
-
{
{router.pathname == "/myportal/representation" ? (
<>
-
-
+
{t("common:breadcrumb-my-portal")}
@@ -243,7 +303,13 @@ const Breadcrumbs = (props) => {
{router.pathname == "/account/personaldetails" ? (
<>
-
-
+
{t("common:breadcrumb-my-portal")}
@@ -268,7 +334,13 @@ const Breadcrumbs = (props) => {
{router.pathname == "/account/changepassword" ? (
<>
-
-
+
{t("common:breadcrumb-my-portal")}
@@ -284,7 +356,13 @@ const Breadcrumbs = (props) => {
{router.pathname == "/dns" ? (
<>
-
-
+
{t("dnsCommon:service-name")}
@@ -333,7 +411,14 @@ const Breadcrumbs = (props) => {
{router.pathname == "/dns/application-view" ? (
<>
-
-
+
{t(
"dnsApplicationView:page-parent-title"
@@ -351,14 +436,26 @@ const Breadcrumbs = (props) => {
{!_.isEmpty(slug) ? (
<>
-
-
+
{t("common:breadcrumb-my-portal")}
-
-
+
New Appeal
diff --git a/components/case/summary.js b/components/case/summary.js
index e5ad44dc..cd4f96fb 100644
--- a/components/case/summary.js
+++ b/components/case/summary.js
@@ -3,6 +3,7 @@ import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import jsonpath from "jsonpath";
import _ from "lodash";
+import transLookup from "../../data/lookuptranslations.json";
const CaseSummary = (props) => {
let { t } = useTranslation();
@@ -72,16 +73,23 @@ const CaseSummary = (props) => {
] || "not entered"}
-
-
- {t("case:summary-agent-label")}
-
-
- {_.has(detailsObj, "pinswg_agentcontactname")
- ? detailsObj.pinswg_agentcontactname
- : ""}
-
-
+ {_.has(detailsObj, "pinswg_agentcontactname") ? (
+
+
+ {t("case:summary-agent-label")}
+
+
+ {_.has(
+ detailsObj,
+ "pinswg_agentcontactname"
+ )
+ ? detailsObj.pinswg_agentcontactname
+ : ""}
+
+
+ ) : (
+ ""
+ )}
{t("case:summary-site-address-label")}
@@ -91,19 +99,19 @@ const CaseSummary = (props) => {
? detailsObj.pinswg_siteaddressline1
: ""}
- {_.has(detailsObj, "pinswg_siteaddressline1")
+ {_.has(detailsObj, "pinswg_siteaddressline2")
? detailsObj.pinswg_siteaddressline2
: ""}
- {_.has(detailsObj, "pinswg_siteaddressline1")
+ {_.has(detailsObj, "pinswg_siteaddresstown")
? detailsObj.pinswg_siteaddresstown
: ""}
- {_.has(detailsObj, "pinswg_siteaddressline1")
+ {_.has(detailsObj, "pinswg_siteaddresscounty")
? detailsObj.pinswg_siteaddresscounty
: ""}
- {_.has(detailsObj, "pinswg_siteaddressline1")
+ {_.has(detailsObj, "pinswg_siteaddresspostcode")
? detailsObj.pinswg_siteaddresspostcode
: ""}
@@ -151,9 +159,21 @@ const CaseSummary = (props) => {
{t("case:summary-case-type-label")}
- {casesObj[
- "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
- ] || "N/A"}
+ {router.locale == "cy"
+ ? jsonpath.query(
+ transLookup,
+ '$..[?(@.value=="' +
+ casesObj[
+ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
+ ] +
+ '")].value_cy'
+ )
+ : casesObj[
+ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
+ ] ||
+ t(
+ "case:summary-no-date-entered-label"
+ )}
@@ -161,16 +181,21 @@ const CaseSummary = (props) => {
{t("case:summary-lpa-label")}
- {_.has(detailsObj, [
- "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue",
- ])
- ? detailsObj[
+ {router.locale == "cy"
+ ? jsonpath.query(
+ transLookup,
+ '$..[?(@.value=="' +
+ detailsObj[
+ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
+ ] +
+ '")].value_cy'
+ )
+ : detailsObj[
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
- ]
- : ""}
+ ] || ""}
-
+ {/*
{t(
"case:summary-case-summary-label"
@@ -184,7 +209,7 @@ const CaseSummary = (props) => {
? detailsObj.pinswg_casedescription
: ""}
-
+
*/}
{t(
@@ -208,13 +233,18 @@ const CaseSummary = (props) => {
{t("case:summary-procedure-label")}
- {_.has(detailsObj, [
- "pinswg_procedure@OData.Community.Display.V1.FormattedValue",
- ])
- ? detailsObj[
+ {router.locale == "cy"
+ ? jsonpath.query(
+ transLookup,
+ '$..[?(@.value=="' +
+ detailsObj[
+ "pinswg_procedure@OData.Community.Display.V1.FormattedValue"
+ ] +
+ '")].value_cy'
+ )
+ : detailsObj[
"pinswg_procedure@OData.Community.Display.V1.FormattedValue"
- ]
- : ""}
+ ] || ""}
@@ -222,9 +252,21 @@ const CaseSummary = (props) => {
{t("case:summary-status-label")}
- {casesObj[
- "statuscode@OData.Community.Display.V1.FormattedValue"
- ] || ""}
+ {router.locale == "cy"
+ ? jsonpath.query(
+ transLookup,
+ '$..[?(@.value=="' +
+ casesObj[
+ "statuscode@OData.Community.Display.V1.FormattedValue"
+ ] +
+ '")].value_cy'
+ )
+ : casesObj[
+ "statuscode@OData.Community.Display.V1.FormattedValue"
+ ] ||
+ t(
+ "case:summary-no-date-entered-label"
+ )}
@@ -232,13 +274,21 @@ const CaseSummary = (props) => {
{t("case:summary-decision-label")}
- {_.has(detailsObj, [
- "pinswg_decision@OData.Community.Display.V1.FormattedValue",
- ])
- ? detailsObj[
+ {router.locale == "cy"
+ ? jsonpath.query(
+ transLookup,
+ '$..[?(@.value=="' +
+ detailsObj[
+ "pinswg_decision@OData.Community.Display.V1.FormattedValue"
+ ] +
+ '")].value_cy'
+ )
+ : detailsObj[
"pinswg_decision@OData.Community.Display.V1.FormattedValue"
- ]
- : ""}
+ ] ||
+ t(
+ "case:summary-no-date-entered-label"
+ )}
{/*
@@ -301,7 +351,9 @@ const CaseSummary = (props) => {
? detailsObj[
"pinswg_startdate@OData.Community.Display.V1.FormattedValue"
]
- : "N/A"}
+ : t(
+ "case:summary-no-date-entered-label"
+ )}
@@ -319,7 +371,9 @@ const CaseSummary = (props) => {
? detailsObj[
"pinswg_questionnaireduedate@OData.Community.Display.V1.FormattedValue"
]
- : "N/A"}
+ : t(
+ "case:summary-no-date-entered-label"
+ )}
@@ -337,7 +391,9 @@ const CaseSummary = (props) => {
? detailsObj[
"pinswg_statementduedate@OData.Community.Display.V1.FormattedValue"
]
- : "N/A"}
+ : t(
+ "case:summary-no-date-entered-label"
+ )}
@@ -355,7 +411,9 @@ const CaseSummary = (props) => {
? detailsObj[
"pinswg_otherpartiesstatement@OData.Community.Display.V1.FormattedValue"
]
- : "N/A"}
+ : t(
+ "case:summary-no-date-entered-label"
+ )}
@@ -373,7 +431,9 @@ const CaseSummary = (props) => {
? detailsObj[
"pinswg_finalcommentsduedate@OData.Community.Display.V1.FormattedValue"
]
- : "N/A"}
+ : t(
+ "case:summary-no-date-entered-label"
+ )}
@@ -391,7 +451,9 @@ const CaseSummary = (props) => {
? detailsObj[
"pinswg_finalcommentsduedate@OData.Community.Display.V1.FormattedValue"
]
- : "N/A"}
+ : t(
+ "case:summary-no-date-entered-label"
+ )}
@@ -407,7 +469,9 @@ const CaseSummary = (props) => {
? detailsObj[
"pinswg_dateeventrequested@OData.Community.Display.V1.FormattedValue"
]
- : "N/A"}
+ : t(
+ "case:summary-no-date-entered-label"
+ )}
@@ -425,7 +489,9 @@ const CaseSummary = (props) => {
? detailsObj[
"pinswg_dateoflpadecision@OData.Community.Display.V1.FormattedValue"
]
- : "N/A"}
+ : t(
+ "case:summary-no-date-entered-label"
+ )}
diff --git a/components/main.js b/components/main.js
index bf5b2b85..ad925872 100644
--- a/components/main.js
+++ b/components/main.js
@@ -28,7 +28,7 @@ export default function Home({ children, pages }) {
- {/* */}
+
diff --git a/components/search/searchresults.js b/components/search/searchresults.js
index a7842b99..dce2de78 100644
--- a/components/search/searchresults.js
+++ b/components/search/searchresults.js
@@ -5,6 +5,7 @@ import { setCurrentReference } from "../../store/currentView/action";
import { connect } from "react-redux";
import jsonpath from "jsonpath";
import _ from "lodash";
+import transLookup from "../../data/lookuptranslations.json";
const SearchResults = (props) => {
const {
@@ -30,7 +31,8 @@ const SearchResults = (props) => {
{t("search:searchresults-count-label", {
count: searchResultsObj["@odata.count"].toString(),
})}
- . You searched for "{searchString}"
+ . {t("search:searchresults-case-count-label")}{" "}
+ "{searchString}"
@@ -76,7 +78,10 @@ const SearchResults = (props) => {
}}
>
- Case Reference:
+ {t(
+ "search:searchresults-case-reference-label"
+ )}
+ :
{item.title}
@@ -84,7 +89,10 @@ const SearchResults = (props) => {
-
- Site Address:{" "}
+ {t(
+ "search:searchresults-site-address-label"
+ )}
+ :
{_.has(
detailsObj,
@@ -123,7 +131,10 @@ const SearchResults = (props) => {
-
- Appellant/Applicant:
+ {t(
+ "search:searchresults-applicant-label"
+ )}
+ :
{_.has(detailsObj, [
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue",
@@ -135,35 +146,66 @@ const SearchResults = (props) => {
-
- Authority:
+ {t(
+ "search:searchresults-authority-label"
+ )}
+ :
{_.has(detailsObj, [
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue",
])
- ? detailsObj[
- "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
- ]
+ ? router.locale == "cy"
+ ? jsonpath.query(
+ transLookup,
+ '$..[?(@.value=="' +
+ detailsObj[
+ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
+ ] +
+ '")].value_cy'
+ )
+ : detailsObj[
+ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
+ ] || "N/A"
: ""}
-
- Case Type:
+ {t(
+ "search:searchresults-case-type-label"
+ )}
+ :
- {
- item[
- "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
- ]
- }
+ {router.locale == "cy"
+ ? jsonpath.query(
+ transLookup,
+ '$..[?(@.value=="' +
+ item[
+ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
+ ] +
+ '")].value_cy'
+ )
+ : item[
+ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
+ ] || "N/A"}
-
- Status:
+ {t("search:searchresults-status-label")}
+ :
- {
- item[
- "statuscode@OData.Community.Display.V1.FormattedValue"
- ]
- }
+
+ {router.locale == "cy"
+ ? jsonpath.query(
+ transLookup,
+ '$..[?(@.value=="' +
+ item[
+ "statuscode@OData.Community.Display.V1.FormattedValue"
+ ] +
+ '")].value_cy'
+ )
+ : item[
+ "statuscode@OData.Community.Display.V1.FormattedValue"
+ ] || "N/A"}
);
diff --git a/data/lookuptranslations.json b/data/lookuptranslations.json
index 7fdf3517..1c77f083 100644
--- a/data/lookuptranslations.json
+++ b/data/lookuptranslations.json
@@ -177,5 +177,166 @@
"value_cy": "Ymchwilio",
"statuscode": 5
}
+ ],
+ "pinswg_decision": [
+ {
+ "value": "Dismissed",
+ "value_cy": "Diswyddo",
+ "pinswg_decision": 846040001
+ },
+ {
+ "value": "Split Decision",
+ "value_cy": "Penderfyniad Hollt",
+ "pinswg_decision": 846040002
+ }
+ ],
+ "pinswg_lpa": [
+ {
+ "value": "Blaenau Gwent County Borough Council",
+ "value_cy": "Cyngor Bwrdeistref Sirol Blaenau Gwent",
+ "pinswg_lpa": 0
+ },
+ {
+ "value": "Bridgend County Borough Council",
+ "value_cy": "Cyngor Bwrdeistref Sirol Pen-y-bont ar Ogwr",
+ "pinswg_lpa": 0
+ },
+ {
+ "value": "Caerphilly County Borough Council",
+ "value_cy": "Cyngor Bwrdeistref Sirol Caerffili",
+ "pinswg_lpa": 0
+ },
+ {
+ "value": "Cardiff Council",
+ "value_cy": "Cyngor Caerdydd",
+ "pinswg_lpa": 0
+ },
+ {
+ "value": "Cardiff City Council",
+ "value_cy": "Cyngor Caerdydd",
+ "pinswg_lpa": 0
+ },
+ {
+ "value": "Carmarthenshire County Council",
+ "value_cy": "Cyngor Sir Gaerfyrddin",
+ "pinswg_lpa": 0
+ },
+ {
+ "value": "Ceredigion County Council",
+ "value_cy": "Cyngor Sir Ceredigion",
+ "pinswg_lpa": 0
+ },
+ {
+ "value": "Conwy County Borough Council",
+ "value_cy": "Cyngor Bwrdeistref Sirol Conwy",
+ "pinswg_lpa": 0
+ },
+ {
+ "value": "Denbighshire County Council",
+ "value_cy": "Cyngor Sir Ddinbych",
+ "pinswg_lpa": 0
+ },
+ {
+ "value": "Flintshire County Council",
+ "value_cy": "Cyngor Sir y Fflint",
+ "pinswg_lpa": 0
+ },
+ {
+ "value": "Gwynedd Council",
+ "value_cy": "Cyngor Gwynedd",
+ "pinswg_lpa": 0
+ },
+ {
+ "value": "Isle of Anglesey County Council",
+ "value_cy": "Cyngor Sir Ynys Môn",
+ "pinswg_lpa": 0
+ },
+ {
+ "value": "Merthyr Tydfil County Borough Council",
+ "value_cy": "Cyngor Bwrdeistref Sirol Merthyr Tudful",
+ "pinswg_lpa": 0
+ },
+ {
+ "value": "Monmouthshire County Council",
+ "value_cy": "Cyngor Sir Fynwy",
+ "pinswg_lpa": 0
+ },
+ {
+ "value": "Neath Port Talbot County Borough Council",
+ "value_cy": "Cyngor Bwrdeistref Sirol Castell-nedd Port Talbot",
+ "pinswg_lpa": 0
+ },
+ {
+ "value": "Newport City Council",
+ "value_cy": "Cyngor Dinas Casnewydd",
+ "pinswg_lpa": 0
+ },
+ {
+ "value": "Pembrokeshire County Council",
+ "value_cy": "Cyngor Sir Penfro",
+ "pinswg_lpa": 0
+ },
+ {
+ "value": "Powys County Council",
+ "value_cy": "Cyngor Sir Powys",
+ "pinswg_lpa": 0
+ },
+ {
+ "value": "Rhondda Cynon Taf County Borough Council",
+ "value_cy": "Cyngor Bwrdeistref Sirol Rhondda Cynon Taf",
+ "pinswg_lpa": 0
+ },
+ {
+ "value": "Swansea Council",
+ "value_cy": "Cyngor a Dinas Abertawe",
+ "pinswg_lpa": 0
+ },
+ {
+ "value": "Torfaen County Borough Council",
+ "value_cy": "Cyngor Bwrdeistref Sirol Torfaen",
+ "pinswg_lpa": 0
+ },
+ {
+ "value": "Vale of Glamorgan Council",
+ "value_cy": "Cyngor Bro Morgannwg",
+ "pinswg_lpa": 0
+ },
+ {
+ "value": "Wrexham County Borough Council",
+ "value_cy": "Cyngor Bwrdeistref Sirol Wrecsam",
+ "pinswg_lpa": 0
+ },
+ {
+ "value": "Brecon Beacons National Park",
+ "value_cy": "Parc Cenedlaethol Bannau Brycheiniog",
+ "pinswg_lpa": 0
+ },
+ {
+ "value": "Pembrokeshire Coast National Park",
+ "value_cy": "Parc Cenedlaethol Arfordir Penfro",
+ "pinswg_lpa": 0
+ },
+ {
+ "value": "Snowdonia National Park",
+ "value_cy": "Parc Cenedlaethol Eryri",
+ "pinswg_lpa": 0
+ }
+ ],
+ "pinswg_procedure": [
+ {
+ "value": "Written representation",
+ "value_cy": "Cynrychiolaeth ysgrifenedig",
+ "pinswg_procedure": 0
+ },
+ {
+ "value": "Hearing",
+ "value_cy": "Clyw",
+ "pinswg_procedure": 0
+ },
+ {
+ "value": "Inquiry",
+ "value_cy": "Ymholiad",
+ "pinswg_procedure": 0
+ }
]
-}
+}
\ No newline at end of file
diff --git a/locales/cy/case.json b/locales/cy/case.json
index 28237029..2f6e0bfd 100644
--- a/locales/cy/case.json
+++ b/locales/cy/case.json
@@ -18,6 +18,7 @@
"summary-case-link-status-not-linked": "Heb gysylltiad",
"summary-linked-cases-label": "Achosion cysylltiedig",
"summary-dates-label": "Dyddiadau",
+ "summary-no-date-entered-label": "dim dyddiad wedi'i nodi",
"summary-start-date-label": "Dyddiad Dechrau",
"summary-questionnaire-due-date-label": "Holiadur i ddod",
"summary-statement-due-date-label": "Datganiad (au) i ddod",
diff --git a/locales/cy/common.json b/locales/cy/common.json
index 0ea810b4..692f7a13 100644
--- a/locales/cy/common.json
+++ b/locales/cy/common.json
@@ -1,4 +1,6 @@
{
+ "gov-wales-link": "https://llyw.cymru",
+ "gov-wales-label": "LLYW.CYMRU",
"service-name": "Cynllunio gwaith achos",
"breadcrumb-back-link": "Yn ôl",
"error-radio": "Dewiswch opsiwn",
@@ -17,7 +19,7 @@
"back-to-top-link": "Nôl i dop y dudalen",
"social-bar-share-link": "Rhannu’r dudalen hon",
"social-bar-share-via-link": "Rhannu’r dudalen hon ar",
- "breadcrumb-search-results" : "Canlyniadau chwilio",
+ "breadcrumb-search-results": "Canlyniadau chwilio",
"breadcrumb-my-portal": "Fy mhorth",
"breadcrumb-case-reference": "Cyfeirnod Achos"
}
\ No newline at end of file
diff --git a/locales/cy/search.json b/locales/cy/search.json
index 8c06a24a..d155c0fb 100644
--- a/locales/cy/search.json
+++ b/locales/cy/search.json
@@ -48,6 +48,7 @@
"searchresults-title-label": "Crynodeb o’r Achos ar gyfer",
"searchresults-count-label": "Cafodd eich chwiliad {{count}} o ganlyniadau",
"searchresults-case-reference-label": "Cyfeirnod yr Achos",
+ "searchresults-case-count-label": "Fe wnaethoch chi chwilio am",
"searchresults-site-address-label": "Cyfeiriad y Safle",
"searchresults-applicant-label": "Apelydd/Ymgeisydd",
"searchresults-authority-label": "ACLl",
diff --git a/locales/en/case.json b/locales/en/case.json
index f7a70dd3..2f447cc6 100644
--- a/locales/en/case.json
+++ b/locales/en/case.json
@@ -18,6 +18,7 @@
"summary-case-link-status-not-linked": "Not linked",
"summary-linked-cases-label": "Linked Cases",
"summary-dates-label": "Dates",
+ "summary-no-date-entered-label": "no date entered",
"summary-start-date-label": "Start Date",
"summary-questionnaire-due-date-label": "Questionnaire due",
"summary-statement-due-date-label": "Statement(s) due",
diff --git a/locales/en/common.json b/locales/en/common.json
index 0988a675..33b7b483 100644
--- a/locales/en/common.json
+++ b/locales/en/common.json
@@ -1,4 +1,6 @@
{
+ "gov-wales-link": "https://www.gov.wales",
+ "gov-wales-label": "GOV.WALES",
"service-name": "Planning casework",
"breadcrumb-back-link": "Back",
"error-radio": "Choose an option",
@@ -17,7 +19,7 @@
"back-to-top-link": "Back to top",
"social-bar-share-link": "Share this page",
"social-bar-share-via-link": "Share this page via",
- "breadcrumb-search-results" : "Search results",
+ "breadcrumb-search-results": "Search results",
"breadcrumb-my-portal": "My portal",
"breadcrumb-case-reference": "Case Reference"
}
\ No newline at end of file
diff --git a/locales/en/search.json b/locales/en/search.json
index f01021e7..4e314770 100644
--- a/locales/en/search.json
+++ b/locales/en/search.json
@@ -48,6 +48,7 @@
"searchresults-title-label": "Search for a case",
"searchresults-count-label": "Your search returned {{count}} results",
"searchresults-case-reference-label": "Case reference",
+ "searchresults-case-count-label": "You searched for",
"searchresults-site-address-label": "Site address",
"searchresults-applicant-label": "Appellant/Applicant",
"searchresults-authority-label": "Authority",
From c2ac1b1a1be17af7cacfa7766bd11160a6c6830c Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Tue, 21 Sep 2021 12:03:29 +0100
Subject: [PATCH 3/4] added dns query included results and details
---
actions/index.js | 28 ++++
components/breadcrumbs.js | 13 +-
components/case/summary.js | 24 +--
components/dnssearchresults.js | 32 ++++
components/header.js | 2 +
components/homepage/dns.js | 8 +-
components/newappeal/complete.js | 7 +-
components/search/dnssearchresults.js | 222 ++++++++++++++++++++++++++
data/collections.json | 2 +-
data/lookuptranslations.json | 5 +
i18n.json | 8 +
pages/dnsapplications.js | 128 +++++++++++++++
pages/dnsdetails.js | 89 +++++++++++
13 files changed, 550 insertions(+), 18 deletions(-)
create mode 100644 components/dnssearchresults.js
create mode 100644 components/search/dnssearchresults.js
create mode 100644 pages/dnsapplications.js
create mode 100644 pages/dnsdetails.js
diff --git a/actions/index.js b/actions/index.js
index a5a3d2f7..ee60e791 100644
--- a/actions/index.js
+++ b/actions/index.js
@@ -130,6 +130,19 @@ export const getBasicSearch = (searchString) => {
});
};
+export const getBasicDNSSearch = (searchString) => {
+ return axios
+ .get(
+ WEBAPI_URL +
+ "incidents?$select=_accountid_value,_customerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=pinswg_appealcasetype eq 846040011&$count=true",
+ azureHeaders
+ )
+ .then((res) => res.data)
+ .catch((error) => {
+ console.log("thiserror", error);
+ });
+};
+
export const getBasicSearchDetails = (appealType, caseReference) => {
return axios
.get(
@@ -146,6 +159,21 @@ export const getBasicSearchDetails = (appealType, caseReference) => {
});
};
+export const getBasicDNSSearchDetails = (appealType, caseReference) => {
+ return axios
+ .get(
+ WEBAPI_URL +
+ "pinswg_dnses?$filter=pinswg_name eq '" +
+ caseReference +
+ "'&$count=true",
+ azureHeaders
+ )
+ .then((res) => res.data)
+ .catch((error) => {
+ console.log("thiserror", error);
+ });
+};
+
export const getFormData = (whichForm) => {
//console.log("got to axios", whichForm);
//console.log("api_root: ", BASE_URL);
diff --git a/components/breadcrumbs.js b/components/breadcrumbs.js
index c54c3a7c..9c66724f 100644
--- a/components/breadcrumbs.js
+++ b/components/breadcrumbs.js
@@ -54,11 +54,11 @@ const Breadcrumbs = (props) => {
-
- {router.pathname.includes("dns")
+ {router.pathname.includes("/dns/")
? t("dnsCommon:service-name")
: t("common:service-name")}
@@ -372,6 +372,15 @@ const Breadcrumbs = (props) => {
) : (
""
)}
+ {router.pathname == "/dnsapplications" ? (
+ <>
+
-
+ {t("dnsCommon:service-name")}
+
+ >
+ ) : (
+ ""
+ )}
{router.pathname == "/dns/application-process" ? (
<>
-
diff --git a/components/case/summary.js b/components/case/summary.js
index cd4f96fb..8979051d 100644
--- a/components/case/summary.js
+++ b/components/case/summary.js
@@ -21,6 +21,8 @@ const CaseSummary = (props) => {
currentType,
} = props;
+ const noRepresentationLink = ["/case", "/dnsdetails"];
+
let setCaseQueryObj = props[currentType];
let setCaseDetailsObj = props[currentType + "Details"];
@@ -122,19 +124,19 @@ const CaseSummary = (props) => {
- {router.pathname != "/case" ? (
- <>
-
-
- {t(
- "case:summary-make-representation-label"
- )}
-
-
- >
- ) : (
+ {noRepresentationLink.includes(router.pathname) ==
+ true ? (
""
+ ) : (
+
+
+ {t(
+ "case:summary-make-representation-label"
+ )}
+
+
)}
+
router.back()}
className="govuk-button govuk-button--secondary"
diff --git a/components/dnssearchresults.js b/components/dnssearchresults.js
new file mode 100644
index 00000000..c3153f27
--- /dev/null
+++ b/components/dnssearchresults.js
@@ -0,0 +1,32 @@
+import Link from "next/link";
+import { useRouter } from "next/router";
+import { useContext } from "react";
+import useTranslation from "next-translate/useTranslation";
+import SearchForCase from "./search/searchforcase";
+import DNSSearchResults from "./search/dnssearchresults";
+
+export default function Search(props) {
+ const { searchString, searchResultsObj } = props;
+ let { t } = useTranslation();
+
+ const router = useRouter();
+ const { locale } = router;
+
+ return (
+
+
+
+ );
+}
diff --git a/components/header.js b/components/header.js
index d0ac40a3..51b3417a 100644
--- a/components/header.js
+++ b/components/header.js
@@ -21,6 +21,8 @@ const Header = (props) => {
"/searchresults",
"/case",
"advancedsearch",
+ "/dnsapplications",
+ "/dnsdetails",
];
const hasContactLink = [
"/dns",
diff --git a/components/homepage/dns.js b/components/homepage/dns.js
index 6d74dbfd..cbbaf329 100644
--- a/components/homepage/dns.js
+++ b/components/homepage/dns.js
@@ -17,9 +17,11 @@ export default function Dns() {
diff --git a/components/newappeal/complete.js b/components/newappeal/complete.js
index 5d6f77ad..84501620 100644
--- a/components/newappeal/complete.js
+++ b/components/newappeal/complete.js
@@ -65,7 +65,12 @@ let CompleteAppeal = (props) => {
primaryAttribute,
props.appealType.caseReference.ticketnumber
);
- }, [props.appealType.caseReference, props.props.form.appealForm.values]);
+ }, [
+ props.appealType.caseReference,
+ props.props.form.appealForm.values,
+ props.appealType.appealLPA,
+ props.props.accountDetails.loggedinUserId,
+ ]);
const getFormCollection = (formtype) => {
const collectionName = jsonpath.query(
diff --git a/components/search/dnssearchresults.js b/components/search/dnssearchresults.js
new file mode 100644
index 00000000..968a5843
--- /dev/null
+++ b/components/search/dnssearchresults.js
@@ -0,0 +1,222 @@
+import Link from "next/link";
+import { useRouter } from "next/router";
+import useTranslation from "next-translate/useTranslation";
+import { setCurrentReference } from "../../store/currentView/action";
+import { connect } from "react-redux";
+import jsonpath from "jsonpath";
+import _ from "lodash";
+import transLookup from "../../data/lookuptranslations.json";
+
+const DNSSearchResults = (props) => {
+ const {
+ searchString,
+ searchResultsObj,
+ searchDetailsObj,
+ setCurrentReference,
+ } = props;
+ let { t } = useTranslation();
+
+ const router = useRouter();
+ const { locale } = router;
+
+ var resultsArr = searchResultsObj.value || [{}];
+
+ return (
+ <>
+
+
+
+ {t("dnsCommon:service-name")}{" "}
+ {t("dnsApplications:page-title")}
+
+
+ {t("dnsApplications:page-intro-paragraph-1")}
+
+
+ - {t("dnsApplications:page-intro-list-item-1")}
+
+ - {t("dnsApplications:page-intro-list-item-2")}
+
+ - {t("dnsApplications:page-intro-list-item-3")}
+
+
+
+
+
+
+
+
-
+ {t("search:searchresults-case-reference-label")}
+
+ -
+ {t("search:searchresults-site-address-label")}
+
+ -
+ {t("search:searchresults-applicant-label")}
+
+ -
+ {t("search:searchresults-authority-label")}
+
+
+ -
+ {t("search:searchresults-status-label")}
+
+
+
+ {resultsArr.map((item, key) => {
+ let detailsObj = jsonpath.query(
+ searchDetailsObj,
+ "$..value[?(@.pinswg_name=='" +
+ item.title +
+ "')]"
+ );
+ detailsObj = detailsObj[0];
+
+ return (
+
+
-
+
+ {
+ setCurrentReference({
+ "currentReference":
+ item.title,
+ "currentType":
+ "searchResultsObj",
+ });
+ }}
+ >
+
+ {t(
+ "search:searchresults-case-reference-label"
+ )}
+ :
+
+ {item.title}
+
+
+
+
-
+
+ {t(
+ "search:searchresults-site-address-label"
+ )}
+ :
+
+ {_.has(
+ detailsObj,
+ "pinswg_siteaddressline1"
+ )
+ ? detailsObj.pinswg_siteaddressline1
+ : ""}
+
+ {_.has(
+ detailsObj,
+ "pinswg_siteaddressline1"
+ )
+ ? detailsObj.pinswg_siteaddressline2
+ : ""}
+
+ {_.has(
+ detailsObj,
+ "pinswg_siteaddressline1"
+ )
+ ? detailsObj.pinswg_siteaddresstown
+ : ""}
+
+ {_.has(
+ detailsObj,
+ "pinswg_siteaddressline1"
+ )
+ ? detailsObj.pinswg_siteaddresscounty
+ : ""}
+
+ {_.has(
+ detailsObj,
+ "pinswg_siteaddressline1"
+ )
+ ? detailsObj.pinswg_siteaddresspostcode
+ : ""}
+
+
-
+
+ {t(
+ "search:searchresults-applicant-label"
+ )}
+ :
+
+ {_.has(detailsObj, [
+ "_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue",
+ ])
+ ? detailsObj[
+ "_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
+ ]
+ : ""}
+
+
-
+
+ {t(
+ "search:searchresults-authority-label"
+ )}
+ :
+
+ {_.has(detailsObj, [
+ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue",
+ ])
+ ? router.locale == "cy"
+ ? jsonpath.query(
+ transLookup,
+ '$..[?(@.value=="' +
+ detailsObj[
+ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
+ ] +
+ '")].value_cy'
+ )
+ : detailsObj[
+ "_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
+ ] || "N/A"
+ : ""}
+
+
-
+
+ {t(
+ "search:searchresults-status-label"
+ )}
+ :
+
+
+ {router.locale == "cy"
+ ? jsonpath.query(
+ transLookup,
+ '$..[?(@.value=="' +
+ item[
+ "statuscode@OData.Community.Display.V1.FormattedValue"
+ ] +
+ '")].value_cy'
+ )
+ : item[
+ "statuscode@OData.Community.Display.V1.FormattedValue"
+ ] || "N/A"}
+
+
+ );
+ })}
+
+
+
+ >
+ );
+};
+
+const mapDispatchToProps = (dispatch) => {
+ return {
+ setCurrentReference: (currentReference) => {
+ dispatch(setCurrentReference(currentReference));
+ },
+ };
+};
+
+export default connect(null, mapDispatchToProps)(DNSSearchResults);
diff --git a/data/collections.json b/data/collections.json
index 16d57a78..d4059743 100644
--- a/data/collections.json
+++ b/data/collections.json
@@ -456,4 +456,4 @@
"MetadataId": "6aedaab1-4a82-eb11-aac0-00224800be9c"
}
]
-}
+}
\ No newline at end of file
diff --git a/data/lookuptranslations.json b/data/lookuptranslations.json
index 1c77f083..27d6418f 100644
--- a/data/lookuptranslations.json
+++ b/data/lookuptranslations.json
@@ -176,6 +176,11 @@
"value": "Researching",
"value_cy": "Ymchwilio",
"statuscode": 5
+ },
+ {
+ "value": "Problem Solved",
+ "value_cy": "Datrys Problemau",
+ "statuscode": 6
}
],
"pinswg_decision": [
diff --git a/i18n.json b/i18n.json
index 515366f7..ca766d15 100644
--- a/i18n.json
+++ b/i18n.json
@@ -64,6 +64,14 @@
"/dns/application-view": [
"dnsCommon",
"dnsApplicationView"
+ ],
+ "/dnsapplications": [
+ "search",
+ "dnsCommon",
+ "dnsApplications"
+ ],
+ "/dnsdetails": [
+ "case"
]
}
}
\ No newline at end of file
diff --git a/pages/dnsapplications.js b/pages/dnsapplications.js
new file mode 100644
index 00000000..dbe0f32c
--- /dev/null
+++ b/pages/dnsapplications.js
@@ -0,0 +1,128 @@
+import _ from "lodash";
+import Head from "next/head";
+import Header from "../components/header";
+import Banner from "../components/banner";
+import CookieBanner from "../components/cookieBanner";
+import Breadcrumbs from "../components/breadcrumbs";
+import DNSSearchResults from "../components/dnssearchresults";
+import Footer from "../components/footer";
+import Errorpage from "../components/errorpage";
+import styles from "../styles/Home.module.css";
+import { useSelector, shallowEqual, connect } from "react-redux";
+import { wrapper } from "../store/store";
+import Cookies from "cookies";
+import { useRouter } from "next/router";
+import useTranslation from "next-translate/useTranslation";
+import jsonpath from "jsonpath";
+import data from "../data/collections.json";
+
+import { setSearch, getSearchObj } from "../store/search/action";
+import {
+ setSearchResults,
+ setSearchDetails,
+ getSearchResultsObj,
+} from "../store/searchOutput/action";
+import { getBasicDNSSearch, getBasicSearchDetails } from "../actions";
+
+const Home = (props) => {
+ const { footerLinks, pages } = props;
+ let { t, lang } = useTranslation();
+
+ const router = useRouter();
+ const { locale } = router;
+ const { appealtypes } = router.query;
+
+ return (
+
+
+
+ {t("search:page-title")} - {t("common:service-name")}
+
+
+
+
+ );
+};
+
+export const getServerSideProps = wrapper.getServerSideProps(
+ (store) =>
+ async ({ query, req, res }) => {
+ console.log("query-", query);
+
+ const searchResultsObj = await getBasicDNSSearch();
+ //console.log(searchResultsObj);
+
+ const searchDetailsObj = await getSearchDetails(searchResultsObj);
+ //console.log(searchDetailsObj);
+ store.dispatch(setSearchResults(searchResultsObj));
+ store.dispatch(setSearchDetails(searchDetailsObj));
+ store.dispatch(setSearch("DNS"));
+ }
+);
+
+const getFormCollection = (formtype) => {
+ const collectionName = jsonpath.query(
+ data,
+ "$..[?(@.LogicalName=='" + formtype + "')].LogicalCollectionName"
+ );
+ //console.log(collectionName[0]);
+ return collectionName[0];
+};
+
+const getSearchDetails = (searchResultsObj) => {
+ //console.log(searchResultsObj);
+
+ let detailsArr = [];
+ searchResultsObj = searchResultsObj.value;
+ const detailsObj = searchResultsObj.map((searchDetail, index) => {
+ if (searchDetail.pinswg_appealcasetype == null) {
+ console.log(searchDetail.ticketnumber);
+ } else {
+ detailsArr.push(
+ getBasicSearchDetails(
+ getFormCollection(
+ "pinswg_" +
+ searchDetail[
+ "pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
+ ]
+ .replace(/(\band|[\s\-\+\(\)\,\&])/g, "")
+ .toLowerCase()
+ .slice(0, 39)
+ ),
+ searchDetail.ticketnumber
+ )
+ );
+ }
+ });
+ //console.log(detailsArr);
+ return Promise.all(detailsArr);
+};
+
+const mapStateToProps = (state) => {
+ return {
+ currentView: state.currentView,
+ search: state.search,
+ searchResultsObj: state.searchResultsObj,
+ formData: state.formData,
+ appealType: state.appealType,
+ form: state.form,
+ myCases: state.myCases,
+ watchedCases: state.watchedCases,
+ myRepresentations: state.myRepresentations,
+ awaitingSubmission: state.awaitingSubmission,
+ };
+};
+
+export default connect(mapStateToProps)(Home);
diff --git a/pages/dnsdetails.js b/pages/dnsdetails.js
new file mode 100644
index 00000000..11120215
--- /dev/null
+++ b/pages/dnsdetails.js
@@ -0,0 +1,89 @@
+import _ from "lodash";
+import Head from "next/head";
+import Header from "../components/header";
+import Banner from "../components/banner";
+import CookieBanner from "../components/cookieBanner";
+import Breadcrumbs from "../components/breadcrumbs";
+import CaseSummary from "../components/case";
+import Footer from "../components/footer";
+import Errorpage from "../components/errorpage";
+import styles from "../styles/Home.module.css";
+import { useSelector, shallowEqual, connect } from "react-redux";
+import { wrapper } from "../store/store";
+import Cookies from "cookies";
+import { useRouter } from "next/router";
+import useTranslation from "next-translate/useTranslation";
+import Case from "../components/case";
+
+const Home = (props) => {
+ const { footerLinks, pages } = props;
+ let { t, lang } = useTranslation();
+
+ const router = useRouter();
+ const { locale } = router;
+ const { appealtypes } = router.query;
+
+ return (
+
+
+
+ {t("case:page-title")}:{" "}
+ {props.currentView.caseReference.currentReference}{" "}
+ {t("common:service-name")}
+
+
+
+
+ );
+};
+
+const mapStateToProps = (state) => {
+ //console.log(state);
+
+ return {
+ currentView: state.currentView,
+ search: state.search,
+ searchResultsObj: state.searchResultsObj,
+ formData: state.formData,
+ appealType: state.appealType,
+ form: state.form,
+ myCases: state.myCases,
+ watchedCases: state.watchedCases,
+ myRepresentations: state.myRepresentations,
+ awaitingSubmission: state.awaitingSubmission,
+ };
+};
+
+export default connect(mapStateToProps)(Home);
From 7ea15998dc05b83f44e90f82d12bcf5f45ad2b47 Mon Sep 17 00:00:00 2001
From: rdbsolutions
Date: Tue, 21 Sep 2021 12:04:24 +0100
Subject: [PATCH 4/4] commented out login module
---
components/main.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/components/main.js b/components/main.js
index ad925872..bf5b2b85 100644
--- a/components/main.js
+++ b/components/main.js
@@ -28,7 +28,7 @@ export default function Home({ children, pages }) {
-
+ {/* */}