[ResponseOps][Rules][Alerts] Link stack rule details page refresh button to alerts table#195736
Conversation
|
Pinging @elastic/response-ops (Team:ResponseOps) |
There was a problem hiding this comment.
Could you please add a unit test to test the new behavior?
| useKibana().services; | ||
| // The lastReloadRequestTime should be updated when the refreshToken changes | ||
| // eslint-disable-next-line react-hooks/exhaustive-deps | ||
| const lastReloadRequestTime = useMemo(() => +new Date(), [refreshToken]); |
There was a problem hiding this comment.
nit: For readability maybe we can do new Date().getTime(). +new Date() is a bit difficult to understand what it does.
There was a problem hiding this comment.
This isn't exactly what memo is meant to be used for. Is this a hack or is there an underlaying issue? Shouldn't this be done with an effect?
There was a problem hiding this comment.
Changed to getTime() in cae83a7 ✅
@jcger it's a temporary solution based on the two tools we already have at our disposal (refreshToken for the rule page and lastReloadRequestTime for the alerts table). In alerts-table-refactor I introduced an imperative handle to forward a couple of APIs such as the original refresh function, which we could use as a more definitive and cleaner solution 🙂
|
Starting backport for target branches: 8.15, 8.16, 8.x |
💚 Build Succeeded
Metrics [docs]Async chunks
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
|
…ton to alerts table (elastic#195736) ## Summary Forwards the reload request from the Stack Management rule detail page `🔄 Refresh` button to the alerts table. ## To verify 1. Create a Stack rule that fires alerts 2. Visit that rule's detail page 3. Check that the `🔄 Refresh` button correctly refreshes the alerts table (i.e. by changing the rule params and checking that the alerts update accordingly) ## References Fixes elastic#188405, elastic#183155 (cherry picked from commit 6a0ad10)
…ton to alerts table (elastic#195736) ## Summary Forwards the reload request from the Stack Management rule detail page `🔄 Refresh` button to the alerts table. ## To verify 1. Create a Stack rule that fires alerts 2. Visit that rule's detail page 3. Check that the `🔄 Refresh` button correctly refreshes the alerts table (i.e. by changing the rule params and checking that the alerts update accordingly) ## References Fixes elastic#188405, elastic#183155 (cherry picked from commit 6a0ad10)
…ton to alerts table (elastic#195736) ## Summary Forwards the reload request from the Stack Management rule detail page `🔄 Refresh` button to the alerts table. ## To verify 1. Create a Stack rule that fires alerts 2. Visit that rule's detail page 3. Check that the `🔄 Refresh` button correctly refreshes the alerts table (i.e. by changing the rule params and checking that the alerts update accordingly) ## References Fixes elastic#188405, elastic#183155 (cherry picked from commit 6a0ad10)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…esh button to alerts table (#195736) (#196652) # Backport This will backport the following commits from `main` to `8.15`: - [[ResponseOps][Rules][Alerts] Link stack rule details page refresh button to alerts table (#195736)](#195736) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Umberto Pepato","email":"umbopepato@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-10-17T09:46:29Z","message":"[ResponseOps][Rules][Alerts] Link stack rule details page refresh button to alerts table (#195736)\n\n## Summary\r\n\r\nForwards the reload request from the Stack Management rule detail page\r\n`🔄 Refresh` button to the alerts table.\r\n\r\n## To verify\r\n\r\n1. Create a Stack rule that fires alerts\r\n2. Visit that rule's detail page\r\n3. Check that the `🔄 Refresh` button correctly refreshes the alerts\r\ntable (i.e. by changing the rule params and checking that the alerts\r\nupdate accordingly)\r\n\r\n## References\r\n\r\nFixes #188405, #183155","sha":"6a0ad109087fd8b9efe9198a6df23f4658929c05","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team:ResponseOps","v9.0.0","backport:prev-major","v8.16.0","v8.15.3"],"title":"[ResponseOps][Rules][Alerts] Link stack rule details page refresh button to alerts table","number":195736,"url":"https://github.com/elastic/kibana/pull/195736","mergeCommit":{"message":"[ResponseOps][Rules][Alerts] Link stack rule details page refresh button to alerts table (#195736)\n\n## Summary\r\n\r\nForwards the reload request from the Stack Management rule detail page\r\n`🔄 Refresh` button to the alerts table.\r\n\r\n## To verify\r\n\r\n1. Create a Stack rule that fires alerts\r\n2. Visit that rule's detail page\r\n3. Check that the `🔄 Refresh` button correctly refreshes the alerts\r\ntable (i.e. by changing the rule params and checking that the alerts\r\nupdate accordingly)\r\n\r\n## References\r\n\r\nFixes #188405, #183155","sha":"6a0ad109087fd8b9efe9198a6df23f4658929c05"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.15"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195736","number":195736,"mergeCommit":{"message":"[ResponseOps][Rules][Alerts] Link stack rule details page refresh button to alerts table (#195736)\n\n## Summary\r\n\r\nForwards the reload request from the Stack Management rule detail page\r\n`🔄 Refresh` button to the alerts table.\r\n\r\n## To verify\r\n\r\n1. Create a Stack rule that fires alerts\r\n2. Visit that rule's detail page\r\n3. Check that the `🔄 Refresh` button correctly refreshes the alerts\r\ntable (i.e. by changing the rule params and checking that the alerts\r\nupdate accordingly)\r\n\r\n## References\r\n\r\nFixes #188405, #183155","sha":"6a0ad109087fd8b9efe9198a6df23f4658929c05"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.15","label":"v8.15.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Umberto Pepato <umbopepato@users.noreply.github.com>
…sh button to alerts table (#195736) (#196654) # Backport This will backport the following commits from `main` to `8.x`: - [[ResponseOps][Rules][Alerts] Link stack rule details page refresh button to alerts table (#195736)](#195736) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Umberto Pepato","email":"umbopepato@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-10-17T09:46:29Z","message":"[ResponseOps][Rules][Alerts] Link stack rule details page refresh button to alerts table (#195736)\n\n## Summary\r\n\r\nForwards the reload request from the Stack Management rule detail page\r\n`🔄 Refresh` button to the alerts table.\r\n\r\n## To verify\r\n\r\n1. Create a Stack rule that fires alerts\r\n2. Visit that rule's detail page\r\n3. Check that the `🔄 Refresh` button correctly refreshes the alerts\r\ntable (i.e. by changing the rule params and checking that the alerts\r\nupdate accordingly)\r\n\r\n## References\r\n\r\nFixes #188405, #183155","sha":"6a0ad109087fd8b9efe9198a6df23f4658929c05","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team:ResponseOps","v9.0.0","backport:prev-major","v8.16.0","v8.15.3"],"title":"[ResponseOps][Rules][Alerts] Link stack rule details page refresh button to alerts table","number":195736,"url":"https://github.com/elastic/kibana/pull/195736","mergeCommit":{"message":"[ResponseOps][Rules][Alerts] Link stack rule details page refresh button to alerts table (#195736)\n\n## Summary\r\n\r\nForwards the reload request from the Stack Management rule detail page\r\n`🔄 Refresh` button to the alerts table.\r\n\r\n## To verify\r\n\r\n1. Create a Stack rule that fires alerts\r\n2. Visit that rule's detail page\r\n3. Check that the `🔄 Refresh` button correctly refreshes the alerts\r\ntable (i.e. by changing the rule params and checking that the alerts\r\nupdate accordingly)\r\n\r\n## References\r\n\r\nFixes #188405, #183155","sha":"6a0ad109087fd8b9efe9198a6df23f4658929c05"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.15"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195736","number":195736,"mergeCommit":{"message":"[ResponseOps][Rules][Alerts] Link stack rule details page refresh button to alerts table (#195736)\n\n## Summary\r\n\r\nForwards the reload request from the Stack Management rule detail page\r\n`🔄 Refresh` button to the alerts table.\r\n\r\n## To verify\r\n\r\n1. Create a Stack rule that fires alerts\r\n2. Visit that rule's detail page\r\n3. Check that the `🔄 Refresh` button correctly refreshes the alerts\r\ntable (i.e. by changing the rule params and checking that the alerts\r\nupdate accordingly)\r\n\r\n## References\r\n\r\nFixes #188405, #183155","sha":"6a0ad109087fd8b9efe9198a6df23f4658929c05"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.15","label":"v8.15.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Umberto Pepato <umbopepato@users.noreply.github.com>
|
This PR didn't make it into the latest BC of v8.15.3. Updating the labels. |
|
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. |
…esh button to alerts table (#195736) (#196653) # Backport This will backport the following commits from `main` to `8.16`: - [[ResponseOps][Rules][Alerts] Link stack rule details page refresh button to alerts table (#195736)](#195736) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Umberto Pepato","email":"umbopepato@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-10-17T09:46:29Z","message":"[ResponseOps][Rules][Alerts] Link stack rule details page refresh button to alerts table (#195736)\n\n## Summary\r\n\r\nForwards the reload request from the Stack Management rule detail page\r\n`🔄 Refresh` button to the alerts table.\r\n\r\n## To verify\r\n\r\n1. Create a Stack rule that fires alerts\r\n2. Visit that rule's detail page\r\n3. Check that the `🔄 Refresh` button correctly refreshes the alerts\r\ntable (i.e. by changing the rule params and checking that the alerts\r\nupdate accordingly)\r\n\r\n## References\r\n\r\nFixes #188405, #183155","sha":"6a0ad109087fd8b9efe9198a6df23f4658929c05","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team:ResponseOps","v9.0.0","backport:prev-major","v8.16.0","v8.15.3"],"title":"[ResponseOps][Rules][Alerts] Link stack rule details page refresh button to alerts table","number":195736,"url":"https://github.com/elastic/kibana/pull/195736","mergeCommit":{"message":"[ResponseOps][Rules][Alerts] Link stack rule details page refresh button to alerts table (#195736)\n\n## Summary\r\n\r\nForwards the reload request from the Stack Management rule detail page\r\n`🔄 Refresh` button to the alerts table.\r\n\r\n## To verify\r\n\r\n1. Create a Stack rule that fires alerts\r\n2. Visit that rule's detail page\r\n3. Check that the `🔄 Refresh` button correctly refreshes the alerts\r\ntable (i.e. by changing the rule params and checking that the alerts\r\nupdate accordingly)\r\n\r\n## References\r\n\r\nFixes #188405, #183155","sha":"6a0ad109087fd8b9efe9198a6df23f4658929c05"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.15"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195736","number":195736,"mergeCommit":{"message":"[ResponseOps][Rules][Alerts] Link stack rule details page refresh button to alerts table (#195736)\n\n## Summary\r\n\r\nForwards the reload request from the Stack Management rule detail page\r\n`🔄 Refresh` button to the alerts table.\r\n\r\n## To verify\r\n\r\n1. Create a Stack rule that fires alerts\r\n2. Visit that rule's detail page\r\n3. Check that the `🔄 Refresh` button correctly refreshes the alerts\r\ntable (i.e. by changing the rule params and checking that the alerts\r\nupdate accordingly)\r\n\r\n## References\r\n\r\nFixes #188405, #183155","sha":"6a0ad109087fd8b9efe9198a6df23f4658929c05"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.15","label":"v8.15.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Umberto Pepato <umbopepato@users.noreply.github.com>


Summary
Forwards the reload request from the Stack Management rule detail page
🔄 Refreshbutton to the alerts table.To verify
🔄 Refreshbutton correctly refreshes the alerts table (i.e. by changing the rule params and checking that the alerts update accordingly)References
Fixes #188405, #183155