Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates error message to be more helpful #125

Merged
merged 4 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 1.5.3 - 2024-08

- (Dan) Update the error message for the postcode sector step 3/7 [120](https://github.com/epimorphics/standard-reports-ui/issues/120)
- (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)
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ GEM
json
lograge
railties
lr_common_styles (1.9.3)
lr_common_styles (1.9.4)
bootstrap-sass (~> 3.4.0)
font-awesome-rails (~> 4.7.0.1)
govuk_elements_rails (~> 2.0.0)
Expand Down Expand Up @@ -402,7 +402,7 @@ DEPENDENCIES
json_rails_logger (~> 1.0.0)!
leaflet-rails
libv8-node (>= 16.10.0.0)
lr_common_styles (~> 1.9.3)!
lr_common_styles (~> 1.9, >= 1.9.4)!
minitest-rails-capybara
minitest-reporters
minitest-spec-rails
Expand Down
3 changes: 2 additions & 1 deletion app/models/step_select_postcode.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ def validate_with(workflow, value)
workflow_update_hook(workflow)
workflow.traverse_to(successor_step)
else
set_flash("Sorry, '#{value}' does not appear to be a valid value for a #{subtype_label}.")
set_flash("Sorry, '#{value}' does not appear to be a valid value for a #{subtype_label}.
Copy link
Contributor

@jonrandahl jonrandahl Aug 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs a little more tweaking as your example does not show the additional space in the supplied postcode example; however, when testing in the dev instance, the space is provided but unclear:

CleanShot 2024-08-14 at 17 24 40

You also might be able to "highlight" or indicate in another manner 1 that there is a space in the supplied value; as well as display the additional validation message only if the space exists... if this is your intention?

Footnotes

  1. https://stackoverflow.com/questions/74012576/how-can-i-make-leading-or-trailing-spaces-visible-in-a-rails-html-view

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure how, but this is an older screenshot and no longer valid. Can you look at this screenshot instead?

Screenshot from 2024-08-14 16-16-34

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue with this approach is you're trying to explain the actual mistake with another mistake? There is no extra space, the string is too many characters. If we only want to guide the user to rethink their entry, without writing code handing the myriad of possible mistakes, rephrase the "umbrella" message such as "Perhaps there's a typo or too many characters or maybe an extra space somewhere?" with the key being an tone which expresses uncertainty or possibility without being specific but offering the common mistakes reported.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise you need to discuss and investigate the common issues experienced and create an error handler that responds to each of the discovered possibilities with a specific message for each.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PS. I can see that this specific ticket focuses on the missing space however there are no other examples of other error messages here to go by. 😁

Have you left a space between the digits?")
end
end

Expand Down