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

[Security Solution][SIEM migrations] Onboarding UI improvements #204320

Merged
Merged
Show file tree
Hide file tree
Changes from 79 commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
60fbe6f
add support for topics on the onboarding page
semd Nov 22, 2024
3985477
reorganize directories inside components
semd Nov 22, 2024
03b5034
solve conflict
semd Nov 22, 2024
376f2d6
Merge remote-tracking branch 'upstream/main' into 10667/siem_migratio…
semd Nov 25, 2024
318d79e
Merge remote-tracking branch 'upstream' into 10667/siem_migrations/on…
semd Nov 26, 2024
8557994
resources schema id
semd Nov 26, 2024
da3938c
update and add tests
semd Nov 26, 2024
132c67b
resources type fix
semd Nov 27, 2024
94c56c8
add connector selection and auto-resume stopped migrations within the…
semd Nov 28, 2024
a0702c9
Merge remote-tracking branch 'origin/10667/siem_migrations/onboarding…
semd Nov 28, 2024
1d1f1da
Merge branch 'main' into 10667/siem_migrations/onboarding_ui
elasticmachine Nov 28, 2024
cee50d7
initial implementation
semd Nov 28, 2024
5a9a06a
extract common styles into single places
semd Nov 28, 2024
f2beaf3
format code
semd Nov 28, 2024
9f305c9
Merge branch '10667/siem_migrations/onboarding_ui' into 10667/siem_mi…
semd Nov 28, 2024
4ce992d
conflict solve
semd Nov 28, 2024
8b60935
cleaning
semd Nov 29, 2024
f09344b
solve conflict
semd Nov 29, 2024
ef6c17d
upload panel styles
semd Nov 29, 2024
5cb839d
flyout scafolding
semd Nov 29, 2024
ecadb11
solve conflicts
semd Nov 30, 2024
d79dc47
add upload input
semd Dec 1, 2024
a486424
basic workflow working
semd Dec 3, 2024
0ce93d9
Merge remote-tracking branch 'upstream/main' into 10667/siem_migratio…
semd Dec 3, 2024
b02a569
no connector selected callout
semd Dec 3, 2024
216a6dc
solve conflicts
semd Dec 3, 2024
0d6ae1f
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Dec 4, 2024
6e63ffa
add langsmith trace options
semd Dec 4, 2024
86210fc
Merge remote-tracking branch 'refs/remotes/origin/10667/siem_migratio…
semd Dec 4, 2024
ac6e675
lint fixes
semd Dec 4, 2024
9573dd6
Merge branch '10667/siem_migrations/onboarding_ui_flyout' into 10667/…
semd Dec 4, 2024
dcaffe2
[CI] Auto-commit changed files from 'yarn openapi:generate'
kibanamachine Dec 4, 2024
2460462
resources missing route
semd Dec 5, 2024
0957440
organize get and filter parameters
semd Dec 5, 2024
5cdf539
conflicts solved
semd Dec 5, 2024
09b8b5a
Merge remote-tracking branch 'refs/remotes/origin/10667/siem_migratio…
semd Dec 5, 2024
ca33b12
type fixes
semd Dec 5, 2024
0af2d10
typo
semd Dec 5, 2024
c9af65b
Merge branch '10667/siem_migrations/onboarding_ui_flyout' into 10667/…
semd Dec 5, 2024
d2b32ee
Merge remote-tracking branch 'upstream/main' into 10667/siem_migratio…
semd Dec 5, 2024
349915b
restore batch size
semd Dec 5, 2024
459d856
Merge branch '10667/siem_migrations/onboarding_ui_flyout' into 10667/…
semd Dec 5, 2024
eb87b4b
Merge remote-tracking branch 'upstream/main' into 10667/siem_migratio…
semd Dec 5, 2024
9e548ff
use Security common NonEmptyString
semd Dec 5, 2024
aa06fe8
try/catch NDJson parser
semd Dec 5, 2024
e8614d6
adapt resources api and batch searchh
semd Dec 7, 2024
4c31b09
Merge remote-tracking branch 'origin/10667/siem_migrations/onboarding…
semd Dec 8, 2024
8e57219
conflicts solved
semd Dec 8, 2024
547d5a4
implement macros step
semd Dec 9, 2024
f28861a
conflicts solved
semd Dec 9, 2024
4ea0ae5
[CI] Auto-commit changed files from 'yarn openapi:generate'
kibanamachine Dec 9, 2024
6c2bcb6
fix type
semd Dec 9, 2024
cd1af61
migration retriever initialize
semd Dec 9, 2024
0e3d6eb
Merge remote-tracking branch 'upstream/main' into 10667/siem_migratio…
semd Dec 10, 2024
acb1a66
createAgent function
semd Dec 10, 2024
4734473
accept ndjson extension
semd Dec 10, 2024
b256828
Merge remote-tracking branch 'upstream/main' into 10667/siem_migratio…
semd Dec 10, 2024
07221d0
Merge remote-tracking branch 'origin/10667/siem_migrations/onboarding…
semd Dec 10, 2024
9e8af45
results panel
semd Dec 12, 2024
ae2a6b6
address comments
semd Dec 12, 2024
8eb86f8
Merge branch '10667/siem_migrations/onboarding_ui_flyout_macros_looku…
semd Dec 12, 2024
9d14cad
Merge branch 'main' into 10667/siem_migrations/onboarding_ui_flyout_m…
elasticmachine Dec 12, 2024
782a39a
implement mark lookup as emtpy
semd Dec 13, 2024
d97fcee
Merge remote-tracking branch 'origin/10667/siem_migrations/onboarding…
semd Dec 13, 2024
ede3df4
fix conflicts
semd Dec 14, 2024
9c4b257
fix conflict
semd Dec 14, 2024
fe8736c
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Dec 14, 2024
0803573
Merge remote-tracking branch 'upstream/main' into 10667/siem_migratio…
semd Dec 16, 2024
d9fbdce
move code to siem_migrations public directory
semd Dec 16, 2024
b3bb5eb
move code to siem_migrations public directory
semd Dec 16, 2024
01a775d
Merge remote-tracking branch 'refs/remotes/origin/10667/siem_migratio…
semd Dec 16, 2024
67680b2
centralize panels components
semd Dec 16, 2024
5864495
conflicts solved
semd Dec 16, 2024
27637bd
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Dec 16, 2024
876ddda
fix macros resource check
semd Dec 16, 2024
5d63c09
fix duplicate missing resources requests
semd Dec 16, 2024
b4c855b
Merge remote-tracking branch 'refs/remotes/origin/10667/siem_migratio…
semd Dec 16, 2024
823d5fb
fix translations
semd Dec 16, 2024
beff67b
fix relocation conflicts
semd Dec 17, 2024
6e3b4e2
theme aware vis colors
semd Dec 17, 2024
4a50aa9
vis dark mode
semd Dec 17, 2024
39e61e2
address PR comments
semd Dec 17, 2024
4aaa575
allow mark as empty when provided
semd Dec 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export enum SiemMigrationStatus {
FAILED = 'failed',
}

