Skip to content
This repository has been archived by the owner. It is now read-only.

Implement chips to reset filters #54

Merged
merged 4 commits into from Sep 14, 2017

Conversation

Projects
None yet
2 participants
@c-w
Copy link
Member

commented Sep 14, 2017

Scenario overview

Opening the dashboard: default filters are shown in chips

image

Selecting a source in the top-sources chart: the selection is reflected in the chips

image

Clearing the source filter via clicking on the X button on the chip: the removal is reflected in the charts

image

Selecting two filters (source and pipeline) is also reflected in the chips

image

It's possible to just clear one filter and leave the other one intact

image

Implementation notes

The screenshots above show a UI option where we always show the chips to make it explicit what the default value is for each filter. In 2aae159 I made a change to only show chips for non-default valued filters (so we wouldn't show the chip for "Source: all"). Both options are possible, just gotta make a call on which one we prefer. Here's a screenshot without the default-valued filters:

image

It's pretty easy to add or remove filter chips. Just let me know exactly what you'd like to control via the chips. I didn't add a filter for placeid because it's not actually part of the synced data. I didn't add a filter for maintopic or termFilters because it would be highly redundant with the component just below:

image

Unfortunately in the CSS one !important is necessary given that the MaterialUI chips set a bunch of styles on the elements instead of via classes... still better to have this one !important as opposed to having to put just a single CSS rule into the Javascript and therewith splitting the styling information over multiple files.

@c-w c-w requested a review from erikschlegel Sep 14, 2017

c-w added some commits Sep 14, 2017

@c-w c-w merged commit 04ec076 into master Sep 14, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@c-w c-w deleted the reset-filters-chips branch Sep 14, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.