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 new flyout to rule form library, responsive design and illustration to rule form page #205977

Closed
wants to merge 52 commits into from

Conversation

Zacqary
Copy link
Contributor

@Zacqary Zacqary commented Jan 8, 2025

This PR is DEPENDENT on #205944

Because we use a fork-and-pull contribution structure at Elastic, Github is not able to base this PR off the correct branch without opening the PR outside the main Kibana repo. Please use manual diffing tools to review this code until #205944 merges

Summary

Part of #195211

Non-User Facing Changes

  • Adds the new rule flyout to @kbn/response-ops-rule-form. It is not yet actually user-facing anywhere in the application, this will be done in a second PR.

Screenshots

Screenshot 2025-01-08 at 4 29 55 PM Screenshot 2025-01-08 at 4 29 59 PM Screenshot 2025-01-08 at 4 30 03 PM Screenshot 2025-01-08 at 4 30 32 PM

User-Facing Changes

These changes were added to the existing full page rule form to minimize the amount of code differences between the flyout and the full page

  • Adds some responsive styling to the rule form page to make it look more similar to the flyout when the browser window is narrow
Screenshot Screenshot 2025-01-08 at 4 31 50 PM
  • Adds the new illustrated "Add an action" empty prompt from the flyout designs to the existing rule form page
Screenshot Screenshot 2025-01-08 at 5 00 55 PM

Testing

To test the new flyout, edit packages/response-ops/rule_form/src/create_rule_form.tsx and packages/response-ops/rule_form/src/edit_rule_form.tsx so that they render <RuleFlyout> instead of <RulePage>.

Use this diff block
diff --git a/packages/response-ops/rule_form/src/create_rule_form.tsx b/packages/response-ops/rule_form/src/create_rule_form.tsx
index 2f5e0472dcd..564744b96ec 100644
--- a/packages/response-ops/rule_form/src/create_rule_form.tsx
+++ b/packages/response-ops/rule_form/src/create_rule_form.tsx
@@ -31,6 +31,7 @@ import {
   parseRuleCircuitBreakerErrorMessage,
 } from './utils';
 import { RULE_CREATE_SUCCESS_TEXT, RULE_CREATE_ERROR_TEXT } from './translations';
+import { RuleFlyout } from './rule_flyout';
 
 export interface CreateRuleFormProps {
   ruleTypeId: string;
@@ -199,7 +200,7 @@ export const CreateRuleForm = (props: CreateRuleFormProps) => {
           }),
         }}
       >
-        <RulePage isEdit={false} isSaving={isSaving} onCancel={onCancel} onSave={onSave} />
+        <RuleFlyout isEdit={false} isSaving={isSaving} onCancel={onCancel} onSave={onSave} />
       </RuleFormStateProvider>
     </div>
   );
diff --git a/packages/response-ops/rule_form/src/edit_rule_form.tsx b/packages/response-ops/rule_form/src/edit_rule_form.tsx
index 392447114ed..41aecd7245a 100644
--- a/packages/response-ops/rule_form/src/edit_rule_form.tsx
+++ b/packages/response-ops/rule_form/src/edit_rule_form.tsx
@@ -26,6 +26,7 @@ import {
 import { RULE_EDIT_ERROR_TEXT, RULE_EDIT_SUCCESS_TEXT } from './translations';
 import { getAvailableRuleTypes, parseRuleCircuitBreakerErrorMessage } from './utils';
 import { DEFAULT_VALID_CONSUMERS, getDefaultFormData } from './constants';
+import { RuleFlyout } from './rule_flyout';
 
 export interface EditRuleFormProps {
   id: string;
@@ -193,7 +194,7 @@ export const EditRuleForm = (props: EditRuleFormProps) => {
           showMustacheAutocompleteSwitch,
         }}
       >
-        <RulePage isEdit={true} isSaving={isSaving} onSave={onSave} onCancel={onCancel} />
+        <RuleFlyout isEdit={true} isSaving={isSaving} onSave={onSave} onCancel={onCancel} />
       </RuleFormStateProvider>
     </div>
   );

Still Todo

  1. Replace the action connector modal with an in-flyout UI as called for in the design spec
  2. Add the Show Request UI
  3. Replace all instances of the v1 rule flyout with this new one (it's used heavily in solutions, not in Stack Management)

Checklist

@Zacqary Zacqary added release_note:enhancement Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v9.0.0 Feature:Alerting/RulesManagement Issues related to the Rules Management UX backport:version Backport to applied version labels v8.18.0 labels Jan 8, 2025
@Zacqary Zacqary marked this pull request as ready for review January 9, 2025 17:22
@Zacqary Zacqary requested review from a team as code owners January 9, 2025 17:22
@elasticmachine
Copy link
Contributor

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

@Zacqary Zacqary requested review from a team as code owners January 9, 2025 21:11
@botelastic botelastic bot added Team:Fleet Team label for Observability Data Collection Fleet team Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team labels Jan 9, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services)

@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@Zacqary
Copy link
Contributor Author

Zacqary commented Jan 9, 2025

Bad rebase, closing

@Zacqary Zacqary closed this Jan 9, 2025
@elasticmachine
Copy link
Contributor

⏳ Build in-progress, with failures

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 Feature:Alerting/RulesManagement Issues related to the Rules Management UX release_note:enhancement Team:Fleet Team label for Observability Data Collection Fleet team Team:obs-ux-infra_services Observability Infrastructure & Services 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.