-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Alerting UI] Don't wait for health check before showing Create Alert flyout #80996
Conversation
…ing/slow-alert-flyout
Pinging @elastic/kibana-alerting-services (Team:Alerting Services) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome. Thank you so much!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM! Tested it locally with adding delay to the health API route and it works as expected - flyout is loaded immediately and Save button is disabled till health check is completed.
I have a couple of nits, but it shouldn't be a blocker. Great work!
x-pack/plugins/triggers_actions_ui/public/application/components/health_check.tsx
Outdated
Show resolved
Hide resolved
@@ -149,6 +149,10 @@ export const AlertForm = ({ | |||
// eslint-disable-next-line react-hooks/exhaustive-deps | |||
}, []); | |||
|
|||
useEffect(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this changes related to the current issue? Did you want to fix something by adding it?
I suppose it can replace the default state from this line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change was to handle a pre-selected alert being passed into the alert form (as in the case of uptime alerts). Previously, there was a delay in rendering the alert form because the health check loading indicator rendered first (however briefly). That allows the pre-selected alert to render when the alert form was first rendered. With the change to show the alert form immediately in the add alert flyout, this useEffect is needed to re-render the form to show the selected alert type.
@elasticmachine merge upstream |
@elasticmachine merge upstream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM, great work!
Regarding the waitForCheck
in other areas, I think I'm good waiting and seeing if they're needed. I have a feeling there's some UX scenarios to think through (Ex: save button disabled in edit form until request completes, TLS banner displaying after a few seconds, etc).
x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add_footer.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add_footer.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Mike Côté <mikecote@users.noreply.github.com>
💚 Build SucceededMetrics [docs]@kbn/optimizer bundle module count
async chunks size
History
To update your PR or re-run it, just comment with: |
… flyout (elastic#80996) * wip * Adding health context provider and option to block waiting for health check * Adding tests * Removing forced lag * Fixing action form not rendering pre selected action * PR fixes * Updating i18n ids Co-authored-by: Mike Côté <mikecote@users.noreply.github.com> * Applying i18n fix Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Mike Côté <mikecote@users.noreply.github.com>
… flyout (#80996) (#81665) * wip * Adding health context provider and option to block waiting for health check * Adding tests * Removing forced lag * Fixing action form not rendering pre selected action * PR fixes * Updating i18n ids Co-authored-by: Mike Côté <mikecote@users.noreply.github.com> * Applying i18n fix Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Mike Côté <mikecote@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Mike Côté <mikecote@users.noreply.github.com>
* master: (37 commits) [ILM] Migrate Warm phase to Form Lib (elastic#81323) [Security Solutions][Detection Engine] Fixes critical bug with error reporting that was doing a throw (elastic#81549) [Detection Rules] Add 7.10 rules (elastic#81676) [kbn/optimizer] ignore missing metrics when updating limits with --focus (elastic#81696) [SECURITY SOLUTIONS] Bugs overview page + investigate eql in timeline (elastic#81550) [Maps] fix unable to edit cluster vector styles styled by count when switching to super fine grid resolution (elastic#81525) Fixed migration issue for case specific actions, by extending email action migrator checks (elastic#81673) [CI] Preparation for APM tracking on CI (elastic#80399) [Home] Fixes Kibana app description order on home page and updates Canvas copy (elastic#80057) Make sure `to` is 'now' and not the same as `from` (elastic#81524) Nitpicking the 8.0 Breaking Change issue template (elastic#81678) [SECURITY_SOLUTION] Fix text on onboarding screen (elastic#81672) [data.search] Skip async search tests in build candidates and production builds (elastic#81547) Fix previousStartedAt by not changing when execution fails (elastic#81388) [Monitoring] Fix a couple of issues with the cpu usage alert (elastic#80737) Telemetry collection xpack to ts project references (elastic#81269) Elasticsearch: don't use url authentication for new client (elastic#81564) [App Search] Credentials: implement working flyout form (elastic#81541) Properly encode links to edit user page (elastic#81562) [Alerting UI] Don't wait for health check before showing Create Alert flyout (elastic#80996) ...
Resolves #77472
Summary
Added optional input prop
waitForCheck
to HealthCheck component to determine if it should immediately render its children or wait for the health check to complete. I thought it only made sense to use thewaitForCheck
override in the AlertAdd component, but I can update the other components (AlertEdit, AlertList, ActionConnectorList) if we feel like it also makes sense there.Created a
HealthContextProvider
to hold the state of whether or not the health check has returned. This allows the AlertAdd component to disable the 'Save' button until the health check has completed.Checklist
Delete any items that are not applicable to this PR.