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

Add standard modules filters management #6534

Merged
merged 44 commits into from
Apr 5, 2024

Conversation

Machi3mfl
Copy link
Member

@Machi3mfl Machi3mfl commented Mar 19, 2024

Description

This PR, adds a standard solution to manage the filters and fetching data using the Data Source added concept.
The solution is applied in the vulnerability detection module.

Issues Resolved

Closes #6499

Evidence

Screen.Recording.2024-03-27.at.16.55.26.mov

Test cases

Global

Test Chrome Firefox Safari
Check data results consistency between inventory and dashboard tab
Check the filters persist between the inventory and dashboard tab
Check the filters are cleaned when throwing in the events tab
Check cluster-manager filter on tabs. Must be applied when the tab is shown (all tabs)
Check rule.groups filter on Events tab
Check pinned agent filter on tabs
Check the request with hidden filters applied (allow agents, hide manager alerts)
Check the fixer filter cannot be removed from the filter bar (the remove icon is hidden)
  • Check data results consistency between inventory and dashboard tab
Screen.Recording.2024-03-27.at.16.56.57.mov
  • Check the filters persist between the inventory and dashboard tab
Screen.Recording.2024-03-27.at.16.56.57.mov
  • Check the filters are cleaned when throwing in the events tab
Screen.Recording.2024-03-27.at.17.03.24.mov
  • Check cluster-manager filter on tabs. Must be applied when the tab is shown (all tabs)
Screen.Recording.2024-03-31.at.12.15.01.mov
  • Check rule.groups filter on Events tab
Screen.Recording.2024-03-31.at.12.16.16.mov
  • Check pinned agent filter on tabs
Screen.Recording.2024-03-31.at.12.18.52.mov
  • Check the request with hidden filters applied (allow agents, hide manager alerts)

Enable/disable the hideManagerAlerts settings on App Settings

Screenshot 2024-03-31 at 12 29 47
Screen.Recording.2024-03-31.at.12.33.11.mov
Screenshot 2024-03-31 at 12 34 15
  • Check the fixer filter cannot be removed from the filter bar
Screen.Recording.2024-04-03.at.14.17.47.mov

Dashboard tab

Test Chrome Firefox Safari
Use search bar input to filter any word and check if the dashboard shows the corresponding results
Select an option from one of the recommended filters and check that the corresponding filter is added and the dashboard changes according to the applied filter
Add a filter through interaction with a visualization and check that the dashboard updates
Use the input and type an incorrect word to check if the no results message is shown
  • Use search bar input to filter any word and check if the dashboard shows the corresponding results
Screen.Recording.2024-03-27.at.17.05.36.mov
  • Select an option from one of the recommended filters and check that the corresponding filter is added and the dashboard changes according to the applied filter
Screen.Recording.2024-03-27.at.17.06.10.mov
  • Add a filter through interaction with a visualization and check that the dashboard updates
  • Use the input and type an incorrect word to check if the no results message is shown

Screenshot 2024-03-27 at 17 07 50

Inventory tab

Test Chrome Firefox Safari
Use search bar input to filter any word and check if the table shows the corresponding results.
Use the input and type an incorrect word to check if the no results message is shown.
Use the add filters button, select any filter and check if the table shows the corresponding results.
Use the page and rows per page selector, and check if is working as expected.
Use the data grid toolbar controls functionality (columns selector, density, sort fields, full screen).
Use export formatted control (export table to CSV button).
Use the header columns controls (column visibility, column sorting, column position).
Click on the inspect document button and check the flyout functionality, the details must show the row clicked on the table.
  • Use search bar input to filter any word and check if the table shows the corresponding results
Screen.Recording.2024-03-27.at.17.10.03.mov
  • Use the input and type an incorrect word to check if the no results message is shown
Screen.Recording.2024-03-27.at.17.09.13.mov
  • Use the add filters button, select any filter and check if the table shows the corresponding results.
Screen.Recording.2024-03-27.at.17.10.35.mov
  • Use the page and rows per page selector, and check if working as expected
Screen.Recording.2024-03-27.at.17.12.12.mov
  • Use the data grid toolbar controls functionality (columns selector, density, sort fields, full screen)
Screen.Recording.2024-03-27.at.17.13.29.mov
  • Use export formatted control (export table to CSV button)
