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

Frontend table filters from query string #925

Merged
merged 7 commits into from
Oct 21, 2022

Conversation

CDimonaco
Copy link
Member

Description

This pr derives from the pr #908, following @rtorrero proposal on query string filters feature.

This pr enables all the tables in trento webapp application to be filtered with query string parameters.
The configuration is declarative and enables these capabilities with option fields on columns.

Demo

trento_table_filters

Configuration examples:

{
        title: 'SID',
        key: 'sid',
        filterFromParams: true,
        filter: true
}

filter field and filterFromParams field should be present.

You can enable the filters an all columns and filters type.

For demo/feature purpose the sid and tags filters are enabled with query string on HostOverview screen.

How was this tested?

E2E testing with cypress, the component is compliant to unit testing with jest, but for pure testing purposes the filtering capabilities are tested with an e2e tests on the HostOverview screen with SID and Tags filters.

@CDimonaco CDimonaco added enhancement New feature or request ux javascript Pull requests that update Javascript code labels Oct 21, 2022
@CDimonaco CDimonaco self-assigned this Oct 21, 2022
Copy link
Contributor

@rtorrero rtorrero left a comment

Choose a reason for hiding this comment

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

Good stuff! As I said, I like the ability of enabling/disabling the search params per column. I made some minor comments, let me know if you agree

assets/js/components/Table/Table.jsx Outdated Show resolved Hide resolved
assets/js/components/Table/Table.jsx Outdated Show resolved Hide resolved
assets/js/components/HostsList.jsx Show resolved Hide resolved
Copy link
Contributor

@dottorblaster dottorblaster left a comment

Choose a reason for hiding this comment

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

A couple things to improve but generally speaking, great job!

assets/js/components/Table/Table.jsx Outdated Show resolved Hide resolved
assets/js/components/Table/filters.jsx Outdated Show resolved Hide resolved
assets/js/components/Table/Table.jsx Outdated Show resolved Hide resolved
Copy link
Contributor

@rtorrero rtorrero left a comment

Choose a reason for hiding this comment

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

Looks good now!

Copy link
Contributor

@dottorblaster dottorblaster left a comment

Choose a reason for hiding this comment

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

LGTM

@CDimonaco CDimonaco merged commit de746a3 into main Oct 21, 2022
@CDimonaco CDimonaco deleted the frontend_table_filters_from_query_string branch October 21, 2022 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request javascript Pull requests that update Javascript code ux
Development

Successfully merging this pull request may close these issues.

3 participants