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

[Response Ops] [Rule Form] Add Rule Form Flyout v2 #206685

Open
wants to merge 122 commits into
base: main
Choose a base branch
from

Conversation

Zacqary
Copy link
Contributor

@Zacqary Zacqary commented Jan 14, 2025

Summary

Part of #195211

Replaces the create/edit rule flyout with the new rule flyout

Screenshot 2025-01-14 at 3 12 30 PM Screenshot 2025-01-14 at 3 12 52 PM

Restores the confirmation prompt before canceling or saving a rule without actions defined.

Also fixes most of the design papercuts in the Actions step:

Screenshot 2025-01-14 at 3 11 06 PM Screenshot 2025-01-14 at 3 11 01 PM

Checklist

@Zacqary Zacqary added Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v9.0.0 release_note:feature Makes this part of the condensed release notes Feature:Alerting/RulesManagement Issues related to the Rules Management UX backport:version Backport to applied version labels v8.18.0 labels Jan 14, 2025
@Zacqary
Copy link
Contributor Author

Zacqary commented Jan 15, 2025

@elastic/kibana-design This PR is still in draft but could use some feedback on these two design elements as they weren't in the Figma:

Screenshot 2025-01-14 at 3 11 45 PM Screenshot 2025-01-14 at 3 11 38 PM

I'm particularly unsure about the confirmation screen, it's definitely Not A Flyout Opening A Modal™ but it's also a ton of blank space

@Zacqary Zacqary force-pushed the 195211-replace-flyout branch 2 times, most recently from c3b25e9 to cbf1333 Compare January 17, 2025 17:36
@MichaelMarcialis
Copy link
Contributor

@elastic/kibana-design This PR is still in draft but could use some feedback on these two design elements as they weren't in the Figma:

Hey, @Zacqary. I'm not certain who the designer was on this, so I'll defer to them if they disagree with any of the following opinions. That said, I'd suggest the following:

Discard changes screenshot

You made mention of not triggering the confirmation modal from the flyout. Is there a compelling reason not to do so? Personally, I'm wondering if it might be a more common/familiar pattern to open a confirmation modal instead of repurposing the content area of the flyout. It'll also be more forgiving for short messages such as this.

No actions configured screenshot

Since it's allowed, I'm wondering if we should change the color="warning" prop on the EuiCallout to the default primary color, to avoid scaring folks. If it's truly just an informational message and not a warning (i.e. nothing is going awry), then we should style it as such. You'll likely also want to change or remove the icon as well.

Additionally, since the message is most relevant at the moment the user leaves the "Actions" step and moves to the "Details" step, perhaps it would make sense to move the callout up towards the top of the flyout (just below the header).

@Zacqary
Copy link
Contributor Author

Zacqary commented Jan 21, 2025

Additionally, since the message is most relevant at the moment the user leaves the "Actions" step and moves to the "Details" step, perhaps it would make sense to move the callout up towards the top of the flyout (just below the header).

The reason I put the callout on the footer is because it's replacing something the full page Rule Form shows as a confirmation popup. It's a message that we're usually displaying to the user right as they're making the decision to save the rule.

I'm happy to move the callout to the top of the screen, but if flyouts are allowed to open confirmation modals I could also just have it pop up the same modal as the rule page instead.

@joana-cps
Copy link

Thanks, @MichaelMarcialis for your comment and thoughts. I forgot to add these screens on Figma and missed the notification for the PR review. @Zacqary is now aware that I'm the one responsible for this area.

Discard changes screenshot
Regarding modals and flyouts I agree with avoiding it when we're talking about modals in the middle of a flyout flow, like the action connector and show request for example. Since this is a validation, the most common pattern around kibana is just a simple confirmation modal. The only thing that we need to be aware of is adding the background so the user can only interact with the confirmation modal.

This behavior is already in use if you create/edit a Rule from Observability:
Screenshot 2025-01-22 at 10 41 29

No actions configured screenshot
Let's use the same modal that we use on the Rule page for consistency. We already show that actions are optional in the actions step, this is just a confirmation modal.
Screenshot 2025-01-22 at 10 52 26

@Zacqary
Copy link
Contributor Author

Zacqary commented Feb 18, 2025

@cnasikas

* We pass the `onChangeMetaData` prop around the rule form to do
useEffect(() => {
    if (!isEmpty(metadata)) {
      onChangeMetaData(metadata);
    }
  }, [metadata, onChangeMetaData]);

Why do we need that? The initialMetaData already has that information. It seems that we needed it here: src/platform/plugins/shared/discover/public/application/main/components/top_nav/app_menu_actions/get_alerts.tsx. How are the metadata being used? Could we pass the metadata to the onClose or onSubmit as before and avoid this pattern?

@elastic/kibana-data-discovery Is this something simple enough to refactor in this PR or do we need to make it a follow-up issue?

@Zacqary
Copy link
Contributor Author

Zacqary commented Feb 18, 2025

I noticed that when I edit a rule in o11y it uses the old flyout and not the new one.

Fixed in 314d14c

# Conflicts:
#	x-pack/solutions/observability/plugins/infra/tsconfig.json
Copy link
Contributor

@awahab07 awahab07 left a comment

Choose a reason for hiding this comment

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

obs-ux-logs changes LGTM!

Only reviewed CODEOWNERS files. Also tested the create rule flow from Discover.

Copy link
Contributor

@jughosta jughosta left a comment

Choose a reason for hiding this comment

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

Data Discovery changes LGTM 👍

Would be great to avoid the validation error showing up during the opening of the flyout:
Screenshot 2025-02-20 at 10 28 40
Feb-20-2025 10-27-53

@elasticmachine
Copy link
Contributor

elasticmachine commented Feb 21, 2025

💔 Build Failed

Failed CI Steps

History

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:version Backport to applied version labels ci:cloud-deploy Create or update a Cloud deployment ci:project-deploy-observability Create an Observability project Feature:Alerting/RulesManagement Issues related to the Rules Management UX release_note:feature Makes this part of the condensed release notes Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team Team:obs-ux-management Observability Management User Experience Team Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.