Skip to content
This repository has been archived by the owner on Nov 6, 2021. It is now read-only.

Use more accessible ui elements for family_requests form #136

Open
benreyn opened this issue Jul 26, 2019 · 6 comments
Open

Use more accessible ui elements for family_requests form #136

benreyn opened this issue Jul 26, 2019 · 6 comments
Labels
Beginner Friendly! Great for beginners! good first issue Good for newcomers

Comments

@benreyn
Copy link
Member

benreyn commented Jul 26, 2019

On the family_requests/new form we use a fancy toggle instead of a vanilla checkbox for the include? column of the table. It would be awesome to use the same toggles for the checkboxes for active and archive on the children form as we do there. Currently we have plain html checkboxes.

These fancy on off mobile style toggles on the Family requests form cannot be accessed by keyboard. Also for a user who is colorblind, it might be unclear which way is "toggled on" vs "toggled off"

I think reverting these to vanilla checkboxes and changing the title of the column to "Include in request?" would do the trick. Also, currently it looks like when these toggles are clicked they send a request in the background to update the childs active column. I think this could be confusing if someone were to start the creation of a family request and abandon it before submitting, (updating the children to inactive with little feedback to the user) I think these updates are fine to do but we should probably wait until the form is submitted and the request created to finalize it.

Screenshot_7_26_19__2_21_PM

@benreyn benreyn added Beginner Friendly! Great for beginners! good first issue Good for newcomers labels Jul 26, 2019
@benreyn
Copy link
Member Author

benreyn commented Jul 26, 2019

Taking a step back from this and chatting with @armahillo I think we should go the other direction on this and make the fancy slider toggles into checkboxes. There are some accessibility concerns with these toggles. (or we can pick a different ui element to use here that makes more sense.)

@benreyn benreyn changed the title Use fancy checkbox toggles in children form for active and archived. Use more accessible ui elements for family_requests creation Jul 28, 2019
@benreyn benreyn changed the title Use more accessible ui elements for family_requests creation Use more accessible ui elements for family_requests form Jul 28, 2019
@VickiShaw94
Copy link

I have just set up my environment to give this issue a try, and am having issues submitting a family diaper request. I created a guardian with a child, but am getting the following internal server error:

JSON::ParserError - 785: unexpected token at '':
  app/services/diaper_bank_client.rb:25:in `send_family_request'
  app/controllers/family_requests_controller.rb:13:in `create'

It looks like maybe I don't have Items Needed? Could I be missing something else?

@benreyn
Copy link
Member Author

benreyn commented Sep 16, 2019

@VickiShaw94, do you also have diaperbase running on your local environment with a seeded database?

@VickiShaw94
Copy link

@benreyn I realized I hadn't seeded the database, but after fixing the Item Needed (and running diaperbase at the same time), I still have the same error.

Here are the request params:

{"utf8"=>"✓", "authenticity_token"=>"0tZMngdubc0rvVxa4rFjK9BP2Tunr0Ms+ewF3AQSfIfP9YDOj1MqSogJZuHNjx9JuZC41PJHlNjHzi9GCyNqrA==", "Active"=>"true", "commit"=>"Submit Diaper Request", "controller"=>"family_requests", "action"=>"create"}

And local variables:

family_request_id | 2
-- | --
family_request | #<FamilyRequest id: 2, partner_id: 1, created_at: "2019-09-17 01:07:20", updated_at: "2019-09-17 01:07:20", sent: nil>
response | #<Net::HTTPForbidden 403 Forbidden readbody=true>

@seanmarcia
Copy link
Member

Hey @VickiShaw94 sorry for the delay! Have you set your environment variables?

@VickiShaw94
Copy link

@seanmarcia sorry I've been busy lately :D how can I get write access to submit a pull request?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Beginner Friendly! Great for beginners! good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants