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

[RAM] add refresh functionality to alert table #139669

Merged
merged 4 commits into from
Aug 30, 2022

Conversation

XavierM
Copy link
Contributor

@XavierM XavierM commented Aug 29, 2022

Summary

We need user of the alert table to be able to refresh the alert table when they want. To do that we added a new prop refreshNow and we expect this value to be set like new Date().getTime() and each time this prop changed, then we will re-run the query with the same parameter.

#134892

Checklist

@XavierM XavierM added release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.5.0 v8.4.2 labels Aug 29, 2022
@XavierM XavierM self-assigned this Aug 29, 2022
@XavierM XavierM requested a review from a team as a code owner August 29, 2022 20:01
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@XavierM
Copy link
Contributor Author

XavierM commented Aug 29, 2022

@maryam-saeidi, can you please check if this PR do what you expected? thanks in advance!

Copy link
Member

@maryam-saeidi maryam-saeidi left a comment

Choose a reason for hiding this comment

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

Awesome! ✨

This will close this ticket: #134892, right?

@XavierM XavierM enabled auto-merge (squash) August 30, 2022 12:43
@kibana-ci
Copy link
Collaborator

💚 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
triggersActionsUi 1.0MB 1.0MB +60.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
triggersActionsUi 183 184 +1

Total ESLint disabled count

id before after diff
triggersActionsUi 186 187 +1

History

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

cc @XavierM

Copy link
Contributor

@JiaweiWu JiaweiWu left a comment

Choose a reason for hiding this comment

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

LGTM! Just a small comment

if (!isLoading && refreshNow) {
refresh();
}
// eslint-disable-next-line react-hooks/exhaustive-deps
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: do we need this eslint-disable since we're actually referencing refreshNow in the effect, also does this have a stale reference to isLoading since it's not a dependency?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The array of dependency plays no direct role in ensuring that the effect runs with fresh values (the effect always runs with the value at the time the component is rendered). The array only controls when the effect runs.

https://blog.bitsrc.io/understanding-dependencies-in-useeffect-7afd4df37c96

@XavierM XavierM merged commit b1f5030 into elastic:main Aug 30, 2022
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Aug 30, 2022
* add refresh functionality to alert table

* add exhaustive deps

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

Co-authored-by: kibanamachine <[email protected]>
(cherry picked from commit b1f5030)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.4

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Aug 30, 2022
* add refresh functionality to alert table

* add exhaustive deps

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

Co-authored-by: kibanamachine <[email protected]>
(cherry picked from commit b1f5030)

Co-authored-by: Xavier Mouligneau <[email protected]>
Mpdreamz pushed a commit to Mpdreamz/kibana that referenced this pull request Sep 6, 2022
* add refresh functionality to alert table

* add exhaustive deps

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

Co-authored-by: kibanamachine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.4.1 v8.4.2 v8.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants