);
};
diff --git a/components/case/summary.js b/components/case/summary.js
index 44771adb..04712df4 100644
--- a/components/case/summary.js
+++ b/components/case/summary.js
@@ -6,6 +6,7 @@ import { useRouter } from "next/router";
import { useEffect } from "react";
import { connect } from "react-redux";
import transLookup from "../../data/lookuptranslations.json";
+import Documents from "./documents";
import {
createWatchedCases,
@@ -80,6 +81,7 @@ const CaseSummary = (props) => {
showMap,
currentView,
messagesObj,
+ docsOffline,
} = props;
const showLoginCheck =
@@ -144,11 +146,11 @@ const CaseSummary = (props) => {
let setCaseQueryObj =
currentType == "directResultsObj"
- ? props.searchResultsObj.searchResultsObj
+ ? props.searchResultsObj
: props[currentType];
let setCaseDetailsObj =
currentType == "directResultsObj"
- ? props.searchResultsObj.searchDetailsObj
+ ? props.searchDetailsObj
: props[currentType + "Details"];
var casesObj = {};
@@ -212,7 +214,7 @@ const CaseSummary = (props) => {
let showDetailsBlock =
showDetails == true ? (
-
@@ -1182,7 +1198,18 @@ const CaseSummary = (props) => {
const mapStateToProps = (state) => {
return {
- ...state,
+ accountDetails: state.accountDetails,
+ currentView: state.currentView,
+ search: state.search,
+ // searchResultsObj: state.searchResultsObj,
+ documentDetailsObj: state.searchResultsObj.documentDetailsObj,
+ formData: state.formData,
+ appealType: state.appealType,
+ form: state.form,
+ myCases: state.myCases,
+ watchedCases: state.watchedCases,
+ myRepresentations: state.myRepresentations,
+ awaitingSubmission: state.awaitingSubmission,
};
};
diff --git a/components/search/dnssearchresults.js b/components/search/dnssearchresults.js
index 574e60cf..ed4cb11a 100644
--- a/components/search/dnssearchresults.js
+++ b/components/search/dnssearchresults.js
@@ -310,14 +310,14 @@ const DNSSearchResults = (props) => {
{
diff --git a/components/search/searchresults.js b/components/search/searchresults.js
index c907b604..df41b120 100644
--- a/components/search/searchresults.js
+++ b/components/search/searchresults.js
@@ -242,7 +242,8 @@ const SearchResults = (props) => {
'")]',
searchDetailsObj
);
- detailsObj = detailsObj[0];
+
+ detailsObj = detailsObj[0] || {};
return (
{
"showLoginCheck":
props.showLoginCheck,
"specialistProcess":
- detailsObj.pinswg_speacialistcaseprocess !=
- null ||
- detailsObj.pinswg_specialistcaseprocess !=
- null
- ? detailsObj.pinswg_speacialistcaseprocess ||
- detailsObj.pinswg_specialistcaseprocess
+ detailsObj.hasOwnProperty(
+ "pinswg_speacialistcaseprocess"
+ )
+ ? detailsObj.pinswg_speacialistcaseprocess
+ : detailsObj.hasOwnProperty(
+ "pinswg_specialistcaseprocess"
+ )
+ ? detailsObj.pinswg_specialistcaseprocess
: "",
});
}}
diff --git a/i18n.js b/i18n.js
index a5076db4..72ed0964 100644
--- a/i18n.js
+++ b/i18n.js
@@ -27,6 +27,8 @@ module.exports = {
"dnsCommon",
"dnsApplications",
],
+ "/myportal/dns/*": ["dnsCommon", "case", "common"],
+ "/myportal/dns/[developmentName]": ["dnsCommon", "case", "common"],
"/advancedsearch": ["search", "myportal"],
"/advancedsearchresults": ["search"],
"/searchresults": ["search", "case"],
diff --git a/pages/_document.js b/pages/_document.js
index 4671d5c3..00c858b9 100644
--- a/pages/_document.js
+++ b/pages/_document.js
@@ -42,10 +42,10 @@ class MyDocument extends Document {
csp += `form-action 'self' ` + process.env.NEXTAUTH_URL + ` ;`;
csp += `object-src 'self' data:;`;
csp += `default-src 'self' https://www.google-analytics.com;`;
- csp += `connect-src 'self' http://127.0.0.1 https://ukwest-0.in.applicationinsights.azure.com https://js.monitor.azure.com https://region1.google-analytics.com;`;
- csp += `script-src 'self' 'unsafe-eval' 'unsafe-inline' https://ukwest-0.in.applicationinsights.azure.com https://region1.google-analytics.com https://www.google-analytics.com/ https://tagmanager.google.com/ https://www.googletagmanager.com/;`;
+ csp += `connect-src 'self' http://127.0.0.1 https://maps.googleapis.com https://ukwest-0.in.applicationinsights.azure.com https://js.monitor.azure.com https://region1.google-analytics.com;`;
+ csp += `script-src 'self' 'unsafe-eval' 'unsafe-inline' https://maps.googleapis.com https://ukwest-0.in.applicationinsights.azure.com https://region1.google-analytics.com https://www.google-analytics.com/ https://tagmanager.google.com/ https://www.googletagmanager.com/;`;
csp += `style-src 'self' 'unsafe-inline' https://pro.fontawesome.com/ https://www.google-analytics.com https://tagmanager.google.com/ https://www.googletagmanager.com/ https://fonts.googleapis.com/;`;
- csp += `img-src 'self' 'unsafe-inline' https://www.gov.wales https://gov.wales https://fonts.gstatic.com https://www.googletagmanager.com https://www.google-analytics.com https://ssl.gstatic.com/ blob: data:;`;
+ csp += `img-src 'self' 'unsafe-inline' https://maps.gstatic.com https://maps.googleapis.com https://www.gov.wales https://gov.wales https://fonts.gstatic.com https://www.googletagmanager.com https://www.google-analytics.com https://ssl.gstatic.com/ blob: data:;`;
csp += `font-src 'self' 'unsafe-inline' https://pro.fontawesome.com/ https://fonts.gstatic.com/ data:;`;
return (
diff --git a/pages/api/endpoint/getdnslist_api.js b/pages/api/endpoint/getdnslist_api.js
index eb9e7fee..fa598c6f 100644
--- a/pages/api/endpoint/getdnslist_api.js
+++ b/pages/api/endpoint/getdnslist_api.js
@@ -25,9 +25,17 @@ export default async function ApiProxy(req, res) {
var token = await getToken();
var queryUrl =
- "incidents?$select=_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,statuscode,ticketnumber,title &$filter=pinswg_appealcasetype eq 846040011 and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true";
+ "incidents?$select=pinswg_appealcasetype,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,statuscode,ticketnumber,title &$filter=pinswg_appealcasetype eq 846040011 and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true";
- //console.log(queryUrl);
+ console.log(queryUrl);
+
+ function renameJsonKey(jsonObj, oldKey, newKey) {
+ if (jsonObj.hasOwnProperty(oldKey)) {
+ jsonObj[newKey] = jsonObj[oldKey]; // Add new key with the same value
+ delete jsonObj[oldKey]; // Delete old key
+ }
+ return jsonObj;
+ }
return axios
.get(
@@ -36,6 +44,7 @@ export default async function ApiProxy(req, res) {
)
.then(({ data }) => {
var dataStr;
+
_.has(data, "@odata.nextLink") == true &&
((dataStr = JSON.stringify(data["@odata.nextLink"])),
(data["@odata.nextLink"] = dataStr.split("/v8.2/")[1]));
diff --git a/pages/api/endpoint/getsearchdocumentTypes_api.js b/pages/api/endpoint/getsearchdocumentTypes_api.js
index ecca545e..26b154ad 100644
--- a/pages/api/endpoint/getsearchdocumentTypes_api.js
+++ b/pages/api/endpoint/getsearchdocumentTypes_api.js
@@ -38,27 +38,33 @@ const hashAPIPath = (queryPath) => {
return (queryPath.indexOf("?") > -1 ? "&hash=" : "?hash=") + hashlink;
};
-const groupArray = (arr = []) => {
- // create map
- let map = new Map();
- for (let i = 0; i < arr.length; i++) {
- const s = JSON.stringify(arr[i]);
- if (!map.has(s)) {
- map.set(s, {
- pinswg_isharedocumentlocations:
- arr[i].pinswg_isharedocumentlocations,
- pinswg_isharedocumentlocationsLabel:
- arr[i][
- "pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
- ],
- // count: 1,
- });
- } else {
- //map.get(s).count++;
- }
- }
- const res = Array.from(map.values());
- return res;
+const groupArray = (arr) => {
+ const map = new Map();
+
+ // Count occurrences of each object
+ arr.forEach((obj) => {
+ const key = JSON.stringify(obj);
+ map.set(key, (map.get(key) || 0) + 1);
+ });
+
+ // Create a new array to store unique objects with count
+ const result = [];
+ map.forEach((count, key) => {
+ const obj = JSON.parse(key);
+
+ const transformedObj = {
+ pinswg_isharedocumentlocations: obj.pinswg_isharedocumentlocations, // Change 'id' to 'userId'
+ pinswg_isharedocumentlocationsLabel:
+ obj[
+ "pinswg_isharedocumentlocations@OData.Community.Display.V1.FormattedValue"
+ ], // Change 'name' to 'userName'
+ count: count, // Add 'count' as 'occurrences'
+ };
+
+ result.push(transformedObj);
+ });
+
+ return result;
};
export default async function ApiProxy(req, res) {
diff --git a/pages/api/endpoint/getsearchdocumentdetailspaged_api.js b/pages/api/endpoint/getsearchdocumentdetailspaged_api.js
index 32213aa9..d748bf9c 100644
--- a/pages/api/endpoint/getsearchdocumentdetailspaged_api.js
+++ b/pages/api/endpoint/getsearchdocumentdetailspaged_api.js
@@ -92,6 +92,37 @@ export default async function ApiProxy(req, res) {
var showNumberOfRecords = req.query.showNumberOfRecords;
var documentType = req.query.documentType || "all";
+ // (documentType != "all"
+ // ? documentType.indexOf(",")<0?" and pinswg_isharedocumentlocations eq " + documentType :
+ // : "") +
+
+ var docTypeQueryString = "";
+
+ if (documentType != "all") {
+ if (documentType.indexOf(",") >= 0) {
+ const documentTypeArr = documentType.split(",");
+
+ docTypeQueryString = " and (";
+ documentTypeArr.forEach(function (item, index) {
+ console.log(item, index);
+
+ if (item != "all") {
+ docTypeQueryString +=
+ " pinswg_isharedocumentlocations eq " + item;
+
+ docTypeQueryString +=
+ index < documentTypeArr.length - 1 ? " or " : "";
+ }
+ });
+ docTypeQueryString += " )";
+ } else {
+ docTypeQueryString +=
+ " and pinswg_isharedocumentlocations eq " + documentType;
+ }
+ }
+
+ console.log(docTypeQueryString);
+
//console.log("has this passed docuemntType:", documentType);
//(documentType !="all" && " pinswg_pinswg_isharedocumentlocations eq " + )
@@ -99,9 +130,7 @@ export default async function ApiProxy(req, res) {
"pinswg_documents?$filter=pinswg_publishtoweb eq true and _pinswg_documentids_value eq " +
incidentID +
" and pinswg_latestpublishedversion ne null and pinswg_latestpublisheddate ne null" +
- (documentType != "all"
- ? " and pinswg_isharedocumentlocations eq " + documentType
- : "") +
+ docTypeQueryString +
"&$select=pinswg_isharedocumentlocations,_pinswg_documentids_value,pinswg_isharelabelcasetype,pinswg_isharelabellpaname,pinswg_publishtoweb,pinswg_uploadstatus,pinswg_isharedocumentclassification,pinswg_isharedocumentreference,pinswg_name,pinswg_latestpublishedversion,pinswg_latestpublisheddate&$orderby=" +
orderby +
" " +
@@ -111,7 +140,7 @@ export default async function ApiProxy(req, res) {
? "&$skiptoken=" + ('')
: "");
- //console.log("docu paged: ", queryUrl);
+ console.log("docu paged: ", queryUrl);
return axios
.get(
diff --git a/pages/case/[ticketnumber].js b/pages/case/[ticketnumber].js
index 176f3ab2..d344cb76 100644
--- a/pages/case/[ticketnumber].js
+++ b/pages/case/[ticketnumber].js
@@ -97,6 +97,8 @@ const CaseHome = (props) => {
}
showLoginCheck={true}
messagesObj={props.messagesObj}
+ showFilteredDocs={props.showFilteredDocs}
+ showMaps={props.showMaps}
/>