export enum SiemMigrationRuleTranslationResult {
export enum RuleTranslationResult {
FULL = 'full',
PARTIAL = 'partial',
UNTRANSLATABLE = 'untranslatable',
Expand All @@ -60,3 +60,5 @@ export const DEFAULT_TRANSLATION_FIELDS = {
to: 'now',
interval: '5m',
} as const;

export const EMPTY_RESOURCE_PLACEHOLDER = '<empty>';
Original file line number Diff line number Diff line change
Expand Up @@ -285,21 +285,47 @@ export const RuleMigrationTranslationStats = z.object({
*/
rules: z.object({
/**
* The total number of rules to migrate.
* The total number of rules in the migration.
*/
total: z.number().int(),
/**
* The number of rules that matched Elastic prebuilt rules.
*/
prebuilt: z.number().int(),
/**
* The number of rules that did not match Elastic prebuilt rules and will be installed as custom rules.
* The number of rules that have been successfully translated.
*/
custom: z.number().int(),
success: z.object({
/**
* The total number of rules that have been successfully translated.
*/
total: z.number().int(),
/**
* The translation results
*/
result: z.object({
/**
* The number of rules that have been fully translated.
*/
full: z.number().int(),
/**
* The number of rules that have been partially translated.
*/
partial: z.number().int(),
/**
* The number of rules that could not be translated.
*/
untranslatable: z.number().int(),
}),
/**
* The number of rules that have been successfully translated and can be installed.
*/
installable: z.number().int(),
/**
* The number of rules that have been successfully translated and matched Elastic prebuilt rules.
*/
prebuilt: z.number().int(),
}),
/**
* The number of rules that can be installed.
* The number of rules that have failed translation.
*/
installable: z.number().int(),
failed: z.number().int(),
}),
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,23 +234,50 @@ components:
description: The rules migration translation stats.
required:
- total
- prebuilt
- custom
- installable
- success
- failed
properties:
total:
type: integer
description: The total number of rules to migrate.
prebuilt:
type: integer
description: The number of rules that matched Elastic prebuilt rules.
custom:
type: integer
description: The number of rules that did not match Elastic prebuilt rules and will be installed as custom rules.
installable:
description: The total number of rules in the migration.
success:
type: object
description: The number of rules that have been successfully translated.
required:
- total
- result
- installable
- prebuilt
properties:
total:
type: integer
description: The total number of rules that have been successfully translated.
result:
type: object
description: The translation results
required:
- full
- partial
- untranslatable
properties:
full:
type: integer
description: The number of rules that have been fully translated.
partial:
type: integer
description: The number of rules that have been partially translated.
untranslatable:
type: integer
description: The number of rules that could not be translated.
installable:
type: integer
description: The number of rules that have been successfully translated and can be installed.
prebuilt:
type: integer
description: The number of rules that have been successfully translated and matched Elastic prebuilt rules.
failed:
type: integer
description: The number of rules that can be installed.

description: The number of rules that have failed translation.
RuleMigrationTranslationResult:
type: string
description: The rule translation result.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

export { PanelText, type PanelTextProps } from './panel_text';
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import React, { type PropsWithChildren } from 'react';
import { EuiText, useEuiTheme, COLOR_MODES_STANDARD, type EuiTextProps } from '@elastic/eui';

export interface PanelTextProps extends PropsWithChildren<EuiTextProps> {
subdued?: true;
semiBold?: true;
}
export const PanelText = React.memo<PanelTextProps>(({ children, subdued, semiBold, ...props }) => {
const { euiTheme, colorMode } = useEuiTheme();
const isDarkMode = colorMode === COLOR_MODES_STANDARD.dark;

let color;
if (subdued && !isDarkMode) {
color = 'subdued';
}

const style: React.CSSProperties = {};
if (semiBold) {
style.fontWeight = euiTheme.font.weight.semiBold;
}

return (
<EuiText {...props} color={color} style={style}>
semd marked this conversation as resolved.
Show resolved Hide resolved
{children}
</EuiText>
);
});
PanelText.displayName = 'PanelText';
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const getCardHash = (cardId: OnboardingCardId | null) => (cardId ? `#${cardId}`
* This hook manages the expanded card id state in the LocalStorage and the hash in the URL.
*/
export const useUrlDetail = () => {
const { spaceId, telemetry } = useOnboardingContext();
const { config, spaceId, telemetry } = useOnboardingContext();
const topicId = useTopicId();
const [storedUrlDetail, setStoredUrlDetail] = useStoredUrlDetails(spaceId);

Expand Down Expand Up @@ -56,6 +56,14 @@ export const useUrlDetail = () => {

const syncUrlDetails = useCallback(
(pathTopicId: OnboardingTopicId | null, hashCardId: OnboardingCardId | null) => {
if (storedUrlDetail) {
// If the stored topic is not valid, clear it
const [storedTopicId] = storedUrlDetail.split('#');
if (storedTopicId && !config.has(storedTopicId as OnboardingTopicId)) {
setStoredUrlDetail(null);
return;
}
}
const urlDetail = `${pathTopicId || ''}${hashCardId ? `#${hashCardId}` : ''}`;
if (urlDetail && urlDetail !== storedUrlDetail) {
if (hashCardId) {
Expand All @@ -67,7 +75,7 @@ export const useUrlDetail = () => {
navigateTo({ deepLinkId: SecurityPageName.landing, path: storedUrlDetail });
}
},
[navigateTo, setStoredUrlDetail, storedUrlDetail, telemetry]
[config, navigateTo, setStoredUrlDetail, storedUrlDetail, telemetry]
);

return { setTopicDetail, setCardDetail, syncUrlDetails };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import React, { useCallback } from 'react';
import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { CenteredLoadingSpinner } from '../../../../../../common/components/centered_loading_spinner';
import { useKibana } from '../../../../../../common/lib/kibana/kibana_react';
import { useDefinedLocalStorage } from '../../../../hooks/use_stored_state';
import type { OnboardingCardComponent } from '../../../../../types';
Expand Down Expand Up @@ -35,9 +36,15 @@ export const AIConnectorCard: OnboardingCardComponent<AIConnectorCardMetadata> =
[setComplete, setStoredConnectorId]
);

const connectors = checkCompleteMetadata?.connectors;
const canExecuteConnectors = checkCompleteMetadata?.canExecuteConnectors;
const canCreateConnectors = checkCompleteMetadata?.canCreateConnectors;
if (!checkCompleteMetadata) {
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

return (
<OnboardingCardContentPanel>
<CenteredLoadingSpinner />
</OnboardingCardContentPanel>
);
}

const { connectors, canExecuteConnectors, canCreateConnectors } = checkCompleteMetadata;

return (
<OnboardingCardContentPanel>
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading