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
Elevate selected filter field values #40055
Conversation
@@ -242,6 +242,66 @@ describe("StringFilterValuePicker", () => { | |||
expect(onChange).toHaveBeenCalledWith(["t", "p"]); | |||
}); | |||
|
|||
it("should elevate selected field values on initial render", async () => { |
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.
All tests here with custom remapping to handle the most advance case.
|
query={query} | ||
stageIndex={stageIndex} | ||
column={column} | ||
values={["p", "c"]} |
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.
Let's also make sure that unchecking values doesn't move the items.
This can be a separate test case, or this one:
values={["p", "c"]} | |
values={["c"]} |
plus expect(checkboxes[0]).not.toBeChecked();
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.
Added a test
@@ -57,7 +57,7 @@ async function setupStringPicker({ | |||
setupFieldSearchValuesEndpoints(result.field_id, value, result.values); | |||
}); | |||
|
|||
renderWithProviders( | |||
const { rerender } = renderWithProviders( |
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.
Should this case be handled too?
2024-03-13.18-52-36.mp4
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.
Fixed, great catch!
@ranquild Did you forget to add a milestone to the issue for this PR? When and where should I add a milestone? |
Product doc https://www.notion.so/metabase/Show-the-selected-filter-values-on-top-of-multi-select-list-6e3f2e1880dc40bc8c50170236ca0aaa
Elevate selected field values on initial render when rendering them as a list of checkboxes.
How to verify: