-
-
Notifications
You must be signed in to change notification settings - Fork 504
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
fix: select fields on request pages (#4069 partial) #4099
fix: select fields on request pages (#4069 partial) #4099
Conversation
Addresses part of issue rubyforgood#4069: After a request bad request is submitted the select input disappears and turns into a text input. This was caused by formatted_requestable_items not being set. Refactors setting @formatted_requestable_items to a private method call. Unifies all the behavior of setting requestable items. Adds additional tests to ensure select fields have correct values. feat: adds TODOs
841d220
to
65357e2
Compare
Renames formatted_requestable_items to requestable_items Moves formatting and sorting to service object Adds tests for service object Removes method with side effect in favor of direct call to service object to set @requestable_items refactor: removes unneeded code Removes testing of service object from system spec
6b9a10a
to
57fb8a6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! Had one request.
Conflicts: app/views/partners/requests/new.html.erb
Previously tests were simply re-stating the original code. Now specific items are set on the org and partner The tests then check in the service object return a correct subset of those items.
ab9c638
to
521d856
Compare
Tried to make it a bit more clear what is getting set up in the service.
fix: set name manually fix: change bad request test Adds a test to make sure incorrect inputs do not get cleared on submission.
26610a0
to
833b199
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the clarification - this looks good!
@elasticspoon , @dorner The field is a drop-down again! Yay! Alas, on manually testing this on staging before we push to production, I found that the content is still disappearing. This is definitely a step in the right direction, though, so I'm going to recommend we push it to production. |
That fix got moved to another PR #4142 that has not yet been merged. Unless additional content stopped getting preserved? It should only be values on individual request pages that don't get preserved. |
I've only seen the values (at least all the items, whether or not complete) on the individual request pages not getting preserved. So, ok - it's on another PR. |
@elasticspoon: Your PR |
Description
Issue #4069 has two parts:
This PR (so far) fixes part 2:
After a request bad request is submitted the select input disappears and turns into a text input:
This was caused by formatted_requestable_items not being set. PR set value.
Additionally, the select field has different values on a new request vs failed request:
Refactors setting @formatted_requestable_items to a private method call. Unifies all the behavior of setting requestable items.
Part 1 is not addressed. I have been unable to replicate locally.
Type of change
How Has This Been Tested?
Added systems tests to test the select inputs.