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
@@ -692,7 +692,7 @@ export const stagesByCaseType = {
descriptionKey: "report-to-ministers-desc-cpo" descriptionKey: "report-to-ministers-desc-cpo"
}, },
{ {
stageId: 846040013, stageId: 846040060,
titleKey: "case-closed", titleKey: "case-closed",
descriptionKey: "case-closed-desc-order" descriptionKey: "case-closed-desc-order"
} }
+110 -133
View File
@@ -5,6 +5,7 @@ import { connect } from "react-redux";
import { Field, formValueSelector, reduxForm } from "redux-form"; import { Field, formValueSelector, reduxForm } from "redux-form";
import transLookup from "../../data/lookuptranslations.json"; import transLookup from "../../data/lookuptranslations.json";
import { statusValues } from "../utils/caseStagesObj";
const required = (errorMsg) => (value) => const required = (errorMsg) => (value) =>
value || typeof value === "number" ? undefined : errorMsg; value || typeof value === "number" ? undefined : errorMsg;
@@ -120,7 +121,7 @@ const RenderCaseStatusList = ({
optionsObj, optionsObj,
meta: { touched, error }, meta: { touched, error },
label, label,
errormsg, errormsg
}) => { }) => {
let { t } = useTranslation(); let { t } = useTranslation();
const router = useRouter(); const router = useRouter();
@@ -170,23 +171,25 @@ const RenderCaseStatusList = ({
{_.isEmpty(optionsObj[key]) {_.isEmpty(optionsObj[key])
? "" ? ""
: _.isEmpty(optionsObj[key]) : _.isEmpty(optionsObj[key])
? "" ? ""
: _.isEmpty(optionsObj[key].value) : _.isEmpty(
? "" optionsObj[key].value
: router.locale == "cy" )
? jsonpath({ ? ""
path: : router.locale == "cy"
'$..[?(@ && @.statuscode=="' + ? jsonpath({
optionsObj[key] path:
.statuscode + '$..[?(@ && @.statuscode=="' +
'")].value_cy', optionsObj[key]
json: optionsObj, .statuscode +
eval: true, '")].value_cy',
}) json: optionsObj,
: optionsObj[key].value || eval: true
t( })
"case:summary-no-date-entered-label" : optionsObj[key].value ||
)} t(
"case:summary-no-date-entered-label"
)}
</option> </option>
); );
})} })}
@@ -211,7 +214,7 @@ let AdvancedSearch = (props) => {
error, error,
pristine, pristine,
reset, reset,
submitting, submitting
} = props; } = props;
const appealOptionsObj = const appealOptionsObj =
@@ -236,7 +239,7 @@ let AdvancedSearch = (props) => {
optionsObj, optionsObj,
meta: { touched, error }, meta: { touched, error },
label, label,
errormsg, errormsg
}) => { }) => {
return ( return (
<> <>
@@ -291,7 +294,7 @@ let AdvancedSearch = (props) => {
.name + .name +
'")].value_cy', '")].value_cy',
json: transLookup, json: transLookup,
eval: true, eval: true
}) })
: optionsObj[key].name || : optionsObj[key].name ||
t( t(
@@ -314,7 +317,7 @@ let AdvancedSearch = (props) => {
optionsObj, optionsObj,
meta: { touched, error }, meta: { touched, error },
label, label,
errormsg, errormsg
}) => { }) => {
return ( return (
<> <>
@@ -361,47 +364,52 @@ let AdvancedSearch = (props) => {
_.isEmpty(optionsObj[key]) _.isEmpty(optionsObj[key])
? "" ? ""
: _.isEmpty( : _.isEmpty(
optionsObj[key] optionsObj[key]
) )
? "" ? ""
: _.isEmpty( : _.isEmpty(
optionsObj[key] optionsObj[key]
.value .value
)
? ""
: optionsObj[key]
.attributevalue +
"," +
optionsObj[key].value
.replace(
/(\band|[\s\-\+\(\)\,\&])/g,
""
) )
.toLowerCase() ? ""
: optionsObj[key]
.attributevalue +
"," +
optionsObj[
key
].value
.replace(
/(\band|[\s\-\+\(\)\,\&])/g,
""
)
.toLowerCase()
} }
> >
{_.isEmpty(optionsObj[key]) {_.isEmpty(optionsObj[key])
? "" ? ""
: _.isEmpty(optionsObj[key]) : _.isEmpty(optionsObj[key])
? "" ? ""
: _.isEmpty( : _.isEmpty(
optionsObj[key].value
)
? ""
: router.locale == "cy"
? jsonpath({
path:
'$..[?(@ && @.value=="' +
optionsObj[key] optionsObj[key]
.value + .value
'")].value_cy', )
json: transLookup, ? ""
eval: true, : router.locale == "cy"
}) ? jsonpath({
: optionsObj[key].value || path:
t( '$..[?(@ && @.value=="' +
"case:summary-no-date-entered-label" optionsObj[
)} key
].value +
'")].value_cy',
json: transLookup,
eval: true
})
: optionsObj[key]
.value ||
t(
"case:summary-no-date-entered-label"
)}
</option> </option>
); );
})} })}
@@ -418,7 +426,7 @@ let AdvancedSearch = (props) => {
optionsObj, optionsObj,
meta: { touched, error }, meta: { touched, error },
label, label,
errormsg, errormsg
}) => { }) => {
return ( return (
<> <>
@@ -465,49 +473,51 @@ let AdvancedSearch = (props) => {
_.isEmpty(optionsObj[key]) _.isEmpty(optionsObj[key])
? "" ? ""
: _.isEmpty( : _.isEmpty(
optionsObj[key] optionsObj[key]
) )
? "" ? ""
: _.isEmpty( : _.isEmpty(
optionsObj[key] optionsObj[key]
.pinswg_sipsprojecttypeid .pinswg_sipsprojecttypeid
)
? ""
: optionsObj[key]
.pinswg_sipsprojecttypeid +
"," +
optionsObj[
key
].pinswg_name
.replace(
/(\band|[\s\-\+\(\)\,\&])/g,
""
) )
.toLowerCase() ? ""
: optionsObj[key]
.pinswg_sipsprojecttypeid +
"," +
optionsObj[
key
].pinswg_name
.replace(
/(\band|[\s\-\+\(\)\,\&])/g,
""
)
.toLowerCase()
} }
> >
{_.isEmpty(optionsObj[key]) {_.isEmpty(optionsObj[key])
? "" ? ""
: _.isEmpty(optionsObj[key]) : _.isEmpty(optionsObj[key])
? "" ? ""
: _.isEmpty( : _.isEmpty(
optionsObj[key]
.pinswg_name
)
? ""
: router.locale == "cy"
? jsonpath(
'$..[?(@.value=="' +
optionsObj[key] optionsObj[key]
.pinswg_name + .pinswg_name
'")].value_cy', )
transLookup ? ""
) : router.locale == "cy"
: optionsObj[key] ? jsonpath(
.pinswg_name || '$..[?(@.value=="' +
t( optionsObj[
"case:summary-no-date-entered-label" key
)} ]
.pinswg_name +
'")].value_cy',
transLookup
)
: optionsObj[key]
.pinswg_name ||
t(
"case:summary-no-date-entered-label"
)}
</option> </option>
); );
})} })}
@@ -550,7 +560,7 @@ let AdvancedSearch = (props) => {
searchString += searchString +=
values.statusCode != null values.statusCode != null
? "statuscode=" + values.projecttype + "&" ? "statuscode=" + values.statusCode + "&"
: ""; : "";
searchString += searchString +=
@@ -594,7 +604,7 @@ let AdvancedSearch = (props) => {
t( t(
"myportal:searchcases-validation-minlength" "myportal:searchcases-validation-minlength"
) )
), )
]} ]}
className="govuk-input govuk-!-width-two-thirds" className="govuk-input govuk-!-width-two-thirds"
component={RenderTextfield} component={RenderTextfield}
@@ -619,7 +629,7 @@ let AdvancedSearch = (props) => {
t( t(
"myportal:searchcases-validation-minlength" "myportal:searchcases-validation-minlength"
) )
), )
]} ]}
className="govuk-input govuk-!-width-two-thirds" className="govuk-input govuk-!-width-two-thirds"
component={RenderLPATextfield} component={RenderLPATextfield}
@@ -681,40 +691,7 @@ let AdvancedSearch = (props) => {
name="statusCode" name="statusCode"
id="statusCode" id="statusCode"
component={RenderCaseStatusList} component={RenderCaseStatusList}
optionsObj={[ optionsObj={statusValues}
{
"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,
},
]}
//validate={[required]} //validate={[required]}
label={t( label={t(
"search:case-status-label" "search:case-status-label"
@@ -835,7 +812,7 @@ const mapStateToProps = (state) => {
myCases: state.myCases, myCases: state.myCases,
watchedCases: state.watchedCases, watchedCases: state.watchedCases,
myRepresentations: state.myRepresentations, myRepresentations: state.myRepresentations,
awaitingSubmission: state.awaitingSubmission, awaitingSubmission: state.awaitingSubmission
}; };
}; };
@@ -849,7 +826,7 @@ AdvancedSearch = connect((state) => {
const appealTypesValue = selector(state, "appealTypes"); const appealTypesValue = selector(state, "appealTypes");
return { return {
appealTypesValue, appealTypesValue
}; };
})(AdvancedSearch); })(AdvancedSearch);
@@ -859,6 +836,6 @@ export default connect(
)( )(
reduxForm({ reduxForm({
form: "advancedSearchForm", form: "advancedSearchForm",
destroyOnUnmount: false, destroyOnUnmount: false
})(AdvancedSearch) })(AdvancedSearch)
); );
+287
View File
@@ -0,0 +1,287 @@
export const statusValues = [
{
"value": "Acceptance Checking",
"value_cy": "Gwirio derbyn",
"statuscode": 846040004
},
{
"value": "Appeal Registered",
"value_cy": "Apêl wedii chofrestru",
"statuscode": 846040015
},
{
"value": "Appeal Submitted",
"value_cy": "Apêl wedii chyflwyno",
"statuscode": 846040014
},
{
"value": "Appeal Validated",
"value_cy": "Apêl wedii dilysu",
"statuscode": 846040016
},
{
"value": "Applicants Final Comment",
"value_cy": "Sylw terfynol yr ymgeisydd",
"statuscode": 846040027
},
{
"value": "Application Called-In",
"value_cy": "Cais wedii alw i mewn",
"statuscode": 846040023
},
{
"value": "Application Validated",
"value_cy": "Cais wedii ddilysu",
"statuscode": 846040024
},
{
"value": "Case in Progress",
"value_cy": "Achos ar y gweill",
"statuscode": 1
},
{
"value": "Consultation",
"value_cy": "Ymgynghoriad",
"statuscode": 846040006
},
{
"value": "Environmental Impact Assessment Scoping",
"value_cy": "Cwmpasu Asesiad or Effaith Amgylcheddol",
"statuscode": 846040002
},
{
"value": "Inspector(s) Decision",
"value_cy": "Penderfyniad yr arolygydd/arolygwyr",
"statuscode": 846040009
},
{
"value": "Invalid Submission",
"value_cy": "Cyflwyniad annilys",
"statuscode": 846040005
},
{
"value": "Notification",
"value_cy": "Hysbysiad",
"statuscode": 846040003
},
{ "value": "On Hold", "value_cy": "Ar Dal", "statuscode": 2 },
{
"value": "Pre-Application",
"value_cy": "Cyn gwneud cais",
"statuscode": 846040001
},
{
"value": "Questionnaire / LPA to Notify",
"value_cy": "Holiadur / ACLl i hysbysu",
"statuscode": 846040017
},
{
"value": "Re-Consultation",
"value_cy": "Ail-ymgynghoriad",
"statuscode": 846040007
},
{ "value": "Researching", "value_cy": "Ymchwilio", "statuscode": 4 },
{
"value": "Report to Ministers",
"value_cy": "Adroddiad i Weinidogion",
"statuscode": 846040011
},
{
"value": "Statements",
"value_cy": "Datganiadau",
"statuscode": 846040010
},
{ "value": "Reporting", "value_cy": "Adrodd", "statuscode": 846040008 },
{
"value": "Waiting for Details",
"value_cy": "Aros am fanylion",
"statuscode": 3
},
{
"value": "Minister's Decision",
"value_cy": "Penderfyniad y Gweinidog",
"statuscode": 846040012
},
{
"value": "Representations Period",
"value_cy": "Cyfnod sylwadau",
"statuscode": 846040018
},
{
"value": "Final Comments",
"value_cy": "Sylwadau terfynol",
"statuscode": 846040019
},
{ "value": "Event", "value_cy": "Digwyddiad", "statuscode": 846040020 },
{
"value": "Site Visit",
"value_cy": "Ymweliad safle",
"statuscode": 846040021
},
{
"value": "Decision Issued",
"value_cy": "Penderfyniad wedii gyhoeddi",
"statuscode": 846040022
},
{
"value": "LPA to Notify",
"value_cy": "ACLl i hysbysu",
"statuscode": 846040025
},
{
"value": "Report Issued to Welsh Ministers",
"value_cy": "Adroddiad wedii gyhoeddi i Weinidogion Cymru",
"statuscode": 846040028
},
{
"value": "Fee Due",
"value_cy": "Ffi yn ddyledus",
"statuscode": 846040029
},
{
"value": "Validated",
"value_cy": "Wedii ddilysu",
"statuscode": 846040030
},
{
"value": "Appeal Start / Case in Progress",
"value_cy": "Apêl wedi dechrau / achos ar y gweill",
"statuscode": 846040031
},
{
"value": "Statements/Representations Period",
"value_cy": "Cyfnod datganiadau/sylwadau",
"statuscode": 846040032
},
{
"value": "Order Submitted",
"value_cy": "Gorchymyn wedii gyflwyno",
"statuscode": 846040033
},
{
"value": "Order Submission Registered",
"value_cy": "Cyflwyniad gorchymyn wedii gofrestru",
"statuscode": 846040034
},
{
"value": "Order Submission Validated",
"value_cy": "Cyflwyniad gorchymyn wedii ddilysu",
"statuscode": 846040035
},
{
"value": "Case started/Case in Progress",
"value_cy": "Achos wedi dechrau / achos ar y gweill",
"statuscode": 846040036
},
{
"value": "Event/Site Visit",
"value_cy": "Digwyddiad/ymweliad safle",
"statuscode": 846040037
},
{
"value": "Applicant Statement on Representations",
"value_cy": "Datganiad yr ymgeisydd ar sylwadau",
"statuscode": 846040038
},
{
"value": "Representatives Comment",
"value_cy": "Sylwr cynrychiolwyr",
"statuscode": 846040039
},
{
"value": "Order Registered",
"value_cy": "Gorchymyn wedii gofrestru",
"statuscode": 846040040
},
{
"value": "Order Validated",
"value_cy": "Gorchymyn wedii ddilysu",
"statuscode": 846040041
},
{
"value": "Representations Period",
"value_cy": "Cyfnod sylwadau",
"statuscode": 846040047
},
{
"value": "Application Submitted",
"value_cy": "Cais wedii gyflwyno",
"statuscode": 846040042
},
{
"value": "Application Registered",
"value_cy": "Cais wedii gofrestru",
"statuscode": 846040043
},
{
"value": "Report to DESNZ",
"value_cy": "Adroddiad i DESNZ",
"statuscode": 846040044
},
{
"value": "Case in Progress / Assessment",
"value_cy": "Achos ar y gweill / asesiad",
"statuscode": 846040045
},
{
"value": "Decision / Outcome",
"value_cy": "Penderfyniad / canlyniad",
"statuscode": 846040046
},
{
"value": "Final Comments",
"value_cy": "Sylwadau terfynol",
"statuscode": 846040048
},
{ "value": "Event", "value_cy": "Digwyddiad", "statuscode": 846040049 },
{
"value": "Minister's Decision",
"value_cy": "Penderfyniad y Gweinidog",
"statuscode": 846040050
},
{
"value": "Case started/Case in Progress",
"value_cy": "Achos wedi dechrau / achos ar y gweill",
"statuscode": 846040051
},
{
"value": "Statements",
"value_cy": "Datganiadau",
"statuscode": 846040052
},
{
"value": "Application Validated",
"value_cy": "Cais wedii ddilysu",
"statuscode": 846040053
},
{
"value": "Appliation Start / Case in Progress",
"value_cy": "Cais wedi dechrau / achos ar y gweill",
"statuscode": 846040054
},
{
"value": "Final Comments",
"value_cy": "Sylwadau terfynol",
"statuscode": 846040055
},
{
"value": "Report to Ministers",
"value_cy": "Adroddiad i Weinidogion",
"statuscode": 846040056
},
{
"value": "Application Validated",
"value_cy": "Cais wedii ddilysu",
"statuscode": 846040057
},
{
"value": "Case in Progress",
"value_cy": "Achos ar y gweill",
"statuscode": 846040058
},
{
"value": "Case Submitted",
"value_cy": "Achos wedii gyflwyno",
"statuscode": 846040061
}
];