From a21fb6c7aeb06fc21f552d613f8387f73f5d3a27 Mon Sep 17 00:00:00 2001 From: Charlotte Alexandra Wilson Date: Thu, 19 Dec 2024 14:41:07 +0000 Subject: [PATCH] Updated EnablementModalCallout name to AdditionalChargesMessage (#203061) ## Summary This PR renames the enablementModalCallout component to AdditionalChargesMessage for better clarity and alignment with its purpose, addressing [this comment](https://github.com/elastic/kibana/pull/201920#pullrequestreview-2467486755) from the original PR. ### Before and After (the output has not changed) ![image](https://github.com/user-attachments/assets/c07ac4a4-51db-4d5c-9040-3cde4fbd199e) ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [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 Co-authored-by: Mark Hopkin --- .../security_solution/public/contract_components.ts | 2 +- .../entity_store/components/enablement_modal.test.tsx | 4 ++-- .../entity_store/components/enablement_modal.tsx | 4 ++-- .../additional_charges_message.tsx} | 4 ++-- .../index.tsx | 8 ++++---- .../lazy.tsx | 6 +++--- .../plugins/security_solution_serverless/public/plugin.ts | 4 ++-- 7 files changed, 16 insertions(+), 16 deletions(-) rename x-pack/solutions/security/plugins/security_solution_serverless/public/components/{enablement_modal_callout/enablement_modal_callout.tsx => additional_charges_message/additional_charges_message.tsx} (84%) rename x-pack/solutions/security/plugins/security_solution_serverless/public/components/{enablement_modal_callout => additional_charges_message}/index.tsx (68%) rename x-pack/solutions/security/plugins/security_solution_serverless/public/components/{enablement_modal_callout => additional_charges_message}/lazy.tsx (70%) diff --git a/x-pack/solutions/security/plugins/security_solution/public/contract_components.ts b/x-pack/solutions/security/plugins/security_solution/public/contract_components.ts index f7c255bcd34b8..83d7b8d0130c5 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/contract_components.ts +++ b/x-pack/solutions/security/plugins/security_solution/public/contract_components.ts @@ -11,7 +11,7 @@ import type { Observable } from 'rxjs'; export type ContractComponents = Partial<{ GetStarted: React.ComponentType<{ indicesExist?: boolean }>; DashboardsLandingCallout: React.ComponentType<{}>; - EnablementModalCallout: React.ComponentType<{}>; + AdditionalChargesMessage: React.ComponentType<{}>; }>; export type SetComponents = (components: ContractComponents) => void; diff --git a/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/components/enablement_modal.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/components/enablement_modal.test.tsx index c16eb7e557a4b..b2c97a33b2ff4 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/components/enablement_modal.test.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/components/enablement_modal.test.tsx @@ -182,9 +182,9 @@ describe('EntityStoreEnablementModal', () => { }); it('should render additional charges message when available', async () => { - const EnablementModalCalloutMock = () => ; + const AdditionalChargesMessageMock = () => ; mockUseContractComponents.mockReturnValue({ - EnablementModalCallout: EnablementModalCalloutMock, + AdditionalChargesMessage: AdditionalChargesMessageMock, }); await renderComponent(); diff --git a/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/components/enablement_modal.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/components/enablement_modal.tsx index e3d01ec82907e..a3f4461998905 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/components/enablement_modal.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/components/enablement_modal.tsx @@ -73,7 +73,7 @@ export const EntityStoreEnablementModal: React.FC - {EnablementModalCallout && } + {AdditionalChargesMessage && } { +export const AdditionalChargesMessage: React.FC = () => { return (
{ADDITIONAL_CHARGES_MESSAGE} @@ -18,4 +18,4 @@ export const EnablementModalCallout: React.FC = () => { }; // eslint-disable-next-line import/no-default-export -export default EnablementModalCallout; +export default AdditionalChargesMessage; diff --git a/x-pack/solutions/security/plugins/security_solution_serverless/public/components/enablement_modal_callout/index.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/components/additional_charges_message/index.tsx similarity index 68% rename from x-pack/solutions/security/plugins/security_solution_serverless/public/components/enablement_modal_callout/index.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/components/additional_charges_message/index.tsx index 0bc65a33d6530..c35e4ed653ffa 100644 --- a/x-pack/solutions/security/plugins/security_solution_serverless/public/components/enablement_modal_callout/index.tsx +++ b/x-pack/solutions/security/plugins/security_solution_serverless/public/components/additional_charges_message/index.tsx @@ -7,13 +7,13 @@ import React from 'react'; import type { Services } from '../../common/services'; import { ServicesProvider } from '../../common/services'; -import { EnablementModalCallout } from './lazy'; +import { AdditionalChargesMessage } from './lazy'; -export const getEnablementModalCallout = (services: Services): React.ComponentType => - function EnablementModalCalloutComponent() { +export const getAdditionalChargesMessage = (services: Services): React.ComponentType => + function AdditionalChargesMessageComponent() { return ( - + ); }; diff --git a/x-pack/solutions/security/plugins/security_solution_serverless/public/components/enablement_modal_callout/lazy.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/components/additional_charges_message/lazy.tsx similarity index 70% rename from x-pack/solutions/security/plugins/security_solution_serverless/public/components/enablement_modal_callout/lazy.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/components/additional_charges_message/lazy.tsx index 547a15fc535e9..e2708b7351019 100644 --- a/x-pack/solutions/security/plugins/security_solution_serverless/public/components/enablement_modal_callout/lazy.tsx +++ b/x-pack/solutions/security/plugins/security_solution_serverless/public/components/additional_charges_message/lazy.tsx @@ -8,10 +8,10 @@ import React, { lazy, Suspense } from 'react'; import { EuiLoadingSpinner } from '@elastic/eui'; -const EnablementModalCalloutLazy = lazy(() => import('./enablement_modal_callout')); +const AdditionalChargesMessageLazy = lazy(() => import('./additional_charges_message')); -export const EnablementModalCallout = () => ( +export const AdditionalChargesMessage = () => ( }> - + ); diff --git a/x-pack/solutions/security/plugins/security_solution_serverless/public/plugin.ts b/x-pack/solutions/security/plugins/security_solution_serverless/public/plugin.ts index 30e0f86ccdacf..09eb56ec0edcb 100644 --- a/x-pack/solutions/security/plugins/security_solution_serverless/public/plugin.ts +++ b/x-pack/solutions/security/plugins/security_solution_serverless/public/plugin.ts @@ -23,7 +23,7 @@ import { type ExperimentalFeatures, } from '../common/experimental_features'; import { setOnboardingSettings } from './onboarding'; -import { getEnablementModalCallout } from './components/enablement_modal_callout'; +import { getAdditionalChargesMessage } from './components/additional_charges_message'; export class SecuritySolutionServerlessPlugin implements @@ -70,7 +70,7 @@ export class SecuritySolutionServerlessPlugin securitySolution.setComponents({ DashboardsLandingCallout: getDashboardsLandingCallout(services), - EnablementModalCallout: getEnablementModalCallout(services), + AdditionalChargesMessage: getAdditionalChargesMessage(services), }); setOnboardingSettings(services);