Skip to content

Commit

Permalink
Updated EnablementModalCallout name to AdditionalChargesMessage (#203061
Browse files Browse the repository at this point in the history
)

## Summary
This PR renames the enablementModalCallout component to
AdditionalChargesMessage for better clarity and alignment with its
purpose, addressing [this
comment](#201920 (review))
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 <[email protected]>
  • Loading branch information
CAWilson94 and hop-dev authored Dec 19, 2024
1 parent f881df1 commit a21fb6c
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ describe('EntityStoreEnablementModal', () => {
});

it('should render additional charges message when available', async () => {
const EnablementModalCalloutMock = () => <span data-test-subj="enablement-modal-test" />;
const AdditionalChargesMessageMock = () => <span data-test-subj="enablement-modal-test" />;
mockUseContractComponents.mockReturnValue({
EnablementModalCallout: EnablementModalCalloutMock,
AdditionalChargesMessage: AdditionalChargesMessageMock,
});

await renderComponent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const EntityStoreEnablementModal: React.FC<EntityStoreEnablementModalProp
useEntityEnginePrivileges();
const riskEnginePrivileges = useMissingRiskEnginePrivileges();
const enablementOptions = enablements.riskScore || enablements.entityStore;
const { EnablementModalCallout } = useContractComponents();
const { AdditionalChargesMessage } = useContractComponents();

if (!visible) {
return null;
Expand Down Expand Up @@ -102,7 +102,7 @@ export const EntityStoreEnablementModal: React.FC<EntityStoreEnablementModalProp

<EuiModalBody>
<EuiFlexGroup direction="column">
<EuiFlexItem>{EnablementModalCallout && <EnablementModalCallout />}</EuiFlexItem>
<EuiFlexItem>{AdditionalChargesMessage && <AdditionalChargesMessage />}</EuiFlexItem>
<EuiFlexItem>
<EuiSwitch
label={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import React from 'react';
import { EuiText } from '@elastic/eui';
import { ADDITIONAL_CHARGES_MESSAGE } from '../../upselling/translations';

export const EnablementModalCallout: React.FC = () => {
export const AdditionalChargesMessage: React.FC = () => {
return (
<div>
<EuiText>{ADDITIONAL_CHARGES_MESSAGE}</EuiText>
Expand All @@ -18,4 +18,4 @@ export const EnablementModalCallout: React.FC = () => {
};

// eslint-disable-next-line import/no-default-export
export default EnablementModalCallout;
export default AdditionalChargesMessage;
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<ServicesProvider services={services}>
<EnablementModalCallout />
<AdditionalChargesMessage />
</ServicesProvider>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => (
<Suspense fallback={<EuiLoadingSpinner size="s" />}>
<EnablementModalCalloutLazy />
<AdditionalChargesMessageLazy />
</Suspense>
);
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -70,7 +70,7 @@ export class SecuritySolutionServerlessPlugin

securitySolution.setComponents({
DashboardsLandingCallout: getDashboardsLandingCallout(services),
EnablementModalCallout: getEnablementModalCallout(services),
AdditionalChargesMessage: getAdditionalChargesMessage(services),
});

setOnboardingSettings(services);
Expand Down

0 comments on commit a21fb6c

Please sign in to comment.