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 to AddClaimantModal #14202

Merged
merged 46 commits into from
May 29, 2020
Merged

Updates to AddClaimantModal #14202

merged 46 commits into from
May 29, 2020

Conversation

jcq
Copy link
Contributor

@jcq jcq commented May 6, 2020

Connects #14153

Description

This adds functionality to AddClaimantModal — implementing debounce on searchable dropdown and async fetching from backend API.

Acceptance Criteria

  • Code compiles correctly
  • Adds debounce functionality
  • Pulls select options via async fetch from backend
  • Saves claimant participant_id
  • Displays added claimant in radio list
  • Supports removing claimant from list
  • Fleshes out feature test

JC Quirin and others added 19 commits May 1, 2020 14:40
(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;
added ADD_CLAIMANT_MODAL_TITLE to COPY
@codeclimate
Copy link

codeclimate bot commented May 6, 2020

Code Climate has analyzed commit e6d2fa0 and detected 12 issues on this pull request.

Here's the issue category breakdown:

Category Count
Duplication 2
Style 10

View more on Code Climate.

@jcq
Copy link
Contributor Author

jcq commented May 15, 2020

Note: will need to update story to include local async fn for generating names

@va-bot
Copy link
Collaborator

va-bot commented May 22, 2020

2 Warnings
⚠️ This is a Big PR. Try to break this down if possible. Stacked pull requests encourage more detailed and thorough code reviews
⚠️ This PR modifies React components — consider adding/updating corresponding Storybook file

Generated by 🚫 Danger

@jcq
Copy link
Contributor Author

jcq commented May 22, 2020

Updated Screenshots:

Screen Shot 2020-05-22 at 15 31 19
Screen Shot 2020-05-22 at 15 31 29

Copy link
Contributor

@leikkisa leikkisa left a 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.

client/babel.config.js Show resolved Hide resolved
<div>
<ReactMarkdown source={ADD_CLAIMANT_MODAL_DESCRIPTION} />
</div>
<SearchableDropdown label="Claimant's name" options={dropdownOpts} onChange={handleChange} value={claimant} />
<SearchableDropdown
Copy link
Contributor

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

Copy link
Contributor Author

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

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!

spec/feature/intake/intake_spec.rb Outdated Show resolved Hide resolved
spec/feature/intake/intake_spec.rb Outdated Show resolved Hide resolved
Copy link
Contributor

@nanotone nanotone left a 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 😅

@jcq
Copy link
Contributor Author

jcq commented May 28, 2020

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 😅

Oof, good flag. Taking a look.

JC Quirin added 2 commits May 28, 2020 16:38
- loading indicator
- filterOption fn
- filterOptions fn
(it passes relevant props to react-select)
@jcq
Copy link
Contributor Author

jcq commented May 28, 2020

@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).

Copy link
Contributor

@nanotone nanotone left a 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?

@jcq
Copy link
Contributor Author

jcq commented May 29, 2020

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!

@nanotone
Copy link
Contributor

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.

@jcq jcq added the Ready-to-Merge This PR is ready to be merged and will be picked up by va-bot to automatically merge to master label May 29, 2020
@va-bot va-bot merged commit 9b70c85 into master May 29, 2020
@va-bot va-bot deleted the jc/14153-update-add-claimant-modal branch May 29, 2020 19:35
pkarman added a commit that referenced this pull request May 29, 2020
va-bot pushed a commit that referenced this pull request May 29, 2020
This reverts commit 9b70c85.

build and bake are failing. Likely a .js dependency in assets precompile step.
@jcq jcq mentioned this pull request Jun 2, 2020
2 tasks
jcq added a commit that referenced this pull request Jun 8, 2020
va-bot pushed a commit that referenced this pull request Jun 8, 2020
(Connects #14153)

Reverts #14434, which reverted #14202.

We reverted #14202 due to issues with builds failing in production. We have since changed things at the devops level, and we want to get this code merged in.
va-bot pushed a commit that referenced this pull request Jun 8, 2020
Connects #14430

### Description
Fixes regression from #14202; this brings fully functioning debounce functionality in `AddClaimantModal` along with additional JS tests

### Acceptance Criteria
- [ ] Code compiles correctly
- [ ] API calls are properly debounced in `AddClaimantModal`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready-to-Merge This PR is ready to be merged and will be picked up by va-bot to automatically merge to master Team: Foxtrot 🦊
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants