-
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.
Only show data warning screen on Serverless (#201920)
## Summary This PR resolves [#11064](elastic/security-team#11064), where the warning was previously shown in both serverless and non-serverless instances. A quick fix removed the message entirely, and this update reintroduces it for serverless environments only. This PR adds a data warning specific to serverless environments using upselling with the callout component from serverless solution components. The idea being to avoid adding a lot of `if serverless` checks throughout the component as mentioned elastic/security-team#11064 (comment) ### To Test **Start a serverless instance** using these doccos: https://docs.elastic.dev/security-solution/dev-docs/serverless or following steps locally: 1. Using VSCode, Reopen PR in container. 2. Start ElasticSearch: yarn es serverless --projectType security --ssl --kill 3. Start Kibana (this is the only way I can make it work...): yarn start --serverless=security --username=your_username --password=your_password **Test the modal works as expected**: 1. Remove / disable the 'entitytStoreDisable' flag here **/config/serverless.security.yml** (I commented it out) for modal to then show 2. Go to dashboards - Entity Analytics, hit the enable button and view modal. ### Before ![image](https://github.com/user-attachments/assets/43ac266d-9be1-47d3-874d-9edc9393fdd1) ### After ![image](https://github.com/user-attachments/assets/a7bf47fb-8737-478b-9782-fe6897980e03) ### 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/packages/kbn-i18n/README.md) - [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
- Loading branch information
1 parent
d3727a5
commit e9ee5b4
Showing
8 changed files
with
92 additions
and
2 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
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
...lution_serverless/public/components/enablement_modal_callout/enablement_modal_callout.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 { EuiText } from '@elastic/eui'; | ||
import { ADDITIONAL_CHARGES_MESSAGE } from '../../upselling/translations'; | ||
|
||
export const EnablementModalCallout: React.FC = () => { | ||
return ( | ||
<div> | ||
<EuiText>{ADDITIONAL_CHARGES_MESSAGE}</EuiText> | ||
</div> | ||
); | ||
}; | ||
|
||
// eslint-disable-next-line import/no-default-export | ||
export default EnablementModalCallout; |
19 changes: 19 additions & 0 deletions
19
...plugins/security_solution_serverless/public/components/enablement_modal_callout/index.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,19 @@ | ||
/* | ||
* 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 type { Services } from '../../common/services'; | ||
import { ServicesProvider } from '../../common/services'; | ||
import { EnablementModalCallout } from './lazy'; | ||
|
||
export const getEnablementModalCallout = (services: Services): React.ComponentType => | ||
function EnablementModalCalloutComponent() { | ||
return ( | ||
<ServicesProvider services={services}> | ||
<EnablementModalCallout /> | ||
</ServicesProvider> | ||
); | ||
}; |
17 changes: 17 additions & 0 deletions
17
.../plugins/security_solution_serverless/public/components/enablement_modal_callout/lazy.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,17 @@ | ||
/* | ||
* 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, { lazy, Suspense } from 'react'; | ||
import { EuiLoadingSpinner } from '@elastic/eui'; | ||
|
||
const EnablementModalCalloutLazy = lazy(() => import('./enablement_modal_callout')); | ||
|
||
export const EnablementModalCallout = () => ( | ||
<Suspense fallback={<EuiLoadingSpinner size="s" />}> | ||
<EnablementModalCalloutLazy /> | ||
</Suspense> | ||
); |
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