From 7e47340326e071e0ac4c9ea1ae12f3d77a436feb Mon Sep 17 00:00:00 2001 From: Robert Bond Date: Tue, 9 Jun 2026 10:04:32 +0000 Subject: [PATCH] Merged PR 2377: added enlarge map view on dnsapplication list added enlarge map view on dnsapplication list Related work items: #23774 --- components/dnssearchresults.js | 2 + components/search/dnssearchresults.js | 81 ++++++++++--------- .../resolveRepresentationWindow.js | 2 + pages/dnsapplications.js | 7 +- pages/myportal/dnsapplications.js | 6 +- styles/sass/welshgov/_application.scss | 17 ++++ 6 files changed, 72 insertions(+), 43 deletions(-) diff --git a/components/dnssearchresults.js b/components/dnssearchresults.js index 15c8dcd0..7c2956d8 100644 --- a/components/dnssearchresults.js +++ b/components/dnssearchresults.js @@ -11,6 +11,7 @@ export default function Search(props) { watchedCases, showMap, showLoginCheck, + mapTarget } = props; let { t } = useTranslation(); @@ -48,6 +49,7 @@ export default function Search(props) { watchedCases={watchedCases} showMap={showMap} showLoginCheck={showLoginCheck} + mapTarget={mapTarget} /> diff --git a/components/search/dnssearchresults.js b/components/search/dnssearchresults.js index 3be6f0c4..f36b2954 100644 --- a/components/search/dnssearchresults.js +++ b/components/search/dnssearchresults.js @@ -53,7 +53,8 @@ const DNSSearchResults = (props) => { setWatchedCases, setWatchedCasesDetails, showMap, - showLoginCheck + showLoginCheck, + mapTarget } = props; let { t } = useTranslation(); @@ -65,6 +66,7 @@ const DNSSearchResults = (props) => { const [searchLoaded, setSearchLoaded] = useState(false); const [showSpinnerState, setShowSpinnerState] = useState(false); + const [isMapExpanded, setIsMapExpanded] = useState(false); // let dataArray = []; // //push your Json Data in the array @@ -907,9 +909,30 @@ const DNSSearchResults = (props) => { <>
+ {showMap == "true" && isMapExpanded && ( +
+
+ + src={`https://datamap.gov.wales/maps/${mapTarget}/embed?center=-3.6553189192727347,52.214962933659415&zoom=2#/`} + width="100%" + height="500" + frameBorder="0" + title="Map" + />
+ +
)}
+ {searchResultsObj["@odata.count"] > 5 && (
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} />