diff --git a/x-pack/legacy/plugins/lens/public/datatable_visualization_plugin/expression.tsx b/x-pack/legacy/plugins/lens/public/datatable_visualization_plugin/expression.tsx index d7d445b3f8df5..23b49ecc168cc 100644 --- a/x-pack/legacy/plugins/lens/public/datatable_visualization_plugin/expression.tsx +++ b/x-pack/legacy/plugins/lens/public/datatable_visualization_plugin/expression.tsx @@ -17,7 +17,6 @@ import { VisualizationContainer } from '../visualization_container'; export interface DatatableColumns { columnIds: string[]; - labels: string[]; } interface Args { @@ -95,11 +94,6 @@ export const datatableColumns: ExpressionFunction< multi: true, help: '', }, - labels: { - types: ['string'], - multi: true, - help: '', - }, }, fn: function fn(_context: unknown, args: DatatableColumns) { return { @@ -138,10 +132,11 @@ function DatatableComponent(props: DatatableProps & { formatFactory: FormatFacto className="lnsDataTable" data-test-subj="lnsDataTable" columns={props.args.columns.columnIds - .map((field, index) => { + .map(field => { + const col = firstTable.columns.find(c => c.id === field); return { field, - name: props.args.columns.labels[index], + name: (col && col.name) || '', }; }) .filter(({ field }) => !!field)} diff --git a/x-pack/legacy/plugins/lens/public/datatable_visualization_plugin/visualization.tsx b/x-pack/legacy/plugins/lens/public/datatable_visualization_plugin/visualization.tsx index 18a6d112e14d6..ff809e9e4827c 100644 --- a/x-pack/legacy/plugins/lens/public/datatable_visualization_plugin/visualization.tsx +++ b/x-pack/legacy/plugins/lens/public/datatable_visualization_plugin/visualization.tsx @@ -212,13 +212,6 @@ export const datatableVisualization: Visualization< function: 'lens_datatable_columns', arguments: { columnIds: operations.map(o => o.columnId), - labels: operations.map( - o => - o.operation.label || - i18n.translate('xpack.lens.datatable.na', { - defaultMessage: 'N/A', - }) - ), }, }, ], diff --git a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/auto_date.ts b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/auto_date.ts new file mode 100644 index 0000000000000..359c6d7c35c3a --- /dev/null +++ b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/auto_date.ts @@ -0,0 +1,86 @@ +/* + * 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 { TimeBuckets } from 'ui/time_buckets'; +import dateMath from '@elastic/datemath'; +import { + ExpressionFunction, + KibanaContext, +} from '../../../../../../src/plugins/expressions/common'; + +interface LensAutoDateProps { + aggConfigs: string; +} + +export function getAutoInterval(ctx?: KibanaContext | null) { + if (!ctx || !ctx.timeRange) { + return; + } + + const { timeRange } = ctx; + const buckets = new TimeBuckets(); + buckets.setInterval('auto'); + buckets.setBounds({ + min: dateMath.parse(timeRange.from), + max: dateMath.parse(timeRange.to, { roundUp: true }), + }); + + return buckets.getInterval(); +} + +/** + * Convert all 'auto' date histograms into a concrete value (e.g. 2h). + * This allows us to support 'auto' on all date fields, and opens the + * door to future customizations (e.g. adjusting the level of detail, etc). + */ +export const autoDate: ExpressionFunction< + 'lens_auto_date', + KibanaContext | null, + LensAutoDateProps, + string +> = { + name: 'lens_auto_date', + aliases: [], + help: '', + context: { + types: ['kibana_context', 'null'], + }, + args: { + aggConfigs: { + types: ['string'], + default: '""', + help: '', + }, + }, + fn(ctx: KibanaContext, args: LensAutoDateProps) { + const interval = getAutoInterval(ctx); + + if (!interval) { + return args.aggConfigs; + } + + const configs = JSON.parse(args.aggConfigs) as Array<{ + type: string; + params: { interval: string }; + }>; + + const updatedConfigs = configs.map(c => { + if (c.type !== 'date_histogram' || !c.params || c.params.interval !== 'auto') { + return c; + } + + return { + ...c, + params: { + ...c.params, + interval: interval.expression, + }, + }; + }); + + return JSON.stringify(updatedConfigs); + }, +}; diff --git a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/indexpattern.test.ts b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/indexpattern.test.ts index 70a0372c028d6..845cfa29d5724 100644 --- a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/indexpattern.test.ts +++ b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/indexpattern.test.ts @@ -272,7 +272,7 @@ describe('IndexPattern Data Source', () => { metricsAtAllLevels=false partialRows=false includeFormatHints=true - aggConfigs='[{\\"id\\":\\"col1\\",\\"enabled\\":true,\\"type\\":\\"count\\",\\"schema\\":\\"metric\\",\\"params\\":{}},{\\"id\\":\\"col2\\",\\"enabled\\":true,\\"type\\":\\"date_histogram\\",\\"schema\\":\\"segment\\",\\"params\\":{\\"field\\":\\"timestamp\\",\\"useNormalizedEsInterval\\":true,\\"interval\\":\\"1d\\",\\"drop_partials\\":false,\\"min_doc_count\\":0,\\"extended_bounds\\":{}}}]' | lens_rename_columns idMap='{\\"col-0-col1\\":\\"col1\\",\\"col-1-col2\\":\\"col2\\"}'" + aggConfigs={lens_auto_date aggConfigs='[{\\"id\\":\\"col1\\",\\"enabled\\":true,\\"type\\":\\"count\\",\\"schema\\":\\"metric\\",\\"params\\":{}},{\\"id\\":\\"col2\\",\\"enabled\\":true,\\"type\\":\\"date_histogram\\",\\"schema\\":\\"segment\\",\\"params\\":{\\"field\\":\\"timestamp\\",\\"useNormalizedEsInterval\\":true,\\"interval\\":\\"1d\\",\\"drop_partials\\":false,\\"min_doc_count\\":0,\\"extended_bounds\\":{}}}]'} | lens_rename_columns idMap='{\\"col-0-col1\\":{\\"label\\":\\"Count of Documents\\",\\"dataType\\":\\"number\\",\\"isBucketed\\":false,\\"operationType\\":\\"count\\",\\"id\\":\\"col1\\"},\\"col-1-col2\\":{\\"label\\":\\"Date\\",\\"dataType\\":\\"date\\",\\"isBucketed\\":true,\\"operationType\\":\\"date_histogram\\",\\"sourceField\\":\\"timestamp\\",\\"params\\":{\\"interval\\":\\"1d\\"},\\"id\\":\\"col2\\"}}'" `); }); }); diff --git a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/indexpattern_suggestions.test.tsx b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/indexpattern_suggestions.test.tsx index 08993c15f5c60..ff6911bd25f84 100644 --- a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/indexpattern_suggestions.test.tsx +++ b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/indexpattern_suggestions.test.tsx @@ -1056,7 +1056,7 @@ describe('IndexPattern Data Source suggestions', () => { { columnId: 'id1', operation: { - label: 'Date histogram of timestamp', + label: 'timestamp', dataType: 'date', isBucketed: true, scale: 'interval', @@ -1132,7 +1132,7 @@ describe('IndexPattern Data Source suggestions', () => { { columnId: 'id1', operation: { - label: 'Date histogram of timestamp', + label: 'timestamp', dataType: 'date', isBucketed: true, scale: 'interval', diff --git a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operations/definitions/date_histogram.test.tsx b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operations/definitions/date_histogram.test.tsx index e9ea50c9273ee..f984597a8eb4b 100644 --- a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operations/definitions/date_histogram.test.tsx +++ b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operations/definitions/date_histogram.test.tsx @@ -136,7 +136,7 @@ describe('date_histogram', () => { expect(column.params.interval).toEqual('auto'); }); - it('should create column object with manual interval for non-primary time fields', () => { + it('should create column object with auto interval for non-primary time fields', () => { const column = dateHistogramOperation.buildColumn({ columns: {}, suggestedPriority: 0, @@ -150,7 +150,7 @@ describe('date_histogram', () => { searchable: true, }, }); - expect(column.params.interval).toEqual('d'); + expect(column.params.interval).toEqual('auto'); }); it('should create column object with restrictions', () => { diff --git a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operations/definitions/date_histogram.tsx b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operations/definitions/date_histogram.tsx index fb91ac593650c..89c4899bb8e56 100644 --- a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operations/definitions/date_histogram.tsx +++ b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/operations/definitions/date_histogram.tsx @@ -29,13 +29,6 @@ const FixedEuiRange = (EuiRange as unknown) as React.ComponentType< } >; -function ofName(name: string) { - return i18n.translate('xpack.lens.indexPattern.dateHistogramOf', { - defaultMessage: 'Date histogram of {name}', - values: { name }, - }); -} - function supportsAutoInterval(fieldName: string, indexPattern: IndexPattern): boolean { return indexPattern.timeFieldName ? indexPattern.timeFieldName === fieldName : false; } @@ -67,7 +60,7 @@ export const dateHistogramOperation: OperationDefinition { return { ...oldColumn, - label: ofName(field.name), + label: field.name, sourceField: field.name, params: { ...oldColumn.params, @@ -172,8 +165,6 @@ export const dateHistogramOperation: OperationDefinition - {fieldAllowsAutoInterval && ( + {!intervalIsRestricted && ( renameColumns); + interpreter.functionsRegistry.register(() => autoDate); } stop() {} diff --git a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/rename_columns.test.ts b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/rename_columns.test.ts index 641b1ceb431fb..74de89d584d2b 100644 --- a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/rename_columns.test.ts +++ b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/rename_columns.test.ts @@ -16,43 +16,49 @@ describe('rename_columns', () => { }; const idMap = { - a: 'b', - b: 'c', + a: { + id: 'b', + label: 'Austrailia', + }, + b: { + id: 'c', + label: 'Boomerang', + }, }; expect(renameColumns.fn(input, { idMap: JSON.stringify(idMap) }, {})).toMatchInlineSnapshot(` -Object { - "columns": Array [ - Object { - "id": "b", - "name": "A", - }, - Object { - "id": "c", - "name": "B", - }, - ], - "rows": Array [ - Object { - "b": 1, - "c": 2, - }, - Object { - "b": 3, - "c": 4, - }, - Object { - "b": 5, - "c": 6, - }, - Object { - "b": 7, - "c": 8, - }, - ], - "type": "kibana_datatable", -} -`); + Object { + "columns": Array [ + Object { + "id": "b", + "name": "Austrailia", + }, + Object { + "id": "c", + "name": "Boomerang", + }, + ], + "rows": Array [ + Object { + "b": 1, + "c": 2, + }, + Object { + "b": 3, + "c": 4, + }, + Object { + "b": 5, + "c": 6, + }, + Object { + "b": 7, + "c": 8, + }, + ], + "type": "kibana_datatable", + } + `); }); it('should keep columns which are not mapped', () => { @@ -63,41 +69,87 @@ Object { }; const idMap = { - b: 'c', + b: { id: 'c', label: 'Catamaran' }, }; expect(renameColumns.fn(input, { idMap: JSON.stringify(idMap) }, {})).toMatchInlineSnapshot(` -Object { - "columns": Array [ - Object { - "id": "a", - "name": "A", - }, - Object { - "id": "c", - "name": "B", - }, - ], - "rows": Array [ - Object { - "a": 1, - "c": 2, - }, - Object { - "a": 3, - "c": 4, - }, - Object { - "a": 5, - "c": 6, - }, - Object { - "a": 7, - "c": 8, - }, - ], - "type": "kibana_datatable", -} -`); + Object { + "columns": Array [ + Object { + "id": "a", + "name": "A", + }, + Object { + "id": "c", + "name": "Catamaran", + }, + ], + "rows": Array [ + Object { + "a": 1, + "c": 2, + }, + Object { + "a": 3, + "c": 4, + }, + Object { + "a": 5, + "c": 6, + }, + Object { + "a": 7, + "c": 8, + }, + ], + "type": "kibana_datatable", + } + `); + }); + + it('should rename date histograms', () => { + const input: KibanaDatatable = { + type: 'kibana_datatable', + columns: [{ id: 'a', name: 'A' }, { id: 'b', name: 'banana per 30 seconds' }], + rows: [{ a: 1, b: 2 }, { a: 3, b: 4 }, { a: 5, b: 6 }, { a: 7, b: 8 }], + }; + + const idMap = { + b: { id: 'c', label: 'Apple', operationType: 'date_histogram', sourceField: 'banana' }, + }; + + expect(renameColumns.fn(input, { idMap: JSON.stringify(idMap) }, {})).toMatchInlineSnapshot(` + Object { + "columns": Array [ + Object { + "id": "a", + "name": "A", + }, + Object { + "id": "c", + "name": "Apple per 30 seconds", + }, + ], + "rows": Array [ + Object { + "a": 1, + "c": 2, + }, + Object { + "a": 3, + "c": 4, + }, + Object { + "a": 5, + "c": 6, + }, + Object { + "a": 7, + "c": 8, + }, + ], + "type": "kibana_datatable", + } + `); }); }); diff --git a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/rename_columns.ts b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/rename_columns.ts index 4a54bcad56163..87e51cb62ba1d 100644 --- a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/rename_columns.ts +++ b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/rename_columns.ts @@ -5,12 +5,19 @@ */ import { i18n } from '@kbn/i18n'; -import { ExpressionFunction, KibanaDatatable } from 'src/legacy/core_plugins/interpreter/public'; +import { + ExpressionFunction, + KibanaDatatable, + KibanaDatatableColumn, +} from 'src/legacy/core_plugins/interpreter/public'; +import { IndexPatternColumn } from './operations'; interface RemapArgs { idMap: string; } +export type OriginalColumn = { id: string } & IndexPatternColumn; + export const renameColumns: ExpressionFunction< 'lens_rename_columns', KibanaDatatable, @@ -35,18 +42,19 @@ export const renameColumns: ExpressionFunction< types: ['kibana_datatable'], }, fn(data: KibanaDatatable, { idMap: encodedIdMap }: RemapArgs) { - const idMap = JSON.parse(encodedIdMap) as Record; + const idMap = JSON.parse(encodedIdMap) as Record; + return { type: 'kibana_datatable', rows: data.rows.map(row => { const mappedRow: Record = {}; Object.entries(idMap).forEach(([fromId, toId]) => { - mappedRow[toId] = row[fromId]; + mappedRow[toId.id] = row[fromId]; }); Object.entries(row).forEach(([id, value]) => { if (id in idMap) { - mappedRow[idMap[id]] = value; + mappedRow[idMap[id].id] = value; } else { mappedRow[id] = value; } @@ -54,10 +62,32 @@ export const renameColumns: ExpressionFunction< return mappedRow; }), - columns: data.columns.map(column => ({ - ...column, - id: idMap[column.id] ? idMap[column.id] : column.id, - })), + columns: data.columns.map(column => { + const mappedItem = idMap[column.id]; + + if (!mappedItem) { + return column; + } + + return { + ...column, + id: mappedItem.id, + name: getColumnName(mappedItem, column), + }; + }), }; }, }; + +function getColumnName(originalColumn: OriginalColumn, newColumn: KibanaDatatableColumn) { + if (originalColumn && originalColumn.operationType === 'date_histogram') { + const fieldName = originalColumn.sourceField; + + // HACK: This is a hack, and introduces some fragility into + // column naming. Eventually, this should be calculated and + // built more systematically. + return newColumn.name.replace(fieldName, originalColumn.label); + } + + return originalColumn.label; +} diff --git a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/to_expression.ts b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/to_expression.ts index 8045ab89b63d4..f4fa9b3862733 100644 --- a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/to_expression.ts +++ b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/to_expression.ts @@ -8,10 +8,10 @@ import _ from 'lodash'; import { IndexPatternColumn } from './indexpattern'; import { operationDefinitionMap } from './operations'; import { IndexPattern, IndexPatternPrivateState } from './types'; +import { OriginalColumn } from './rename_columns'; function getExpressionForLayer( indexPattern: IndexPattern, - layerId: string, columns: Record, columnOrder: string[] ) { @@ -34,10 +34,13 @@ function getExpressionForLayer( (currentIdMap, [colId], index) => { return { ...currentIdMap, - [`col-${index}-${colId}`]: colId, + [`col-${index}-${colId}`]: { + ...columns[colId], + id: colId, + }, }; }, - {} as Record + {} as Record ); return `esaggs @@ -45,7 +48,9 @@ function getExpressionForLayer( metricsAtAllLevels=false partialRows=false includeFormatHints=true - aggConfigs='${JSON.stringify(aggs)}' | lens_rename_columns idMap='${JSON.stringify(idMap)}'`; + aggConfigs={lens_auto_date aggConfigs='${JSON.stringify( + aggs + )}'} | lens_rename_columns idMap='${JSON.stringify(idMap)}'`; } return null; @@ -55,7 +60,6 @@ export function toExpression(state: IndexPatternPrivateState, layerId: string) { if (state.layers[layerId]) { return getExpressionForLayer( state.indexPatterns[state.layers[layerId].indexPatternId], - layerId, state.layers[layerId].columns, state.layers[layerId].columnOrder ); diff --git a/x-pack/legacy/plugins/lens/public/xy_visualization_plugin/__snapshots__/xy_expression.test.tsx.snap b/x-pack/legacy/plugins/lens/public/xy_visualization_plugin/__snapshots__/xy_expression.test.tsx.snap index 8a79240159b2e..473ee16ffe0c3 100644 --- a/x-pack/legacy/plugins/lens/public/xy_visualization_plugin/__snapshots__/xy_expression.test.tsx.snap +++ b/x-pack/legacy/plugins/lens/public/xy_visualization_plugin/__snapshots__/xy_expression.test.tsx.snap @@ -135,7 +135,7 @@ exports[`xy_expression XYChart component it renders area 1`] = ` position="bottom" showGridLines={false} tickFormat={[Function]} - title="" + title="c" /> 1 || data.tables[layers[0].layerId].columns.length > 2; const shouldRotate = isHorizontalChart(layers); + const xTitle = (xAxisColumn && xAxisColumn.name) || args.xTitle; + return ( xAxisFormatter.convert(d)} diff --git a/x-pack/test/functional/es_archives/lens/basic/data.json.gz b/x-pack/test/functional/es_archives/lens/basic/data.json.gz index 992bf7c85e9fd..a5079d92e77f0 100644 Binary files a/x-pack/test/functional/es_archives/lens/basic/data.json.gz and b/x-pack/test/functional/es_archives/lens/basic/data.json.gz differ diff --git a/x-pack/test/functional/es_archives/lens/basic/mappings.json b/x-pack/test/functional/es_archives/lens/basic/mappings.json index 10a94d305dd5d..b87dbe12a7005 100644 --- a/x-pack/test/functional/es_archives/lens/basic/mappings.json +++ b/x-pack/test/functional/es_archives/lens/basic/mappings.json @@ -9,9 +9,6 @@ "mappings": { "_meta": { "migrationMappingPropertyHashes": { - "action": "ecc01e367a369542bc2b15dae1fb1773", - "action_task_params": "a9d49f184ee89641044be0ca2950fa3a", - "alert": "b2d549df61fd5bf8098427ec68a4712d", "apm-telemetry": "07ee1939fa4302c62ddc052ec03fed90", "canvas-element": "7390014e1091044523666d97247392fc", "canvas-workpad": "b0a1706d356228dbdcb4a17e6b9eb231", @@ -21,10 +18,12 @@ "graph-workspace": "cd7ba1330e6682e9cc00b78850874be1", "index-pattern": "66eccb05066c5a89924f48a9e9736499", "infrastructure-ui-source": "ddc0ecb18383f6b26101a2fadb2dab0c", + "inventory-view": "84b320fd67209906333ffce261128462", "kql-telemetry": "d12a98a6f19a2d273696597547e064ee", - "lens": "d69713426be87ba23283776aab149b9a", + "lens": "21c3ea0763beb1ecb0162529706b88c5", "map": "23d7aa4a720d4938ccde3983f87bd58d", "maps-telemetry": "a4229f8b16a6820c6d724b7e0c1f729d", + "metrics-explorer-view": "53c5365793677328df0ccb6138bf3cdd", "migrationVersion": "4a1746014a75ade3a714e1db5763276f", "ml-telemetry": "257fd1d4b4fdbb9cb4b8a3b27da201e9", "namespace": "2f4316de49999235636386fe51dc06c1", @@ -36,7 +35,7 @@ "siem-ui-timeline": "1f6f0860ad7bc0dba3e42467ca40470d", "siem-ui-timeline-note": "8874706eedc49059d4cf0f5094559084", "siem-ui-timeline-pinned-event": "20638091112f0e14f0e443d512301c29", - "space": "25de8c2deec044392922989cfcf24c54", + "space": "c5ca8acafa0beaa4d08d014a97b6bc6b", "telemetry": "e1c8bc94e443aefd9458932cc0697a4d", "timelion-sheet": "9a2a2748877c7a7b582fef201ab1d4cf", "type": "2f4316de49999235636386fe51dc06c1", @@ -458,6 +457,77 @@ } } }, + "inventory-view": { + "properties": { + "autoBounds": { + "type": "boolean" + }, + "autoReload": { + "type": "boolean" + }, + "boundsOverride": { + "properties": { + "max": { + "type": "integer" + }, + "min": { + "type": "integer" + } + } + }, + "customOptions": { + "properties": { + "field": { + "type": "keyword" + }, + "text": { + "type": "keyword" + } + }, + "type": "nested" + }, + "filterQuery": { + "properties": { + "expression": { + "type": "keyword" + }, + "kind": { + "type": "keyword" + } + } + }, + "groupBy": { + "properties": { + "field": { + "type": "keyword" + }, + "label": { + "type": "keyword" + } + }, + "type": "nested" + }, + "metric": { + "properties": { + "type": { + "type": "keyword" + } + } + }, + "name": { + "type": "keyword" + }, + "nodeType": { + "type": "keyword" + }, + "time": { + "type": "integer" + }, + "view": { + "type": "keyword" + } + } + }, "kql-telemetry": { "properties": { "optInCount": { @@ -475,8 +545,7 @@ "type": "keyword" }, "state": { - "enabled": false, - "type": "object" + "type": "flattened" }, "title": { "type": "text" @@ -559,6 +628,72 @@ } } }, + "metrics-explorer-view": { + "properties": { + "chartOptions": { + "properties": { + "stack": { + "type": "boolean" + }, + "type": { + "type": "keyword" + }, + "yAxisMode": { + "type": "keyword" + } + } + }, + "currentTimerange": { + "properties": { + "from": { + "type": "keyword" + }, + "interval": { + "type": "keyword" + }, + "to": { + "type": "keyword" + } + } + }, + "name": { + "type": "keyword" + }, + "options": { + "properties": { + "aggregation": { + "type": "keyword" + }, + "filterQuery": { + "type": "keyword" + }, + "groupBy": { + "type": "keyword" + }, + "limit": { + "type": "integer" + }, + "metrics": { + "properties": { + "aggregation": { + "type": "keyword" + }, + "color": { + "type": "keyword" + }, + "field": { + "type": "keyword" + }, + "label": { + "type": "keyword" + } + }, + "type": "nested" + } + } + } + } + }, "migrationVersion": { "dynamic": "true", "properties": { @@ -950,6 +1085,10 @@ "disabledFeatures": { "type": "keyword" }, + "imageUrl": { + "index": false, + "type": "text" + }, "initials": { "type": "keyword" }, diff --git a/x-pack/test/functional/es_archives/lens/reporting/data.json.gz b/x-pack/test/functional/es_archives/lens/reporting/data.json.gz index 3a55820a3551d..3c06824f60646 100644 Binary files a/x-pack/test/functional/es_archives/lens/reporting/data.json.gz and b/x-pack/test/functional/es_archives/lens/reporting/data.json.gz differ diff --git a/x-pack/test/functional/es_archives/lens/reporting/mappings.json b/x-pack/test/functional/es_archives/lens/reporting/mappings.json index 14882ee507261..0321d57bc2df6 100644 --- a/x-pack/test/functional/es_archives/lens/reporting/mappings.json +++ b/x-pack/test/functional/es_archives/lens/reporting/mappings.json @@ -18,10 +18,12 @@ "graph-workspace": "cd7ba1330e6682e9cc00b78850874be1", "index-pattern": "66eccb05066c5a89924f48a9e9736499", "infrastructure-ui-source": "ddc0ecb18383f6b26101a2fadb2dab0c", + "inventory-view": "84b320fd67209906333ffce261128462", "kql-telemetry": "d12a98a6f19a2d273696597547e064ee", - "lens": "d69713426be87ba23283776aab149b9a", + "lens": "21c3ea0763beb1ecb0162529706b88c5", "map": "23d7aa4a720d4938ccde3983f87bd58d", "maps-telemetry": "a4229f8b16a6820c6d724b7e0c1f729d", + "metrics-explorer-view": "53c5365793677328df0ccb6138bf3cdd", "migrationVersion": "4a1746014a75ade3a714e1db5763276f", "ml-telemetry": "257fd1d4b4fdbb9cb4b8a3b27da201e9", "namespace": "2f4316de49999235636386fe51dc06c1", @@ -455,6 +457,77 @@ } } }, + "inventory-view": { + "properties": { + "autoBounds": { + "type": "boolean" + }, + "autoReload": { + "type": "boolean" + }, + "boundsOverride": { + "properties": { + "max": { + "type": "integer" + }, + "min": { + "type": "integer" + } + } + }, + "customOptions": { + "properties": { + "field": { + "type": "keyword" + }, + "text": { + "type": "keyword" + } + }, + "type": "nested" + }, + "filterQuery": { + "properties": { + "expression": { + "type": "keyword" + }, + "kind": { + "type": "keyword" + } + } + }, + "groupBy": { + "properties": { + "field": { + "type": "keyword" + }, + "label": { + "type": "keyword" + } + }, + "type": "nested" + }, + "metric": { + "properties": { + "type": { + "type": "keyword" + } + } + }, + "name": { + "type": "keyword" + }, + "nodeType": { + "type": "keyword" + }, + "time": { + "type": "integer" + }, + "view": { + "type": "keyword" + } + } + }, "kql-telemetry": { "properties": { "optInCount": { @@ -472,8 +545,7 @@ "type": "keyword" }, "state": { - "enabled": false, - "type": "object" + "type": "flattened" }, "title": { "type": "text" @@ -556,6 +628,72 @@ } } }, + "metrics-explorer-view": { + "properties": { + "chartOptions": { + "properties": { + "stack": { + "type": "boolean" + }, + "type": { + "type": "keyword" + }, + "yAxisMode": { + "type": "keyword" + } + } + }, + "currentTimerange": { + "properties": { + "from": { + "type": "keyword" + }, + "interval": { + "type": "keyword" + }, + "to": { + "type": "keyword" + } + } + }, + "name": { + "type": "keyword" + }, + "options": { + "properties": { + "aggregation": { + "type": "keyword" + }, + "filterQuery": { + "type": "keyword" + }, + "groupBy": { + "type": "keyword" + }, + "limit": { + "type": "integer" + }, + "metrics": { + "properties": { + "aggregation": { + "type": "keyword" + }, + "color": { + "type": "keyword" + }, + "field": { + "type": "keyword" + }, + "label": { + "type": "keyword" + } + }, + "type": "nested" + } + } + } + } + }, "migrationVersion": { "dynamic": "true", "properties": {