15439 fix for app error in advanced search

This commit is contained in:
2025-03-28 06:38:06 +00:00
parent cc0e830cf8
commit 1a740bd78b
4 changed files with 68 additions and 38 deletions
+39 -15
View File
@@ -46,21 +46,45 @@ const GoogleMapComponent = (props) => {
// yesIWantToUseGoogleMapApiInternals
// onGoogleApiLoaded={({ map, maps }) => ModelsMap(map, maps)}
// ></GoogleMapReact>
<iframe
src={
"https://datamap.gov.wales/maps/pedw-dev/embed?center=" +
props.center.lng +
"," +
props.center.lat +
"&zoom=6#/"
}
//src={"https://datamap.gov.wales/maps/pedw-dev/embed#/"}
width={"100%"}
maxheight={"400px"}
height={"100%"}
className={"mappingFrame"}
></iframe>
<>
{" "}
<div className="govuk-grid-row">
<div className="govuk-grid-column-full">
<a
href={
"https://datamap.gov.wales/maps/pedw-dev/embed?center=" +
props.center.lng +
"," +
props.center.lat +
"&zoom=7#/"
}
rel="noreferrer noopener"
className="govuk-link govuk-link--no-underline govuk-!-font-size-14 "
target="_blank"
>
See this map on Datamap Wales
</a>
</div>
</div>
<div className="govuk-grid-row">
<div className="govuk-grid-column-full">
<iframe
src={
"https://datamap.gov.wales/maps/pedw-dev/embed?center=" +
props.center.lng +
"," +
props.center.lat +
"&zoom=7#/"
}
//src={"https://datamap.gov.wales/maps/pedw-dev/embed#/"}
width={"100%"}
maxheight={"400px"}
height={"500px"}
className={"mappingFrame"}
></iframe>
</div>
</div>
</>
);
};
+12 -4
View File
@@ -580,10 +580,10 @@ let AdvancedSearch = (props) => {
label={t("search:appealtype-label")}
errormsg="Appeal type is required"
/>
{props.props?.props.form[
props.form
]?.values?.appealTypes.split(",")[0] ===
"846040002" && (
{props.appealTypesValue?.split(
","
)[0] === "846040002" && (
<Field
name="projecttype"
id="projecttype"
@@ -778,6 +778,14 @@ const mapDispatchToProps = (dispatch) => {
const selector = formValueSelector("advancedSearchForm"); // <-- same as form name
AdvancedSearch = connect((state) => {
const appealTypesValue = selector(state, "appealTypes");
return {
appealTypesValue,
};
})(AdvancedSearch);
export default connect(
mapStateToProps,
mapDispatchToProps
+17 -6
View File
@@ -753,12 +753,12 @@ const DNSSearchResults = (props) => {
{showMap == "true" && (
<div className="govuk-grid-column-one-half">
<div
style={{
height: "45vh",
width: "100%",
}}
// style={{
// height: "45vh",
// width: "100%",
// }}
>
<GoogleMapReact
{/* <GoogleMapReact
options={function (maps) {
return {
overviewMapControl: true,
@@ -777,7 +777,18 @@ const DNSSearchResults = (props) => {
onGoogleApiLoaded={({ map, maps }) =>
ModelsMap(map, maps)
}
/>
/> */}
<iframe
src={
"https://datamap.gov.wales/maps/pedw-dev/embed?center=-3.6553189192727347,52.214962933659415&zoom=2#/"
}
//src={"https://datamap.gov.wales/maps/pedw-dev/embed#/"}
width={"100%"}
maxheight={"400px"}
height={"500px"}
className={"mappingFrame"}
></iframe>
</div>
</div>
)}
-13
View File
@@ -53,19 +53,6 @@ ApiProxy.post(async (req, res) => {
// }
// }
// for (const [fileName, fileDetails] of Object.entries(req.files)) {
// if (allowedMimeTypes.includes(fileDetails[0].headers["content-type"])) {
// allowedFilesFormData[fileName] = fileDetails.map((file) => ({
// fieldName: file.fieldName,
// originalFilename: file.originalFilename,
// path: file.path,
// size: file.size,
// headers: file.headers,
// contentType: file.headers["content-type"],
// }));
// }
// }
for (const [fileName, fileDetails] of Object.entries(req.files)) {
const file = fileDetails[0];
const filePath = file.path;