-
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.
Browse files
Browse the repository at this point in the history
# Backport This will backport the following commits from `main` to `9.0`: - [[Siem Migrations] Translated Rules Upsell Page (#212777)](#212777) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Jatin Kathuria","email":"jatin.kathuria@elastic.co"},"sourceCommit":{"committedDate":"2025-03-05T14:53:26Z","message":"[Siem Migrations] Translated Rules Upsell Page (#212777)\n\n## Summary\n\nThis PR adds the Upsell for `Translated Rules` Page as per\n[design](https://www.figma.com/design/BD9GZZz6y8pfSbubAt5H2W/%5B8.18%5D-GenAI-Powered-SIEM-Migration%3A-Rule-translation?node-id=63-81202&p=f&t=oJug1zebtufPlNKM-0).\n\n\nBelow is the Demo for the same.\n\n|Instance|Demo|\n|---|---|\n|ESS|<video\nsrc=\"https://github.com/user-attachments/assets/d7484635-292d-4bf0-883b-c9fd93b72096\"/>|\n|Serverless|<video\nsrc=\"https://github.com/user-attachments/assets/767d8409-a391-41b8-b4d1-1c838dffc363\"/>|\n\n\n\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\n\n- [x] Any text added follows [EUI's writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\nsentence case text and includes [i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n\n\n### Identify risks\n\nDoes this PR introduce any risks? For example, consider risks like hard\nto test bugs, performance regression, potential of data loss.\n\nDescribe the risk, its severity, and mitigation for each identified\nrisk. Invite stakeholders and evaluate how to proceed before merging.\n\n- [ ] [See some risk\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)\n- [ ] ...\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"197a281bf918ca021979dc1c948730fe99fd07de","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Threat Hunting","backport:version","v8.18.0","v9.1.0","v8.19.0"],"title":"[Siem Migrations] Translated Rules Upsell Page","number":212777,"url":"https://github.com/elastic/kibana/pull/212777","mergeCommit":{"message":"[Siem Migrations] Translated Rules Upsell Page (#212777)\n\n## Summary\n\nThis PR adds the Upsell for `Translated Rules` Page as per\n[design](https://www.figma.com/design/BD9GZZz6y8pfSbubAt5H2W/%5B8.18%5D-GenAI-Powered-SIEM-Migration%3A-Rule-translation?node-id=63-81202&p=f&t=oJug1zebtufPlNKM-0).\n\n\nBelow is the Demo for the same.\n\n|Instance|Demo|\n|---|---|\n|ESS|<video\nsrc=\"https://github.com/user-attachments/assets/d7484635-292d-4bf0-883b-c9fd93b72096\"/>|\n|Serverless|<video\nsrc=\"https://github.com/user-attachments/assets/767d8409-a391-41b8-b4d1-1c838dffc363\"/>|\n\n\n\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\n\n- [x] Any text added follows [EUI's writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\nsentence case text and includes [i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n\n\n### Identify risks\n\nDoes this PR introduce any risks? For example, consider risks like hard\nto test bugs, performance regression, potential of data loss.\n\nDescribe the risk, its severity, and mitigation for each identified\nrisk. Invite stakeholders and evaluate how to proceed before merging.\n\n- [ ] [See some risk\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)\n- [ ] ...\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"197a281bf918ca021979dc1c948730fe99fd07de"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/212777","number":212777,"mergeCommit":{"message":"[Siem Migrations] Translated Rules Upsell Page (#212777)\n\n## Summary\n\nThis PR adds the Upsell for `Translated Rules` Page as per\n[design](https://www.figma.com/design/BD9GZZz6y8pfSbubAt5H2W/%5B8.18%5D-GenAI-Powered-SIEM-Migration%3A-Rule-translation?node-id=63-81202&p=f&t=oJug1zebtufPlNKM-0).\n\n\nBelow is the Demo for the same.\n\n|Instance|Demo|\n|---|---|\n|ESS|<video\nsrc=\"https://github.com/user-attachments/assets/d7484635-292d-4bf0-883b-c9fd93b72096\"/>|\n|Serverless|<video\nsrc=\"https://github.com/user-attachments/assets/767d8409-a391-41b8-b4d1-1c838dffc363\"/>|\n\n\n\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\n\n- [x] Any text added follows [EUI's writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\nsentence case text and includes [i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n\n\n### Identify risks\n\nDoes this PR introduce any risks? For example, consider risks like hard\nto test bugs, performance regression, potential of data loss.\n\nDescribe the risk, its severity, and mitigation for each identified\nrisk. Invite stakeholders and evaluate how to proceed before merging.\n\n- [ ] [See some risk\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)\n- [ ] ...\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"197a281bf918ca021979dc1c948730fe99fd07de"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Jatin Kathuria <jatin.kathuria@elastic.co>
- Loading branch information
1 parent
f62e695
commit 9bb526a
Showing
15 changed files
with
239 additions
and
3 deletions.
There are no files selected for viewing
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
50 changes: 50 additions & 0 deletions
50
x-pack/solutions/security/packages/upselling/pages/siem_migrations_translated_rules.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,50 @@ | ||
/* | ||
* 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 { SiemMigrationsTranslatedRulesUpsellPage } from './siem_migrations_translated_rules'; | ||
import { render, screen } from '@testing-library/react'; | ||
|
||
describe('SiemMigrationsTranslatedRulesUpsellPage', () => { | ||
it('should render the component with all sections correctly', () => { | ||
render( | ||
<SiemMigrationsTranslatedRulesUpsellPage | ||
title="title" | ||
upgradeMessage="upgradeMessage" | ||
upgradeHref="https://upgrade.Href" | ||
/> | ||
); | ||
|
||
expect(screen.getByTestId('siemMigrationTranslatedRulesUpsellButton')).toBeVisible(); | ||
|
||
expect(screen.getByTestId('siemMigrationTranslatedRulesUpsellTitle')).toBeVisible(); | ||
expect(screen.getByTestId('siemMigrationTranslatedRulesUpsellTitle')).toHaveTextContent( | ||
'title' | ||
); | ||
|
||
expect(screen.getByTestId('siemMigrationTranslatedRulesUpsellUpgradeMessage')).toBeVisible(); | ||
expect( | ||
screen.getByTestId('siemMigrationTranslatedRulesUpsellUpgradeMessage') | ||
).toHaveTextContent('upgradeMessage'); | ||
|
||
expect(screen.getByTestId('siemMigrationTranslatedRulesUpsellButton')).toBeVisible(); | ||
expect(screen.getByTestId('siemMigrationTranslatedRulesUpsellButton')).toHaveAttribute( | ||
'href', | ||
'https://upgrade.Href' | ||
); | ||
}); | ||
|
||
it('should render the component without upgradeHref', () => { | ||
render( | ||
<SiemMigrationsTranslatedRulesUpsellPage title="title" upgradeMessage="upgradeMessage" /> | ||
); | ||
|
||
expect( | ||
screen.queryByTestId('siemMigrationTranslatedRulesUpsellButton') | ||
).not.toBeInTheDocument(); | ||
}); | ||
}); |
74 changes: 74 additions & 0 deletions
74
x-pack/solutions/security/packages/upselling/pages/siem_migrations_translated_rules.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,74 @@ | ||
/* | ||
* 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, EuiEmptyPrompt, EuiPageHeader, EuiFlexItem, EuiFlexGroup } from '@elastic/eui'; | ||
import React, { useMemo } from 'react'; | ||
import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template'; | ||
import { css } from '@emotion/react'; | ||
import { SIEM_MIGRATION_MANAGER_LICENSE_BTN } from '../messages'; | ||
import * as i18n from './translations'; | ||
|
||
export const SiemMigrationsTranslatedRulesUpsellPage = React.memo( | ||
function SiemMigrationsTranslatedRulesUpsellPage({ | ||
title, | ||
upgradeMessage, | ||
upgradeHref, | ||
}: { | ||
title: React.ReactNode; | ||
upgradeMessage: React.ReactNode; | ||
upgradeHref?: string; | ||
}) { | ||
const CTAButton = useMemo(() => { | ||
return ( | ||
<EuiButton | ||
data-test-subj="siemMigrationTranslatedRulesUpsellButton" | ||
href={upgradeHref} | ||
color="primary" | ||
iconType="gear" | ||
> | ||
{SIEM_MIGRATION_MANAGER_LICENSE_BTN} | ||
</EuiButton> | ||
); | ||
}, [upgradeHref]); | ||
|
||
return ( | ||
<KibanaPageTemplate contentBorder={false} grow={true} restrictWidth={false}> | ||
<KibanaPageTemplate.Section color="plain" paddingSize="none"> | ||
<EuiPageHeader bottomBorder pageTitle={i18n.SIEM_MIGRATION_UPSELLING_PAGE_TITLE} /> | ||
<EuiFlexGroup | ||
css={css` | ||
/** | ||
* Height of 210px applies to both ESS and Serverless. | ||
* It is combination of height of Kibana Header + Action Bar and Page Header | ||
* | ||
*/ | ||
min-height: calc(100vh - 210px); | ||
`} | ||
justifyContent="center" | ||
alignItems="center" | ||
direction="column" | ||
> | ||
<EuiFlexItem> | ||
<EuiEmptyPrompt | ||
title={ | ||
<span data-test-subj="siemMigrationTranslatedRulesUpsellTitle">{title}</span> | ||
} | ||
actions={upgradeHref ? CTAButton : null} | ||
iconType={'logoSecurity'} | ||
body={ | ||
<span data-test-subj="siemMigrationTranslatedRulesUpsellUpgradeMessage"> | ||
{upgradeMessage} | ||
</span> | ||
} | ||
/> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
</KibanaPageTemplate.Section> | ||
</KibanaPageTemplate> | ||
); | ||
} | ||
); |
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
27 changes: 27 additions & 0 deletions
27
...plugins/security_solution_ess/public/upselling/pages/siem_migrations_translated_rules.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,27 @@ | ||
/* | ||
* 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 { SiemMigrationsTranslatedRulesUpsellPage as SiemMigrationsTranslatedRulesUpsellPageCommonn } from '@kbn/security-solution-upselling/pages/siem_migrations_translated_rules'; | ||
import { useKibana } from '../../common/services'; | ||
import * as i18n from '../translations'; | ||
|
||
export const SiemMigrationsTranslatedRulesPage = React.memo( | ||
function SiemMigrationsTranslatedRulesPage() { | ||
const { services } = useKibana(); | ||
|
||
return ( | ||
<SiemMigrationsTranslatedRulesUpsellPageCommonn | ||
title={i18n.SIEM_MIGRATION_UPSELLING_TITLE('Enterprise')} | ||
upgradeMessage={i18n.SIEM_MIGRATION_RULES_PAGE_UPGRADE_LICENSE_MESSAGE} | ||
upgradeHref={services.application.getUrlForApp('management', { | ||
path: 'stack/license_management', | ||
})} | ||
/> | ||
); | ||
} | ||
); |
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
21 changes: 21 additions & 0 deletions
21
.../security_solution_serverless/public/upselling/pages/siem_migrations_translated_rules.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,21 @@ | ||
/* | ||
* 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 { SiemMigrationsTranslatedRulesUpsellPage as SiemMigrationsTranslatedRulesUpsellPageCommon } from '@kbn/security-solution-upselling/pages/siem_migrations_translated_rules'; | ||
import * as i18n from '../translations'; | ||
|
||
export const SiemMigrationsTranslatedRulesUpsellPage = React.memo( | ||
function SiemMigrationsTranslatedRulesUpsellPage() { | ||
return ( | ||
<SiemMigrationsTranslatedRulesUpsellPageCommon | ||
title={i18n.SIEM_MIGRATION_UPSELLING_TITLE('Complete')} | ||
upgradeMessage={i18n.SIEM_MIGRATION_RULES_PAGE_UPGRADE_LICENSE_MESSAGE} | ||
/> | ||
); | ||
} | ||
); |
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