-
Notifications
You must be signed in to change notification settings - Fork 0
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
[Publisher] Add "Other" textbox to race breakdown #1557
base: main
Are you sure you want to change the base?
Conversation
Hi @mxosman! So after playing with this around, I think maybe injecting component into Also, how do you like my implementation of And last one: I was thinking about displaying existing |
Ah, do you mind clarifying your thoughts on this? Is it moreso challenging to refactor the component to inject a text input? I could see us doing this more often - but just wanted to understand the challenges you ran into!
Hmm... the biggest thing I don't like about the textbox before is the big distance between 'Other' and the textbox - it makes it feel less intuitive what that input is connected to, despite the description in the box. Ideally, it makes the most sense from a UX perspective that it happens right after the 'Other' checkbox, but if that's too technically clunky, the next best option IMO is below the checkboxes because it keeps it within the closest proximity to the 'Other' checkbox. To help with it always being visible and to enhance its connection to the 'Other' checkbox, we could add a E.g. -
I think this works! It's hard to tell without the backend implemented b/c this is a complex component and the Other applies to 3 different sets of ethnicities, but reading the payload I think this works perfectly fine!
Ah, hmm... I might not be fully understanding - selecting an answer for |
<NewInput | ||
type="text" | ||
label="" | ||
placeholder={`If the listed categories do not adequately describe this breakdown, please describe additional definition/clarification of the "Other" selection.`} |
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.
Let's adjust this to just be Please describe additional definition/clarification of the "Other" selection.
if (otherDimension) { | ||
otherDimension.other_description = otherDescription; | ||
} | ||
} |
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.
Let me think about this section a bit more - I think it's right, but just want to make sure it's mapping to the correct Other/Ethnicity.
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.
OK - I took a closer look. This is almost there -- so basically there are 3 "Other" fields in the background of this feature:
- "Other" race + "Unknown Ethnicity"
- "Other" race + "Not Hispanic or Latino" ethnicity
- "Other" race + "Hispanic or Latino" ethnicity
What gets updated should match the grid that's displayed in the UI. So, when a user is in the...
- "Unknown Ethnicity" state (they answered "No" for being able to record an individual's ethnicity, and "Hispanic Or Latino" is NOT selected) - then it should update the "Other / Unknown Ethnicity"
- "Hispanic or Latino" state (they answered "No" for being able to record an individual's ethnicity, and "Hispanic Or Latino" IS SELECTED) - then it should update the "Other / Not Hispanic or Latino"
- "Not Hispanic or Latino" state (they answered "Yes" for being able to record an individual's ethnicity) - then it should update all 3 - "Other / Unknown Ethnicity" AND "Other / Not Hispanic or Latino" AND "Other / Hispanic or Latino"
LMK if this is confusing (because it is) and I can give some more context as to why these fields work this way! But the TLDR is - the other_description
should be set matching the blue dots in the UI depending on the state we're in if it's easier to think about it this way?
Oh, one thing I realized I forgot to include in the ticket - can we make filling out the text field a requirement if a user is going to select "Other"? Meaning, if they enter nothing, we should keep "Other" unchecked. Sorry for the last minute complexity! |
…to nasaownsky/1491-race-breakdown-other-textbox
Hi @mxosman! I've updated textbox logic according to your comments, so please check out my changes and if it's working correctly! In the meantime I only have to find a way for this to work properly:
Thank you! |
Thanks, @nasaownsky - will dive into this tomorrow morning! |
Nice @nasaownsky! It looks like it's working exactly as intended in all 3 cases I tested. Thank you for updating the logic + positioning of it and working through the last piece. Almost there! I'll review once everything is in place. |
Description of the change
Added "Other" textbox to race breakdown
Type of change
Related issues
closes #1491
Checklists
Development
This box MUST be checked by the submitter prior to merging:
These boxes should be checked by the submitter prior to merging:
Code review
These boxes should be checked by reviewers prior to merging: