-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ Siem Migrations ] Upsell Siem Migrations Start (#212607)
## Summary This PR adds the Upsell section for SIEM Migration Start section. - [Design Source](https://www.figma.com/design/BD9GZZz6y8pfSbubAt5H2W/%5B8.18%5D-GenAI-Powered-SIEM-Migration%3A-Rule-translation?node-id=63-81202&p=f&t=8x9RlFegceXzwYQf-0) SIEM migrations has below requirements in ESS and Serverless and if these requirements are not met, We show the upsell sections. - ESS - `Enterprise` license. - Serverless - `Complete` Product tier ## Demo |Instance|Demo| |---|---| |Serverless|<video src="https://github.com/user-attachments/assets/58d3ce98-7108-4d74-9f5c-e270804f2666"/>| |ESS|<video src="https://github.com/user-attachments/assets/85b650a7-fa11-4855-9927-aab89a2ed8ef"/>| ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ...
- Loading branch information
Showing
26 changed files
with
612 additions
and
22 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
x-pack/solutions/security/packages/upselling/sections/siem_migrations_start.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* 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 from 'react'; | ||
import { render, screen } from '@testing-library/react'; | ||
import { SiemMigrationStartUpsellSection } from './siem_migrations_start'; | ||
|
||
describe('SiemMigrationStartUpsellSection', () => { | ||
it('should render the component with all sections correctly', () => { | ||
render( | ||
<SiemMigrationStartUpsellSection | ||
title="title" | ||
upgradeMessage="upgradeMessage" | ||
upgradeHref="https://upgrade.Href" | ||
/> | ||
); | ||
|
||
expect(screen.getByTestId('siemMigrationStartUpsellSection')).toBeVisible(); | ||
|
||
expect(screen.getByTestId('siemMigrationStartUpsellTitle')).toBeVisible(); | ||
expect(screen.getByTestId('siemMigrationStartUpsellTitle')).toHaveTextContent('title'); | ||
|
||
expect(screen.getByTestId('siemMigrationStartUpsellMessage')).toBeVisible(); | ||
expect(screen.getByTestId('siemMigrationStartUpsellMessage')).toHaveTextContent( | ||
'upgradeMessage' | ||
); | ||
|
||
expect(screen.getByTestId('siemMigrationStartUpsellHref')).toBeVisible(); | ||
expect(screen.getByTestId('siemMigrationStartUpsellHref')).toHaveAttribute( | ||
'href', | ||
'https://upgrade.Href' | ||
); | ||
}); | ||
|
||
it('should render the component without upgradeHref', () => { | ||
render(<SiemMigrationStartUpsellSection title="title" upgradeMessage="upgradeMessage" />); | ||
|
||
expect(screen.queryByTestId('SiemMigrationStartUpsellHref')).not.toBeInTheDocument(); | ||
}); | ||
}); |
52 changes: 52 additions & 0 deletions
52
x-pack/solutions/security/packages/upselling/sections/siem_migrations_start.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* 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 { EuiButton, EuiCallOut, EuiFlexGroup, EuiFlexItem, EuiPanel, EuiText } from '@elastic/eui'; | ||
import React from 'react'; | ||
|
||
export const SiemMigrationStartUpsellSection = React.memo(function SiemMigrationStartUpsellSection({ | ||
title, | ||
upgradeMessage, | ||
upgradeHref, | ||
}: { | ||
title: React.ReactNode; | ||
upgradeMessage: React.ReactNode; | ||
upgradeHref?: string; | ||
}) { | ||
return ( | ||
<> | ||
<EuiPanel data-test-subj="siemMigrationStartUpsellSection" paddingSize="none" hasBorder> | ||
<EuiCallOut | ||
data-test-subj="siemMigrationStartUpsellTitle" | ||
title={title} | ||
color="warning" | ||
iconType="lock" | ||
> | ||
<EuiFlexGroup> | ||
<EuiFlexItem grow={true}> | ||
<EuiText size="s" data-test-subj="siemMigrationStartUpsellMessage"> | ||
{upgradeMessage} | ||
</EuiText> | ||
</EuiFlexItem> | ||
{upgradeHref ? ( | ||
<EuiFlexItem grow={false}> | ||
<EuiButton | ||
data-test-subj="siemMigrationStartUpsellHref" | ||
href={upgradeHref} | ||
color="warning" | ||
fill | ||
> | ||
{'Manage License'} | ||
</EuiButton> | ||
</EuiFlexItem> | ||
) : null} | ||
</EuiFlexGroup> | ||
</EuiCallOut> | ||
</EuiPanel> | ||
</> | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
...ons/security/plugins/security_solution/public/common/mock/mock_siem_migrations_service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* 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 { createTelemetryServiceMock } from '../lib/telemetry/telemetry_service.mock'; | ||
|
||
const createRuleMigrationStorageMock = () => { | ||
return { | ||
get: jest.fn(), | ||
set: jest.fn(), | ||
remove: jest.fn(), | ||
}; | ||
}; | ||
|
||
export const createSiemMigrationsMock = () => { | ||
return { | ||
rules: { | ||
getLatestStats$: jest.fn(), | ||
getMissingCapabilities: jest.fn(), | ||
hasMissingCapabilities: jest.fn(), | ||
isAvailable: jest.fn(), | ||
startPolling: jest.fn(), | ||
createRuleMigration: jest.fn(), | ||
upsertMigrationResources: jest.fn(), | ||
startRuleMigration: jest.fn(), | ||
getRuleMigrationStats: jest.fn(), | ||
getRuleMigrationsStats: jest.fn(), | ||
getMissingResources: jest.fn(), | ||
getIntegrations: jest.fn(), | ||
connectorIdStorage: createRuleMigrationStorageMock(), | ||
traceOptionsStorage: createRuleMigrationStorageMock(), | ||
telemetry: createTelemetryServiceMock(), | ||
}, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.