-
-
Notifications
You must be signed in to change notification settings - Fork 55
WEB-4654 - Filter Bar #1980
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
Open
henry-tp
wants to merge
42
commits into
feat/filter-enhancements
Choose a base branch
from
WEB-4654-filter-bar
base: feat/filter-enhancements
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
WEB-4654 - Filter Bar #1980
Changes from 10 commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
e8b5f2b
WEB-4654 initial scaffolding for ActiveFiltersBar and AppliedFilters
henry-tp 2680f37
WEB-4654 rename items to chips
henry-tp b54fc49
WEB-4654 refactor to get rid of one-off functions
henry-tp 056fe0a
WEB-4654 update chip styling
henry-tp f583d39
WEB-4654 remove FilterResetBar and replace
henry-tp e4a29c1
WEB-4654 fix visual styling for applied filters
henry-tp b18c1f4
WEB-4654 fix Summarizing Period label and positioning
henry-tp 8706f0b
WEB-4654 simplify Data Recency button
henry-tp ef612ae
WEB-4654 change order of filters in Pop Health
henry-tp e52b5af
WEB-4654 AppliedFilters takes search argument
henry-tp 4ce23e7
WEB-4654 simplify chipgroup prefix
henry-tp 9b2b4f4
WEB-4654 rename dropdown to Clinic Sites
henry-tp 39f59b2
WEB-4654 AppliedFilters accepts rightContent
henry-tp cb8b216
WEB-4654 fix font sizing & spacing
henry-tp 690abf4
WEB-4654 remove default case from AppliedFiltersAdapter
henry-tp 8d3f1ec
WEB-4654 revert ordering
henry-tp 7b8f0f5
WEB-4654 abstract ClearFilterButtons
henry-tp 0c49625
WEB-4654 fix prop name bug
henry-tp bafce2c
Merge branch 'feat/filter-enhancements' into WEB-4654-filter-bar
henry-tp 71310fd
WEB-4654 fix missing print fn
henry-tp 46fdaae
WEB-4654 revert changes to SummaryPeriod filter
henry-tp c576f4e
WEB-4654 revert changes to SummaryPeriod filter
henry-tp 68d4eb0
WEB-4654 rename to ActiveFiltersTray
henry-tp b932de2
WEB-4654 re-add comments for `SPECIAL_FILTER_STATES`
henry-tp 84a9a30
WEB-4654 change directory for AppliedFiltersList
henry-tp 14c5cbd
WEB-4654 put tray-hiding behaviour into adapter component instead of …
henry-tp 14195bb
WEB-4654 remove unused tests
henry-tp 40980f8
WEB-4654 move ClearFilterButtons rendering into AppliedFiltersList
henry-tp 65c2d02
WEB-4654 write tests for AppliedFiltersList
henry-tp d4930a8
WEB-4654 write tests for ActiveFilterTray
henry-tp bf7d7ac
WEB-4654 update copy text for no tag / no site in ActiveFiltersTray
henry-tp df238e9
WEB-4654 add correct symbol for cgm us
henry-tp 747ee5b
WEB-4654 rename reset filters button
henry-tp 47b21f5
WEB-4654 clean up logic for label determination
henry-tp ff3be8d
WEB-4654 fix breaking test
henry-tp dac1fd5
WEB-4654 remove unused var
henry-tp 23c9bc2
WEB-4654 add missing pluralization strings
henry-tp a150632
WEb-4654 sort tags/sites alphabetically in tray
henry-tp 9e6056b
WEB-4654 remove unnecessary comments in tests
henry-tp 30d791a
WEB-4654 fix missing CGM use clear case
henry-tp 7ac0870
WEB-4654 update imports for consistency
henry-tp b5f2665
WEB-4654 fix render condition
henry-tp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| import React from 'react'; | ||
| import { useSelector } from 'react-redux'; | ||
| import PropTypes from 'prop-types'; | ||
| import without from 'lodash/without'; | ||
|
|
||
| import AppliedFilters from './components/AppliedFilters'; | ||
| import { defaultFilterState } from './useClinicPatientsFilters'; | ||
|
|
||
| const AppliedFiltersAdapter = ({ activeFilters, setActiveFilters }) => { | ||
| const { patientListSearchTextInput } = useSelector(({ blip }) => blip.patientListFilters); | ||
|
|
||
| const handleRemoveFilter = (filterKey, value) => { | ||
| switch (filterKey) { | ||
| case 'lastData': | ||
| setActiveFilters({ | ||
| ...activeFilters, | ||
| lastData: defaultFilterState.lastData, | ||
| lastDataType: defaultFilterState.lastDataType, | ||
| }); | ||
| break; | ||
|
|
||
| case 'timeInRange': | ||
| setActiveFilters({ | ||
| ...activeFilters, | ||
| timeInRange: without(activeFilters.timeInRange, value), | ||
| }); | ||
| break; | ||
|
|
||
| case 'patientTags': | ||
| setActiveFilters({ | ||
| ...activeFilters, | ||
| patientTags: without(activeFilters.patientTags, value), | ||
| }); | ||
| break; | ||
|
|
||
| case 'clinicSites': | ||
| setActiveFilters({ | ||
| ...activeFilters, | ||
| clinicSites: without(activeFilters.clinicSites, value), | ||
| }); | ||
| break; | ||
|
|
||
| default: | ||
| setActiveFilters({ | ||
| ...activeFilters, | ||
| [filterKey]: defaultFilterState[filterKey], | ||
| }); | ||
| } | ||
| }; | ||
|
|
||
| const hasSearchActive = !!patientListSearchTextInput; | ||
|
|
||
| return ( | ||
| <AppliedFilters | ||
| hasSearchActive={hasSearchActive} | ||
| filters={activeFilters} | ||
| onRemoveFilter={handleRemoveFilter} | ||
| /> | ||
| ); | ||
| }; | ||
|
|
||
| export default AppliedFiltersAdapter; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.