Skip to content

Commit

Permalink
[8.x] Updated EnablementModalCallout name to AdditionalChargesMessage (
Browse files Browse the repository at this point in the history
…#203061) (#210417)

# Backport

This will backport the following commits from `main` to `8.x`:
- [Updated EnablementModalCallout name to AdditionalChargesMessage
(#203061)](#203061)

<!--- Backport version: 9.6.4 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Charlotte Alexandra
Wilson","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-12-19T14:41:07Z","message":"Updated
EnablementModalCallout name to AdditionalChargesMessage (#203061)\n\n##
Summary\nThis PR renames the enablementModalCallout component
to\nAdditionalChargesMessage for better clarity and alignment with
its\npurpose, addressing
[this\ncomment](https://github.com/elastic/kibana/pull/201920#pullrequestreview-2467486755)\nfrom
the original PR.\n\n### Before and After (the output has not changed)
\n\n\n![image](https://github.com/user-attachments/assets/c07ac4a4-51db-4d5c-9040-3cde4fbd199e)\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\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\nCo-authored-by:
Mark Hopkin
<[email protected]>","sha":"a21fb6c7aeb06fc21f552d613f8387f73f5d3a27","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","backport
missing","v9.0.0","Team: SecuritySolution","Team:Entity
Analytics","backport:version","v8.18.0"],"title":"Updated
EnablementModalCallout name to
AdditionalChargesMessage","number":203061,"url":"https://github.com/elastic/kibana/pull/203061","mergeCommit":{"message":"Updated
EnablementModalCallout name to AdditionalChargesMessage (#203061)\n\n##
Summary\nThis PR renames the enablementModalCallout component
to\nAdditionalChargesMessage for better clarity and alignment with
its\npurpose, addressing
[this\ncomment](https://github.com/elastic/kibana/pull/201920#pullrequestreview-2467486755)\nfrom
the original PR.\n\n### Before and After (the output has not changed)
\n\n\n![image](https://github.com/user-attachments/assets/c07ac4a4-51db-4d5c-9040-3cde4fbd199e)\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\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\nCo-authored-by:
Mark Hopkin
<[email protected]>","sha":"a21fb6c7aeb06fc21f552d613f8387f73f5d3a27"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/203061","number":203061,"mergeCommit":{"message":"Updated
EnablementModalCallout name to AdditionalChargesMessage (#203061)\n\n##
Summary\nThis PR renames the enablementModalCallout component
to\nAdditionalChargesMessage for better clarity and alignment with
its\npurpose, addressing
[this\ncomment](https://github.com/elastic/kibana/pull/201920#pullrequestreview-2467486755)\nfrom
the original PR.\n\n### Before and After (the output has not changed)
\n\n\n![image](https://github.com/user-attachments/assets/c07ac4a4-51db-4d5c-9040-3cde4fbd199e)\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\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\nCo-authored-by:
Mark Hopkin
<[email protected]>","sha":"a21fb6c7aeb06fc21f552d613f8387f73f5d3a27"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"url":"https://github.com/elastic/kibana/pull/210196","number":210196,"branch":"8.18","state":"OPEN"}]}]
BACKPORT-->
  • Loading branch information
CAWilson94 authored Feb 13, 2025
1 parent 1f2cf4f commit a834d9c
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 7 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 @@ -70,7 +70,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 @@ -99,7 +99,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
@@ -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 AdditionalChargesMessage: React.FC = () => {
return (
<div>
<EuiText>{ADDITIONAL_CHARGES_MESSAGE}</EuiText>
</div>
);
};

// eslint-disable-next-line import/no-default-export
export default AdditionalChargesMessage;
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 { AdditionalChargesMessage } from './lazy';

export const getAdditionalChargesMessage = (services: Services): React.ComponentType =>
function AdditionalChargesMessageComponent() {
return (
<ServicesProvider services={services}>
<AdditionalChargesMessage />
</ServicesProvider>
);
};
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 AdditionalChargesMessageLazy = lazy(() => import('./additional_charges_message'));

export const AdditionalChargesMessage = () => (
<Suspense fallback={<EuiLoadingSpinner size="s" />}>
<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 a834d9c

Please sign in to comment.