elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.6k stars 8.21k forks source link

[Security Solution] Onboarding hub page architecture improvements #174766

Closed semd closed 1 week ago

semd commented 9 months ago

Summary

Context

Due to multiple design and feature changes, the onboarding hub implementation has been increasing in complexity since it was first created for serverless offerings.

There are some dead features in the code, and there is logic that has become outdated and is no longer needed. Making changes has become harder and time-consuming for this reason. Including fixing bugs like this one https://github.com/elastic/kibana/issues/183760

It is necessary to re-think the architecture of this page, remove unnecessary code, and reduce the complexity to have a more maintainable and extensible code.

Proposal

Simplify the implementation assuming the following requirements:

Declarative approach

It would be extremely helpful to have a clear declarative definition for groups and cards, to control their behavior in the application easily.

Proposal:

This is an initial proposal for the page definition, it may still need to be extended or modified:

enum OnboardingHubCardId {
  // ...
}

interface OnboardingHubCardDefinition {
  id: OnboardingHubCardId;
  title: string; // i18n
  icon: EuiIconType;
  /**
   * Component to render the card
   */
  component: React.ComponentType<{ setComplete: (complete: boolean) => void }>; // use React.lazy() to load the component
  /**
   * for auto-checking completion
   * @returns Promise for the complete status
   */
  isComplete?: () => Promise<boolean>;
  /**
   * Capabilities strings (using object dot notation) to enable the link.
   */
  capabilities?: RequiredCapabilities; // check `x-pack/plugins/security_solution/public/common/lib/capabilities/has_capabilities.ts`
  /**
   * Minimum license required to enable the card
   */
  licenseType?: LicenseType;
}

type OnboardingHubGroups = Array<{
  title: string;
  cards: OnboardingHubCardDefinition[];
}>;

Design

For reference this is the new design

onboarding hub new design screenshot

elasticmachine commented 9 months ago

Pinging @elastic/security-threat-hunting (Team:Threat Hunting)

elasticmachine commented 9 months ago

Pinging @elastic/security-threat-hunting-explore (Team:Threat Hunting:Explore)