From b669bca28800019fe8087e202cc23e54c9ab95b3 Mon Sep 17 00:00:00 2001 From: Yulia Cech Date: Tue, 10 Nov 2020 14:04:18 +0100 Subject: [PATCH 1/8] Add Managed label to data streams and a view switch for the table --- .../helpers/test_subjects.ts | 1 + .../home/data_streams_tab.helpers.ts | 12 ++- .../home/data_streams_tab.test.ts | 78 ++++++++++++++++--- .../home/indices_tab.test.ts | 4 +- .../common/lib/data_stream_serialization.ts | 2 + .../common/types/data_streams.ts | 10 +++ .../public/application/lib/data_streams.tsx | 17 ++++ .../data_stream_list/data_stream_list.tsx | 18 ++++- .../data_stream_table/data_stream_table.tsx | 34 +++++--- 9 files changed, 149 insertions(+), 27 deletions(-) create mode 100644 x-pack/plugins/index_management/public/application/lib/data_streams.tsx diff --git a/x-pack/plugins/index_management/__jest__/client_integration/helpers/test_subjects.ts b/x-pack/plugins/index_management/__jest__/client_integration/helpers/test_subjects.ts index b5386dec34205..979206cf19783 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/helpers/test_subjects.ts +++ b/x-pack/plugins/index_management/__jest__/client_integration/helpers/test_subjects.ts @@ -21,6 +21,7 @@ export type TestSubjects = | 'filterList.filterItem' | 'ilmPolicyLink' | 'includeStatsSwitch' + | 'viewManagedSwitch' | 'indexTable' | 'indexTableIncludeHiddenIndicesToggle' | 'indexTableIndexNameLink' diff --git a/x-pack/plugins/index_management/__jest__/client_integration/home/data_streams_tab.helpers.ts b/x-pack/plugins/index_management/__jest__/client_integration/home/data_streams_tab.helpers.ts index 6bf6c11a37bb4..7d931bf2a5097 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/home/data_streams_tab.helpers.ts +++ b/x-pack/plugins/index_management/__jest__/client_integration/home/data_streams_tab.helpers.ts @@ -24,6 +24,7 @@ export interface DataStreamsTabTestBed extends TestBed { goToDataStreamsList: () => void; clickEmptyPromptIndexTemplateLink: () => void; clickIncludeStatsSwitch: () => void; + clickViewManagedSwitch: () => void; clickReloadButton: () => void; clickNameAt: (index: number) => void; clickIndicesAt: (index: number) => void; @@ -83,6 +84,11 @@ export const setup = async (overridingDependencies: any = {}): Promise { + const { find } = testBed; + find('viewManagedSwitch').simulate('click'); + }; + const clickReloadButton = () => { const { find } = testBed; find('reloadButton').simulate('click'); @@ -170,6 +176,7 @@ export const setup = async (overridingDependencies: any = {}): Promise ({ - name, +export const createDataStreamPayload = (dataStream: Partial): DataStream => ({ + name: 'my-data-stream', timeStampField: { name: '@timestamp' }, indices: [ { @@ -201,6 +208,7 @@ export const createDataStreamPayload = (name: string): DataStream => ({ indexTemplateName: 'indexTemplate', storageSize: '1b', maxTimeStamp: 420, + ...dataStream, }); export const createDataStreamBackingIndex = (indexName: string, dataStreamName: string) => ({ diff --git a/x-pack/plugins/index_management/__jest__/client_integration/home/data_streams_tab.test.ts b/x-pack/plugins/index_management/__jest__/client_integration/home/data_streams_tab.test.ts index d3460e627bb32..2cc33ae4cf52e 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/home/data_streams_tab.test.ts +++ b/x-pack/plugins/index_management/__jest__/client_integration/home/data_streams_tab.test.ts @@ -96,10 +96,10 @@ describe('Data Streams tab', () => { createNonDataStreamIndex('non-data-stream-index'), ]); - const dataStreamForDetailPanel = createDataStreamPayload('dataStream1'); + const dataStreamForDetailPanel = createDataStreamPayload({ name: 'dataStream1' }); setLoadDataStreamsResponse([ dataStreamForDetailPanel, - createDataStreamPayload('dataStream2'), + createDataStreamPayload({ name: 'dataStream2' }), ]); setLoadDataStreamResponse(dataStreamForDetailPanel); @@ -260,9 +260,9 @@ describe('Data Streams tab', () => { createDataStreamBackingIndex('data-stream-index2', 'dataStream2'), ]); - const dataStreamDollarSign = createDataStreamPayload('%dataStream'); - setLoadDataStreamsResponse([dataStreamDollarSign]); - setLoadDataStreamResponse(dataStreamDollarSign); + const dataStreamPercentSign = createDataStreamPayload({ name: '%dataStream' }); + setLoadDataStreamsResponse([dataStreamPercentSign]); + setLoadDataStreamResponse(dataStreamPercentSign); testBed = await setup({ history: createMemoryHistory(), @@ -300,10 +300,10 @@ describe('Data Streams tab', () => { test('with an ILM url generator and an ILM policy', async () => { const { setLoadDataStreamsResponse, setLoadDataStreamResponse } = httpRequestsMockHelpers; - const dataStreamForDetailPanel = { - ...createDataStreamPayload('dataStream1'), + const dataStreamForDetailPanel = createDataStreamPayload({ + name: 'dataStream1', ilmPolicyName: 'my_ilm_policy', - }; + }); setLoadDataStreamsResponse([dataStreamForDetailPanel]); setLoadDataStreamResponse(dataStreamForDetailPanel); @@ -324,7 +324,7 @@ describe('Data Streams tab', () => { test('with an ILM url generator and no ILM policy', async () => { const { setLoadDataStreamsResponse, setLoadDataStreamResponse } = httpRequestsMockHelpers; - const dataStreamForDetailPanel = createDataStreamPayload('dataStream1'); + const dataStreamForDetailPanel = createDataStreamPayload({ name: 'dataStream1' }); setLoadDataStreamsResponse([dataStreamForDetailPanel]); setLoadDataStreamResponse(dataStreamForDetailPanel); @@ -346,10 +346,10 @@ describe('Data Streams tab', () => { test('without an ILM url generator and with an ILM policy', async () => { const { setLoadDataStreamsResponse, setLoadDataStreamResponse } = httpRequestsMockHelpers; - const dataStreamForDetailPanel = { - ...createDataStreamPayload('dataStream1'), + const dataStreamForDetailPanel = createDataStreamPayload({ + name: 'dataStream1', ilmPolicyName: 'my_ilm_policy', - }; + }); setLoadDataStreamsResponse([dataStreamForDetailPanel]); setLoadDataStreamResponse(dataStreamForDetailPanel); @@ -368,4 +368,58 @@ describe('Data Streams tab', () => { expect(findDetailPanelIlmPolicyName().contains('my_ilm_policy')).toBeTruthy(); }); }); + + describe('managed data streams', () => { + const nonBreakingSpace = ' '; + beforeEach(async () => { + const managedDataStream = createDataStreamPayload({ + name: 'managed-data-stream', + _meta: { + package: 'test', + managed: true, + managed_by: 'ingest-manager', + }, + }); + const nonManagedDataStream = createDataStreamPayload({ name: 'non-managed-data-stream' }); + httpRequestsMockHelpers.setLoadDataStreamsResponse([managedDataStream, nonManagedDataStream]); + + testBed = await setup({ + history: createMemoryHistory(), + }); + await act(async () => { + testBed.actions.goToDataStreamsList(); + }); + testBed.component.update(); + }); + + test('listed in the table with Managed label', () => { + const { table } = testBed; + const { tableCellsValues } = table.getMetaData('dataStreamTable'); + + expect(tableCellsValues).toEqual([ + ['', `managed-data-stream${nonBreakingSpace}Managed`, 'green', '1', 'Delete'], + ['', 'non-managed-data-stream', 'green', '1', 'Delete'], + ]); + }); + + test('turning of "View managed" switch hides managed data streams', async () => { + const { exists, actions, component, table } = testBed; + let { tableCellsValues } = table.getMetaData('dataStreamTable'); + + expect(tableCellsValues).toEqual([ + ['', `managed-data-stream${nonBreakingSpace}Managed`, 'green', '1', 'Delete'], + ['', 'non-managed-data-stream', 'green', '1', 'Delete'], + ]); + + expect(exists('viewManagedSwitch')).toBe(true); + + await act(async () => { + actions.clickViewManagedSwitch(); + }); + component.update(); + + ({ tableCellsValues } = table.getMetaData('dataStreamTable')); + expect(tableCellsValues).toEqual([['', 'non-managed-data-stream', 'green', '1', 'Delete']]); + }); + }); }); diff --git a/x-pack/plugins/index_management/__jest__/client_integration/home/indices_tab.test.ts b/x-pack/plugins/index_management/__jest__/client_integration/home/indices_tab.test.ts index adc47515acaee..356d55016fa03 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/home/indices_tab.test.ts +++ b/x-pack/plugins/index_management/__jest__/client_integration/home/indices_tab.test.ts @@ -74,7 +74,9 @@ describe('', () => { // The detail panel should still appear even if there are no data streams. httpRequestsMockHelpers.setLoadDataStreamsResponse([]); - httpRequestsMockHelpers.setLoadDataStreamResponse(createDataStreamPayload('dataStream1')); + httpRequestsMockHelpers.setLoadDataStreamResponse( + createDataStreamPayload({ name: 'dataStream1' }) + ); testBed = await setup({ history: createMemoryHistory(), diff --git a/x-pack/plugins/index_management/common/lib/data_stream_serialization.ts b/x-pack/plugins/index_management/common/lib/data_stream_serialization.ts index 69004eaa020eb..2d8e038d2a60f 100644 --- a/x-pack/plugins/index_management/common/lib/data_stream_serialization.ts +++ b/x-pack/plugins/index_management/common/lib/data_stream_serialization.ts @@ -17,6 +17,7 @@ export function deserializeDataStream(dataStreamFromEs: DataStreamFromEs): DataS ilm_policy: ilmPolicyName, store_size: storageSize, maximum_timestamp: maxTimeStamp, + _meta, } = dataStreamFromEs; return { @@ -35,6 +36,7 @@ export function deserializeDataStream(dataStreamFromEs: DataStreamFromEs): DataS ilmPolicyName, storageSize, maxTimeStamp, + _meta, }; } diff --git a/x-pack/plugins/index_management/common/types/data_streams.ts b/x-pack/plugins/index_management/common/types/data_streams.ts index 7c348f9a8085d..adb7104043fbb 100644 --- a/x-pack/plugins/index_management/common/types/data_streams.ts +++ b/x-pack/plugins/index_management/common/types/data_streams.ts @@ -10,6 +10,14 @@ interface TimestampFieldFromEs { type TimestampField = TimestampFieldFromEs; +interface MetaFieldFromEs { + managed_by: string; + package: any; + managed: boolean; +} + +type MetaField = MetaFieldFromEs; + export type HealthFromEs = 'GREEN' | 'YELLOW' | 'RED'; export interface DataStreamFromEs { @@ -17,6 +25,7 @@ export interface DataStreamFromEs { timestamp_field: TimestampFieldFromEs; indices: DataStreamIndexFromEs[]; generation: number; + _meta?: MetaFieldFromEs; status: HealthFromEs; template: string; ilm_policy?: string; @@ -41,6 +50,7 @@ export interface DataStream { ilmPolicyName?: string; storageSize?: string; maxTimeStamp?: number; + _meta?: MetaField; } export interface DataStreamIndex { diff --git a/x-pack/plugins/index_management/public/application/lib/data_streams.tsx b/x-pack/plugins/index_management/public/application/lib/data_streams.tsx new file mode 100644 index 0000000000000..d58cdebff5dd4 --- /dev/null +++ b/x-pack/plugins/index_management/public/application/lib/data_streams.tsx @@ -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; + * you may not use this file except in compliance with the Elastic License. + */ + +import { DataStream } from '../../../common'; + +export const isManagedByIngestManager = (dataStream: DataStream): boolean => { + return Boolean(dataStream._meta?.managed && dataStream._meta?.managed_by === 'ingest-manager'); +}; + +export const filterDataStreams = (dataStreams: DataStream[], managed: boolean): DataStream[] => { + return dataStreams.filter((dataStream: DataStream) => + managed ? isManagedByIngestManager(dataStream) : !isManagedByIngestManager(dataStream) + ); +}; diff --git a/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_list.tsx b/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_list.tsx index 20b93d9d71d04..a409938d57b2a 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_list.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_list.tsx @@ -32,6 +32,7 @@ import { documentationService } from '../../../services/documentation'; import { Section } from '../home'; import { DataStreamTable } from './data_stream_table'; import { DataStreamDetailPanel } from './data_stream_detail_panel'; +import { filterDataStreams } from '../../../lib/data_streams'; interface MatchParams { dataStreamName?: string; @@ -52,6 +53,7 @@ export const DataStreamList: React.FunctionComponent ); } else if (Array.isArray(dataStreams) && dataStreams.length > 0) { + const filteredDataStreams = isIncludeManagedChecked + ? dataStreams + : filterDataStreams(dataStreams, isIncludeManagedChecked); content = ( <> - {/* TODO: Add a switch for toggling on data streams created by Ingest Manager */} + + setIsIncludeManagedChecked(e.target.checked)} + data-test-subj="viewManagedSwitch" + /> + @@ -212,7 +226,7 @@ export const DataStreamList: React.FunctionComponent = ({ }), truncateText: true, sortable: true, - render: (name: DataStream['name']) => { + render: (name: DataStream['name'], dataStream: DataStream) => { return ( - - {name} - + + + {name} + + {isManagedByIngestManager(dataStream) ? ( + +   + + + + + ) : null} + ); }, }); @@ -121,7 +135,7 @@ export const DataStreamTable: React.FunctionComponent = ({ name: i18n.translate('xpack.idxMgmt.dataStreamList.table.actionDeleteText', { defaultMessage: 'Delete', }), - description: i18n.translate('xpack.idxMgmt.dataStreamList.table.actionDeleteDecription', { + description: i18n.translate('xpack.idxMgmt.dataStreamList.table.actionDeleteDescription', { defaultMessage: 'Delete this data stream', }), icon: 'trash', From 7190c288b05bd1c32e6d2eacd8cb0b0aeefbb7f1 Mon Sep 17 00:00:00 2001 From: Yulia Cech Date: Tue, 10 Nov 2020 15:13:58 +0100 Subject: [PATCH 2/8] Fix i18n errors --- x-pack/plugins/translations/translations/ja-JP.json | 13 ++++++------- x-pack/plugins/translations/translations/zh-CN.json | 13 ++++++------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index d8e136567564e..237fbb44ccbda 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -1361,6 +1361,12 @@ "data.search.unableToGetSavedQueryToastTitle": "保存したクエリ {savedQueryId} を読み込めません", "data.search.upgradeLicense": "クエリがタイムアウトしました。無料のベーシックティアではクエリがタイムアウトすることはありません。", "data.search.upgradeLicenseActionText": "今すぐアップグレード", + "data.search.functions.kibana_context.filters.help": "Kibana ジェネリックフィルターを指定します", + "data.search.functions.kibana_context.help": "Kibana グローバルコンテキストを更新します", + "data.search.functions.kibana_context.q.help": "自由形式の Kibana テキストクエリを指定します", + "data.search.functions.kibana_context.savedSearchId.help": "クエリとフィルターに使用する保存検索ID を指定します。", + "data.search.functions.kibana_context.timeRange.help": "Kibana 時間範囲フィルターを指定します", + "data.search.functions.kibana.help": "Kibana グローバルコンテキストを取得します", "devTools.badge.readOnly.text": "読み込み専用", "devTools.badge.readOnly.tooltip": "を保存できませんでした", "devTools.devToolsTitle": "開発ツール", @@ -1662,12 +1668,6 @@ "expressions.functions.font.invalidFontWeightErrorMessage": "無効なフォント太さ:'{weight}'", "expressions.functions.font.invalidTextAlignmentErrorMessage": "無効なテキストアラインメント:'{align}'", "expressions.functions.fontHelpText": "フォントスタイルを作成します。", - "data.search.functions.kibana_context.filters.help": "Kibana ジェネリックフィルターを指定します", - "data.search.functions.kibana_context.help": "Kibana グローバルコンテキストを更新します", - "data.search.functions.kibana_context.q.help": "自由形式の Kibana テキストクエリを指定します", - "data.search.functions.kibana_context.savedSearchId.help": "クエリとフィルターに使用する保存検索ID を指定します。", - "data.search.functions.kibana_context.timeRange.help": "Kibana 時間範囲フィルターを指定します", - "data.search.functions.kibana.help": "Kibana グローバルコンテキストを取得します", "expressions.functions.theme.args.defaultHelpText": "テーマ情報がない場合のデフォルト値。", "expressions.functions.theme.args.variableHelpText": "読み取るテーマ変数名。", "expressions.functions.themeHelpText": "テーマ設定を読み取ります。", @@ -8157,7 +8157,6 @@ "xpack.idxMgmt.dataStreamList.loadingDataStreamsErrorMessage": "データストリームの読み込み中にエラーが発生", "xpack.idxMgmt.dataStreamList.reloadDataStreamsButtonLabel": "再読み込み", "xpack.idxMgmt.dataStreamList.table.actionColumnTitle": "アクション", - "xpack.idxMgmt.dataStreamList.table.actionDeleteDecription": "このデータストリームを削除", "xpack.idxMgmt.dataStreamList.table.actionDeleteText": "削除", "xpack.idxMgmt.dataStreamList.table.deleteDataStreamsButtonLabel": "{count, plural, one {個のデータストリーム} other {個のデータストリーム}}を削除", "xpack.idxMgmt.dataStreamList.table.healthColumnTitle": "ヘルス", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 84cc3510ce487..0b585ce5c451e 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -1362,6 +1362,12 @@ "data.search.unableToGetSavedQueryToastTitle": "无法加载已保存查询 {savedQueryId}", "data.search.upgradeLicense": "您的查询已超时。使用我们免费的基础级许可,您的查询永不会超时。", "data.search.upgradeLicenseActionText": "立即升级", + "data.search.functions.kibana_context.filters.help": "指定 Kibana 常规筛选", + "data.search.functions.kibana_context.help": "更新 kibana 全局上下文", + "data.search.functions.kibana_context.q.help": "指定 Kibana 自由格式文本查询", + "data.search.functions.kibana_context.savedSearchId.help": "指定要用于查询和筛选的已保存搜索 ID", + "data.search.functions.kibana_context.timeRange.help": "指定 Kibana 时间范围筛选", + "data.search.functions.kibana.help": "获取 kibana 全局上下文", "devTools.badge.readOnly.text": "只读", "devTools.badge.readOnly.tooltip": "无法保存", "devTools.devToolsTitle": "开发工具", @@ -1663,12 +1669,6 @@ "expressions.functions.font.invalidFontWeightErrorMessage": "无效的字体粗细:“{weight}”", "expressions.functions.font.invalidTextAlignmentErrorMessage": "无效的文本对齐方式:“{align}”", "expressions.functions.fontHelpText": "创建字体样式。", - "data.search.functions.kibana_context.filters.help": "指定 Kibana 常规筛选", - "data.search.functions.kibana_context.help": "更新 kibana 全局上下文", - "data.search.functions.kibana_context.q.help": "指定 Kibana 自由格式文本查询", - "data.search.functions.kibana_context.savedSearchId.help": "指定要用于查询和筛选的已保存搜索 ID", - "data.search.functions.kibana_context.timeRange.help": "指定 Kibana 时间范围筛选", - "data.search.functions.kibana.help": "获取 kibana 全局上下文", "expressions.functions.theme.args.defaultHelpText": "主题信息不可用时的默认值。", "expressions.functions.theme.args.variableHelpText": "要读取的主题变量的名称。", "expressions.functions.themeHelpText": "读取主题设置。", @@ -8165,7 +8165,6 @@ "xpack.idxMgmt.dataStreamList.loadingDataStreamsErrorMessage": "加载数据流时出错", "xpack.idxMgmt.dataStreamList.reloadDataStreamsButtonLabel": "重新加载", "xpack.idxMgmt.dataStreamList.table.actionColumnTitle": "操作", - "xpack.idxMgmt.dataStreamList.table.actionDeleteDecription": "删除此数据流", "xpack.idxMgmt.dataStreamList.table.actionDeleteText": "删除", "xpack.idxMgmt.dataStreamList.table.deleteDataStreamsButtonLabel": "删除{count, plural, one {数据流} other {数据流} }", "xpack.idxMgmt.dataStreamList.table.healthColumnTitle": "运行状况", From 2c781aff8f64bc5d3742084c5c6c9f3dfb77c0a3 Mon Sep 17 00:00:00 2001 From: Yulia Cech Date: Mon, 16 Nov 2020 14:54:38 +0100 Subject: [PATCH 3/8] Updated some wording and made filter function easier (managed data streams) --- .../helpers/test_subjects.ts | 2 +- .../home/data_streams_tab.helpers.ts | 2 +- .../home/data_streams_tab.test.ts | 2 +- .../public/application/lib/data_streams.tsx | 6 +-- .../data_stream_list/data_stream_list.tsx | 37 ++++++++++++++----- .../data_stream_table/data_stream_table.tsx | 32 ++++++++++++---- 6 files changed, 57 insertions(+), 24 deletions(-) diff --git a/x-pack/plugins/index_management/__jest__/client_integration/helpers/test_subjects.ts b/x-pack/plugins/index_management/__jest__/client_integration/helpers/test_subjects.ts index 584685acecf58..04843cae6a57e 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/helpers/test_subjects.ts +++ b/x-pack/plugins/index_management/__jest__/client_integration/helpers/test_subjects.ts @@ -21,7 +21,7 @@ export type TestSubjects = | 'filterList.filterItem' | 'ilmPolicyLink' | 'includeStatsSwitch' - | 'viewManagedSwitch' + | 'includeManagedSwitch' | 'indexTable' | 'indexTableIncludeHiddenIndicesToggle' | 'indexTableIndexNameLink' diff --git a/x-pack/plugins/index_management/__jest__/client_integration/home/data_streams_tab.helpers.ts b/x-pack/plugins/index_management/__jest__/client_integration/home/data_streams_tab.helpers.ts index f00298963906e..093fa9042ea0f 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/home/data_streams_tab.helpers.ts +++ b/x-pack/plugins/index_management/__jest__/client_integration/home/data_streams_tab.helpers.ts @@ -83,7 +83,7 @@ export const setup = async (overridingDependencies: any = {}): Promise { const { find } = testBed; - find('viewManagedSwitch').simulate('click'); + find('includeManagedSwitch').simulate('click'); }; const clickReloadButton = () => { diff --git a/x-pack/plugins/index_management/__jest__/client_integration/home/data_streams_tab.test.ts b/x-pack/plugins/index_management/__jest__/client_integration/home/data_streams_tab.test.ts index 5fa2684a748eb..eebad14b8f214 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/home/data_streams_tab.test.ts +++ b/x-pack/plugins/index_management/__jest__/client_integration/home/data_streams_tab.test.ts @@ -438,7 +438,7 @@ describe('Data Streams tab', () => { ['', 'non-managed-data-stream', 'green', '1', 'Delete'], ]); - expect(exists('viewManagedSwitch')).toBe(true); + expect(exists('includeManagedSwitch')).toBe(true); await act(async () => { actions.clickViewManagedSwitch(); diff --git a/x-pack/plugins/index_management/public/application/lib/data_streams.tsx b/x-pack/plugins/index_management/public/application/lib/data_streams.tsx index d58cdebff5dd4..ca5297e399339 100644 --- a/x-pack/plugins/index_management/public/application/lib/data_streams.tsx +++ b/x-pack/plugins/index_management/public/application/lib/data_streams.tsx @@ -10,8 +10,6 @@ export const isManagedByIngestManager = (dataStream: DataStream): boolean => { return Boolean(dataStream._meta?.managed && dataStream._meta?.managed_by === 'ingest-manager'); }; -export const filterDataStreams = (dataStreams: DataStream[], managed: boolean): DataStream[] => { - return dataStreams.filter((dataStream: DataStream) => - managed ? isManagedByIngestManager(dataStream) : !isManagedByIngestManager(dataStream) - ); +export const filterDataStreams = (dataStreams: DataStream[]): DataStream[] => { + return dataStreams.filter((dataStream: DataStream) => !isManagedByIngestManager(dataStream)); }; diff --git a/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_list.tsx b/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_list.tsx index a409938d57b2a..187d83ce5b861 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_list.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_list.tsx @@ -151,7 +151,7 @@ export const DataStreamList: React.FunctionComponent 0) { const filteredDataStreams = isIncludeManagedChecked ? dataStreams - : filterDataStreams(dataStreams, isIncludeManagedChecked); + : filterDataStreams(dataStreams); content = ( <> @@ -207,14 +207,33 @@ export const DataStreamList: React.FunctionComponent - setIsIncludeManagedChecked(e.target.checked)} - data-test-subj="viewManagedSwitch" - /> + + + setIsIncludeManagedChecked(e.target.checked)} + data-test-subj="includeManagedSwitch" + /> + + + + + + diff --git a/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_table/data_stream_table.tsx b/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_table/data_stream_table.tsx index a2bc1421f7ef6..8e6ca4be29ce9 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_table/data_stream_table.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_table/data_stream_table.tsx @@ -7,16 +7,23 @@ import React, { useState, Fragment } from 'react'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; -import { EuiInMemoryTable, EuiBasicTableColumn, EuiButton, EuiLink, EuiBadge } from '@elastic/eui'; +import { + EuiInMemoryTable, + EuiBasicTableColumn, + EuiButton, + EuiLink, + EuiBadge, + EuiToolTip, +} from '@elastic/eui'; import { ScopedHistory } from 'kibana/public'; import { DataStream } from '../../../../../../common/types'; import { UseRequestResponse, reactRouterNavigate } from '../../../../../shared_imports'; import { getDataStreamDetailsLink, getIndexListUri } from '../../../../services/routing'; +import { isManagedByIngestManager } from '../../../../lib/data_streams'; import { DataHealth } from '../../../../components'; import { DeleteDataStreamConfirmationModal } from '../delete_data_stream_confirmation_modal'; import { humanizeTimeStamp } from '../humanize_time_stamp'; -import { isManagedByIngestManager } from '../../../../lib/data_streams'; interface Props { dataStreams?: DataStream[]; @@ -57,12 +64,21 @@ export const DataStreamTable: React.FunctionComponent = ({ {isManagedByIngestManager(dataStream) ? (   - - - + + + + + ) : null} From 1048166dbda21e6cb8f16e30266f8d08bdb12c3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yulia=20=C4=8Cech?= <6585477+yuliacech@users.noreply.github.com> Date: Mon, 16 Nov 2020 15:00:17 +0100 Subject: [PATCH 4/8] Update x-pack/plugins/index_management/__jest__/client_integration/home/data_streams_tab.test.ts Co-authored-by: Alison Goryachev --- .../__jest__/client_integration/home/data_streams_tab.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/index_management/__jest__/client_integration/home/data_streams_tab.test.ts b/x-pack/plugins/index_management/__jest__/client_integration/home/data_streams_tab.test.ts index eebad14b8f214..74998acfb3fa0 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/home/data_streams_tab.test.ts +++ b/x-pack/plugins/index_management/__jest__/client_integration/home/data_streams_tab.test.ts @@ -429,7 +429,7 @@ describe('Data Streams tab', () => { ]); }); - test('turning of "View managed" switch hides managed data streams', async () => { + test('turning off "View managed" switch hides managed data streams', async () => { const { exists, actions, component, table } = testBed; let { tableCellsValues } = table.getMetaData('dataStreamTable'); From 33469e4f514185c2d399050a7e495b427f3f9d06 Mon Sep 17 00:00:00 2001 From: Yulia Cech Date: Mon, 16 Nov 2020 15:02:39 +0100 Subject: [PATCH 5/8] Renamed view to include (managed data streams) --- .../client_integration/home/data_streams_tab.helpers.ts | 6 +++--- .../client_integration/home/data_streams_tab.test.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/x-pack/plugins/index_management/__jest__/client_integration/home/data_streams_tab.helpers.ts b/x-pack/plugins/index_management/__jest__/client_integration/home/data_streams_tab.helpers.ts index 093fa9042ea0f..4e0486e55720d 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/home/data_streams_tab.helpers.ts +++ b/x-pack/plugins/index_management/__jest__/client_integration/home/data_streams_tab.helpers.ts @@ -19,7 +19,7 @@ export interface DataStreamsTabTestBed extends TestBed { goToDataStreamsList: () => void; clickEmptyPromptIndexTemplateLink: () => void; clickIncludeStatsSwitch: () => void; - clickViewManagedSwitch: () => void; + clickIncludeManagedSwitch: () => void; clickReloadButton: () => void; clickNameAt: (index: number) => void; clickIndicesAt: (index: number) => void; @@ -81,7 +81,7 @@ export const setup = async (overridingDependencies: any = {}): Promise { + const clickIncludeManagedSwitch = () => { const { find } = testBed; find('includeManagedSwitch').simulate('click'); }; @@ -189,7 +189,7 @@ export const setup = async (overridingDependencies: any = {}): Promise { ]); }); - test('turning off "View managed" switch hides managed data streams', async () => { + test('turning off "Include managed" switch hides managed data streams', async () => { const { exists, actions, component, table } = testBed; let { tableCellsValues } = table.getMetaData('dataStreamTable'); @@ -441,7 +441,7 @@ describe('Data Streams tab', () => { expect(exists('includeManagedSwitch')).toBe(true); await act(async () => { - actions.clickViewManagedSwitch(); + actions.clickIncludeManagedSwitch(); }); component.update(); From ea4c669849e8de1b0494bbb49f56d3a811a3f26c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yulia=20=C4=8Cech?= <6585477+yuliacech@users.noreply.github.com> Date: Wed, 18 Nov 2020 18:43:49 +0100 Subject: [PATCH 6/8] Update x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_list.tsx Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com> --- .../sections/home/data_stream_list/data_stream_list.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_list.tsx b/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_list.tsx index 187d83ce5b861..95ad75b3a3e85 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_list.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_list.tsx @@ -213,7 +213,7 @@ export const DataStreamList: React.FunctionComponent Date: Wed, 18 Nov 2020 18:43:56 +0100 Subject: [PATCH 7/8] Update x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_list.tsx Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com> --- .../sections/home/data_stream_list/data_stream_list.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_list.tsx b/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_list.tsx index 95ad75b3a3e85..0df5697a4281a 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_list.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_list.tsx @@ -227,7 +227,7 @@ export const DataStreamList: React.FunctionComponent Date: Wed, 18 Nov 2020 18:44:05 +0100 Subject: [PATCH 8/8] Update x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_table/data_stream_table.tsx Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com> --- .../data_stream_list/data_stream_table/data_stream_table.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_table/data_stream_table.tsx b/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_table/data_stream_table.tsx index 8e6ca4be29ce9..c1fd33a39569c 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_table/data_stream_table.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_table/data_stream_table.tsx @@ -68,7 +68,7 @@ export const DataStreamTable: React.FunctionComponent = ({ content={i18n.translate( 'xpack.idxMgmt.dataStreamList.table.managedDataStreamTooltip', { - defaultMessage: 'Created and managed by Ingest Manager', + defaultMessage: 'Created and managed by Fleet', } )} >