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 custom saved queries and fix duplicate requests #7090

Merged

Conversation

asteriscos
Copy link
Member

@asteriscos asteriscos commented Oct 9, 2024

Description

This PR fixes automatic dashboard refresh and duplicate queries on the dashboard's initial load.
image

Issues Resolved

#7083

Evidence

Peek.2024-09-25.11-44.mp4

Test

  1. Remove the sample data, if present.
  2. Add the sample data to obtain the latest timestamps.
  3. Navigate to any application.
  4. Set a refresh interval of 5 seconds within the time filter.
  5. Observe whether the histogram updates over time.

Important

  1. Check if the URL updates with the savedQuery when you select an option or clear all (savedQueries)
  2. Additionally, verify that the AppFilters are being saved correctly in the URL
Peek.2024-09-27.13-27.mp4

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

@asteriscos asteriscos self-assigned this Oct 9, 2024
@asteriscos asteriscos mentioned this pull request Oct 9, 2024
2 tasks
@asteriscos asteriscos marked this pull request as ready for review October 9, 2024 16:44
@asteriscos asteriscos linked an issue Oct 9, 2024 that may be closed by this pull request
2 tasks
@asteriscos asteriscos changed the title Add custom saved queries Add custom saved queries and fix duplicate requests Oct 9, 2024
CHANGELOG.md Show resolved Hide resolved
@guidomodarelli
Copy link
Contributor

guidomodarelli commented Oct 10, 2024

TEST 🟢

DISCOVER
Peek.2024-10-10.17-03.discover.mp4
Peek.2024-10-10.17-40.mp4
Peek.2024-10-10.17-42.mp4

@guidomodarelli guidomodarelli self-assigned this Oct 14, 2024
@Machi3mfl Machi3mfl self-requested a review October 14, 2024 13:58
@Machi3mfl
Copy link
Member

Machi3mfl commented Oct 14, 2024

Tests

Legend:
⚪ no apply
⚫: none
🟢: pass
🟡: warning
🔴: fail
⚪: not applicable

UI

Test Chrome Firefox Safari
Render the tabs and verify whether the requests are duplicated (approximately two per visualization). 🟢 🟢
Click the refresh button to update the data grid with the results for the new time range. 🟢 🟢
Utilize the saved query UI handler to save, update, remove, or clear entries 🟢 🟢
Adjust the filters and ensure there are no duplicate requests. 🟢 🟢
Implement a filter using an absolute time range, which should only update upon clicking the refresh button. 🟢 🟢
Implement data grid pagination and verify that the results remain consistent when navigating through pages while the filters stay unchanged. 🟢 🟢
Utilize the auto-refresh feature for time filters and verify the requests. 🟢 🟢
Apply filters using visualizations 🟢 🟢
Create a report and verify the results displayed in the PDF. 🟢 🟢
Check cluster, endpoints summary, statistics 🟢 🟢
For vulnerability detection, examine filters and review saved queries 🟢 🟢
Click the refresh button to update the data grid with the results for the new time range.
Screen.Recording.2024-10-14.at.3.20.02.PM.mov
Screen.Recording.2024-10-15.at.9.25.27.AM.mov
Render the tabs and verify whether the requests are duplicated (approximately two per visualization).
Screen.Recording.2024-10-14.at.3.06.50.PM.mov
Screen.Recording.2024-10-15.at.9.26.37.AM.mov
Utilize the saved query UI handler to save, update, remove, or clear entries
Screen.Recording.2024-10-14.at.3.12.41.PM.mov
Screen.Recording.2024-10-15.at.9.33.14.AM.mov
Adjust the filters and ensure there are no duplicate requests.
Screen.Recording.2024-10-14.at.3.14.08.PM.mov
Screen.Recording.2024-10-15.at.9.35.15.AM.mov
Implement a filter using an absolute time range, which should only update upon clicking the refresh button.
Screen.Recording.2024-10-14.at.3.16.09.PM.mov
Screen.Recording.2024-10-15.at.9.37.16.AM.mov
Implement data grid pagination and verify that the results remain consistent when navigating through pages while the filters stay unchanged.
Screen.Recording.2024-10-14.at.3.18.34.PM.mov
Screen.Recording.2024-10-15.at.9.38.58.AM.mov
Utilize the auto-refresh feature for time filters and verify the requests.
Screen.Recording.2024-10-14.at.3.59.39.PM.mov
Apply filters using visualizations
Screen.Recording.2024-10-14.at.4.01.25.PM.mov
Screen.Recording.2024-10-15.at.9.41.15.AM.mov
Create a report and verify the results displayed in the PDF.
Screen.Recording.2024-10-14.at.4.02.23.PM.mov
Screen.Recording.2024-10-15.at.9.42.17.AM.mov
Check cluster, endpoints summary, statistics
Screen.Recording.2024-10-14.at.4.04.25.PM.mov
Screen.Recording.2024-10-15.at.9.43.18.AM.mov
For vulnerability detection, examine filters and review saved queries
Screen.Recording.2024-10-14.at.4.05.46.PM.mov
Screen.Recording.2024-10-15.at.9.45.30.AM.mov

@guidomodarelli
Copy link
Contributor

guidomodarelli commented Oct 14, 2024

Tests

Legend:
⚫: none
🟢: pass
🟡: warning
🔴: fail
⚪: not applicable

Discover and all sections with a search bar

🟢 Render the tabs and verify whether the requests are duplicated (approximately two per visualization).

CHROME - 🟢

image

image

🔴 The refresh does not function on the first attempt when selecting a saved query.

CHROME - 🔴

Peek 2024-10-14 21-02

Click the refresh button to update the data grid with the results for the new time range.

CHROME - 🟢

Peek 2024-10-14 21-30

Utilize the saved query UI handler to save, update, remove, or clear entries