Screen.Recording.2024-03-27.at.17.13.29.mov
  • Use the header columns controls (column visibility, column sorting, column position)
Screen.Recording.2024-03-27.at.17.13.29.mov
  • Click on the inspect document button and check the flyout functionality, the details must show the row clicked on the table.
Screen.Recording.2024-03-27.at.17.16.28.mov

Events tab (Discover)

Search bar

Test Chrome Firefox Safari
Apply filters using search bar input
Apply filters using the search bar add filter feature
Apply filters using the date picker
Apply filters with no results (Check the No results match your search criteria message)
Use the saved queries feature (Check saved queries CRUD)
  • Apply filters using search bar input
Screen.Recording.2024-03-31.at.11.53.54.mov
  • Apply filters using the search bar add filter feature
Screen.Recording.2024-03-31.at.11.54.46.mov
  • Apply filters using the date picker
Screen.Recording.2024-03-31.at.12.03.49.mov
  • Apply filters with no results (Check the No results match your search criteria message)
Screen.Recording.2024-03-31.at.12.04.32.mov
  • Use the saved queries feature (Check saved queries CRUD)
Screen.Recording.2024-03-31.at.12.05.04.mov

Histogram chart

Test Chrome Firefox Safari
Check histogram chart hits consistency
Use chart options (three points: maximize, minimize, inspect)
  • Check histogram chart hits consistency
Screen.Recording.2024-03-31.at.12.07.11.mov
  • Use chart options (three points: maximize, minimize, inspect)
Screen.Recording.2024-03-31.at.12.09.21.mov

Data grid

Test Chrome Firefox Safari
Check all table header features (sort, show/hide columns, density, etc)
Check table pagination and rows per page
Check document detail flyout
  • Check all table header features (sort, show/hide columns, density, etc)
Screen.Recording.2024-03-31.at.12.09.52.mov
  • Check table pagination and rows per page
Screen.Recording.2024-03-31.at.12.11.11.mov
  • Check document detail flyout
Screen.Recording.2024-03-31.at.12.12.45.mov

Check List

  • All tests pass
    • yarn test:jest
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

@Machi3mfl Machi3mfl linked an issue Mar 19, 2024 that may be closed by this pull request
@Machi3mfl Machi3mfl marked this pull request as ready for review March 31, 2024 20:23
@Machi3mfl Machi3mfl requested a review from a team March 31, 2024 20:23
@jbiset jbiset self-requested a review April 3, 2024 12:27
@yenienserrano yenienserrano self-requested a review April 3, 2024 18:19
@yenienserrano
Copy link
Member

yenienserrano commented Apr 3, 2024

Test cases

Global

Test Chrome Firefox Safari
Check data results consistency between inventory and dashboard tab 🟢
Check the filters persist between the inventory and dashboard tab 🟢
Check the filters are cleaned when throwing in the events tab 🟢
Check cluster-manager filter on tabs. Must be applied when the tab is shown (all tabs) 🟢
Check rule.groups filter on Events tab 🟢
Check pinned agent filter on tabs 🟢
Check the request with hidden filters applied (allow agents, hide manager alerts) 🟢
Check the fixer filter cannot be removed from the filter bar (the remove icon is hidden) 🟢
  • Check data results consistency between inventory and dashboard tab
image image
  • Check the filters persist between the inventory and dashboard tab
image image
  • Check the filters are cleaned when throwing in the events tab
image image
  • Check cluster-manager filter on tabs. Must be applied when the tab is shown (all tabs)
image image image
  • Check rule.groups filter on Events tab
image
  • Check pinned agent filter on tabs
image image image
  • Check the request with hidden filters applied (allow agents, hide manager alerts)
image
  • Check the fixer filter cannot be removed from the filter bar
Grabacion.de.pantalla.2024-04-04.a.las.8.53.13.a.m.mov

Dashboard tab

Test Chrome Firefox Safari
Use search bar input to filter any word and check if the dashboard shows the corresponding results 🟢
Select an option from one of the recommended filters and check that the corresponding filter is added and the dashboard changes according to the applied filter 🟢
Add a filter through interaction with a visualization and check that the dashboard updates 🟢
Use the input and type an incorrect word to check if the no results message is shown 🟢
  • Use search bar input to filter any word and check if the dashboard shows the corresponding results
