updated dropdown search with translations
This commit is contained in:
@@ -7,6 +7,7 @@ import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
|
||||
import jsonpath from "jsonpath";
|
||||
import data from "../../data/collections.json";
|
||||
import LoadingOverlay from "react-loading-overlay";
|
||||
import transLookup from "../../data/lookuptranslations.json";
|
||||
|
||||
let AdvancedSearch = (props) => {
|
||||
let { t } = useTranslation();
|
||||
@@ -78,7 +79,7 @@ let AdvancedSearch = (props) => {
|
||||
//onChange={(e) => props.onChangeSelectLPA(e)}
|
||||
>
|
||||
<option value="" disabled defaultValue>
|
||||
Select...
|
||||
{t("common:drop-down-select")}
|
||||
</option>
|
||||
{_.isEmpty(optionsObj)
|
||||
? ""
|
||||
@@ -88,7 +89,20 @@ let AdvancedSearch = (props) => {
|
||||
key={key}
|
||||
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>
|
||||
);
|
||||
})}
|
||||
@@ -141,7 +155,7 @@ let AdvancedSearch = (props) => {
|
||||
//onChange={(e) => props.onChangeSelectAppealType(e)}
|
||||
>
|
||||
<option value="" disabled defaultValue>
|
||||
Select...
|
||||
{t("common:drop-down-select")}
|
||||
</option>
|
||||
{_.isEmpty(optionsObj)
|
||||
? ""
|
||||
@@ -180,7 +194,18 @@ let AdvancedSearch = (props) => {
|
||||
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>
|
||||
);
|
||||
})}
|
||||
@@ -293,7 +318,7 @@ let AdvancedSearch = (props) => {
|
||||
component={RenderAppealTypeList}
|
||||
optionsObj={appealOptionsObj}
|
||||
// validate={[required]}
|
||||
label="Select an appeal type"
|
||||
label={t("search:appealtype-label")}
|
||||
errormsg="Appeal type is required"
|
||||
/>
|
||||
<Field
|
||||
@@ -395,7 +420,7 @@ let AdvancedSearch = (props) => {
|
||||
name="search"
|
||||
className="govuk-button"
|
||||
>
|
||||
Search
|
||||
{t("common:search-button")}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -223,7 +223,7 @@ const DNSSearchResults = (props) => {
|
||||
) : (
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-two-thirds">
|
||||
<h3>There are no records</h3>
|
||||
<h3>{t("search:searchresults-no-records-label")}</h3>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -215,7 +215,9 @@ const SearchResults = (props) => {
|
||||
) : (
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-two-thirds">
|
||||
<h3>There are no records</h3>
|
||||
<h3>
|
||||
{t("search:searchresults-no-records-label")}
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user