Skip to content

[Security Solution][Detections] - Fix loading indicators in the rules management table#91925

Merged
banderror merged 9 commits intoelastic:masterfrom
banderror:rules-table-loading-indicators
Feb 22, 2021
Merged

[Security Solution][Detections] - Fix loading indicators in the rules management table#91925
banderror merged 9 commits intoelastic:masterfrom
banderror:rules-table-loading-indicators

Conversation

@banderror
Copy link
Copy Markdown
Contributor

@banderror banderror commented Feb 18, 2021

Base PR: #91342
Fixes: #91336

Summary

This PR fixes loading indicators used in the rules management table.

  • [Added] Blocking indicator. We show a spinner and "freeze" (fade out) the table when any of these changes: filters, sorting, pagination, manual click on Refresh button.
  • [Adjusted] Non-blocking indicator. We show a non-blocking "ribbon" (progress bar) only when auto-refresh is in progress.
  • Initial loading indicator. We show it only on the first table load.

Code and tests are slightly adjusted. Things to note are marked below in additional GH comments.

Screenshots

Initial load:
init_load

Manual refresh:
manual_refresh

Auto refresh:
auto_refresh

Pagination:
page_load

Backports

-> 7.13 #92270
-> 7.12 #92266

Checklist

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Cyclomatic complexity of the RulesTables component exceeded the limit. I disabled it for now. I think a decent refactoring is needed for the whole table (maybe the whole page).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yikes, we might want to file that in a tech debt ticket

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@dplumlee Agree, I'll do that. I'll add a few tickets and update my plan for 7.13+. I'm planning to focus on optimizing our rules-related endpoints now (#91265 is in fact about that). Once I'm done with the endpoints, I hope to switch to the client-side table implementation and this tech debt.

Thanks for reminding about being explicit and transparent 👍

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Here we go: #92160 and #92169

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Loader doesn't pass data-test-subj="loadingPanelAllRulesTable" to its children and renders data-test-subj="loading-spinner" internally.

Current Cypress tests use data-test-subj="loading-spinner" to identify this loading indicator. It works, but it's somewhat brittle.

Comment on lines 164 to 174
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

What do you think about using this click-and-wait approach by default? Think it's safer and the tests would probably be less flaky.

Some of the tests here were not working because of the lack of proper waiting for certain indicators on the page to show up and then disappear. I added this waiting where needed: either like here, inside the tasks, or outside of tasks (which seems to be a more common pattern in our codebase).

Comment on lines 75 to 85
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not sure if constants like FIVE_ROWS are needed. Unless a constant is a kind of default for the majority of tests, I'd keep the function and get rid of the constants.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

FYI cleaned this up in a separate commit.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Here's this generic loading-spinner

Comment on lines 91 to 92
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed and unskipped

@banderror banderror self-assigned this Feb 19, 2021
@banderror banderror added bug Fixes for quality problems that affect the customer experience release_note:fix Team:Detections and Resp Security Detection Response Team v7.12.0 v8.0.0 labels Feb 19, 2021
@banderror banderror requested review from a team and yctercero February 19, 2021 18:22
@banderror banderror marked this pull request as ready for review February 19, 2021 18:22
@banderror banderror requested a review from a team as a code owner February 19, 2021 18:22
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/security-detections-response (Team:Detections and Resp)

@banderror banderror added the Feature:Detection Rules Security Solution rules and Detection Engine label Feb 19, 2021
@banderror banderror added the Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. label Feb 19, 2021
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

Copy link
Copy Markdown
Contributor

@dplumlee dplumlee left a comment

Choose a reason for hiding this comment

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

This all looks good! If we're not too far over the complexity max for the rules table file it might be worth a small refactor to not have to disable it for this pr, otherwise we should open a ticket for it to be addressed in tech debt next release. Actually either way we should open a ticket being so close to the max, but optimally we obv don't want to disable lint rules for entire files. Maybe just around a certain function if possible?

@banderror
Copy link
Copy Markdown
Contributor Author