image
  • Select an option from one of the recommended filters and check that the corresponding filter is added and the dashboard changes according to the applied filter
image
  • Add a filter through interaction with a visualization and check that the dashboard updates
image
  • Use the input and type an incorrect word to check if the no results message is shown
image

Inventory tab

Test Chrome Firefox Safari
Use search bar input to filter any word and check if the table shows the corresponding results. 🟢
Use the input and type an incorrect word to check if the no results message is shown. 🟢
Use the add filters button, select any filter and check if the table shows the corresponding results. 🟢
Use the page and rows per page selector, and check if is working as expected. 🟢
Use the data grid toolbar controls functionality (columns selector, density, sort fields, full screen). 🟢
Use export formatted control (export table to CSV button). 🟢
Use the header columns controls (column visibility, column sorting, column position). 🟢
Click on the inspect document button and check the flyout functionality, the details must show the row clicked on the table. 🟢
  • Use search bar input to filter any word and check if the table shows the corresponding results
image
  • Use the input and type an incorrect word to check if the no results message is shown
image
  • Use the add filters button, select any filter and check if the table shows the corresponding results.
image
  • Use the page and rows per page selector, and check if working as expected
image
  • Use the data grid toolbar controls functionality (columns selector, density, sort fields, full screen)
image image image image
  • Use export formatted control (export table to CSV button)
image
  • Use the header columns controls (column visibility, column sorting, column position)
image
  • Click on the inspect document button and check the flyout functionality, the details must show the row clicked on the table.
image

Events tab (Discover)

Search bar

Test Chrome Firefox Safari
Apply filters using search bar input 🟢
Apply filters using the search bar add filter feature 🟢
Apply filters using the date picker 🟢
Apply filters with no results (Check the No results match your search criteria message) 🟢
Use the saved queries feature (Check saved queries CRUD) 🟢
  • Apply filters using search bar input
image
  • Apply filters using the search bar add filter feature
image
  • Apply filters using the date picker
image
  • Apply filters with no results (Check the No results match your search criteria message)
image
  • Use the saved queries feature (Check saved queries CRUD)
image image image image

Histogram chart

Test Chrome Firefox Safari
Check histogram chart hits consistency 🟢
Use chart options (three points: maximize, minimize, inspect) 🟢
  • Check histogram chart hits consistency
image
  • Use chart options (three points: maximize, minimize, inspect)
image image image

Data grid

Test Chrome Firefox Safari
Check all table header features (sort, show/hide columns, density, etc) 🟢
Check table pagination and rows per page 🟢
Check document detail flyout 🟢
  • Check all table header features (sort, show/hide columns, density, etc)
image image image image image
  • Check table pagination and rows per page
image
  • Check document detail flyout
image

@jbiset
Copy link
Member

jbiset commented Apr 3, 2024

Test cases

Global

Test Chrome Firefox Safari
Check data results consistency between inventory and dashboard tab 🟢 🟢
Check the filters persist between the inventory and dashboard tab 🟢 🟢
Check the filters are cleaned when throwing in the events tab 🟢 🟢
Check cluster-manager filter on tabs. Must be applied when the tab is shown (all tabs) 🟢 🟢
Check rule.groups filter on Events tab 🟢 🟢
Check pinned agent filter on tabs 🟢 🟢
Check the request with hidden filters applied (allow agents, hide manager alerts) 🟢 🟢
Check the fixer filter cannot be removed from the filter bar (the remove icon is hidden) 🟢 🟢
  • Check data results consistency between inventory and dashboard tab 🟢

Chrome 🟢

Global1_Chrome.webm

Firefox 🟢

Global1_Firefox.webm
  • Check the filters persist between the inventory and dashboard tab 🟢

Chrome 🟢

Global1_Chrome.webm

Firefox 🟢

Global1_Firefox.webm
  • Check the filters are cleaned when throwing in the events tab 🟢

Chrome 🟢

Global3_Chrome.webm

Firefox 🟢

Global3_Firefox.webm
  • Check cluster-manager filter on tabs. Must be applied when the tab is shown (all tabs) 🟢

Chrome 🟢

image

image

image

Firefox 🟢

image

image

image

  • Check rule.groups filter on Events tab 🟢

Chrome 🟢

image

Firefox 🟢

image

  • Check pinned agent filter on tabs 🟢

