[App Search] ILM is always enabled from 8.0 (#117291)

This commit is contained in:
Orhan Toy 2021-11-05 15:40:43 +01:00 committed by GitHub
parent cd33f58ea6
commit 92762fa62f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 2 additions and 45 deletions

View file

@ -7,7 +7,6 @@
export const DEFAULT_INITIAL_APP_DATA = {
readOnlyMode: false,
ilmEnabled: true,
searchOAuth: {
clientId: 'someUID',
redirectUrl: 'http://localhost:3002/ws/search_callback',

View file

@ -16,7 +16,6 @@ import {
export interface InitialAppData {
readOnlyMode?: boolean;
ilmEnabled?: boolean;
searchOAuth?: SearchOAuth;
configuredLimits?: ConfiguredLimits;
access?: ProductAccess;

View file

@ -25,7 +25,6 @@ describe('AppLogic', () => {
mount({}, DEFAULT_INITIAL_APP_DATA);
expect(AppLogic.values).toEqual({
ilmEnabled: true,
configuredLimits: {
engine: {
maxDocumentByteSize: 102400,

View file

@ -16,7 +16,6 @@ import { ConfiguredLimits, Account, Role } from './types';
import { getRoleAbilities } from './utils/role';
interface AppValues {
ilmEnabled: boolean;
configuredLimits: ConfiguredLimits;
account: Account;
myRole: Role;
@ -41,7 +40,6 @@ export const AppLogic = kea<MakeLogicType<AppValues, AppActions, Required<Initia
},
],
configuredLimits: [props.configuredLimits.appSearch, {}],
ilmEnabled: [props.ilmEnabled, {}],
}),
selectors: {
myRole: [

View file

@ -83,14 +83,6 @@ export const NoLogging: React.FC<Props> = ({ type, disabledAt }) => {
);
};
export const ILMDisabled: React.FC<Props> = ({ type }) => (
<FormattedMessage
id="xpack.enterpriseSearch.appSearch.logRetention.ilmDisabled"
defaultMessage="App Search isn't managing {logsType} log retention."
values={{ logsType: CAPITALIZATION_MAP[type].lowercase }}
/>
);
export const CustomPolicy: React.FC<Props> = ({ type }) => (
<FormattedMessage
id="xpack.enterpriseSearch.appSearch.logRetention.customPolicy"

View file

@ -21,7 +21,7 @@ describe('LogRetentionMessage', () => {
const analytics = LogRetentionOptions.Analytics;
const api = LogRetentionOptions.API;
const setLogRetention = (logRetention: object, ilmEnabled: boolean = true) => {
const setLogRetention = (logRetention: object) => {
const logRetentionSettings = {
disabledAt: null,
enabled: true,
@ -30,7 +30,6 @@ describe('LogRetentionMessage', () => {
};
setMockValues({
ilmEnabled,
logRetention: {
[LogRetentionOptions.API]: logRetentionSettings,
[LogRetentionOptions.Analytics]: logRetentionSettings,
@ -155,22 +154,4 @@ describe('LogRetentionMessage', () => {
});
});
});
describe('when ILM is disabled entirely', () => {
describe('an ILM disabled message renders', () => {
beforeEach(() => {
setLogRetention({}, false);
});
it('for analytics', () => {
const wrapper = mountWithIntl(<LogRetentionMessage type={analytics} />);
expect(wrapper.text()).toEqual("App Search isn't managing analytics log retention.");
});
it('for api', () => {
const wrapper = mountWithIntl(<LogRetentionMessage type={api} />);
expect(wrapper.text()).toEqual("App Search isn't managing API log retention.");
});
});
});
});

View file

@ -9,18 +9,15 @@ import React from 'react';
import { useValues } from 'kea';
import { AppLogic } from '../../../app_logic';
import { LogRetentionLogic } from '../log_retention_logic';
import { LogRetentionOptions } from '../types';
import { NoLogging, ILMDisabled, CustomPolicy, DefaultPolicy } from './constants';
import { NoLogging, CustomPolicy, DefaultPolicy } from './constants';
interface Props {
type: LogRetentionOptions;
}
export const LogRetentionMessage: React.FC<Props> = ({ type }) => {
const { ilmEnabled } = useValues(AppLogic);
const { logRetention } = useValues(LogRetentionLogic);
if (!logRetention) return null;
@ -30,9 +27,6 @@ export const LogRetentionMessage: React.FC<Props> = ({ type }) => {
if (!logRetentionSettings.enabled) {
return <NoLogging type={type} disabledAt={logRetentionSettings.disabledAt} />;
}
if (!ilmEnabled) {
return <ILMDisabled type={type} />;
}
if (!logRetentionSettings.retentionPolicy?.isDefault) {
return <CustomPolicy type={type} />;
} else {

View file

@ -46,7 +46,6 @@ describe('callEnterpriseSearchConfigAPI', () => {
settings: {
external_url: 'http://some.vanity.url/',
read_only_mode: false,
ilm_enabled: true,
is_federated_auth: false,
search_oauth: {
client_id: 'someUID',
@ -139,7 +138,6 @@ describe('callEnterpriseSearchConfigAPI', () => {
},
publicUrl: undefined,
readOnlyMode: false,
ilmEnabled: false,
searchOAuth: {
clientId: undefined,
redirectUrl: undefined,

View file

@ -74,7 +74,6 @@ export const callEnterpriseSearchConfigAPI = async ({
},
publicUrl: stripTrailingSlash(data?.settings?.external_url),
readOnlyMode: !!data?.settings?.read_only_mode,
ilmEnabled: !!data?.settings?.ilm_enabled,
searchOAuth: {
clientId: data?.settings?.search_oauth?.client_id,
redirectUrl: data?.settings?.search_oauth?.redirect_url,

View file

@ -9741,7 +9741,6 @@
"xpack.enterpriseSearch.appSearch.logRetention.callout.disabledSinceTitle": "{logsTitle}は、{disabledDate}以降に無効にされました。",
"xpack.enterpriseSearch.appSearch.logRetention.callout.disabledTitle": "{logsTitle}は無効です。",
"xpack.enterpriseSearch.appSearch.logRetention.customPolicy": "カスタム{logsType}ログ保持ポリシーがあります。",
"xpack.enterpriseSearch.appSearch.logRetention.ilmDisabled": "App Search は{logsType}ログ保持を管理していません。",
"xpack.enterpriseSearch.appSearch.logRetention.noLogging": "すべてのエンジンの{logsType}ログが無効です。",
"xpack.enterpriseSearch.appSearch.logRetention.noLogging.collected": "前回の{logsType}ログは{disabledAtDate}に収集されました。",
"xpack.enterpriseSearch.appSearch.logRetention.noLogging.notCollected": "収集された{logsType}ログはありません。",

View file

@ -9839,7 +9839,6 @@
"xpack.enterpriseSearch.appSearch.logRetention.callout.disabledTitle": "{logsTitle} 已禁用。",
"xpack.enterpriseSearch.appSearch.logRetention.customPolicy": "您有定制 {logsType} 日志保留策略。",
"xpack.enterpriseSearch.appSearch.logRetention.defaultPolicy": "您的 {logsType} 日志将存储至少 {minAgeDays, plural, other {# 天}}。",
"xpack.enterpriseSearch.appSearch.logRetention.ilmDisabled": "App Search 未管理 {logsType} 日志保留。",
"xpack.enterpriseSearch.appSearch.logRetention.noLogging": "所有引擎的 {logsType} 日志记录均已禁用。",
"xpack.enterpriseSearch.appSearch.logRetention.noLogging.collected": "{logsType} 日志的最后收集日期为 {disabledAtDate}。",
"xpack.enterpriseSearch.appSearch.logRetention.noLogging.notCollected": "未收集任何 {logsType} 日志。",