From ff6af3f153d4efad56abe9602b0dd862f0da6539 Mon Sep 17 00:00:00 2001 From: Ignacio Rivas Date: Wed, 3 Jan 2024 11:15:43 +0100 Subject: [PATCH 01/10] Add deprecated warnings --- .../common/types/policies.ts | 1 + .../edit_policy/components/edit_warning.tsx | 25 +++++++++++++++++++ .../policy_list/components/policy_table.tsx | 25 +++++++++++++++++++ .../common/lib/template_serialization.ts | 3 +++ .../common/types/templates.ts | 2 ++ 5 files changed, 56 insertions(+) diff --git a/x-pack/plugins/index_lifecycle_management/common/types/policies.ts b/x-pack/plugins/index_lifecycle_management/common/types/policies.ts index c241ce6b5c58d..916381c41c083 100644 --- a/x-pack/plugins/index_lifecycle_management/common/types/policies.ts +++ b/x-pack/plugins/index_lifecycle_management/common/types/policies.ts @@ -18,6 +18,7 @@ export type PhaseWithDownsample = 'hot' | 'warm' | 'cold'; export interface SerializedPolicy { name: string; phases: Phases; + deprecated?: boolean; _meta?: Record; } diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/edit_warning.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/edit_warning.tsx index 9ad9e54676fc8..cc25f93bbb567 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/edit_warning.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/edit_warning.tsx @@ -68,6 +68,7 @@ export const EditWarning: FunctionComponent = () => { indexTemplatesLink ); const isManagedPolicy = policy?._meta?.managed; + const isDeprecatedPolicy = policy?.deprecated; return ( <> @@ -102,6 +103,30 @@ export const EditWarning: FunctionComponent = () => { )} + {isDeprecatedPolicy && ( + <> + + } + color="warning" + iconType="warning" + data-test-subj="editManagedPolicyWithDeprecation" + > +

+ +

+
+ + + )} +

