Skip to content

Commit

Permalink
updated searchable snapshot field in hot phase callout
Browse files Browse the repository at this point in the history
  • Loading branch information
jloleysens committed Mar 1, 2021
1 parent c39a305 commit 75a6579
Showing 1 changed file with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
} from '../../../../../../../shared_imports';

import { useEditPolicyContext } from '../../../../edit_policy_context';
import { UseField } from '../../../../form';
import { useConfigurationIssues, UseField } from '../../../../form';

import { i18nTexts } from '../../../../i18n_texts';

Expand All @@ -52,6 +52,7 @@ export const SearchableSnapshotField: FunctionComponent<Props> = ({ phase }) =>
services: { cloud },
} = useKibana();
const { getUrlForApp, policy, license, isNewPolicy } = useEditPolicyContext();
const { isUsingSearchableSnapshotInHotPhase } = useConfigurationIssues();

const searchableSnapshotPath = `phases.${phase}.actions.searchable_snapshot.snapshot_repository`;

Expand Down Expand Up @@ -242,7 +243,21 @@ export const SearchableSnapshotField: FunctionComponent<Props> = ({ phase }) =>
const renderInfoCallout = (): JSX.Element | undefined => {
let infoCallout: JSX.Element | undefined;

if (isDisabledDueToLicense) {
if (phase === 'hot' && isUsingSearchableSnapshotInHotPhase) {
infoCallout = (
<EuiCallOut
size="s"
title={i18n.translate(
'xpack.indexLifecycleMgmt.editPolicy.searchableSnapshotCalloutBody',
{
defaultMessage:
'Force merge, shrink and freeze actions are not allowed when searchable snapshots are enabled in this phase.',
}
)}
data-test-subj="searchableSnapshotFieldsDisabledCallout"
/>
);
} else if (isDisabledDueToLicense) {
infoCallout = (
<EuiCallOut
data-test-subj="searchableSnapshotDisabledDueToLicense"
Expand Down

0 comments on commit 75a6579

Please sign in to comment.