-
Notifications
You must be signed in to change notification settings - Fork 19
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 to AddClaimantModal
#14202
Updates to AddClaimantModal
#14202
Conversation
(removes mention of Pulac Cerullo in URL)
added proptypes; refactored into functional component
added story for `AddClaimantModal`; updated `SelectClaimant` to allow opening of `AddClaimantModal` if `attorneyFees` feature toggle is enabled;
… `SelectClaimant`
…Claimant` is true;
added ADD_CLAIMANT_MODAL_TITLE to COPY
…ed on returning participantId
(if appropriate feature toggle is set)
Code Climate has analyzed commit e6d2fa0 and detected 12 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
(avoids errors with async functions at top level of files)
(default — optionally supports a different async fn as a prop)
Note: will need to update story to include local async fn for generating names |
Generated by 🚫 Danger |
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.
Hey JC - This looks really good code-wise! Nice FE test. I also checked out the storybook locally which was fun.
I added a couple of minor comments, non-blocking since the feature generally is still a WIP. We might want to run screenshots by Rutvi, the spacing is a confusing layout for me (esp. for the legacy opt in field). Submitting successfully adds the claimant, but the add_issues page isn't loading because it depends on some claimant formatting stuff, but make sense for another ticket.
<div> | ||
<ReactMarkdown source={ADD_CLAIMANT_MODAL_DESCRIPTION} /> | ||
</div> | ||
<SearchableDropdown label="Claimant's name" options={dropdownOpts} onChange={handleChange} value={claimant} /> | ||
<SearchableDropdown |
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.
I know this may be up in the air but I'm not loving the searchable dropdown with one option in it
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.
@rutvigupta-design Just wanted to flag this for you
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.
I'd love to take a look at the screenshots, if possible!
client/test/app/intake/components/__snapshots__/AddClaimantModal.test.js.snap
Show resolved
Hide resolved
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.
Hm, while playing around with this and prepping for demo, I might've stumbled on a flaw in how we're using this component. The XHR and the React state contain results, but the <Select>
is only showing those with an exact (case-insensitive) substring match.
This makes the dropdown pretty intolerant of typos, and defeats some of the fuzzy matching special sauce 😅
- loading indicator - filterOption fn - filterOptions fn (it passes relevant props to react-select)
…ons returned from backend
@nanotone I think the update I just pushed should cover the issue you raised (it will now return all options that it received from the backend). |
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 fixing that filter issue so quickly! I think this PR is fine to be merged if you like.
One aspect that might warrant a closer look (maybe a separate PR) is the debouncing. When testing locally, it looks like I was able to fire off these 8 XHRs within a span of about 400 milliseconds. Does that square with how you understand the debouncing strategy?
Nope, looks like there must have been a regression on that. I'll look into it and follow up with another PR. Good catch! |
Food for thought: this feels like a great opportunity for a frontend test. It's confined to one or a few components, and is the kind of test that benefits from the snappiness of ditching rspec+capybara. I see that Jest comes with some nifty timer mocks, too. |
This reverts commit 9b70c85. build and bake are failing. Likely a .js dependency in assets precompile step.
Connects #14153
Description
This adds functionality to
AddClaimantModal
— implementing debounce on searchable dropdown and async fetching from backend API.Acceptance Criteria
participant_id