+ {showMap == "true" && isMapExpanded && (
+
+
+
+
+
+
+ )}
+
{
- {showMap == "true" && (
+ {showMap == "true" && !isMapExpanded && (
-
- {/*
- ModelsMap(map, maps)
- }
- /> */}
-
+
+ src={`https://datamap.gov.wales/maps/${mapTarget}/embed?center=-3.6553189192727347,52.214962933659415&zoom=2#/`}
+ width="100%"
+ height="500"
+ frameBorder="0"
+ title="Map"
+ />
+
+
)}
diff --git a/lib/domain/representation-policy/resolveRepresentationWindow.js b/lib/domain/representation-policy/resolveRepresentationWindow.js
index 6d8d2a7e..f94f074d 100644
--- a/lib/domain/representation-policy/resolveRepresentationWindow.js
+++ b/lib/domain/representation-policy/resolveRepresentationWindow.js
@@ -28,6 +28,8 @@ export function isRepresentationWindowClosed(
}
export function resolveRepresentationWindow(caseDetails, DateCtor = Date) {
+ caseDetails = caseDetails || {};
+
const hasStartDate =
Object.prototype.hasOwnProperty.call(caseDetails, "pinswg_startdate") ||
Object.prototype.hasOwnProperty.call(
diff --git a/pages/dnsapplications.js b/pages/dnsapplications.js
index 538c0d03..774eb176 100644
--- a/pages/dnsapplications.js
+++ b/pages/dnsapplications.js
@@ -23,7 +23,7 @@ import { wrapper } from "../store/store";
import ServiceBanner from "../components/servicebanner";
const Home = (props) => {
- const { footerLinks, pages, showMap, showLoginCheck } = props;
+ const { footerLinks, pages, showMap, showLoginCheck, mapTarget } = props;
let { t, lang } = useTranslation();
const router = useRouter();
@@ -109,6 +109,7 @@ const Home = (props) => {
searchString="DNS"
searchResultsObj={props.searchResultsObj}
showLoginCheck={showLoginCheck}
+ mapTarget={mapTarget}
/>
@@ -140,6 +141,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
const showLoginCheck = process.env.SHOWLOGIN || false;
const showMapCheck = process.env.SHOWMAPS || false;
+ const mapTarget = process.env.MAP_TARGET || "pedw-dev";
// if (_.has(searchResultsObj, "status") == true) {
// return {
@@ -166,7 +168,8 @@ export const getServerSideProps = wrapper.getServerSideProps(
return {
props: {
showMap: showMapCheck,
- showLoginCheck: showLoginCheck
+ showLoginCheck: showLoginCheck,
+ mapTarget: mapTarget
}
};
}
diff --git a/pages/myportal/dnsapplications.js b/pages/myportal/dnsapplications.js
index fa98caa5..dcffa802 100644
--- a/pages/myportal/dnsapplications.js
+++ b/pages/myportal/dnsapplications.js
@@ -40,7 +40,7 @@ import { getSession } from "next-auth/react";
import ServiceBanner from "../../components/myportal/servicebanner";
const Home = (props) => {
- const { footerLinks, pages, watchedCases, showMap } = props;
+ const { footerLinks, pages, watchedCases, showMap, mapTarget } = props;
let { t, lang } = useTranslation();
const router = useRouter();
@@ -127,6 +127,7 @@ const Home = (props) => {
searchResultsObj={props.searchResultsObj}
myportal={true}
watchedCases={watchedCases}
+ mapTarget={mapTarget}
/>
@@ -174,6 +175,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
// : searchResultsObj;
const showMapCheck = process.env.SHOWMAPS || false;
+ const mapTarget = process.env.MAP_TARGET || "pedw-dev";
const watchedCasesDetails = await getDetails(
watchedCases,
@@ -190,7 +192,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
store.dispatch(setAccountDetails(accountDetails));
return {
- props: { showMap: showMapCheck }
+ props: { showMap: showMapCheck, mapTarget: mapTarget }
};
}
}
diff --git a/styles/sass/welshgov/_application.scss b/styles/sass/welshgov/_application.scss
index 88d54f22..823075fc 100644
--- a/styles/sass/welshgov/_application.scss
+++ b/styles/sass/welshgov/_application.scss
@@ -3543,4 +3543,21 @@ ul.subFieldList {
font-weight: normal;
text-decoration: none;
white-space: nowrap;
+}
+
+
+
+.map-container {
+ width: 100%;
+}
+
+.map-container--expanded {
+ margin-bottom: 30px;
+}
+
+.map-expand-link {
+ background: none;
+ border: 0;
+ padding: 0;
+ cursor: pointer;
}
\ No newline at end of file