Merged PR 2426: added var to summary map and welsh translatioins

added var to summary map and welsh translatioins

Related work items: #23879
This commit is contained in:
Robert Bond
2026-06-24 17:10:22 +00:00
parent c98bbfc321
commit 5483c4cdf2
7 changed files with 242 additions and 89 deletions
+33 -30
View File
@@ -197,21 +197,23 @@ const Pinswg_dnsid = (props) => {
"case:summary-procedure-label" "case:summary-procedure-label"
)} )}
value={ value={
router.locale == "cy" detailsObj.pinswg_choiceofprocedure !==
? jsonpath({ null
path: ? router.locale == "cy"
'$..[?(@ && @.value=="' + ? jsonpath({
detailsObj[ path:
"pinswg_choiceofprocedure@OData.Community.Display.V1.FormattedValue" '$..[?(@ && @.value=="' +
] + detailsObj[
'")].value_cy', "pinswg_choiceofprocedure@OData.Community.Display.V1.FormattedValue"
json: transLookup, ] +
eval: true '")].value_cy',
}) json: transLookup,
: detailsObj[ eval: true
"pinswg_choiceofprocedure@OData.Community.Display.V1.FormattedValue" })
] || : detailsObj[
t( "pinswg_choiceofprocedure@OData.Community.Display.V1.FormattedValue"
]
: t(
"case:summary-to-be-confirmed-label" "case:summary-to-be-confirmed-label"
) )
} }
@@ -320,21 +322,22 @@ const Pinswg_dnsid = (props) => {
{t("case:summary-decision-label")} {t("case:summary-decision-label")}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{router.locale == "cy" {detailsObj.pinswg_decision !== null
? jsonpath({ ? router.locale == "cy"
path: ? jsonpath({
'$..[?(@ && @.value=="' + path:
detailsObj[ '$..[?(@ && @.value=="' +
"pinswg_decision@OData.Community.Display.V1.FormattedValue" detailsObj[
] + "pinswg_decision@OData.Community.Display.V1.FormattedValue"
'")].value_cy', ] +
json: transLookup, '")].value_cy',
eval: true json: transLookup,
}) eval: true
: detailsObj[ })
"pinswg_decision@OData.Community.Display.V1.FormattedValue" : detailsObj[
] || "pinswg_decision@OData.Community.Display.V1.FormattedValue"
t( ]
: t(
"case:summary-no-information-to-date-label" "case:summary-no-information-to-date-label"
)} )}
+60 -53
View File
@@ -126,7 +126,7 @@ const Pinswg_sipscase = (props) => {
{projectTypes.length > 0 && ( {projectTypes.length > 0 && (
<SummaryRow <SummaryRow
label={"Project Type"} label={t("case:project-type-label")}
value={ value={
<> <>
{projectTypes.map( {projectTypes.map(
@@ -225,19 +225,21 @@ const Pinswg_sipscase = (props) => {
"case:summary-procedure-label" "case:summary-procedure-label"
)} )}
value={ value={
router.locale == "cy" detailsObj.pinswg_choiceofprocedure !==
? jsonpath( null
'$..[?(@.value=="' + ? router.locale == "cy"
detailsObj[ ? jsonpath(
"pinswg_choiceofprocedure@OData.Community.Display.V1.FormattedValue" '$..[?(@.value=="' +
] + detailsObj[
'")].value_cy', "pinswg_choiceofprocedure@OData.Community.Display.V1.FormattedValue"
transLookup ] +
) '")].value_cy',
: detailsObj[ transLookup
"pinswg_choiceofprocedure@OData.Community.Display.V1.FormattedValue" )
] || : detailsObj[
t( "pinswg_choiceofprocedure@OData.Community.Display.V1.FormattedValue"
]
: t(
"case:summary-to-be-confirmed-label" "case:summary-to-be-confirmed-label"
) )
} }
@@ -245,19 +247,21 @@ const Pinswg_sipscase = (props) => {
<SummaryRow <SummaryRow
label={"ES Submitted"} label={"ES Submitted"}
value={ value={
router.locale == "cy" detailsObj.pinswg_essubmitted !==
? jsonpath( null
'$..[?(@.value=="' + ? router.locale == "cy"
detailsObj[ ? jsonpath(
"pinswg_essubmitted@OData.Community.Display.V1.FormattedValue" '$..[?(@.value=="' +
] + detailsObj[
'")].value_cy', "pinswg_essubmitted@OData.Community.Display.V1.FormattedValue"
transLookup ] +
) '")].value_cy',
: detailsObj[ transLookup
"pinswg_essubmitted@OData.Community.Display.V1.FormattedValue" )
] || : detailsObj[
t( "pinswg_essubmitted@OData.Community.Display.V1.FormattedValue"
]
: t(
"case:summary-to-be-confirmed-label" "case:summary-to-be-confirmed-label"
) )
} }
@@ -267,19 +271,21 @@ const Pinswg_sipscase = (props) => {
"Deemed Marine License Applied for" "Deemed Marine License Applied for"
} }
value={ value={
router.locale == "cy" detailsObj.pinswg_deemedmarinelicenseappliedfor !==
? jsonpath( null
'$..[?(@.value=="' + ? router.locale == "cy"
detailsObj[ ? jsonpath(
"pinswg_deemedmarinelicenseappliedfor@OData.Community.Display.V1.FormattedValue" '$..[?(@.value=="' +
] + detailsObj[
'")].value_cy', "pinswg_deemedmarinelicenseappliedfor@OData.Community.Display.V1.FormattedValue"
transLookup ] +
) '")].value_cy',
: detailsObj[ transLookup
"pinswg_deemedmarinelicenseappliedfor@OData.Community.Display.V1.FormattedValue" )
] || : detailsObj[
t( "pinswg_deemedmarinelicenseappliedfor@OData.Community.Display.V1.FormattedValue"
]
: t(
"case:summary-to-be-confirmed-label" "case:summary-to-be-confirmed-label"
) )
} }
@@ -394,19 +400,20 @@ const Pinswg_sipscase = (props) => {
{t("case:summary-decision-label")} {t("case:summary-decision-label")}
</dt> </dt>
<dd className="govuk-summary-list__value"> <dd className="govuk-summary-list__value">
{router.locale == "cy" {detailsObj.pinswg_decision !== null
? jsonpath( ? router.locale == "cy"
'$..[?(@.value=="' + ? jsonpath(
detailsObj[ '$..[?(@.value=="' +
"pinswg_decision@OData.Community.Display.V1.FormattedValue" detailsObj[
] + "pinswg_decision@OData.Community.Display.V1.FormattedValue"
'")].value_cy', ] +
transLookup '")].value_cy',
) transLookup
: detailsObj[ )
"pinswg_decision@OData.Community.Display.V1.FormattedValue" : detailsObj[
] || "pinswg_decision@OData.Community.Display.V1.FormattedValue"
t( ]
: t(
"case:summary-no-information-to-date-label" "case:summary-no-information-to-date-label"
)} )}
+136
View File
@@ -919,5 +919,141 @@
"value": "Refused planning permission for the development", "value": "Refused planning permission for the development",
"value_cy": "Wedi gwrthod caniatâd cynllunio ar gyfer y datblygiad" "value_cy": "Wedi gwrthod caniatâd cynllunio ar gyfer y datblygiad"
} }
],
"common": [
{
"value": "Yes",
"value_cy": "Ie"
},
{
"value": "No",
"value_cy": "Na"
}
],
"projecTypes": [
{
"value": "Airport",
"value_cy": "Maes Awyr"
},
{
"value": "Dams and Reservoirs",
"value_cy": "Argaeau a Chronfeydd Dŵr"
},
{
"value": "Electricity infrastructure installation of an electric line above ground associated with a generating station",
"value_cy": "Seilwaith trydan gosod llinell drydan uwchben y ddaear sy'n gysylltiedig â gorsaf gynhyrchu"
},
{
"value": "Electricity infrastructure - Installation of an electric line, other than above ground associated with a generating station",
"value_cy": "Seilwaith trydan gosod llinell drydan, heblaw un uwchben y ddaear sy'n gysylltiedig â gorsaf gynhyrchu"
},
{
"value": "Electricity infrastructure marine other",
"value_cy": "Seilwaith trydan morol arall"
},
{
"value": "Electricity infrastructure marine solar",
"value_cy": "Seilwaith trydan ynni solar morol"
},
{
"value": "Electricity infrastructure marine tidal",
"value_cy": "Seilwaith trydan ynni llanw morol"
},
{
"value": "Electricity infrastructure marine wind",
"value_cy": "Seilwaith trydan ynni gwynt morol"
},
{
"value": "Electricity infrastructure onshore energy from waste",
"value_cy": "Seilwaith trydan ynni o wastraff ar y tir"
},
{
"value": "Electricity infrastructure onshore other",
"value_cy": "Seilwaith trydan ar y tir arall"
},
{
"value": "Electricity infrastructure onshore solar",
"value_cy": "Seilwaith trydan ynni solar ar y tir"
},
{
"value": "Electricity infrastructure onshore wind",
"value_cy": "Seilwaith trydan ynni gwynt ar y tir"
},
{
"value": "Energy Storage",
"value_cy": "Storio Ynni"
},
{
"value": "Gas Reception Facilities",
"value_cy": "Cyfleusterau Derbyn Nwy"
},
{
"value": "Harbour facilities",
"value_cy": "Cyfleusterau Harbwr"
},
{
"value": "Hazardous Waste Facilities",
"value_cy": "Cyfleusterau Gwastraff Peryglus"
},
{
"value": "Highway",
"value_cy": "Priffordd"
},
{
"value": "Hydraulic Fracturing for Oil and Gas and Coal Gasification",
"value_cy": "Hollti Hydrolig ar gyfer Olew a Nwy a Nwyeiddio Glo"
},
{
"value": "Hydraulic fracturing for oil and gas and coal gasification",
"value_cy": "Hollti hydrolig ar gyfer olew a nwy a nwyeiddio glo"
},
{
"value": "Hydrogen production",
"value_cy": "Cynhyrchu Hydrogen"
},
{
"value": "Liquefied Natural Gas Facilities",
"value_cy": "Cyfleusterau Nwy Naturiol Hylifedig"
},
{
"value": "Non gas transport pipeline",
"value_cy": "Piblinell gludo nad yw ar gyfer nwy"
},
{
"value": "Open Cast Coal Mining",
"value_cy": "Cloddio Glo Brig"
},
{
"value": "Open cast coal mining",
"value_cy": "Cloddio glo brig"
},
{
"value": "Pipeline by Gas transporters",
"value_cy": "Piblinell gan gludwyr nwy"
},
{
"value": "Radioactive Waste Geological Disposal Facilities",
"value_cy": "Cyfleusterau Gwaredu Daearegol Gwastraff Ymbelydrol"
},
{
"value": "Rail Freight Interchange",
"value_cy": "Cyfnewidfa Cludo Nwyddau Rheilffordd"
},
{
"value": "Railway",
"value_cy": "Rheilffordd"
},
{
"value": "The construction of flood defence works",
"value_cy": "Adeiladu gwaith amddiffyn rhag llifogydd"
},
{
"value": "Transfer of Water Resources",
"value_cy": "Trosglwyddo Adnoddau Dŵr"
},
{
"value": "Waste Water Treatment Plants",
"value_cy": "Gweithfeydd Trin Dŵr Gwastraff"
}
] ]
} }
+2 -1
View File
@@ -151,5 +151,6 @@
"live-event-link": "Gwylio'r ffrydio byw", "live-event-link": "Gwylio'r ffrydio byw",
"status-title": "Statws", "status-title": "Statws",
"status-show-all-label": "Dangoswch bob cam", "status-show-all-label": "Dangoswch bob cam",
"status-hide-all-label": "Cuddio pob cam" "status-hide-all-label": "Cuddio pob cam",
"project-type-label": "Math o brosiect"
} }
+2 -1
View File
@@ -152,5 +152,6 @@
"live-event-link": "Watch live stream", "live-event-link": "Watch live stream",
"status-title": "Status", "status-title": "Status",
"status-show-all-label": "Show all stages", "status-show-all-label": "Show all stages",
"status-hide-all-label": "Hide all stages" "status-hide-all-label": "Hide all stages",
"project-type-label": "Project type"
} }
+5 -2
View File
@@ -38,7 +38,8 @@ const CaseHome = (props) => {
pages, pages,
setSearchResults, setSearchResults,
setSearchDetails, setSearchDetails,
searchResultsObj searchResultsObj,
mapTarget
} = props; } = props;
let { t, lang } = useTranslation(); let { t, lang } = useTranslation();
@@ -113,6 +114,7 @@ const CaseHome = (props) => {
showMaps={props.showMaps} showMaps={props.showMaps}
eventsObj={props.searchResultsObj.eventsObj} eventsObj={props.searchResultsObj.eventsObj}
mediaObj={props.searchResultsObj.mediaObj} mediaObj={props.searchResultsObj.mediaObj}
mapTarget={props.mapTarget}
/> />
</div> </div>
<Footer <Footer
@@ -245,7 +247,8 @@ export const getServerSideProps = wrapper.getServerSideProps(
), ),
showFilteredDocs: process.env.SHOWFILTERDOCS || false, showFilteredDocs: process.env.SHOWFILTERDOCS || false,
showMaps: process.env.SHOWMAPS, showMaps: process.env.SHOWMAPS,
showLoginCheck: process.env.SHOWLOGIN || false showLoginCheck: process.env.SHOWLOGIN || false,
mapTarget: process.env.MAP_TARGET || "pedw-dev"
} }
}; };
} }
+4 -2
View File
@@ -61,7 +61,7 @@ import ServiceBanner from "../../../components/myportal/servicebanner";
import TimeOut from "../../../components/timeout"; import TimeOut from "../../../components/timeout";
const CaseHome = (props) => { const CaseHome = (props) => {
const { footerLinks } = props; const { footerLinks, mapTarget } = props;
useTranslation(); useTranslation();
const router = useRouter(); const router = useRouter();
@@ -125,6 +125,7 @@ const CaseHome = (props) => {
showMaps={props.showMaps} showMaps={props.showMaps}
eventsObj={props.searchResultsObj.eventsObj} eventsObj={props.searchResultsObj.eventsObj}
mediaObj={props.searchResultsObj.mediaObj} mediaObj={props.searchResultsObj.mediaObj}
mapTarget={props.mapTarget}
/> />
</div> </div>
<Footer <Footer
@@ -403,7 +404,8 @@ export const getServerSideProps = wrapper.getServerSideProps(
searchResultsObj.value[0].incidentid searchResultsObj.value[0].incidentid
), ),
showFilteredDocs: process.env.SHOWFILTERDOCS || false, showFilteredDocs: process.env.SHOWFILTERDOCS || false,
showMaps: process.env.SHOWMAPS showMaps: process.env.SHOWMAPS,
mapTarget: process.env.MAP_TARGET || "pedw-dev"
} }
}; };
} }