= ({ policies }) => { sortable: true, render: (value: string, item) => { const isManaged = item.policy?._meta?.managed; + const isDeprecated = item.policy?.deprecated; + return ( <> = ({ policies }) => { {value} + {isDeprecated && ( + <> +   + + + {deprecatedPolicyTooltips.badge} + + + + )} + {isManaged && ( <>   diff --git a/x-pack/plugins/index_management/common/lib/template_serialization.ts b/x-pack/plugins/index_management/common/lib/template_serialization.ts index 8a38b40258dba..efeebdd2c50db 100644 --- a/x-pack/plugins/index_management/common/lib/template_serialization.ts +++ b/x-pack/plugins/index_management/common/lib/template_serialization.ts @@ -54,6 +54,7 @@ export function deserializeTemplate( composed_of: composedOf, data_stream: dataStream, allow_auto_create: allowAutoCreate, + deprecated, } = templateEs; const { settings } = template; @@ -66,6 +67,7 @@ export function deserializeTemplate( type = 'managed'; } + const deserializedTemplate: TemplateDeserialized = { name, version, @@ -77,6 +79,7 @@ export function deserializeTemplate( composedOf: composedOf ?? [], dataStream, allowAutoCreate, + deprecated, _meta, _kbnMeta: { type, diff --git a/x-pack/plugins/index_management/common/types/templates.ts b/x-pack/plugins/index_management/common/types/templates.ts index 7d85bb4d20ae0..452b16edccddc 100644 --- a/x-pack/plugins/index_management/common/types/templates.ts +++ b/x-pack/plugins/index_management/common/types/templates.ts @@ -27,6 +27,7 @@ export interface TemplateSerialized { _meta?: { [key: string]: any }; data_stream?: {}; allow_auto_create?: boolean; + deprecated?: boolean; } /** @@ -42,6 +43,7 @@ export interface TemplateDeserialized { aliases?: Aliases; mappings?: Mappings; }; + deprecated?: boolean; lifecycle?: DataRetention; composedOf?: string[]; // Composable template only version?: number; From 8de06e472bd4bd3ba0a60b4f40493318f350857c Mon Sep 17 00:00:00 2001 From: Ignacio Rivas Date: Wed, 3 Jan 2024 11:15:51 +0100 Subject: [PATCH 02/10] commit with @elastic email From fcb64bfb42977f90bf49835c97a83f340ae5aa4a Mon Sep 17 00:00:00 2001 From: Ignacio Rivas Date: Wed, 3 Jan 2024 11:20:06 +0100 Subject: [PATCH 03/10] commit with @elastic email From d629cc89abe72ce13c90f36828c6b475a8286922 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Wed, 3 Jan 2024 10:52:47 +0000 Subject: [PATCH 04/10] [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' --- .../index_management/common/lib/template_serialization.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/x-pack/plugins/index_management/common/lib/template_serialization.ts b/x-pack/plugins/index_management/common/lib/template_serialization.ts index efeebdd2c50db..3a2756f28b6b0 100644 --- a/x-pack/plugins/index_management/common/lib/template_serialization.ts +++ b/x-pack/plugins/index_management/common/lib/template_serialization.ts @@ -67,7 +67,6 @@ export function deserializeTemplate( type = 'managed'; } - const deserializedTemplate: TemplateDeserialized = { name, version, From fd2c79127bc81e6628794070cf7f366c380bc51a Mon Sep 17 00:00:00 2001 From: Ignacio Rivas Date: Mon, 8 Jan 2024 11:52:04 +0100 Subject: [PATCH 05/10] Add tests --- .../__jest__/policy_table.test.tsx | 19 +++++++++++++++++++ .../edit_policy/constants.ts | 1 + .../edit_policy/features/edit_warning.test.ts | 13 +++++++++++++ .../edit_policy/components/edit_warning.tsx | 2 +- 4 files changed, 34 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/policy_table.test.tsx b/x-pack/plugins/index_lifecycle_management/__jest__/policy_table.test.tsx index 7c28270dd419b..34ad33521f975 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/policy_table.test.tsx +++ b/x-pack/plugins/index_lifecycle_management/__jest__/policy_table.test.tsx @@ -43,6 +43,7 @@ const testPolicy = { const isUsedByAnIndex = (i: number) => i % 2 === 0; const isDesignatedManagedPolicy = (i: number) => i > 0 && i % 3 === 0; +const isDeprecatedPolicy = (i: number) => i > 0 && i % 2 === 0; const policies: PolicyFromES[] = [testPolicy]; for (let i = 1; i < 105; i++) { @@ -54,6 +55,7 @@ for (let i = 1; i < 105; i++) { name: `testy${i}`, policy: { name: `testy${i}`, + deprecated: i % 2 === 0, phases: {}, ...(isDesignatedManagedPolicy(i) ? { @@ -96,6 +98,7 @@ const getPolicies = (rendered: ReactWrapper) => { version, name, isManagedPolicy: isDesignatedManagedPolicy(version), + isDeprecatedPolicy: isDeprecatedPolicy(version), isUsedByAnIndex: isUsedByAnIndex(version), }; }); @@ -198,6 +201,22 @@ describe('policy table', () => { }); }); + test('shows deprecated policies with Deprecated badges', () => { + const rendered = mountWithIntl(component); + const visiblePolicies = getPolicies(rendered); + + visiblePolicies.forEach((p) => { + const policyRow = findTestSubject(rendered, `policyTableRow-${p.name}`); + const deprecatedBadge = findTestSubject(policyRow, 'deprecatedPolicyBadge'); + + if (p.isDeprecatedPolicy) { + expect(deprecatedBadge.exists()).toBeTruthy(); + } else { + expect(deprecatedBadge.exists()).toBeFalsy(); + } + }); + }); + test('filters based on content of search input', () => { const rendered = mountWithIntl(component); const searchInput = rendered.find('.euiFieldSearch').first(); diff --git a/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/constants.ts b/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/constants.ts index a41bea1cb8415..9232c82717b77 100644 --- a/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/constants.ts +++ b/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/constants.ts @@ -226,6 +226,7 @@ export const POLICY_MANAGED_BY_ES: PolicyFromES = { modifiedDate: Date.now().toString(), policy: { name: POLICY_NAME, + deprecated: true, phases: { hot: { min_age: '0ms', diff --git a/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/features/edit_warning.test.ts b/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/features/edit_warning.test.ts index 65f9144a9a964..8b5ac73153955 100644 --- a/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/features/edit_warning.test.ts +++ b/x-pack/plugins/index_lifecycle_management/integration_tests/edit_policy/features/edit_warning.test.ts @@ -67,6 +67,19 @@ describe(' edit warning', () => { expect(exists('editManagedPolicyCallOut')).toBe(true); }); + test('an edit warning callout is shown for a deprecated policy', async () => { + httpRequestsMockHelpers.setLoadPolicies([POLICY_MANAGED_BY_ES]); + + await act(async () => { + testBed = await initTestBed(httpSetup); + }); + const { exists, component } = testBed; + component.update(); + + expect(exists('editWarning')).toBe(true); + expect(exists('editPolicyWithDeprecation')).toBe(true); + }); + test('no indices link if no indices', async () => { httpRequestsMockHelpers.setLoadPolicies([ { ...getDefaultHotPhasePolicy(POLICY_NAME), indices: [] }, diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/edit_warning.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/edit_warning.tsx index cc25f93bbb567..41cb3121250a7 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/edit_warning.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/edit_warning.tsx @@ -114,7 +114,7 @@ export const EditWarning: FunctionComponent = () => { } color="warning" iconType="warning" - data-test-subj="editManagedPolicyWithDeprecation" + data-test-subj="editPolicyWithDeprecation" >

Date: Mon, 8 Jan 2024 16:48:36 +0100 Subject: [PATCH 06/10] Address CR feedback --- .../sections/edit_policy/components/edit_warning.tsx | 2 +- .../sections/policy_list/components/policy_table.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/edit_warning.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/edit_warning.tsx index 41cb3121250a7..1690676cd28d7 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/edit_warning.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/edit_warning.tsx @@ -119,7 +119,7 @@ export const EditWarning: FunctionComponent = () => {

diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/policy_list/components/policy_table.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/policy_list/components/policy_table.tsx index 0fb708c33a17a..5370fe191ff98 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/policy_list/components/policy_table.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/policy_list/components/policy_table.tsx @@ -76,7 +76,7 @@ const deprecatedPolicyTooltips = { badgeTooltip: i18n.translate( 'xpack.indexLifecycleMgmt.policyTable.templateBadgeType.deprecatedDescription', { - defaultMessage: 'This policy is deprecated and should not be relied on.', + defaultMessage: 'This policy is no longer supported and might be removed in a future release. Instead, use one of the other policies available or create a new one.', } ), }; From 174f4b880c284333eada37d188b43d6776c5f4a9 Mon Sep 17 00:00:00 2001 From: Ignacio Rivas Date: Tue, 9 Jan 2024 17:06:57 +0100 Subject: [PATCH 07/10] Address CR changes --- .../policy_list/components/policy_table.tsx | 48 ++++++++++++++++--- .../common/lib/template_serialization.ts | 2 - .../common/types/templates.ts | 2 - 3 files changed, 41 insertions(+), 11 deletions(-) diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/policy_list/components/policy_table.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/policy_list/components/policy_table.tsx index 5370fe191ff98..f6a9945ad0790 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/policy_list/components/policy_table.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/policy_list/components/policy_table.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import React, { useMemo } from 'react'; +import React, { useState, useMemo } from 'react'; import { EuiButtonEmpty, EuiLink, @@ -15,6 +15,7 @@ import { EuiBadge, EuiFlexItem, EuiSwitch, + EuiSearchBarProps, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; @@ -76,7 +77,8 @@ const deprecatedPolicyTooltips = { badgeTooltip: i18n.translate( 'xpack.indexLifecycleMgmt.policyTable.templateBadgeType.deprecatedDescription', { - defaultMessage: 'This policy is no longer supported and might be removed in a future release. Instead, use one of the other policies available or create a new one.', + defaultMessage: + 'This policy is no longer supported and might be removed in a future release. Instead, use one of the other policies available or create a new one.', } ), }; @@ -88,6 +90,8 @@ interface Props { const SHOW_MANAGED_POLICIES_BY_DEFAULT = 'ILM_SHOW_MANAGED_POLICIES_BY_DEFAULT'; export const PolicyTable: React.FunctionComponent = ({ policies }) => { + const [query, setQuery] = useState(''); + const history = useHistory(); const { services: { getUrlForApp }, @@ -97,9 +101,27 @@ export const PolicyTable: React.FunctionComponent = ({ policies }) => { false ); const { setListAction } = usePolicyListContext(); + + const handleOnChange: EuiSearchBarProps['onChange'] = ({ queryText, error }) => { + if (!error) { + setQuery(queryText); + } + }; + const searchOptions = useMemo( () => ({ + query, + onChange: handleOnChange, box: { incremental: true, 'data-test-subj': 'ilmSearchBar' }, + filters: [ + { + type: 'is', + field: 'policy.deprecated', + name: i18n.translate('xpack.indexLifecycleMgmt.policyTable.isDeprecatedFilterLabel', { + defaultMessage: 'Deprecated', + }), + }, + ], toolsRight: ( = ({ policies }) => { ), }), - [managedPoliciesVisible, setManagedPoliciesVisible] + [managedPoliciesVisible, setManagedPoliciesVisible, query] ); const filteredPolicies = useMemo(() => { - return managedPoliciesVisible - ? policies - : policies.filter((item) => !item.policy?._meta?.managed); - }, [policies, managedPoliciesVisible]); + let result = policies; + + if (managedPoliciesVisible) { + result = result.filter((item) => !item.policy?._meta?.managed); + } + + // When the query includes 'is:policy.deprecated', we want to show deprecated policies. + // Otherwise hide them all since they wont be supported in the future. + if (query.includes('is:policy.deprecated')) { + result = result.filter((item) => item.policy?.deprecated); + } else { + result = result.filter((item) => !item.policy?.deprecated); + } + + return result; + }, [policies, managedPoliciesVisible, query]); const columns: Array> = [ { diff --git a/x-pack/plugins/index_management/common/lib/template_serialization.ts b/x-pack/plugins/index_management/common/lib/template_serialization.ts index 3a2756f28b6b0..8a38b40258dba 100644 --- a/x-pack/plugins/index_management/common/lib/template_serialization.ts +++ b/x-pack/plugins/index_management/common/lib/template_serialization.ts @@ -54,7 +54,6 @@ export function deserializeTemplate( composed_of: composedOf, data_stream: dataStream, allow_auto_create: allowAutoCreate, - deprecated, } = templateEs; const { settings } = template; @@ -78,7 +77,6 @@ export function deserializeTemplate( composedOf: composedOf ?? [], dataStream, allowAutoCreate, - deprecated, _meta, _kbnMeta: { type, diff --git a/x-pack/plugins/index_management/common/types/templates.ts b/x-pack/plugins/index_management/common/types/templates.ts index 452b16edccddc..7d85bb4d20ae0 100644 --- a/x-pack/plugins/index_management/common/types/templates.ts +++ b/x-pack/plugins/index_management/common/types/templates.ts @@ -27,7 +27,6 @@ export interface TemplateSerialized { _meta?: { [key: string]: any }; data_stream?: {}; allow_auto_create?: boolean; - deprecated?: boolean; } /** @@ -43,7 +42,6 @@ export interface TemplateDeserialized { aliases?: Aliases; mappings?: Mappings; }; - deprecated?: boolean; lifecycle?: DataRetention; composedOf?: string[]; // Composable template only version?: number; From 213a8c86e58ab4e6ae4e94ebc7b3acb2a26cd3a6 Mon Sep 17 00:00:00 2001 From: Ignacio Rivas Date: Wed, 10 Jan 2024 11:39:54 +0100 Subject: [PATCH 08/10] Add tests and fix default sorting --- .../__snapshots__/policy_table.test.tsx.snap | 90 +++++++++---------- .../__jest__/policy_table.test.tsx | 22 ++--- .../policy_list/components/policy_table.tsx | 8 +- 3 files changed, 60 insertions(+), 60 deletions(-) diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/__snapshots__/policy_table.test.tsx.snap b/x-pack/plugins/index_lifecycle_management/__jest__/__snapshots__/policy_table.test.tsx.snap index aeae7b28f0b88..f9e7a78b3b44c 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/__snapshots__/policy_table.test.tsx.snap +++ b/x-pack/plugins/index_lifecycle_management/__jest__/__snapshots__/policy_table.test.tsx.snap @@ -4,14 +4,14 @@ exports[`policy table changes pages when a pagination link is clicked on 1`] = ` Array [ "testy0", "testy1", - "testy10", - "testy100", "testy101", "testy103", - "testy104", "testy11", "testy13", - "testy14", + "testy17", + "testy19", + "testy23", + "testy25", ] `; @@ -19,14 +19,14 @@ exports[`policy table changes pages when a pagination link is clicked on 2`] = ` Array [ "testy0", "testy1", - "testy10", - "testy100", "testy101", "testy103", - "testy104", "testy11", "testy13", - "testy14", + "testy17", + "testy19", + "testy23", + "testy25", ] `; @@ -122,15 +122,15 @@ Array [ exports[`policy table sorts when linked index templates header is clicked 2`] = ` Array [ "testy0", - "testy2", - "testy4", - "testy8", - "testy10", - "testy14", - "testy16", - "testy20", - "testy22", - "testy26", + "testy1", + "testy5", + "testy7", + "testy11", + "testy13", + "testy17", + "testy19", + "testy23", + "testy25", ] `; @@ -152,60 +152,60 @@ Array [ exports[`policy table sorts when linked indices header is clicked 2`] = ` Array [ "testy0", - "testy2", - "testy4", - "testy8", - "testy10", - "testy14", - "testy16", - "testy20", - "testy22", - "testy26", + "testy1", + "testy5", + "testy7", + "testy11", + "testy13", + "testy17", + "testy19", + "testy23", + "testy25", ] `; exports[`policy table sorts when modified date header is clicked 1`] = ` Array [ "testy0", - "testy104", "testy103", "testy101", - "testy100", - "testy98", "testy97", "testy95", - "testy94", - "testy92", + "testy91", + "testy89", + "testy85", + "testy83", + "testy79", ] `; exports[`policy table sorts when modified date header is clicked 2`] = ` Array [ "testy1", - "testy2", - "testy4", "testy5", "testy7", - "testy8", - "testy10", "testy11", "testy13", - "testy14", + "testy17", + "testy19", + "testy23", + "testy25", + "testy29", ] `; exports[`policy table sorts when name header is clicked 1`] = ` Array [ - "testy98", "testy97", "testy95", - "testy94", - "testy92", "testy91", "testy89", - "testy88", - "testy86", "testy85", + "testy83", + "testy79", + "testy77", + "testy73", + "testy71", ] `; @@ -213,13 +213,13 @@ exports[`policy table sorts when name header is clicked 2`] = ` Array [ "testy0", "testy1", - "testy2", - "testy4", "testy5", "testy7", - "testy8", - "testy10", "testy11", "testy13", + "testy17", + "testy19", + "testy23", + "testy25", ] `; diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/policy_table.test.tsx b/x-pack/plugins/index_lifecycle_management/__jest__/policy_table.test.tsx index 34ad33521f975..3c646c3411dfd 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/policy_table.test.tsx +++ b/x-pack/plugins/index_lifecycle_management/__jest__/policy_table.test.tsx @@ -203,18 +203,20 @@ describe('policy table', () => { test('shows deprecated policies with Deprecated badges', () => { const rendered = mountWithIntl(component); - const visiblePolicies = getPolicies(rendered); - visiblePolicies.forEach((p) => { - const policyRow = findTestSubject(rendered, `policyTableRow-${p.name}`); - const deprecatedBadge = findTestSubject(policyRow, 'deprecatedPolicyBadge'); + // Initially the switch is off so we should not see any deprecated policies + let deprecatedPolicies = findTestSubject(rendered, 'deprecatedPolicyBadge'); + expect(deprecatedPolicies.length).toBe(0); - if (p.isDeprecatedPolicy) { - expect(deprecatedBadge.exists()).toBeTruthy(); - } else { - expect(deprecatedBadge.exists()).toBeFalsy(); - } - }); + // Enable filtering by deprecated policies + const searchInput = rendered.find('.euiFieldSearch').first(); + (searchInput.instance() as unknown as HTMLInputElement).value = 'is:policy.deprecated'; + searchInput.simulate('keyup', { key: 'Enter', keyCode: 13, which: 13 }); + rendered.update(); + + // Now we should see all deprecated policies + deprecatedPolicies = findTestSubject(rendered, 'deprecatedPolicyBadge'); + expect(deprecatedPolicies.length).toBe(10); }); test('filters based on content of search input', () => { diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/policy_list/components/policy_table.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/policy_list/components/policy_table.tsx index f6a9945ad0790..3f09fe5dfb18b 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/policy_list/components/policy_table.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/policy_list/components/policy_table.tsx @@ -143,11 +143,9 @@ export const PolicyTable: React.FunctionComponent = ({ policies }) => { ); const filteredPolicies = useMemo(() => { - let result = policies; - - if (managedPoliciesVisible) { - result = result.filter((item) => !item.policy?._meta?.managed); - } + let result = managedPoliciesVisible + ? policies + : policies.filter((item) => !item.policy?._meta?.managed); // When the query includes 'is:policy.deprecated', we want to show deprecated policies. // Otherwise hide them all since they wont be supported in the future. From d8bf13a2045b12e1e5a5a1faec40326172bb37b0 Mon Sep 17 00:00:00 2001 From: Ignacio Rivas Date: Wed, 10 Jan 2024 13:04:45 +0100 Subject: [PATCH 09/10] Fix types --- .../sections/policy_list/components/policy_table.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/policy_list/components/policy_table.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/policy_list/components/policy_table.tsx index 3f09fe5dfb18b..5cd01597c5b3f 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/policy_list/components/policy_table.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/policy_list/components/policy_table.tsx @@ -16,6 +16,7 @@ import { EuiFlexItem, EuiSwitch, EuiSearchBarProps, + EuiInMemoryTableProps, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; @@ -319,7 +320,7 @@ export const PolicyTable: React.FunctionComponent = ({ policies }) => { direction: 'asc', }, }} - search={searchOptions} + search={searchOptions as EuiInMemoryTableProps['search']} tableLayout="auto" items={filteredPolicies} columns={columns} From a8e92b6dc8c92ad4d3b62860722e5eef0d4ae8cd Mon Sep 17 00:00:00 2001 From: Ignacio Rivas Date: Wed, 10 Jan 2024 15:56:07 +0100 Subject: [PATCH 10/10] Change condition --- .../index_lifecycle_management/__jest__/policy_table.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/policy_table.test.tsx b/x-pack/plugins/index_lifecycle_management/__jest__/policy_table.test.tsx index 3c646c3411dfd..b7278f79b0668 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/policy_table.test.tsx +++ b/x-pack/plugins/index_lifecycle_management/__jest__/policy_table.test.tsx @@ -216,7 +216,7 @@ describe('policy table', () => { // Now we should see all deprecated policies deprecatedPolicies = findTestSubject(rendered, 'deprecatedPolicyBadge'); - expect(deprecatedPolicies.length).toBe(10); + expect(deprecatedPolicies.length).toBeGreaterThan(0); }); test('filters based on content of search input', () => {