Chrome 🟢

Global6_Chrome.webm

Firefox 🟢

Global6_Firefox.webm
  • Check the request with hidden filters applied (allow agents, hide manager alerts) 🟢

Enable/disable the hideManagerAlerts settings on App Settings

image

Chrome 🟢

image

Firefox 🟢

image

  • Check the fixer filter cannot be removed from the filter bar 🟢

Chrome 🟢

Global8_Chrome.webm

Firefox 🟢

Global8_Firefox.webm

Dashboard tab

Test Chrome Firefox Safari
Use search bar input to filter any word and check if the dashboard shows the corresponding results 🟢 🟢
Select an option from one of the recommended filters and check that the corresponding filter is added and the dashboard changes according to the applied filter 🟢 🟢
Add a filter through interaction with a visualization and check that the dashboard updates 🟢 🟢
Use the input and type an incorrect word to check if the no results message is shown 🟢 🟢
  • Use search bar input to filter any word and check if the dashboard shows the corresponding results 🟢

Chrome 🟢

Dashboard1_Chrome.webm

Firefox 🟢

Dashboard1_Firefox.webm
  • Select an option from one of the recommended filters and check that the corresponding filter is added and the dashboard changes according to the applied filter 🟢

Chrome 🟢

Dashboard2_Chrome.webm

Firefox 🟢

Dashboard2_Firefox.webm
  • Add a filter through interaction with a visualization and check that the dashboard updates 🟢

Chrome 🟢

Dashboard3_Chrome.webm

Firefox 🟢

Dashboard3_Firefox.webm
  • Use the input and type an incorrect word to check if the no results message is shown 🟢

Chrome 🟢

image

Firefox 🟢

image

Inventory tab

Test Chrome Firefox Safari
Use search bar input to filter any word and check if the table shows the corresponding results. 🟢 🟢
Use the input and type an incorrect word to check if the no results message is shown. 🟢 🟢
Use the add filters button, select any filter and check if the table shows the corresponding results. 🟢 🟢
Use the page and rows per page selector, and check if is working as expected. 🟢 🟢
Use the data grid toolbar controls functionality (columns selector, density, sort fields, full screen). 🟢 🟢
Use export formatted control (export table to CSV button). 🟢 🟢
Use the header columns controls (column visibility, column sorting, column position). 🟡 🟡
Click on the inspect document button and check the flyout functionality, the details must show the row clicked on the table. 🟢 🟢
  • Use search bar input to filter any word and check if the table shows the corresponding results 🟢

Chrome 🟢

Inventory1_Chrome.webm

Firefox 🟢

Inventory1_Firefox.webm
  • Use the input and type an incorrect word to check if the no results message is shown 🟢

Chrome 🟢

image

Firefox 🟢

image

  • Use the add filters button, select any filter and check if the table shows the corresponding results. 🟢

Chrome 🟢

Inventory3_Chrome.webm

Firefox 🟢

Inventory3_Firefox.webm
  • Use the page and rows per page selector, and check if working as expected 🟢

Chrome 🟢

Inventory4_Chrome.webm

Firefox 🟢

Inventory4_FIrefox.webm
  • Use the data grid toolbar controls functionality (columns selector, density, sort fields, full screen) 🟢

Chrome 🟢

Inventory5_Chrome.webm

Firefox 🟢

Inventory5_Firefox.webm
  • Use export formatted control (export table to CSV button) 🟢

Chrome 🟢

Inventory6_Chrome.webm

image

Firefox 🟢

Inventory6_Firefox.webm

image

  • Use the header columns controls (column visibility, column sorting, column position) 🟡

When you move a column to the right, then if you want to move it to the left it doesn't work. In the same way in reverse.

Chrome 🟡

Inventory7_Chrome.webm

Firefox 🟡

Inventory7_Firefox.webm
  • Click on the inspect document button and check the flyout functionality, the details must show the row clicked on the table. 🟢

Chrome 🟢

Inventory8_Chrome.webm

Firefox 🟢

Inventory8_Firefox.webm

Events tab (Discover)

Search bar

Test Chrome Firefox Safari
Apply filters using search bar input 🟢 🟢
Apply filters using the search bar add filter feature 🟢 🟢
Apply filters using the date picker 🟢 🟢
Apply filters with no results (Check the No results match your search criteria message) 🟢 🟢
Use the saved queries feature (Check saved queries CRUD) 🟡 🟡
  • Apply filters using search bar input 🟢

