-
Notifications
You must be signed in to change notification settings - Fork 571
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
feat: multi-selection time period filters #4507
Conversation
7e3f051
to
de3c702
Compare
The Apply button is currently displaying "Apply (1)" for any combination of time periods because we pass all selected options as one array of values like so:
The "Ways to buy" filter, however, can display "Apply (2)" when two options are selected because it passes each selected option as a separate filter like so:
|
de3c702
to
500eda5
Compare
This looks good. About the designs, I thought we were trying to push more into the direction of using checkmarks instead of toggle switches to have more consistent behavior in all filter types. It offers a better UX (since the user will expect to check an item by pressing anywhere in the row instead of only selecting the toggle switch). But I see that the filters specs made by CX are designed differently than the ones made by FX. @samchieng do you mind if you clear this out to make sure we don't have more different type of filters in the future.
That's great, that's the behavior we want.
Ideally we should be showing this as 1 as well. Take a look at this eigen/src/lib/Components/FilterModal/FilterModal.tsx Lines 177 to 187 in ac5ac0a
eigen/src/lib/Components/FilterModal/FilterModal.tsx Lines 603 to 614 in ac5ac0a
|
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.
Nice, and thanks for leading this mob 🙏
|
||
expect(item).not.toBeUndefined() | ||
if (item) { | ||
expect(extractText(item)).toContain("2020, 2000") |
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.
Based on real-world data I was expecting to see these as ranges ("2000–2010" etc) — but this is fine bc they match the mock data, yeah?
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.
That's correct. I confirmed by changing the mocked data to ["Roger", "Robert"]
and observing that the result was a comma-separated string "Roger, Robert"
.
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.
LGTM 👍 💯
@MounirDhahri yes, apologies for the inconsistencies right now! Currently collaborating with Tricia to refine the final filter specs. |
500eda5
to
3077a51
Compare
This PR will be in a draft state until the work to place it behind a feature flag is complete. |
3077a51
to
df78831
Compare
784d3ff
to
9eca6ad
Compare
includeArtworksByFollowedArtists: false, | ||
inquireableOnly: false, | ||
latestCreatedYear: undefined, | ||
majorPeriods: undefined, | ||
majorPeriods: [], |
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.
I didn't put this behind a feature flag because I don't think that the actual value matters for the single-selection implementation, as long as there is one.
I tested the "All" option on the time periods filter with and without the feature flag to confirm this, and both the results and the filters screen behaved as expected.
9eca6ad
to
2d3f1be
Compare
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.
Looks good to me. Feel free to merge after the changelog conflict is resolved 😞
2d3f1be
to
b7448f2
Compare
The type of this PR is: Feature
This PR resolves FX-2624
This PR is the work of @dzucconi, @dblandin, and @anandaroop
Description
Screenshots
Before
After
PR Checklist (tick all before merging)