Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Delay loading search field dropdown data #1731

Merged
merged 6 commits into from Mar 19, 2022

Conversation

TaiWilkin
Copy link
Contributor

@TaiWilkin TaiWilkin commented Mar 18, 2022

Overview

As part of our redesign of the sidebar to support extended fields we researched search behavior and hid list frequently used search fields. If the search fields are never shown, their dropdown list option do not need to be fetched.

Connects #1729

Demo

2022-03-19 10 04 11

Notes

When refreshing the page after selection both a facility type and a processing type, the facility type options do not populate. This is not a regression and is a non-ideal behavior in the current implementation of filtering options based on the connection between facility type and processing type.

Testing Instructions

  • Open the dev tools network tab and filter by XHR
  • Browse http://localhost:6543/ and verify that API request are not made for
    • /api/contributor-types
    • /api/facility-processing-types
    • /api/product-types
    • /api/worker-ranges
  • Click "More filters" and verify that fetches are now make and that all the dropdowns are populated
  • Select items in all the extended field dropdowns then refresh the page, verify that the selections are restored

Checklist

  • fixup! commits have been squashed
  • CI passes after rebase
  • CHANGELOG.md updated with summary of features or fixes, following Keep a Changelog guidelines

TaiWilkin and others added 5 commits March 19, 2022 08:45
We also rename the style variable to be consistent with the component file name.
FilterSidebarExtendedSearch was originally extracted from the
FilterSidebarSearchTab.
The original hook generated a lint warning for the missing dependencies. Using a
single hook resulted in repeat fetches so we split out a separate hook for each
distinct fetch.
@jwalgran jwalgran force-pushed the tw/delay-loading-dropdown-data branch from de73db2 to c45b9ab Compare March 19, 2022 16:39
@jwalgran
Copy link
Contributor

I rebased this on develop and force pushed along with some cleanup.

@jwalgran jwalgran changed the title DRAFT: Delay loading dropdown data Delay loading search field dropdown data Mar 19, 2022
@jwalgran
Copy link
Contributor

We want to make other adjustments to fields in this new sub-component so since I effectively did a review of @TaiWilkin 's initial work I am going to approve and merge this. If there are additional clean ups or changes we would like to do they can be made in a follow up PR.

@jwalgran jwalgran merged commit dd290e9 into develop Mar 19, 2022
@jwalgran jwalgran deleted the tw/delay-loading-dropdown-data branch March 19, 2022 17:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants