[Security Solution][Detections] - Fix loading indicators in the rules management table#91925
Conversation
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
yikes, we might want to file that in a tech debt ticket
There was a problem hiding this comment.
@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 👍
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
FYI cleaned this up in a separate commit.
There was a problem hiding this comment.
Here's this generic loading-spinner
There was a problem hiding this comment.
Fixed and unskipped
|
Pinging @elastic/security-detections-response (Team:Detections and Resp) |
|
Pinging @elastic/security-solution (Team: SecuritySolution) |
dplumlee
left a comment
There was a problem hiding this comment.
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?
|
I added new tickets for the tech debt and refactoring: |
9c45c63 to
9a41944
Compare
… 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>
… 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>
💚 Build SucceededMetrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
|
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. |
… 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>
|
On it ^^^ |
… 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>
Base PR: #91342
Fixes: #91336
Summary
This PR fixes loading indicators used in the rules management table.
Code and tests are slightly adjusted. Things to note are marked below in additional GH comments.
Screenshots
Initial load:

Manual refresh:

Auto refresh:

Pagination:

Backports
-> 7.13 #92270
-> 7.12 #92266
Checklist