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

[8.x] Creating a shared component for the Risk Engine's countdown text (#203212) #204565

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 8.x:

Questions ?

Please refer to the Backport tool documentation

…stic#203212)

## Summary

The countdown text for the Risk Engine did not update without a page
refresh.

![Screenshot 2024-12-05 at 2 50
43 PM](https://github.com/user-attachments/assets/9f8ea7ce-1a5d-4c56-8198-199acc75fb49)

This pull request includes changes to the `use_risk_engine_status.ts`
and `schedule_risk_engine_callout.tsx` files to enhance the
functionality and code quality. The most important changes include the
addition of a countdown timer, refactoring of existing code, and
improvements to the import statements.

Enhancements and new functionality:

* Added `useRiskEngineCountdownTime` hook to provide a countdown timer
for the risk engine status.

Refactoring and code quality improvements:

* Refactored the `ScheduleRiskEngineCallout` component to use the new
`useRiskEngineCountdownTime` hook, simplifying the code by creating a
shared hook and removing the `useMemo` logic for countdown text.
* Improved import statements by adding `useMemo` and `moment` in
`use_risk_engine_status.ts` and removing unused imports in
`schedule_risk_engine_callout.tsx`.

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

(cherry picked from commit 5c260a4)
@kibanamachine kibanamachine merged commit 72e64f7 into elastic:8.x Dec 17, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants