diff --git a/.env.local b/.env.local
index 4e0c3f45..7c6dfc02 100644
--- a/.env.local
+++ b/.env.local
@@ -47,6 +47,8 @@ RELAYPATH = "dev-pedw-hc"
GOOGLE_TAG_MANAGER = GTM-T78CBC3
SHOWLOGIN = "true"
SHOWREPRESENTATIONS = false
+SHOWFILEUPLOAD = "false"
+SHOWMAPS = "true"
//BASIC_AUTH_CREDENTIALS = pinswg:password|pinswg2:password2
@@ -72,3 +74,4 @@ NEXT_PUBLIC_GG_REDIRECT_URI = "http://localhost:3000"
API_ROOT = "http://localhost:3000"
+GOOGLE_MAP_API_KEY = AIzaSyCzeVrHt544bp_72YCFkw21eDsmI2JEsQo
\ No newline at end of file
diff --git a/actions/govgateway.js b/actions/govgateway.js
index 034f90a5..cf03784f 100644
--- a/actions/govgateway.js
+++ b/actions/govgateway.js
@@ -8,6 +8,19 @@ const WEBAPI_URL =
process.env.RELAY_ROOT ||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
+const azureHeaders = (access_token) => {
+ return {
+ headers: {
+ "OData-MaxVersion": "4.0",
+ "OData-Version": "4.0",
+ "Accept": "application/json;odata.metadata=none",
+ "Prefer": 'odata.include-annotations="*",return=representation',
+ "Content-Type": "application/json",
+ "Authorization": "Bearer " + access_token,
+ },
+ };
+};
+
export const getProviderConfig = () => {
return axios
.get(configEndpoint)
@@ -78,19 +91,6 @@ export const getPortalLogin = (emailAddress, token) => {
});
};
-const azureHeaders = (access_token) => {
- return {
- headers: {
- "OData-MaxVersion": "4.0",
- "OData-Version": "4.0",
- "Accept": "application/json;odata.metadata=none",
- "Prefer": 'odata.include-annotations="*",return=representation',
- "Content-Type": "application/json",
- "Authorization": "Bearer " + access_token,
- },
- };
-};
-
var Base64 = {
_keyStr:
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
diff --git a/actions/index.js b/actions/index.js
index 39f2bff3..8d110ab1 100644
--- a/actions/index.js
+++ b/actions/index.js
@@ -190,6 +190,24 @@ export const getBasicSearchPaged = (
});
};
+export const getDNSCoords = () => {
+ return axios
+ .get(BASE_URL + "/api/endpoint/getdnscoords_api")
+ .then((res) => {
+ //console.log(res.data);
+ return res.data;
+ })
+ .catch((error) => {
+ let ErrResponse = {
+ value: [],
+ errorCode: error.response.status,
+ errorMsg: error.response.statusText,
+ };
+
+ return ErrResponse;
+ });
+};
+
export const getDNSList = (searchString) => {
return axios
.get(BASE_URL + "/api/endpoint/getdnslist_api")
diff --git a/actions/selectQueryTypes.js b/actions/selectQueryTypes.js
index 20cd6641..bd5d87bd 100644
--- a/actions/selectQueryTypes.js
+++ b/actions/selectQueryTypes.js
@@ -19,7 +19,7 @@ export const getSelectQuery = (appealTypeName) => {
case "pinswg_compulsorypurchaseorderses":
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddresscounty,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_proofsofevidencewrittenstatementsofeviden,pinswg_questionnaireduedate,pinswg_relevantauthorityname,pinswg_startdate,statuscode";
case "pinswg_dnses":
- return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_addressline1,pinswg_addressline2,pinswg_postcode,pinswg_addresstown,_pinswg_associatedlpa_value,pinswg_addresscounty,pinswg_applicationacceptedasvalid,pinswg_applicationrejectedasinvalid,pinswg_choiceofprocedure,pinswg_confirmrequesttovaryapplication,pinswg_dateeventrequested,pinswg_dateofdecision,pinswg_dateofrequesttovarytheapplication,pinswg_dateofsubmissionofapplication,pinswg_dateprojectpublishedonwebsite,pinswg_deadlineforsubmissionofapplication,pinswg_decision,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectdescription,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_suspensionenddates,pinswg_suspensionstartdates,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode,pinswg_casestage";
+ return "&$select=pinswg_anticipatedgridreferenceeastingtext,pinswg_anticipatedgridreferencenorthingtext,_pinswg_appellant_value,pinswg_name,pinswg_addressline1,pinswg_addressline2,pinswg_postcode,pinswg_addresstown,_pinswg_associatedlpa_value,pinswg_addresscounty,pinswg_applicationacceptedasvalid,pinswg_applicationrejectedasinvalid,pinswg_choiceofprocedure,pinswg_confirmrequesttovaryapplication,pinswg_dateeventrequested,pinswg_dateofdecision,pinswg_dateofrequesttovarytheapplication,pinswg_dateofsubmissionofapplication,pinswg_dateprojectpublishedonwebsite,pinswg_deadlineforsubmissionofapplication,pinswg_decision,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectdescription,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_suspensionenddates,pinswg_suspensionstartdates,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode,pinswg_casestage";
case "pinswg_electricityacts":
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_addressline1,pinswg_addressline2,pinswg_postcode,pinswg_addresstown,_pinswg_associatedlpa_value,pinswg_applicationacceptedasvalid,pinswg_applicationrejectedasinvalid,pinswg_confirmrequesttovaryapplication,pinswg_dateeventrequested,pinswg_dateofrequesttovarytheapplication,pinswg_dateofsubmissionofapplication,pinswg_dateprojectpublishedonwebsite,pinswg_deadlineforsubmissionofapplication,pinswg_decision,pinswg_endofrepresentationperiod,pinswg_inspectorreportsubmittedtowelshgovernment,pinswg_procedureconfirmed,pinswg_projectlocation,pinswg_recommendation,pinswg_rejectrequesttovaryapplication,pinswg_reportdueby,pinswg_suspensiondates,pinswg_validnoticeofintentiontosubmitanapplicati,pinswg_webaddress,pinswg_withdrawndate,pinswg_writtenacceptanceofnotification,statuscode";
case "pinswg_householderappealhases":
diff --git a/components/breadcrumbs.js b/components/breadcrumbs.js
index 0e9982db..b381e99d 100644
--- a/components/breadcrumbs.js
+++ b/components/breadcrumbs.js
@@ -395,6 +395,64 @@ const Breadcrumbs = (props) => {
) : (
""
)}
+
+ {router.pathname == "/myportal/dnsapplications" ? (
+ <>
+ {" "}
+
+
+
+ {t("common:breadcrumb-my-portal")}
+
+
+
+
+ {t("dnsCommon:service-name")}
+
+ >
+ ) : (
+ ""
+ )}
+ {router.pathname == "/myportal/dnsdetails" ? (
+ <>
+
+
+
+ {t("common:breadcrumb-my-portal")}
+
+
+
+
+
+
+ {t("dnsCommon:service-name")}
+
+
+
+
+ {t("common:breadcrumb-case-reference")}:{" "}
+ {
+ props.props.currentView.caseReference
+ .currentReference
+ }
+
+ >
+ ) : (
+ ""
+ )}
+
{router.pathname == "/case" ? (
<>
diff --git a/components/case/documents.js b/components/case/documents.js
index f02e1d8f..e1ec2df1 100644
--- a/components/case/documents.js
+++ b/components/case/documents.js
@@ -2,7 +2,7 @@ import Link from "next/link";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import jsonpath from "jsonpath";
-import { useState, useEffect, useRef } from "react";
+import { useState, useEffect, useRef, useCallback } from "react";
import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
import transLookup from "../../data/lookuptranslations.json";
import PaginationControl from "./pagination";
@@ -289,23 +289,27 @@ const DocumentDetails = (props) => {
selectedOption,
fieldSortState,
orderByState,
+ getDocumentResults,
]);
- const getDocumentResults = (pageNumber, orderBy, fieldSort) => {
- getSearchDocumentDetailsPaged(
- props.incidentid,
- pageNumber,
- orderBy,
- fieldSort,
- selectedOption
- )
- .then((data) => data)
- .then((data) => {
- //console.log("getting details", data);
- setDocumentDetails(data);
- setShowSpinnerState(false);
- });
- };
+ const getDocumentResults = useCallback(
+ (pageNumber, orderBy, fieldSort) => {
+ getSearchDocumentDetailsPaged(
+ props.incidentid,
+ pageNumber,
+ orderBy,
+ fieldSort,
+ selectedOption
+ )
+ .then((data) => data)
+ .then((data) => {
+ //console.log("getting details", data);
+ setDocumentDetails(data);
+ setShowSpinnerState(false);
+ });
+ },
+ [props.incidentid, selectedOption, setDocumentDetails]
+ );
const getDocumentDetails = async () => {
let docObj = await getSearchDocumentDetailsPaged(
diff --git a/components/case/summaryTypes/pinswg_dnsid.js b/components/case/summaryTypes/pinswg_dnsid.js
index 0855bf51..530f418b 100644
--- a/components/case/summaryTypes/pinswg_dnsid.js
+++ b/components/case/summaryTypes/pinswg_dnsid.js
@@ -1,21 +1,50 @@
import { useRouter } from "next/router";
+import Head from "next/head";
+import { useEffect, useRef, ReactElement } from "react";
+
import useTranslation from "next-translate/useTranslation";
import jsonpath from "jsonpath";
-import _ from "lodash";
+import _, { round } from "lodash";
import transLookup from "../../../data/lookuptranslations.json";
+import GoogleMapComponent from "../../mapping/";
+
+import OSPoint from "ospoint";
+
const Pinswg_dnsid = (props) => {
let { t } = useTranslation();
const { casesObj, detailsObj, formatDates, linkedCasesList } = props;
const router = useRouter();
const { locale } = router;
+ const point = {};
+ const siteCoords = {};
+ let center = {};
+
+ point = new OSPoint(
+ detailsObj.pinswg_anticipatedgridreferencenorthingtext,
+ detailsObj.pinswg_anticipatedgridreferenceeastingtext
+ );
+ siteCoords = point.toOSGB36();
+ //console.log(siteCoords);
+ center = {
+ id: "",
+ lat: isNaN(parseFloat(siteCoords.latitude))
+ ? 52.412272
+ : parseFloat(siteCoords.latitude),
+ lng: isNaN(parseFloat(siteCoords.longitude))
+ ? -3.437989
+ : parseFloat(siteCoords.longitude),
+ };
+
+ const zoom = isNaN(parseFloat(siteCoords.latitude)) ? 7 : 12;
+
return (
<>
{detailsObj.pinswg_projectdescription != null ? (
-
+
{t("case:summary-project-details-label")}
@@ -51,6 +80,22 @@ const Pinswg_dnsid = (props) => {
: ""}
*/}
+ {/* {process.env.SHOWMAPS == "true" && ( */}
+
+ {/* )} */}
) : (
diff --git a/components/dnssearchresults.js b/components/dnssearchresults.js
index d75c3b3b..4b4f1943 100644
--- a/components/dnssearchresults.js
+++ b/components/dnssearchresults.js
@@ -7,7 +7,7 @@ import DNSSearchResults from "./search/dnssearchresults";
import CRMError from "./crmError";
export default function Search(props) {
- const { searchString, searchResultsObj } = props;
+ const { searchString, searchResultsObj, myportal, watchedCases } = props;
let { t } = useTranslation();
const router = useRouter();
@@ -39,6 +39,9 @@ export default function Search(props) {
searchDetailsObj={
searchResultsObj.searchDetailsObj
}
+ dnsCoords={searchResultsObj.dnsCoordsObj.value}
+ myportal={myportal}
+ watchedCases={watchedCases}
/>
diff --git a/components/elements/index.js b/components/elements/index.js
index afde1d02..3c7aa921 100644
--- a/components/elements/index.js
+++ b/components/elements/index.js
@@ -73,10 +73,9 @@ export function Textfield(props) {
hint,
} = props;
const required = (value) => (value ? undefined : "Required");
+ let { t } = useTranslation();
if (name == "pinswg_name") {
- let { t } = useTranslation();
-
return (
<>
@@ -676,7 +675,7 @@ const RenderRadio = ({
>
{" "}
{custom.hint != false && (
-
{t(custom.hint)}
+
{t(custom.hint)}
)}
{Object.keys(options).map((key, index) => (
{
+ const { center, zoom } = props;
+
+ let data = [center];
+
+ const ModelsMap = (map, maps) => {
+ //instantiate array that will hold your Json Data
+ let dataArray = [];
+ //push your Json Data in the array
+ {
+ data.map((markerJson) => dataArray.push(markerJson));
+ }
+
+ //Loop through the dataArray to create a marker per data using the coordinates in the json
+ for (let i = 0; i < dataArray.length; i++) {
+ let marker = new maps.Marker({
+ position: { lat: dataArray[i].lat, lng: dataArray[i].lng },
+ map,
+ label: dataArray[i].id,
+ });
+ }
+ };
+ return (
+
ModelsMap(map, maps)}
+ >
+ );
+};
+
+export default GoogleMapComponent;
diff --git a/components/mapping/osm.js b/components/mapping/osm.js
new file mode 100644
index 00000000..f06cda02
--- /dev/null
+++ b/components/mapping/osm.js
@@ -0,0 +1,38 @@
+import L from "leaflet";
+import { useRef, useMemo } from "react";
+import { MapContainer, TileLayer, Marker, Popup } from "react-leaflet";
+
+const OSMapComponent = (props) => {
+ const { center, zoom } = props;
+ const markerRef = useRef(null);
+ let data = [center];
+
+ // const ModelsMap = (map, maps) => {
+ // //instantiate array that will hold your Json Data
+ // let dataArray = [];
+ // //push your Json Data in the array
+ // {
+ // data.map((markerJson) => dataArray.push(markerJson));
+ // }
+
+ // //Loop through the dataArray to create a marker per data using the coordinates in the json
+ // for (let i = 0; i < dataArray.length; i++) {
+ // let marker = new maps.Marker({
+ // position: { lat: dataArray[i].lat, lng: dataArray[i].lng },
+ // map,
+ // label: dataArray[i].id,
+ // });
+ // }
+ // };
+
+ return (
+
+
+
+
+ hello
+
+
+ );
+};
+export default OSMapComponent;
diff --git a/components/myportal.js b/components/myportal.js
index 3dc240d4..0d919ee4 100644
--- a/components/myportal.js
+++ b/components/myportal.js
@@ -10,14 +10,17 @@ import MyRepresentations from "./myportal/myrepresentations";
import WatchedCases from "./myportal/watchedcases";
import YourAccount from "./myportal/youraccount";
import { parseCookies, setCookie, destroyCookie } from "nookies";
+import Dns from "./myportal/dns";
import IdleTimer from "react-idle-timer";
import TimeoutModal from "./timeout/timeoutmodal";
import { useState } from "react";
import TimeOut from "../components/timeout";
+import UploadFile from "./myportal/uploadFile";
const MyPortal = (props) => {
+ const { showFileUpload } = props;
let { t } = useTranslation();
const router = useRouter();
@@ -110,18 +113,18 @@ const MyPortal = (props) => {
-
+
+ {showFileUpload == "true" && }
diff --git a/components/myportal/awaitingsubmission.js b/components/myportal/awaitingsubmission.js
index 5c8351d4..88bff7e7 100644
--- a/components/myportal/awaitingsubmission.js
+++ b/components/myportal/awaitingsubmission.js
@@ -13,7 +13,7 @@ const AwaitingSubmission = (props) => {
const { setCurrentView } = props;
return (
-