CHROME - 🟢

Peek 2024-10-14 21-44

Adjust the filters and ensure there are no duplicate requests.

CHROME - 🟢

Peek.2024-10-14.22-00.webm
Implement data grid pagination and verify that the results remain consistent when navigating through pages while the filters stay unchanged.

CHROME - 🟢

Peek.2024-10-14.22-09.webm
Utilize the auto-refresh feature for time filters and verify the requests.

CHROME - 🟢

Peek.2024-10-14.22-13.webm
Apply filters using visualizations

CHROME - 🟢

Peek.2024-10-14.22-26.webm
Create a report and verify the results displayed in the PDF.

CHROME - 🟢

Peek.2024-10-15.10-53.mp4

FIREFOX - 🟢

Peek.2024-10-15.10-57.mp4

SAFARI - ⚫

Check cluster, endpoints summary, statistics

CHROME - 🟢

Peek.2024-10-15.11-02.mp4

FIREFOX - 🟢

Peek.2024-10-15.11-04.mp4

SAFARI - ⚫

For vulnerability detection, examine filters and review saved queries

CHROME - 🟢

Peek.2024-10-15.11-10.mp4

FIREFOX - 🟢

Peek.2024-10-15.11-12.mp4

SAFARI - ⚫

@Desvelao
Copy link
Member

@Machi3mfl, this seems to work with the latest changes. Could you update the development branch and try again?

🔴 Click the refresh button to update the data grid with the results for the new time range.

@guidomodarelli, this seems to work with the latest changes. Could you update the development branch and try again?

🔴 The refresh does not function on the first attempt when selecting a saved query.

Copy link
Contributor

Wazuh Core plugin code coverage (Jest) test % values
Statements 45.5% ( 400 / 879 )
Branches 41.09% ( 157 / 382 )
Functions 43.87% ( 136 / 310 )
Lines 45.69% ( 398 / 871 )

Copy link
Contributor

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

Main plugin code coverage (Jest) test % values
Statements 13.96% ( 4120 / 29509 )
Branches 9.19% ( 1773 / 19281 )
Functions 13.62% ( 971 / 7126 )
Lines 14.13% ( 4013 / 28391 )

@Desvelao
Copy link
Member

Desvelao commented Oct 15, 2024

wdp-pr-7090

Legend:
⚪ no apply
⚫: none
🟢: pass
🟡: warning
🔴: fail
⚪: not applicable

UI

Test Chrome Firefox Safari
Render the tabs and verify whether the requests are duplicated (approximately two per visualization). 🟢 🟢
Click the refresh button to update the data grid with the results for the new time range. 🟢 🟢
Utilize the saved query UI handler to save, update, remove, or clear entries 🟢 🟢
Adjust the filters and ensure there are no duplicate requests. 🟢 🟢
Implement a filter using an absolute time range, which should only update upon clicking the refresh button. 🟢 🟢
Implement data grid pagination and verify that the results remain consistent when navigating through pages while the filters stay unchanged. 🟢 🟢
Utilize the auto-refresh feature for time filters and verify the requests. 🟢 🟢
Apply filters using visualizations 🟢 🟢
Create a report and verify the results displayed in the PDF. 🟢 🟢
Check cluster, endpoints summary, statistics 🟢 🟢
For vulnerability detection, examine filters and review saved queries 🟢 🟢
Pin agent and unpin agent in the dashboard, check the requests 🟢 🟢

Details

🟢 Render the tabs and verify whether the requests are duplicated (approximately two per visualization).

Chrome - 🟢

image
Firefox - 🟢

image

Safari - ⚫

🟢 Click the refresh button to update the data grid with the results for the new time range.

Chrome - 🟢
image
image
image

Firefox - 🟢
image
image
image

Safari - ⚫

🟢 Utilize the saved query UI handler to save, update, remove, or clear entries

Chrome - 🟢
image

Firefox - 🟢
image

Safari - ⚫

🟢 Adjust the filters and ensure there are no duplicate requests.

Chrome - 🟢
image

Firefox - 🟢
image

Safari - ⚫

🟢 Implement a filter using an absolute time range, which should only update upon clicking the refresh button.

Chrome - 🟢
image

Firefox - 🟢
image

Safari - ⚫

🟢 Implement data grid pagination and verify that the results remain consistent when navigating through pages while the filters stay unchanged.

Chrome - 🟢
image

Firefox - 🟢
image

Safari - ⚫

🟢 Utilize the auto-refresh feature for time filters and verify the requests.

Chrome - 🟢
image
image

Firefox - 🟢
image
image

Safari - ⚫

🟢 Apply filters using visualizations

Chrome - 🟢
image

Firefox - 🟢
image

Safari - ⚫

🟢 Create a report and verify the results displayed in the PDF.

Chrome - 🟢
image
image
image

Firefox - 🟢
image
image

Safari - ⚫

🟢 Check cluster, endpoints summary, statistics

Chrome - 🟢
image
image

Firefox - 🟢
image
image

Safari - ⚫

🟢 For vulnerability detection, examine filters and review saved queries

Chrome - 🟢
image

Applying a saved query:
image

Firefox - 🟢
image

Applying a saved query:
image

Safari - ⚫

🟢 Pin agent and unpin agent in the dashboard, check the requests

Chrome - 🟢
image

Firefox - 🟢
image

Safari - ⚫

Copy link
Member

@Desvelao Desvelao left a comment

Choose a reason for hiding this comment

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

LGTM!

@asteriscos asteriscos merged commit 79837fe into 4.9.1 Oct 15, 2024
5 checks passed
@asteriscos asteriscos deleted the enhancement/7083-remove-duplicate-requests-in-dashboards branch October 15, 2024 14:13
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.

Improve dashboards performance
4 participants