Skip to content
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: Add show_search and show_quick_filters to ui.table #461

Merged
merged 10 commits into from
May 29, 2024

Conversation

mattrunyon
Copy link
Collaborator

@mattrunyon mattrunyon commented May 11, 2024

Fixes #443, Fixes #444. Also removes ui.table.quick_filter to align with design doc. Drops can_search for now since it was not implemented according to spec

from deephaven import empty_table
import deephaven.ui as ui

t = empty_table(1000).update("X=ii")

ui_table = ui.table(t, quick_filters={"X": ">50", "Y": "=20"}, show_quick_filters=True)
ui_with_search = ui.table(t, show_search=True)
ui_with_search_and_filter = ui.table(t, show_search=True, show_quick_filters=True)

@mattrunyon mattrunyon requested a review from mofojed May 11, 2024 04:48
@mattrunyon mattrunyon self-assigned this May 11, 2024
@mattrunyon
Copy link
Collaborator Author

@jnumainville The issues I ran into with testing were

  1. If components/table.py adds any default that is not None, the tests fail because the value is serialized for every UITable, but not part of the asserted value. In Jest we would use toMatchObject which validates the expected value is in the object, but doesn't prevent the object from having more key/value pairs.
  2. I added the quick_filters prop to components/table.py and made the fluent style set that prop with .quick_filter. This caused an issue with _with_dict_prop which I think I fixed properly. Since the param defaults to None, it exists in the dict so the .get returns None which can't be spread.

@dsmmcken
Copy link
Contributor

No of this quick filters stuff is expected to be fluent.

https://github.com/deephaven/deephaven-plugins/blob/main/plugins/ui/DESIGN.md#uitable

@mattrunyon
Copy link
Collaborator Author

Removed ui.table.quick_filter

Copy link
Member

@mofojed mofojed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just want some tests

@mattrunyon mattrunyon requested a review from mofojed May 28, 2024 20:15
@mattrunyon mattrunyon merged commit 4923017 into deephaven:main May 29, 2024
14 checks passed
@mattrunyon mattrunyon deleted the ui-table-show-search branch May 29, 2024 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show/hide quick filter by default Show/hide search bar by default
3 participants