diff --git a/x-pack/platform/plugins/shared/index_management/__jest__/client_integration/home/data_streams_tab.test.ts b/x-pack/platform/plugins/shared/index_management/__jest__/client_integration/home/data_streams_tab.test.ts index 5e937790962a8..cc1be9360eec4 100644 --- a/x-pack/platform/plugins/shared/index_management/__jest__/client_integration/home/data_streams_tab.test.ts +++ b/x-pack/platform/plugins/shared/index_management/__jest__/client_integration/home/data_streams_tab.test.ts @@ -969,6 +969,28 @@ describe('Data Streams tab', () => { expect(exists('editDataRetentionButton')).toBe(false); }); + test('displays/hides bulk edit data retention depending if data stream fully managed by ILM is selected', async () => { + const { + find, + actions: { selectDataStream, clickManageDataStreamsButton }, + } = testBed; + + // Select data stream fully managed by ILM + selectDataStream('dataStream1', true); + clickManageDataStreamsButton(); + expect(find('bulkEditDataRetentionButton').exists()).toBeFalsy(); + + // Select data stream managed by DSL + selectDataStream('dataStream2', true); + clickManageDataStreamsButton(); + expect(find('bulkEditDataRetentionButton').exists()).toBeFalsy(); + + // Unselect data stream fully managed by ILM + selectDataStream('dataStream1', false); + clickManageDataStreamsButton(); + expect(find('bulkEditDataRetentionButton').exists()).toBeTruthy(); + }); + test('when partially managed by dsl but has backing indices managed by ILM should show a warning', async () => { const { setLoadDataStreamResponse } = httpRequestsMockHelpers; diff --git a/x-pack/platform/plugins/shared/index_management/public/application/sections/home/data_stream_list/data_stream_table/data_stream_table.tsx b/x-pack/platform/plugins/shared/index_management/public/application/sections/home/data_stream_list/data_stream_table/data_stream_table.tsx index ea9be050c03ca..788573c8b6eae 100644 --- a/x-pack/platform/plugins/shared/index_management/public/application/sections/home/data_stream_list/data_stream_table/data_stream_table.tsx +++ b/x-pack/platform/plugins/shared/index_management/public/application/sections/home/data_stream_list/data_stream_table/data_stream_table.tsx @@ -288,7 +288,11 @@ export const DataStreamTable: React.FunctionComponent = ({ const dataStreamActions: EuiContextMenuPanelItemDescriptor[] = []; if ( - selection.every((dataStream: DataStream) => dataStream.privileges.manage_data_stream_lifecycle) + selection.every( + (dataStream: DataStream) => + dataStream.privileges.manage_data_stream_lifecycle && + !isDataStreamFullyManagedByILM(dataStream) + ) ) { dataStreamActions.push({ name: i18n.translate('xpack.idxMgmt.dataStreamList.table.bulkEditDataRetentionButtonLabel', {