updated dropdown search with translations

This commit is contained in:
2021-09-30 11:55:30 +01:00
parent 13833930fe
commit d05caec63c
16 changed files with 68 additions and 17 deletions
+6 -1
View File
@@ -89,7 +89,12 @@ const DocumentDetails = (props) => {
key={key} key={key}
> >
<dd className="govuk-summary-list__value govuk-!-font-size-14 govuk-!-padding-left-2"> <dd className="govuk-summary-list__value govuk-!-font-size-14 govuk-!-padding-left-2">
<Link href="/"> <Link
href={
"/" +
detailsObj.pinswg_isharedocumentreference
}
>
<a> <a>
<span className="results-visually-hidden"> <span className="results-visually-hidden">
{t( {t(
+1 -1
View File
@@ -64,7 +64,7 @@ const CaseSummary = (props) => {
<div className="govuk-grid-row"> <div className="govuk-grid-row">
<div className="govuk-grid-column-full"> <div className="govuk-grid-column-full">
<h1 className="govuk-heading-xl govuk-!-margin-bottom-7"> <h1 className="govuk-heading-xl govuk-!-margin-bottom-7">
Reference:{" "} {t("case:summary-reference-label")}:{" "}
{currentType == "searchResultsObj" {currentType == "searchResultsObj"
? detailsObj.pinswg_name ? detailsObj.pinswg_name
: casesObj.reference} : casesObj.reference}
+1 -1
View File
@@ -12,7 +12,7 @@ export default function Inspectorate() {
<div className="card clear" id="inspectorate-card"> <div className="card clear" id="inspectorate-card">
<div className="card-body"> <div className="card-body">
<Image <Image
alt="Planning Inspectorate" alt={t("home:inspectorate-card-alt-text")}
src="/assets/images/PINS_dual_logo_400.png" src="/assets/images/PINS_dual_logo_400.png"
width="380px" width="380px"
height="58px" height="58px"
+2 -2
View File
@@ -27,10 +27,10 @@ export default function LoginSoon() {
<br /> <br />
<a <a
target="_blank" target="_blank"
href="https://gov.wales/planning-appeal-forms" href={t("home:login-comingsoon-forms-link")}
rel="noreferrer" rel="noreferrer"
> >
https://gov.wales/planning-appeal-forms {t("home:login-comingsoon-forms-link")}
</a> </a>
</div> </div>
</div> </div>
+31 -6
View File
@@ -7,6 +7,7 @@ import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
import jsonpath from "jsonpath"; import jsonpath from "jsonpath";
import data from "../../data/collections.json"; import data from "../../data/collections.json";
import LoadingOverlay from "react-loading-overlay"; import LoadingOverlay from "react-loading-overlay";
import transLookup from "../../data/lookuptranslations.json";
let AdvancedSearch = (props) => { let AdvancedSearch = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -78,7 +79,7 @@ let AdvancedSearch = (props) => {
//onChange={(e) => props.onChangeSelectLPA(e)} //onChange={(e) => props.onChangeSelectLPA(e)}
> >
<option value="" disabled defaultValue> <option value="" disabled defaultValue>
Select... {t("common:drop-down-select")}
</option> </option>
{_.isEmpty(optionsObj) {_.isEmpty(optionsObj)
? "" ? ""
@@ -88,7 +89,20 @@ let AdvancedSearch = (props) => {
key={key} key={key}
value={optionsObj[key].accountid} value={optionsObj[key].accountid}
> >
{optionsObj[key].name} {/* {optionsObj[key].name} */}
{router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
optionsObj[key]
.name +
'")].value_cy'
)
: optionsObj[key].name ||
t(
"case:summary-no-date-entered-label"
)}
</option> </option>
); );
})} })}
@@ -141,7 +155,7 @@ let AdvancedSearch = (props) => {
//onChange={(e) => props.onChangeSelectAppealType(e)} //onChange={(e) => props.onChangeSelectAppealType(e)}
> >
<option value="" disabled defaultValue> <option value="" disabled defaultValue>
Select... {t("common:drop-down-select")}
</option> </option>
{_.isEmpty(optionsObj) {_.isEmpty(optionsObj)
? "" ? ""
@@ -180,7 +194,18 @@ let AdvancedSearch = (props) => {
optionsObj[key].value optionsObj[key].value
) )
? "" ? ""
: optionsObj[key].value} : router.locale == "cy"
? jsonpath.query(
transLookup,
'$..[?(@.value=="' +
optionsObj[key]
.value +
'")].value_cy'
)
: optionsObj[key].value ||
t(
"case:summary-no-date-entered-label"
)}
</option> </option>
); );
})} })}
@@ -293,7 +318,7 @@ let AdvancedSearch = (props) => {
component={RenderAppealTypeList} component={RenderAppealTypeList}
optionsObj={appealOptionsObj} optionsObj={appealOptionsObj}
// validate={[required]} // validate={[required]}
label="Select an appeal type" label={t("search:appealtype-label")}
errormsg="Appeal type is required" errormsg="Appeal type is required"
/> />
<Field <Field
@@ -395,7 +420,7 @@ let AdvancedSearch = (props) => {
name="search" name="search"
className="govuk-button" className="govuk-button"
> >
Search {t("common:search-button")}
</button> </button>
</div> </div>
</div> </div>
+1 -1
View File
@@ -223,7 +223,7 @@ const DNSSearchResults = (props) => {
) : ( ) : (
<div className="govuk-grid-row"> <div className="govuk-grid-row">
<div className="govuk-grid-column-two-thirds"> <div className="govuk-grid-column-two-thirds">
<h3>There are no records</h3> <h3>{t("search:searchresults-no-records-label")}</h3>
</div> </div>
</div> </div>
)} )}
+3 -1
View File
@@ -215,7 +215,9 @@ const SearchResults = (props) => {
) : ( ) : (
<div className="govuk-grid-row"> <div className="govuk-grid-row">
<div className="govuk-grid-column-two-thirds"> <div className="govuk-grid-column-two-thirds">
<h3>There are no records</h3> <h3>
{t("search:searchresults-no-records-label")}
</h3>
</div> </div>
</div> </div>
)} )}
+5
View File
@@ -201,6 +201,11 @@
"value_cy": "Cyngor Bwrdeistref Sirol Blaenau Gwent", "value_cy": "Cyngor Bwrdeistref Sirol Blaenau Gwent",
"pinswg_lpa": 0 "pinswg_lpa": 0
}, },
{
"value": "Bridgend CBC",
"value_cy": "Cyngor Bwrdeistref Sirol Pen-y-bont ar Ogwr",
"pinswg_lpa": 0
},
{ {
"value": "Bridgend County Borough Council", "value": "Bridgend County Borough Council",
"value_cy": "Cyngor Bwrdeistref Sirol Pen-y-bont ar Ogwr", "value_cy": "Cyngor Bwrdeistref Sirol Pen-y-bont ar Ogwr",
+1
View File
@@ -1,6 +1,7 @@
{ {
"page-title": "Cyfeirnod", "page-title": "Cyfeirnod",
"case-card-title": "Reference: APP/B1415/W/20/3271702", "case-card-title": "Reference: APP/B1415/W/20/3271702",
"summary-reference-label": "Cyfeirnod",
"summary-applicant-label": "Apelydd/Ymgeisydd", "summary-applicant-label": "Apelydd/Ymgeisydd",
"summary-agent-label": "Asiant", "summary-agent-label": "Asiant",
"summary-site-address-label": "Cyfeiriad y Safle", "summary-site-address-label": "Cyfeiriad y Safle",
+3 -1
View File
@@ -9,6 +9,7 @@
"error-textbox": "Choose an option", "error-textbox": "Choose an option",
"available-in": "English", "available-in": "English",
"continue-button": "Parhewch", "continue-button": "Parhewch",
"search-button": "Chwilio",
"submit-and-start": "Cyflwyno a dechrau'r cwrs", "submit-and-start": "Cyflwyno a dechrau'r cwrs",
"footer-terms-conditions-link": "Telerau ac amodau", "footer-terms-conditions-link": "Telerau ac amodau",
"footer-privacy-link": "Rhybudd Preifatrwydd", "footer-privacy-link": "Rhybudd Preifatrwydd",
@@ -37,5 +38,6 @@
"cookie-banner-list-item-2": "i wella'n gwefan drwy gasglu ac adrodd gwybodaeth ar sut yr ydych yn defnyddio'r safle", "cookie-banner-list-item-2": "i wella'n gwefan drwy gasglu ac adrodd gwybodaeth ar sut yr ydych yn defnyddio'r safle",
"cookie-banner-list-item-3": "i deilwra cyfathrebu", "cookie-banner-list-item-3": "i deilwra cyfathrebu",
"cookie-banner-decline": "Rwy'n dirywio", "cookie-banner-decline": "Rwy'n dirywio",
"cookie-banner-accept": "Derbyn cwcis" "cookie-banner-accept": "Derbyn cwcis",
"drop-down-select": "Dewiswch..."
} }
+2
View File
@@ -2,6 +2,7 @@
"login-card-title-temp": "Croeso", "login-card-title-temp": "Croeso",
"login-comingsoon-temp-1": "Maer wefan hon yn cael ei datblygu o hyd. Os hoffech gyflwyno apêl neu gais newydd, neu wneud sylwadau ar un sydd eisoes yn bodoli, cyflwynwch yr apêl, y cais neur sylwadau, ynghyd ag unrhyw ddogfennau cysylltiedig perthnasol, i ", "login-comingsoon-temp-1": "Maer wefan hon yn cael ei datblygu o hyd. Os hoffech gyflwyno apêl neu gais newydd, neu wneud sylwadau ar un sydd eisoes yn bodoli, cyflwynwch yr apêl, y cais neur sylwadau, ynghyd ag unrhyw ddogfennau cysylltiedig perthnasol, i ",
"login-comingsoon-temp-2": "Gellir gofyn am ffurflenni apelio a ffurflenni cais trwy e-bost neu gellir eu lawrlwytho trwy ddilyn y ddolen isod. ", "login-comingsoon-temp-2": "Gellir gofyn am ffurflenni apelio a ffurflenni cais trwy e-bost neu gellir eu lawrlwytho trwy ddilyn y ddolen isod. ",
"login-comingsoon-forms-link": "https://llyw.cymru/ffurflenni-apelio",
"login-card-title": "Mewngofnodi i apelio yn erbyn penderfyniad cynllunio", "login-card-title": "Mewngofnodi i apelio yn erbyn penderfyniad cynllunio",
"login-card-id-label": "Dynodydd Defnyddiwr (ID) Porth y Llywodraeth", "login-card-id-label": "Dynodydd Defnyddiwr (ID) Porth y Llywodraeth",
"login-card-id-hint": "Gallai hyn fod hyd at 12 o gymeriadau.", "login-card-id-hint": "Gallai hyn fod hyd at 12 o gymeriadau.",
@@ -23,6 +24,7 @@
"casescomment-card-paragraph-two": "O ran apeliadau Deiliaid Tai a Masnachol, ni all partïon â buddiant wneud sylwadau yn ystod y cam apêl. Bydd unrhyw sylwadau a wnaed yn ystod y cam ymgeision cael eu darparu gan yr awdurdod cynllunio lleol au hystyried gan yr arolygydd.", "casescomment-card-paragraph-two": "O ran apeliadau Deiliaid Tai a Masnachol, ni all partïon â buddiant wneud sylwadau yn ystod y cam apêl. Bydd unrhyw sylwadau a wnaed yn ystod y cam ymgeision cael eu darparu gan yr awdurdod cynllunio lleol au hystyried gan yr arolygydd.",
"inspectorate-card-visit-label": "Ymweld Yr Arolygiaeth Gynllunio", "inspectorate-card-visit-label": "Ymweld Yr Arolygiaeth Gynllunio",
"inspectorate-card-visit-link": "Hafan", "inspectorate-card-visit-link": "Hafan",
"inspectorate-card-alt-text": "Yr Arolygiaeth Gynllunio",
"dns-card-title": "Datblygiadau o Arwyddocâd Cenedlaethol", "dns-card-title": "Datblygiadau o Arwyddocâd Cenedlaethol",
"dns-card-paragraph": "Mae Datblygiad o Arwyddocâd Cenedlaethol (DAC) yn fath o gais cynllunio ar gyfer prosiect seilwaith mawr sydd o bwysigrwydd cenedlaethol yng Nghymru. Yn y fan hon, gallwch gael gwybod am geisiadau DAC arfaethedig. Rheolir y safle hwn gan yr Arolygiaeth Gynllunio.", "dns-card-paragraph": "Mae Datblygiad o Arwyddocâd Cenedlaethol (DAC) yn fath o gais cynllunio ar gyfer prosiect seilwaith mawr sydd o bwysigrwydd cenedlaethol yng Nghymru. Yn y fan hon, gallwch gael gwybod am geisiadau DAC arfaethedig. Rheolir y safle hwn gan yr Arolygiaeth Gynllunio.",
"dns-card-button": "Gweld pob cais" "dns-card-button": "Gweld pob cais"
+3 -1
View File
@@ -9,6 +9,7 @@
"postcode-label": "Cod Post", "postcode-label": "Cod Post",
"lpa-label": "Awdurdod Cynllunio Lleol", "lpa-label": "Awdurdod Cynllunio Lleol",
"lpa-reference-label": "Cyfeirnod yr Awdurdod Cynllunio Lleol", "lpa-reference-label": "Cyfeirnod yr Awdurdod Cynllunio Lleol",
"appealtype-label": "Dewiswch fath o apêl",
"case-type-label": "Math o Achos", "case-type-label": "Math o Achos",
"case-type-option-1": "--Dewiswch--", "case-type-option-1": "--Dewiswch--",
"case-type-option-2": "Unrhyw fath/Pob math", "case-type-option-2": "Unrhyw fath/Pob math",
@@ -57,5 +58,6 @@
"searchresults-status-label": "Statws", "searchresults-status-label": "Statws",
"searchresults-watch-label": "Gwylio", "searchresults-watch-label": "Gwylio",
"searchresults-search-button-label": "Mireinio'r chwiliad", "searchresults-search-button-label": "Mireinio'r chwiliad",
"searchresults-new-search-button-label": "Chwiliad newydd" "searchresults-new-search-button-label": "Chwiliad newydd",
"searchresults-no-records-label": "Nid oes unrhyw gofnodion"
} }
+1
View File
@@ -1,6 +1,7 @@
{ {
"page-title": "Reference", "page-title": "Reference",
"case-card-title": "Reference: APP/B1415/W/20/3271702", "case-card-title": "Reference: APP/B1415/W/20/3271702",
"summary-reference-label": "Reference",
"summary-applicant-label": "Appellant/Applicant", "summary-applicant-label": "Appellant/Applicant",
"summary-agent-label": "Agent", "summary-agent-label": "Agent",
"summary-site-address-label": "Site Address", "summary-site-address-label": "Site Address",
+3 -1
View File
@@ -9,6 +9,7 @@
"error-textbox": "Choose an option", "error-textbox": "Choose an option",
"available-in": "Cymraeg", "available-in": "Cymraeg",
"continue-button": "Continue", "continue-button": "Continue",
"search-button": "Search",
"submit-and-start": "Submit and start course", "submit-and-start": "Submit and start course",
"footer-terms-conditions-link": "Terms and conditions", "footer-terms-conditions-link": "Terms and conditions",
"footer-privacy-link": "Privacy Notice", "footer-privacy-link": "Privacy Notice",
@@ -37,5 +38,6 @@
"cookie-banner-list-item-2": "improve our website by collecting and reporting information on how you use it", "cookie-banner-list-item-2": "improve our website by collecting and reporting information on how you use it",
"cookie-banner-list-item-3": "tailor communications", "cookie-banner-list-item-3": "tailor communications",
"cookie-banner-decline": "I decline", "cookie-banner-decline": "I decline",
"cookie-banner-accept": "Accept cookies" "cookie-banner-accept": "Accept cookies",
"drop-down-select": "Select..."
} }
+2
View File
@@ -2,6 +2,7 @@
"login-card-title-temp": "Welcome", "login-card-title-temp": "Welcome",
"login-comingsoon-temp-1": "This website is still in development, if you wish to submit a new appeal or application please submit it, along with any relevant associated documentation, to ", "login-comingsoon-temp-1": "This website is still in development, if you wish to submit a new appeal or application please submit it, along with any relevant associated documentation, to ",
"login-comingsoon-temp-2": "Appeal and application forms can be requested by e-mail or downloaded following the below link.", "login-comingsoon-temp-2": "Appeal and application forms can be requested by e-mail or downloaded following the below link.",
"login-comingsoon-forms-link": "https://gov.wales/planning-appeal-forms",
"login-card-title": "Sign in to appeal a planning decision", "login-card-title": "Sign in to appeal a planning decision",
"login-card-id-label": "Government Gateway user ID", "login-card-id-label": "Government Gateway user ID",
"login-card-id-hint": "This could be up to 12 characters.", "login-card-id-hint": "This could be up to 12 characters.",
@@ -23,6 +24,7 @@
"casescomment-card-paragraph-two": "For Householder and Commercial appeals, interested parties are unable to make representations at appeal stage. Any representations made at application stage will be provided by the local planning authority and considered by the inspector.", "casescomment-card-paragraph-two": "For Householder and Commercial appeals, interested parties are unable to make representations at appeal stage. Any representations made at application stage will be provided by the local planning authority and considered by the inspector.",
"inspectorate-card-visit-label": "Visit the Planning Inspectorate", "inspectorate-card-visit-label": "Visit the Planning Inspectorate",
"inspectorate-card-visit-link": "Home", "inspectorate-card-visit-link": "Home",
"inspectorate-card-alt-text": "The Planning Inspectorate",
"dns-card-title": "Developments of National Significance", "dns-card-title": "Developments of National Significance",
"dns-card-paragraph": "A Development of National Significance (DNS) is a type of planning application for a large infrastructure project of national importance in Wales. Here you can find out about proposed DNS applications. This site is managed by the Planning Inspectorate.", "dns-card-paragraph": "A Development of National Significance (DNS) is a type of planning application for a large infrastructure project of national importance in Wales. Here you can find out about proposed DNS applications. This site is managed by the Planning Inspectorate.",
"dns-card-button": "View all applications" "dns-card-button": "View all applications"
+3 -1
View File
@@ -9,6 +9,7 @@
"postcode-label": "Postcode", "postcode-label": "Postcode",
"lpa-label": "Local Planning Authority", "lpa-label": "Local Planning Authority",
"lpa-reference-label": "LPA reference number", "lpa-reference-label": "LPA reference number",
"appealtype-label": "Select an appeal type",
"case-type-label": "Case type", "case-type-label": "Case type",
"case-type-option-1": "-- Select --", "case-type-option-1": "-- Select --",
"case-type-option-2": "Any/All", "case-type-option-2": "Any/All",
@@ -57,5 +58,6 @@
"searchresults-status-label": "Status", "searchresults-status-label": "Status",
"searchresults-watch-label": "Watch", "searchresults-watch-label": "Watch",
"searchresults-search-button-label": "Refine Search", "searchresults-search-button-label": "Refine Search",
"searchresults-new-search-button-label": "New Search" "searchresults-new-search-button-label": "New Search",
"searchresults-no-records-label": "There are no records"
} }