Chrome 🟢

Events1_Chrome.webm

Firefox 🟢

Events1_Firefox.webm
  • Apply filters using the search bar add filter feature 🟢

Chrome 🟢

Events2_Chrome.webm

Firefox 🟢

Events2_Firefox.webm
  • Apply filters using the date picker 🟢

Chrome 🟢

Events3_Chrome.webm

Firefox 🟢

Events3_Firefox.webm
  • Apply filters with no results (Check the No results match your search criteria message) 🟢

Chrome 🟢

image

Firefox 🟢

image

  • Use the saved queries feature (Check saved queries CRUD) 🟡

**When a saved query is applied and the Clear button in the saved queries options is pressed, all filters are eliminated, including fixed filters. (See in Firefox evidence) **

Chrome 🟡

Events5_Chrome.webm

Firefox 🟡

Events5_Firefox.webm

Histogram chart

Test Chrome Firefox Safari
Check histogram chart hits consistency 🟢 🟢
Use chart options (three points: maximize, minimize, inspect) 🟢 🟢
  • Check histogram chart hits consistency 🟢

Chrome 🟢

Histogram1_Chrome.webm

Firefox 🟢

Histogram1_Firefox.webm
  • Use chart options (three points: maximize, minimize, inspect) 🟢

Chrome 🟢

Histogram2_Chrome.webm

Firefox 🟢

Histogram2_Firefox.webm

Data grid

Test Chrome Firefox Safari
Check all table header features (sort, show/hide columns, density, etc) 🟡 🟡
Check table pagination and rows per page 🟢 🟢
Check document detail flyout 🟢 🟢
  • Check all table header features (sort, show/hide columns, density, etc) 🟡

In both Chrome and Firefox, moving columns from the header does not work correctly.
Only in Chrome, when you swap the columns in the Sort Fields dropdown, the entire list turns red.

Chrome 🟡

DataGrid1_Chrome.webm

Firefox 🟡

DataGrid1_Firefox.webm
  • Check table pagination and rows per page 🟢

Chrome 🟢

DataGrid1_Chrome.webm

Firefox 🟢

DataGrid1_Firefox.webm
  • Check document detail flyout 🟢

Chrome 🟢

DataGrid3_Chrome.webm

Firefox 🟢

DataGrid3_Firefox.webm

@yenienserrano
Copy link
Member

in events of other applications the view is broken

image

Copy link
Contributor

github-actions bot commented Apr 5, 2024

Wazuh Core plugin code coverage (Jest) test % values
Statements 31.12% ( 286 / 919 )
Branches 29.88% ( 107 / 358 )
Functions 28.1% ( 86 / 306 )
Lines 30.71% ( 278 / 905 )

Copy link
Contributor

github-actions bot commented Apr 5, 2024

Wazuh Check Updates plugin code coverage (Jest) test % values
Statements 76.44% ( 172 / 225 )
Branches 58.65% ( 61 / 104 )
Functions 61.7% ( 29 / 47 )
Lines 76.44% ( 172 / 225 )

Copy link
Contributor

github-actions bot commented Apr 5, 2024

Main plugin code coverage (Jest) test % values
Statements 10.84% ( 3769 / 34767 )
Branches 7.31% ( 1666 / 22784 )
Functions 10.5% ( 871 / 8291 )
Lines 10.99% ( 3663 / 33324 )

@Machi3mfl
Copy link
Member Author

in events of other applications the view is broken

image

Thanks @yenienserrano.
This happens because we refactored the discovery used in the events tab for all modules. We are going to solve this problem when we refactor the modules one by one. This is the related issue: #6477

Copy link
Member

@jbiset jbiset left a comment

Choose a reason for hiding this comment

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

CR: 🟢

Test UI 🟢 (with details 🟡 )

Taking into account that the tests marked with yellow are non-breaking details, this PR is approved

@asteriscos asteriscos merged commit 711f798 into 4.9.0 Apr 5, 2024
4 checks passed
@asteriscos asteriscos deleted the feat/6499-standard-module-filters-management branch April 5, 2024 18:23
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.

Standardize filter management mechanisms
4 participants