@banderror banderror added the auto-backport Deprecated - use backport:version if exact versions are needed label Feb 22, 2021
@banderror banderror removed the auto-backport Deprecated - use backport:version if exact versions are needed label Feb 22, 2021
@banderror banderror force-pushed the rules-table-loading-indicators branch from 9c45c63 to 9a41944 Compare February 22, 2021 15:47
@banderror banderror added the auto-backport Deprecated - use backport:version if exact versions are needed label Feb 22, 2021
@banderror banderror merged commit 4511fe5 into elastic:master Feb 22, 2021
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Feb 22, 2021
… management table (elastic#91925)

**Base PR:** elastic#91342
**Fixes:** elastic#91336

## Summary

This PR fixes loading indicators used in the rules management table.

- [Added] Blocking indicator. We show a spinner and "freeze" (fade out) the table when any of these changes: filters, sorting, pagination, manual click on Refresh button.
- [Adjusted] Non-blocking indicator. We show a non-blocking "ribbon" (progress bar) only when auto-refresh is in progress.
- Initial loading indicator. We show it only on the first table load.

Code and tests are slightly adjusted. Things to note are marked below in additional GH comments.

Co-authored-by: Yara Tercero <yara.tercero@elastic.co>
@kibanamachine
Copy link
Copy Markdown
Contributor

💚 Backport successful

7.12 / #92266

Successful backport PRs will be merged automatically after passing CI.

@banderror banderror deleted the rules-table-loading-indicators branch February 22, 2021 19:11
@banderror banderror restored the rules-table-loading-indicators branch February 22, 2021 19:24
@banderror banderror deleted the rules-table-loading-indicators branch February 22, 2021 19:29
kibanamachine added a commit that referenced this pull request Feb 22, 2021
… management table (#91925) (#92266)

**Base PR:** #91342
**Fixes:** #91336

## Summary

This PR fixes loading indicators used in the rules management table.

- [Added] Blocking indicator. We show a spinner and "freeze" (fade out) the table when any of these changes: filters, sorting, pagination, manual click on Refresh button.
- [Adjusted] Non-blocking indicator. We show a non-blocking "ribbon" (progress bar) only when auto-refresh is in progress.
- Initial loading indicator. We show it only on the first table load.

Code and tests are slightly adjusted. Things to note are marked below in additional GH comments.

Co-authored-by: Yara Tercero <yara.tercero@elastic.co>

Co-authored-by: Georgii Gorbachev <georgii.gorbachev@elastic.co>
Co-authored-by: Yara Tercero <yara.tercero@elastic.co>
@kibanamachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 7.7MB 7.7MB +878.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @banderror @yctercero

@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Feb 23, 2021
banderror added a commit to banderror/kibana that referenced this pull request Feb 24, 2021
… management table (elastic#91925)

**Base PR:** elastic#91342
**Fixes:** elastic#91336

## Summary

This PR fixes loading indicators used in the rules management table.

- [Added] Blocking indicator. We show a spinner and "freeze" (fade out) the table when any of these changes: filters, sorting, pagination, manual click on Refresh button.
- [Adjusted] Non-blocking indicator. We show a non-blocking "ribbon" (progress bar) only when auto-refresh is in progress.
- Initial loading indicator. We show it only on the first table load.

Code and tests are slightly adjusted. Things to note are marked below in additional GH comments.

Co-authored-by: Yara Tercero <yara.tercero@elastic.co>
@banderror
Copy link
Copy Markdown
Contributor Author

On it ^^^

@banderror banderror removed the v7.11.2 label Feb 24, 2021
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Feb 24, 2021
banderror added a commit that referenced this pull request Feb 24, 2021
… management table (#91925) (#92270)

**Base PR:** #91342
**Fixes:** #91336

## Summary

This PR fixes loading indicators used in the rules management table.

- [Added] Blocking indicator. We show a spinner and "freeze" (fade out) the table when any of these changes: filters, sorting, pagination, manual click on Refresh button.
- [Adjusted] Non-blocking indicator. We show a non-blocking "ribbon" (progress bar) only when auto-refresh is in progress.
- Initial loading indicator. We show it only on the first table load.

Code and tests are slightly adjusted. Things to note are marked below in additional GH comments.

Co-authored-by: Yara Tercero <yara.tercero@elastic.co>

Co-authored-by: Yara Tercero <yara.tercero@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Deprecated - use backport:version if exact versions are needed bug Fixes for quality problems that affect the customer experience Feature:Detection Rules Security Solution rules and Detection Engine release_note:fix Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v7.12.0 v7.13.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants