From fb026f2926073c97eac555ad951774ef905a1182 Mon Sep 17 00:00:00 2001 From: Daniel Couzens Date: Wed, 14 Aug 2024 13:55:58 +0100 Subject: [PATCH 1/2] updates step 3/7 to return user input --- app/models/step_select_county_or_district.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/models/step_select_county_or_district.rb b/app/models/step_select_county_or_district.rb index afaa3e5..224ffd4 100644 --- a/app/models/step_select_county_or_district.rb +++ b/app/models/step_select_county_or_district.rb @@ -18,16 +18,17 @@ def traverse(workflow) end def validate_value(workflow) + input_text = value(workflow) normalized_value = validate(value(workflow)) unless normalized_value && (value(workflow) == normalized_value) - workflow.set_state(param_name, normalized_value) + workflow.set_state(param_name, input_text) end - normalized_value || validation_failure(workflow) + normalized_value || validation_failure(input_text) end - def validation_failure(workflow) - set_flash("Sorry, #{subtype_label} '#{value(workflow)}' was not recognised") + def validation_failure(input_text) + set_flash("Sorry, #{subtype_label} '#{input_text}' was not recognised") false end From ac1dd2795e852ba7e334c9369e27a17f16affaad Mon Sep 17 00:00:00 2001 From: Daniel Couzens Date: Wed, 14 Aug 2024 14:03:29 +0100 Subject: [PATCH 2/2] updates changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c493b4e..7460492 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## 1.5.3 - 2024-08 +- (Dan) Updates step 3/7 to return user input rather than false when user inputs invalid value [118](https://github.com/epimorphics/standard-reports-ui/issues/118) - (Dan) Adds underline text to laning page of standard reports and to help link[114](https://github.com/epimorphics/standard-reports-ui/issues/114) - (Dan) Styled the help button to match PPD [117](https://github.com/epimorphics/standard-reports-ui/issues/117) - (Dan) Adds more descriptive text to action buttons on the report page [115](https://github.com/epimorphics/standard-reports-ui/issues/115)