Merged PR 2349: updated dropdown to show all new case stages

updated dropdown to show all new case stages

Related work items: #23447
This commit is contained in:
Robert Bond
2026-05-28 07:05:06 +00:00
parent 26e8464d46
commit 905c82f598
3 changed files with 398 additions and 134 deletions
+110 -133
View File
@@ -5,6 +5,7 @@ import { connect } from "react-redux";
import { Field, formValueSelector, reduxForm } from "redux-form";
import transLookup from "../../data/lookuptranslations.json";
import { statusValues } from "../utils/caseStagesObj";
const required = (errorMsg) => (value) =>
value || typeof value === "number" ? undefined : errorMsg;
@@ -120,7 +121,7 @@ const RenderCaseStatusList = ({
optionsObj,
meta: { touched, error },
label,
errormsg,
errormsg
}) => {
let { t } = useTranslation();
const router = useRouter();
@@ -170,23 +171,25 @@ const RenderCaseStatusList = ({
{_.isEmpty(optionsObj[key])
? ""
: _.isEmpty(optionsObj[key])
? ""
: _.isEmpty(optionsObj[key].value)
? ""
: router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.statuscode=="' +
optionsObj[key]
.statuscode +
'")].value_cy',
json: optionsObj,
eval: true,
})
: optionsObj[key].value ||
t(
"case:summary-no-date-entered-label"
)}
? ""
: _.isEmpty(
optionsObj[key].value
)
? ""
: router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.statuscode=="' +
optionsObj[key]
.statuscode +
'")].value_cy',
json: optionsObj,
eval: true
})
: optionsObj[key].value ||
t(
"case:summary-no-date-entered-label"
)}
</option>
);
})}
@@ -211,7 +214,7 @@ let AdvancedSearch = (props) => {
error,
pristine,
reset,
submitting,
submitting
} = props;
const appealOptionsObj =
@@ -236,7 +239,7 @@ let AdvancedSearch = (props) => {
optionsObj,
meta: { touched, error },
label,
errormsg,
errormsg
}) => {
return (
<>
@@ -291,7 +294,7 @@ let AdvancedSearch = (props) => {
.name +
'")].value_cy',
json: transLookup,
eval: true,
eval: true
})
: optionsObj[key].name ||
t(
@@ -314,7 +317,7 @@ let AdvancedSearch = (props) => {
optionsObj,
meta: { touched, error },
label,
errormsg,
errormsg
}) => {
return (
<>
@@ -361,47 +364,52 @@ let AdvancedSearch = (props) => {
_.isEmpty(optionsObj[key])
? ""
: _.isEmpty(
optionsObj[key]
)
? ""
: _.isEmpty(
optionsObj[key]
.value
)
? ""
: optionsObj[key]
.attributevalue +
"," +
optionsObj[key].value
.replace(
/(\band|[\s\-\+\(\)\,\&])/g,
""
optionsObj[key]
)
? ""
: _.isEmpty(
optionsObj[key]
.value
)
.toLowerCase()
? ""
: optionsObj[key]
.attributevalue +
"," +
optionsObj[
key
].value
.replace(
/(\band|[\s\-\+\(\)\,\&])/g,
""
)
.toLowerCase()
}
>
{_.isEmpty(optionsObj[key])
? ""
: _.isEmpty(optionsObj[key])
? ""
: _.isEmpty(
optionsObj[key].value
)
? ""
: router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
? ""
: _.isEmpty(
optionsObj[key]
.value +
'")].value_cy',
json: transLookup,
eval: true,
})
: optionsObj[key].value ||
t(
"case:summary-no-date-entered-label"
)}
.value
)
? ""
: router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
optionsObj[
key
].value +
'")].value_cy',
json: transLookup,
eval: true
})
: optionsObj[key]
.value ||
t(
"case:summary-no-date-entered-label"
)}
</option>
);
})}
@@ -418,7 +426,7 @@ let AdvancedSearch = (props) => {
optionsObj,
meta: { touched, error },
label,
errormsg,
errormsg
}) => {
return (
<>
@@ -465,49 +473,51 @@ let AdvancedSearch = (props) => {
_.isEmpty(optionsObj[key])
? ""
: _.isEmpty(
optionsObj[key]
)
? ""
: _.isEmpty(
optionsObj[key]
.pinswg_sipsprojecttypeid
)
? ""
: optionsObj[key]
.pinswg_sipsprojecttypeid +
"," +
optionsObj[
key
].pinswg_name
.replace(
/(\band|[\s\-\+\(\)\,\&])/g,
""
optionsObj[key]
)
? ""
: _.isEmpty(
optionsObj[key]
.pinswg_sipsprojecttypeid
)
.toLowerCase()
? ""
: optionsObj[key]
.pinswg_sipsprojecttypeid +
"," +
optionsObj[
key
].pinswg_name
.replace(
/(\band|[\s\-\+\(\)\,\&])/g,
""
)
.toLowerCase()
}
>
{_.isEmpty(optionsObj[key])
? ""
: _.isEmpty(optionsObj[key])
? ""
: _.isEmpty(
optionsObj[key]
.pinswg_name
)
? ""
: router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
? ""
: _.isEmpty(
optionsObj[key]
.pinswg_name +
'")].value_cy',
transLookup
)
: optionsObj[key]
.pinswg_name ||
t(
"case:summary-no-date-entered-label"
)}
.pinswg_name
)
? ""
: router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
optionsObj[
key
]
.pinswg_name +
'")].value_cy',
transLookup
)
: optionsObj[key]
.pinswg_name ||
t(
"case:summary-no-date-entered-label"
)}
</option>
);
})}
@@ -550,7 +560,7 @@ let AdvancedSearch = (props) => {
searchString +=
values.statusCode != null
? "statuscode=" + values.projecttype + "&"
? "statuscode=" + values.statusCode + "&"
: "";
searchString +=
@@ -594,7 +604,7 @@ let AdvancedSearch = (props) => {
t(
"myportal:searchcases-validation-minlength"
)
),
)
]}
className="govuk-input govuk-!-width-two-thirds"
component={RenderTextfield}
@@ -619,7 +629,7 @@ let AdvancedSearch = (props) => {
t(
"myportal:searchcases-validation-minlength"
)
),
)
]}
className="govuk-input govuk-!-width-two-thirds"
component={RenderLPATextfield}
@@ -681,40 +691,7 @@ let AdvancedSearch = (props) => {
name="statusCode"
id="statusCode"
component={RenderCaseStatusList}
optionsObj={[
{
"value": "In Progress",
"value_cy": "Ar y gweill",
"statuscode": 1,
},
{
"value": "On Hold",
"value_cy": "Ar Dal",
"statuscode": 2,
},
{
"value":
"Waiting for details",
"value_cy":
"Aros am fanylion",
"statuscode": 3,
},
{
"value": "Researching",
"value_cy": "Ymchwilio",
"statuscode": 4,
},
{
"value": "Case Closed",
"value_cy": "Achos ar Gau",
"statuscode": 5,
},
{
"value": "Cancelled",
"value_cy": "Wedi'i ganslo",
"statuscode": 6,
},
]}
optionsObj={statusValues}
//validate={[required]}
label={t(
"search:case-status-label"
@@ -835,7 +812,7 @@ const mapStateToProps = (state) => {
myCases: state.myCases,
watchedCases: state.watchedCases,
myRepresentations: state.myRepresentations,
awaitingSubmission: state.awaitingSubmission,
awaitingSubmission: state.awaitingSubmission
};
};
@@ -849,7 +826,7 @@ AdvancedSearch = connect((state) => {
const appealTypesValue = selector(state, "appealTypes");
return {
appealTypesValue,
appealTypesValue
};
})(AdvancedSearch);
@@ -859,6 +836,6 @@ export default connect(
)(
reduxForm({
form: "advancedSearchForm",
destroyOnUnmount: false,
destroyOnUnmount: false
})(AdvancedSearch)
);