-
Notifications
You must be signed in to change notification settings - Fork 1
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
Reduce fetch requests #81
Conversation
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.
Great work! Super clean!
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.
@existentialmutt
I had to merge in main
to be able to see the filter in the test repo because of the new CSS updates. I pushed up a branch to test in that repo here: https://github.com/leenyburger/bullet_train_test_refine_npm_package/tree/reduce-fetch-requests (it's pointing to my local gemfile right now).
I'm seeing two issues:
- The Apply button isn't doing anything. Curiously, they're seeing this same behavior on CF2 for only 1 filter. This was Daniel's response to the thread I tagged you in over there:
Daniel Pence
1 hour ago
Very helpful, actually, thanks! I see the issue. In the cases where we want to use filters inside a modal or, in this case inside a tab panel, we need to use the turbo version of the search-filter-controller called turbo-search-filter-controller. A small tweak to that controller and changing the action on the Apply button seems to make things work as expected. Will play with it more in the morning, but I think we're unblocked at this point 👌. Thanks again 👍
- When the user clicks
Load a Filter
the filter isn't loaded into the view.
Video if the above isn't clear:
https://www.loom.com/share/c2267d528c5b4414b59e4aa8bba2dc6d
The main purpose of this PR is to remove an unnecessary fetch request every time the user updates the filter form. This second request had been for maintaining a stableID in client state, which was needed for the stored filter workflow.
I've refactored the stored filter workflow so that it uses the current blueprint instead of stableID. This allows us to eliminate the second fetch request when the filter form is updated.