;
// Warning: (ae-forgotten-export) The symbol "IIndexPatternFieldList" needs to be exported by the entry point index.d.ts
@@ -584,6 +590,7 @@ export class IndexPattern implements IIndexPattern {
time_zone?: string | undefined;
}>> | undefined;
getAsSavedObjectBody(): {
+ fieldAttrs: string | undefined;
title: string;
timeFieldName: string | undefined;
intervalName: string | undefined;
@@ -603,6 +610,12 @@ export class IndexPattern implements IIndexPattern {
}[];
};
// (undocumented)
+ getFieldAttrs: () => {
+ [x: string]: {
+ customName: string;
+ };
+ };
+ // (undocumented)
getFieldByName(name: string): IndexPatternField | undefined;
getFormatterForField(field: IndexPatternField | IndexPatternField['spec'] | IFieldType): FieldFormat;
getFormatterForFieldNoDefault(fieldname: string): FieldFormat | undefined;
@@ -613,6 +626,7 @@ export class IndexPattern implements IIndexPattern {
// (undocumented)
getNonScriptedFields(): IndexPatternField[];
getOriginalSavedObjectBody: () => {
+ fieldAttrs?: string | undefined;
title?: string | undefined;
timeFieldName?: string | undefined;
intervalName?: string | undefined;
@@ -673,6 +687,8 @@ export class IndexPattern implements IIndexPattern {
//
// @public (undocumented)
export interface IndexPatternAttributes {
+ // (undocumented)
+ fieldAttrs?: string;
// (undocumented)
fieldFormatMap?: string;
// (undocumented)
@@ -1199,8 +1215,8 @@ export function usageProvider(core: CoreSetup_2): SearchUsage;
//
// src/plugins/data/common/es_query/filters/meta_filter.ts:53:3 - (ae-forgotten-export) The symbol "FilterState" needs to be exported by the entry point index.d.ts
// src/plugins/data/common/es_query/filters/meta_filter.ts:54:3 - (ae-forgotten-export) The symbol "FilterMeta" needs to be exported by the entry point index.d.ts
-// src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts:56:45 - (ae-forgotten-export) The symbol "IndexPatternFieldMap" needs to be exported by the entry point index.d.ts
-// src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts:62:5 - (ae-forgotten-export) The symbol "FormatFieldFn" needs to be exported by the entry point index.d.ts
+// src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts:58:45 - (ae-forgotten-export) The symbol "IndexPatternFieldMap" needs to be exported by the entry point index.d.ts
+// src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts:64:5 - (ae-forgotten-export) The symbol "FormatFieldFn" needs to be exported by the entry point index.d.ts
// src/plugins/data/server/index.ts:40:23 - (ae-forgotten-export) The symbol "buildCustomFilter" needs to be exported by the entry point index.d.ts
// src/plugins/data/server/index.ts:40:23 - (ae-forgotten-export) The symbol "buildFilter" needs to be exported by the entry point index.d.ts
// src/plugins/data/server/index.ts:71:21 - (ae-forgotten-export) The symbol "getEsQueryConfig" needs to be exported by the entry point index.d.ts
diff --git a/src/plugins/discover/public/application/angular/doc_table/components/table_header/helpers.tsx b/src/plugins/discover/public/application/angular/doc_table/components/table_header/helpers.tsx
index bd48b1e083871..b456fa0773b85 100644
--- a/src/plugins/discover/public/application/angular/doc_table/components/table_header/helpers.tsx
+++ b/src/plugins/discover/public/application/angular/doc_table/components/table_header/helpers.tsx
@@ -17,7 +17,6 @@
* under the License.
*/
import { IndexPattern } from '../../../../../kibana_services';
-import { shortenDottedString } from '../../../../helpers';
export type SortOrder = [string, string];
export interface ColumnProps {
@@ -67,7 +66,7 @@ export function getDisplayedColumns(
const field = indexPattern.getFieldByName(column);
return {
name: column,
- displayName: isShortDots ? shortenDottedString(column) : column,
+ displayName: field ? field.displayName : column,
isSortable: field && field.sortable ? true : false,
isRemoveable: column !== '_source' || columns.length > 1,
colLeftIdx: idx - 1 < 0 ? -1 : idx - 1,
diff --git a/src/plugins/discover/public/application/angular/doc_table/components/table_header/table_header.test.tsx b/src/plugins/discover/public/application/angular/doc_table/components/table_header/table_header.test.tsx
index 3d5698e2e0d96..7636939194ce1 100644
--- a/src/plugins/discover/public/application/angular/doc_table/components/table_header/table_header.test.tsx
+++ b/src/plugins/discover/public/application/angular/doc_table/components/table_header/table_header.test.tsx
@@ -35,6 +35,7 @@ function getMockIndexPattern() {
if (name === 'test1') {
return {
name,
+ displayName: name,
type: 'string',
aggregatable: false,
searchable: true,
@@ -43,6 +44,7 @@ function getMockIndexPattern() {
} else {
return {
name,
+ displayName: name,
type: 'string',
aggregatable: false,
searchable: true,
diff --git a/src/plugins/discover/public/application/angular/doc_table/components/table_header/table_header_column.tsx b/src/plugins/discover/public/application/angular/doc_table/components/table_header/table_header_column.tsx
index ac986fcaf0cbc..08a2d07d0b8e0 100644
--- a/src/plugins/discover/public/application/angular/doc_table/components/table_header/table_header_column.tsx
+++ b/src/plugins/discover/public/application/angular/doc_table/components/table_header/table_header_column.tsx
@@ -24,7 +24,7 @@ import { SortOrder } from './helpers';
interface Props {
colLeftIdx: number; // idx of the column to the left, -1 if moving is not possible
colRightIdx: number; // idx of the column to the right, -1 if moving is not possible
- displayName: string;
+ displayName?: string;
isRemoveable: boolean;
isSortable: boolean;
name: string;
diff --git a/src/plugins/discover/public/application/components/field_name/__snapshots__/field_name.test.tsx.snap b/src/plugins/discover/public/application/components/field_name/__snapshots__/field_name.test.tsx.snap
index d00a956b7c73d..2fa96f9372380 100644
--- a/src/plugins/discover/public/application/components/field_name/__snapshots__/field_name.test.tsx.snap
+++ b/src/plugins/discover/public/application/components/field_name/__snapshots__/field_name.test.tsx.snap
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`FieldName renders a geo field, useShortDots is set to true 1`] = `
+exports[`FieldName renders a geo field 1`] = `
@@ -24,7 +24,7 @@ exports[`FieldName renders a geo field, useShortDots is set to true 1`] = `
class="euiToolTipAnchor eui-textTruncate"
>
- t.t.test
+ test.test.test
diff --git a/src/plugins/discover/public/application/components/field_name/field_name.test.tsx b/src/plugins/discover/public/application/components/field_name/field_name.test.tsx
index e6cf8a57686f1..0deddce1c40a8 100644
--- a/src/plugins/discover/public/application/components/field_name/field_name.test.tsx
+++ b/src/plugins/discover/public/application/components/field_name/field_name.test.tsx
@@ -32,9 +32,7 @@ test('FieldName renders a number field by providing a field record, useShortDots
expect(component).toMatchSnapshot();
});
-test('FieldName renders a geo field, useShortDots is set to true', () => {
- const component = render(
-
- );
+test('FieldName renders a geo field', () => {
+ const component = render();
expect(component).toMatchSnapshot();
});
diff --git a/src/plugins/discover/public/application/components/field_name/field_name.tsx b/src/plugins/discover/public/application/components/field_name/field_name.tsx
index cf11f971ef76c..b8f664d6cf38a 100644
--- a/src/plugins/discover/public/application/components/field_name/field_name.tsx
+++ b/src/plugins/discover/public/application/components/field_name/field_name.tsx
@@ -18,30 +18,31 @@
*/
import React from 'react';
import { EuiFlexGroup, EuiFlexItem, EuiToolTip } from '@elastic/eui';
-
import { FieldIcon, FieldIconProps } from '../../../../../kibana_react/public';
-import { shortenDottedString } from '../../helpers';
import { getFieldTypeName } from './field_type_name';
+import { FieldMapping } from '../../doc_views/doc_views_types';
// properties fieldType and fieldName are provided in kbn_doc_view
// this should be changed when both components are deangularized
interface Props {
fieldName: string;
fieldType: string;
- useShortDots?: boolean;
+ fieldMapping?: FieldMapping;
fieldIconProps?: Omit;
scripted?: boolean;
}
export function FieldName({
fieldName,
+ fieldMapping,
fieldType,
- useShortDots,
fieldIconProps,
scripted = false,
}: Props) {
const typeName = getFieldTypeName(fieldType);
- const displayName = useShortDots ? shortenDottedString(fieldName) : fieldName;
+ const displayName =
+ fieldMapping && fieldMapping.displayName ? fieldMapping.displayName : fieldName;
+ const tooltip = displayName !== fieldName ? `${fieldName} (${displayName})` : fieldName;
return (
@@ -51,7 +52,7 @@ export function FieldName({
diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field.test.tsx b/src/plugins/discover/public/application/components/sidebar/discover_field.test.tsx
index 02ed17cd01f07..391e15485f074 100644
--- a/src/plugins/discover/public/application/components/sidebar/discover_field.test.tsx
+++ b/src/plugins/discover/public/application/components/sidebar/discover_field.test.tsx
@@ -43,8 +43,6 @@ jest.mock('../../../kibana_services', () => ({
get: (key: string) => {
if (key === 'fields:popularLimit') {
return 5;
- } else if (key === 'shortDots:enable') {
- return false;
}
},
},
@@ -54,7 +52,6 @@ jest.mock('../../../kibana_services', () => ({
function getComponent({
selected = false,
showDetails = false,
- useShortDots = false,
field,
}: {
selected?: boolean;
@@ -72,19 +69,16 @@ function getComponent({
const finalField =
field ??
- new IndexPatternField(
- {
- name: 'bytes',
- type: 'number',
- esTypes: ['long'],
- count: 10,
- scripted: false,
- searchable: true,
- aggregatable: true,
- readFromDocValues: true,
- },
- 'bytes'
- );
+ new IndexPatternField({
+ name: 'bytes',
+ type: 'number',
+ esTypes: ['long'],
+ count: 10,
+ scripted: false,
+ searchable: true,
+ aggregatable: true,
+ readFromDocValues: true,
+ });
const props = {
indexPattern,
@@ -95,7 +89,6 @@ function getComponent({
onRemoveField: jest.fn(),
showDetails,
selected,
- useShortDots,
};
const comp = mountWithIntl();
return { comp, props };
@@ -118,17 +111,14 @@ describe('discover sidebar field', function () {
expect(props.getDetails).toHaveBeenCalledWith(props.field);
});
it('should not allow clicking on _source', function () {
- const field = new IndexPatternField(
- {
- name: '_source',
- type: '_source',
- esTypes: ['_source'],
- searchable: true,
- aggregatable: true,
- readFromDocValues: true,
- },
- '_source'
- );
+ const field = new IndexPatternField({
+ name: '_source',
+ type: '_source',
+ esTypes: ['_source'],
+ searchable: true,
+ aggregatable: true,
+ readFromDocValues: true,
+ });
const { comp, props } = getComponent({
selected: true,
field,
diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field.tsx b/src/plugins/discover/public/application/components/sidebar/discover_field.tsx
index 0329b3a34580c..35515a6a0e7a5 100644
--- a/src/plugins/discover/public/application/components/sidebar/discover_field.tsx
+++ b/src/plugins/discover/public/application/components/sidebar/discover_field.tsx
@@ -24,7 +24,6 @@ import { DiscoverFieldDetails } from './discover_field_details';
import { FieldIcon, FieldButton } from '../../../../../kibana_react/public';
import { FieldDetails } from './types';
import { IndexPatternField, IndexPattern } from '../../../../../data/public';
-import { shortenDottedString } from '../../helpers';
import { getFieldTypeName } from './lib/get_field_type_name';
import './discover_field.scss';
@@ -58,10 +57,6 @@ export interface DiscoverFieldProps {
* Determines whether the field is selected
*/
selected?: boolean;
- /**
- * Determines whether the field name is shortened test.sub1.sub2 = t.s.sub2
- */
- useShortDots?: boolean;
/**
* Metric tracking function
* @param metricType
@@ -78,7 +73,6 @@ export function DiscoverField({
onAddFilter,
getDetails,
selected,
- useShortDots,
trackUiMetric,
}: DiscoverFieldProps) {
const addLabelAria = i18n.translate('discover.fieldChooser.discoverField.addButtonAriaLabel', {
@@ -118,13 +112,12 @@ export function DiscoverField({
);
+ const title =
+ field.displayName !== field.name ? `${field.name} (${field.displayName} )` : field.displayName;
+
const fieldName = (
-
- {useShortDots ? wrapOnDot(shortenDottedString(field.name)) : wrapOnDot(field.displayName)}
+
+ {wrapOnDot(field.displayName)}
);
diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field_details.test.tsx b/src/plugins/discover/public/application/components/sidebar/discover_field_details.test.tsx
index 8607873b98d3d..0618e53d15dbb 100644
--- a/src/plugins/discover/public/application/components/sidebar/discover_field_details.test.tsx
+++ b/src/plugins/discover/public/application/components/sidebar/discover_field_details.test.tsx
@@ -48,55 +48,46 @@ describe('discover sidebar field details', function () {
}
it('should enable the visualize link for a number field', function () {
- const visualizableField = new IndexPatternField(
- {
- name: 'bytes',
- type: 'number',
- esTypes: ['long'],
- count: 10,
- scripted: false,
- searchable: true,
- aggregatable: true,
- readFromDocValues: true,
- },
- 'bytes'
- );
+ const visualizableField = new IndexPatternField({
+ name: 'bytes',
+ type: 'number',
+ esTypes: ['long'],
+ count: 10,
+ scripted: false,
+ searchable: true,
+ aggregatable: true,
+ readFromDocValues: true,
+ });
const comp = mountComponent(visualizableField);
expect(findTestSubject(comp, 'fieldVisualize-bytes')).toBeTruthy();
});
it('should disable the visualize link for an _id field', function () {
- const conflictField = new IndexPatternField(
- {
- name: '_id',
- type: 'string',
- esTypes: ['_id'],
- count: 0,
- scripted: false,
- searchable: true,
- aggregatable: true,
- readFromDocValues: true,
- },
- 'test'
- );
+ const conflictField = new IndexPatternField({
+ name: '_id',
+ type: 'string',
+ esTypes: ['_id'],
+ count: 0,
+ scripted: false,
+ searchable: true,
+ aggregatable: true,
+ readFromDocValues: true,
+ });
const comp = mountComponent(conflictField);
expect(findTestSubject(comp, 'fieldVisualize-_id')).toEqual({});
});
it('should disable the visualize link for an unknown field', function () {
- const unknownField = new IndexPatternField(
- {
- name: 'test',
- type: 'unknown',
- esTypes: ['double'],
- count: 0,
- scripted: false,
- searchable: true,
- aggregatable: true,
- readFromDocValues: true,
- },
- 'test'
- );
+ const unknownField = new IndexPatternField({
+ name: 'test',
+ type: 'unknown',
+ esTypes: ['double'],
+ count: 0,
+ scripted: false,
+ searchable: true,
+ aggregatable: true,
+ readFromDocValues: true,
+ });
const comp = mountComponent(unknownField);
expect(findTestSubject(comp, 'fieldVisualize-test')).toEqual({});
});
diff --git a/src/plugins/discover/public/application/components/sidebar/discover_sidebar.test.tsx b/src/plugins/discover/public/application/components/sidebar/discover_sidebar.test.tsx
index 7504d181d82b2..23d2fa0a39f34 100644
--- a/src/plugins/discover/public/application/components/sidebar/discover_sidebar.test.tsx
+++ b/src/plugins/discover/public/application/components/sidebar/discover_sidebar.test.tsx
@@ -51,8 +51,6 @@ jest.mock('../../../kibana_services', () => ({
get: (key: string) => {
if (key === 'fields:popularLimit') {
return 5;
- } else if (key === 'shortDots:enable') {
- return false;
}
},
},
diff --git a/src/plugins/discover/public/application/components/sidebar/discover_sidebar.tsx b/src/plugins/discover/public/application/components/sidebar/discover_sidebar.tsx
index dfd09ccee9337..b8e09ce4d17e8 100644
--- a/src/plugins/discover/public/application/components/sidebar/discover_sidebar.tsx
+++ b/src/plugins/discover/public/application/components/sidebar/discover_sidebar.tsx
@@ -30,7 +30,7 @@ import { IndexPatternAttributes } from '../../../../../data/common';
import { SavedObject } from '../../../../../../core/types';
import { FIELDS_LIMIT_SETTING } from '../../../../common';
import { groupFields } from './lib/group_fields';
-import { IndexPatternField, IndexPattern, UI_SETTINGS } from '../../../../../data/public';
+import { IndexPatternField, IndexPattern } from '../../../../../data/public';
import { getDetails } from './lib/get_details';
import { getDefaultFieldFilter, setFieldFilterProp } from './lib/field_filter';
import { getIndexPatternFieldList } from './lib/get_index_pattern_field_list';
@@ -117,7 +117,6 @@ export function DiscoverSidebar({
);
const popularLimit = services.uiSettings.get(FIELDS_LIMIT_SETTING);
- const useShortDots = services.uiSettings.get(UI_SETTINGS.SHORT_DOTS_ENABLE);
const {
selected: selectedFields,
@@ -201,7 +200,6 @@ export function DiscoverSidebar({
onAddFilter={onAddFilter}
getDetails={getDetailsByField}
selected={true}
- useShortDots={useShortDots}
trackUiMetric={trackUiMetric}
/>
@@ -276,7 +274,6 @@ export function DiscoverSidebar({
onRemoveField={onRemoveField}
onAddFilter={onAddFilter}
getDetails={getDetailsByField}
- useShortDots={useShortDots}
trackUiMetric={trackUiMetric}
/>
@@ -307,7 +304,6 @@ export function DiscoverSidebar({
onRemoveField={onRemoveField}
onAddFilter={onAddFilter}
getDetails={getDetailsByField}
- useShortDots={useShortDots}
trackUiMetric={trackUiMetric}
/>
diff --git a/src/plugins/discover/public/application/components/sidebar/lib/field_filter.test.ts b/src/plugins/discover/public/application/components/sidebar/lib/field_filter.test.ts
index eb139f97c7b00..ebbffae83125c 100644
--- a/src/plugins/discover/public/application/components/sidebar/lib/field_filter.test.ts
+++ b/src/plugins/discover/public/application/components/sidebar/lib/field_filter.test.ts
@@ -59,6 +59,7 @@ describe('field_filter', function () {
const fieldList = [
{
name: 'bytes',
+ displayName: 'Bye,bye,Bytes',
type: 'number',
esTypes: ['long'],
count: 10,
@@ -68,6 +69,7 @@ describe('field_filter', function () {
},
{
name: 'extension',
+ displayName: 'Extension',
type: 'string',
esTypes: ['text'],
count: 10,
@@ -80,6 +82,8 @@ describe('field_filter', function () {
[
{ filter: {}, result: ['bytes', 'extension'] },
{ filter: { name: 'by' }, result: ['bytes'] },
+ { filter: { name: 'Ext' }, result: ['extension'] },
+ { filter: { name: 'Bytes' }, result: ['bytes'] },
{ filter: { aggregatable: true }, result: ['extension'] },
{ filter: { aggregatable: true, searchable: false }, result: [] },
{ filter: { type: 'string' }, result: ['extension'] },
diff --git a/src/plugins/discover/public/application/components/sidebar/lib/field_filter.ts b/src/plugins/discover/public/application/components/sidebar/lib/field_filter.ts
index f0d9a2d8af20f..2e1d9b76606df 100644
--- a/src/plugins/discover/public/application/components/sidebar/lib/field_filter.ts
+++ b/src/plugins/discover/public/application/components/sidebar/lib/field_filter.ts
@@ -72,7 +72,9 @@ export function isFieldFiltered(
field.type === '_source' ||
field.scripted ||
fieldCounts[field.name] > 0;
- const matchName = !filterState.name || field.name.indexOf(filterState.name) !== -1;
+ const needle = filterState.name ? filterState.name.toLowerCase() : '';
+ const haystack = `${field.name}${field.displayName || ''}`.toLowerCase();
+ const matchName = !filterState.name || haystack.indexOf(needle) !== -1;
return matchFilter && isAggregatable && isSearchable && scriptedOrMissing && matchName;
}
diff --git a/src/plugins/discover/public/application/components/table/table.tsx b/src/plugins/discover/public/application/components/table/table.tsx
index 628045bd32f61..5d37f598b38f6 100644
--- a/src/plugins/discover/public/application/components/table/table.tsx
+++ b/src/plugins/discover/public/application/components/table/table.tsx
@@ -46,7 +46,13 @@ export function DocViewTable({
{Object.keys(flattened)
- .sort()
+ .sort((fieldA, fieldB) => {
+ const mappingA = mapping(fieldA);
+ const mappingB = mapping(fieldB);
+ const nameA = !mappingA || !mappingA.displayName ? fieldA : mappingA.displayName;
+ const nameB = !mappingB || !mappingB.displayName ? fieldB : mappingB.displayName;
+ return nameA.localeCompare(nameB);
+ })
.map((field) => {
const valueRaw = flattened[field];
const value = trimAngularSpan(String(formatted[field]));
diff --git a/src/plugins/discover/public/application/components/table/table_row.tsx b/src/plugins/discover/public/application/components/table/table_row.tsx
index 5f7dd9f37dcd3..3d75e175951d5 100644
--- a/src/plugins/discover/public/application/components/table/table_row.tsx
+++ b/src/plugins/discover/public/application/components/table/table_row.tsx
@@ -91,6 +91,7 @@ export function DocViewTableRow({
diff --git a/src/plugins/discover/public/application/doc_views/doc_views_types.ts b/src/plugins/discover/public/application/doc_views/doc_views_types.ts
index 6c90861e26727..01145402e0f29 100644
--- a/src/plugins/discover/public/application/doc_views/doc_views_types.ts
+++ b/src/plugins/discover/public/application/doc_views/doc_views_types.ts
@@ -36,6 +36,7 @@ export interface FieldMapping {
rowCount?: number;
type: string;
name: string;
+ displayName?: string;
}
export type DocViewFilterFn = (
diff --git a/src/plugins/discover/public/application/helpers/index.ts b/src/plugins/discover/public/application/helpers/index.ts
index 3555d24924e80..f7497c29a2bda 100644
--- a/src/plugins/discover/public/application/helpers/index.ts
+++ b/src/plugins/discover/public/application/helpers/index.ts
@@ -17,5 +17,4 @@
* under the License.
*/
-export { shortenDottedString } from './shorten_dotted_string';
export { formatNumWithCommas } from './format_number_with_commas';
diff --git a/src/plugins/discover/public/application/helpers/shorten_dotted_string.ts b/src/plugins/discover/public/application/helpers/shorten_dotted_string.ts
deleted file mode 100644
index 9d78a96784339..0000000000000
--- a/src/plugins/discover/public/application/helpers/shorten_dotted_string.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-const DOT_PREFIX_RE = /(.).+?\./g;
-
-/**
- * Convert a dot.notated.string into a short
- * version (d.n.string)
- */
-export const shortenDottedString = (input: string) => input.replace(DOT_PREFIX_RE, '$1.');
diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx b/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx
index e1359eafe1c67..4b63eb5c56fd1 100644
--- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx
+++ b/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx
@@ -19,7 +19,14 @@
import React, { PureComponent } from 'react';
-import { EuiIcon, EuiInMemoryTable, EuiIconTip, EuiBasicTableColumn } from '@elastic/eui';
+import {
+ EuiIcon,
+ EuiInMemoryTable,
+ EuiIconTip,
+ EuiBasicTableColumn,
+ EuiBadge,
+ EuiToolTip,
+} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
@@ -144,6 +151,11 @@ const editDescription = i18n.translate(
{ defaultMessage: 'Edit' }
);
+const customNameDescription = i18n.translate(
+ 'indexPatternManagement.editIndexPattern.fields.table.customNameTooltip',
+ { defaultMessage: 'A custom name for the field.' }
+);
+
interface IndexedFieldProps {
indexPattern: IIndexPattern;
items: IndexedFieldItem[];
@@ -160,7 +172,7 @@ export class Table extends PureComponent {
return (
- {name}
+ {field.name}
{field.info && field.info.length ? (
@@ -185,6 +197,15 @@ export class Table extends PureComponent {
/>
) : null}
+ {field.customName && field.customName !== field.name ? (
+
+
+
+ {field.customName}
+
+
+
+ ) : null}
);
}
diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.test.tsx b/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.test.tsx
index 224d956cd9cf7..db53f6d51ec63 100644
--- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.test.tsx
+++ b/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.test.tsx
@@ -48,10 +48,7 @@ const indexPattern = ({
} as unknown) as IndexPattern;
const mockFieldToIndexPatternField = (spec: Record) => {
- return new IndexPatternField(
- (spec as unknown) as IndexPatternField['spec'],
- spec.displayName as string
- );
+ return new IndexPatternField((spec as unknown) as IndexPatternField['spec']);
};
const fields = [
diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx b/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx
index 92f0c4576e931..e097271248bbd 100644
--- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx
+++ b/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx
@@ -89,7 +89,11 @@ export class IndexedFieldsTable extends Component<
(fields, fieldFilter, indexedFieldTypeFilter) => {
if (fieldFilter) {
const normalizedFieldFilter = fieldFilter.toLowerCase();
- fields = fields.filter((field) => field.name.toLowerCase().includes(normalizedFieldFilter));
+ fields = fields.filter(
+ (field) =>
+ field.name.toLowerCase().includes(normalizedFieldFilter) ||
+ (field.displayName && field.displayName.toLowerCase().includes(normalizedFieldFilter))
+ );
}
if (indexedFieldTypeFilter) {
diff --git a/src/plugins/index_pattern_management/public/components/field_editor/__snapshots__/field_editor.test.tsx.snap b/src/plugins/index_pattern_management/public/components/field_editor/__snapshots__/field_editor.test.tsx.snap
index 1e8fb6f9492fe..babfbbfc2a763 100644
--- a/src/plugins/index_pattern_management/public/components/field_editor/__snapshots__/field_editor.test.tsx.snap
+++ b/src/plugins/index_pattern_management/public/components/field_editor/__snapshots__/field_editor.test.tsx.snap
@@ -51,6 +51,22 @@ exports[`FieldEditor should render create new scripted field correctly 1`] = `
value=""
/>
+
+ }
+ label="Custom name"
+ >
+
+
-
+
+ }
+ label="Custom name"
+ >
+
+
-
+
+ }
+ label="Custom name"
+ >
+
+
-
+
+ }
+ label="Custom name"
+ >
+
+
@@ -954,7 +1021,7 @@ exports[`FieldEditor should show deprecated lang warning 1`] = `
isInvalid={false}
label="Script"
>
-
+
+ }
+ label="Custom name"
+ >
+
+
- ({}));
@@ -37,6 +38,7 @@ jest.mock('@elastic/eui', () => ({
EuiButtonEmpty: 'eui-button-empty',
EuiCallOut: 'eui-call-out',
EuiCode: 'eui-code',
+ EuiCodeEditor: 'eui-code-editor',
EuiConfirmModal: 'eui-confirm-modal',
EuiFieldNumber: 'eui-field-number',
EuiFieldText: 'eui-field-text',
@@ -173,6 +175,60 @@ describe('FieldEditor', () => {
expect(component).toMatchSnapshot();
});
+ it('should display and update a customName correctly', async () => {
+ let testField = ({
+ name: 'test',
+ format: new Format(),
+ lang: undefined,
+ type: 'string',
+ customName: 'Test',
+ } as unknown) as IndexPatternField;
+ fieldList.push(testField);
+ indexPattern.fields.getByName = (name) => {
+ const flds = {
+ [testField.name]: testField,
+ };
+ return flds[name];
+ };
+ indexPattern.fields = {
+ ...indexPattern.fields,
+ ...{
+ update: (fld) => {
+ testField = (fld as unknown) as IndexPatternField;
+ },
+ add: jest.fn(),
+ },
+ };
+ indexPattern.fieldFormatMap = { test: field };
+ indexPattern.deleteFieldFormat = jest.fn();
+
+ const component = createComponentWithContext(
+ FieldEditor,
+ {
+ indexPattern,
+ spec: (testField as unknown) as IndexPatternField,
+ services: {
+ redirectAway: () => {},
+ indexPatternService: ({
+ updateSavedObject: jest.fn(() => Promise.resolve()),
+ } as unknown) as IndexPatternsService,
+ },
+ },
+ mockContext
+ );
+
+ await new Promise((resolve) => process.nextTick(resolve));
+ component.update();
+ const input = findTestSubject(component, 'editorFieldCustomName');
+ expect(input.props().value).toBe('Test');
+ input.simulate('change', { target: { value: 'new Test' } });
+ const saveBtn = findTestSubject(component, 'fieldSaveButton');
+
+ await saveBtn.simulate('click');
+ await new Promise((resolve) => process.nextTick(resolve));
+ expect(testField.customName).toEqual('new Test');
+ });
+
it('should show deprecated lang warning', async () => {
const testField = {
...field,
diff --git a/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx b/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx
index d02338a6aee24..97d30d88e018c 100644
--- a/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx
+++ b/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx
@@ -126,6 +126,7 @@ export interface FieldEditorState {
errors?: string[];
format: any;
spec: IndexPatternField['spec'];
+ customName: string;
}
export interface FieldEdiorProps {
@@ -166,6 +167,7 @@ export class FieldEditor extends PureComponent
+ }
+ >
+ {
+ this.setState({ customName: e.target.value });
+ }}
+ />
+
+ );
+ }
+
/**
* renders a warning and a table of conflicting indices
* in case there are indices with different types
@@ -772,7 +802,7 @@ export class FieldEditor extends PureComponent {
const field = this.state.spec;
const { indexPattern } = this.props;
- const { fieldFormatId, fieldFormatParams } = this.state;
+ const { fieldFormatId, fieldFormatParams, customName } = this.state;
if (field.scripted) {
this.setState({
@@ -813,6 +843,11 @@ export class FieldEditor extends PureComponent {
@@ -873,6 +908,7 @@ export class FieldEditor extends PureComponent
{this.renderScriptingPanels()}
{this.renderName()}
+ {this.renderCustomName()}
{this.renderLanguage()}
{this.renderType()}
{this.renderTypeConflict()}
diff --git a/test/functional/apps/discover/_discover.js b/test/functional/apps/discover/_discover.js
index 0bf032592d4fc..18d51626c2ae3 100644
--- a/test/functional/apps/discover/_discover.js
+++ b/test/functional/apps/discover/_discover.js
@@ -318,6 +318,16 @@ export default function ({ getService, getPageObjects }) {
const currentUrlWithoutScore = await browser.getCurrentUrl();
expect(currentUrlWithoutScore).not.to.contain('_score');
});
+ it('should add a field with customLabel, sort by it, display it correctly', async function () {
+ await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
+ await PageObjects.common.navigateToApp('discover');
+ await PageObjects.discover.clickFieldListItemAdd('referer');
+ await PageObjects.discover.clickFieldSort('referer');
+ expect(await PageObjects.discover.getDocHeader()).to.have.string('Referer custom');
+ expect(await PageObjects.discover.getAllFieldNames()).to.contain('Referer custom');
+ const url = await browser.getCurrentUrl();
+ expect(url).to.contain('referer');
+ });
});
describe('refresh interval', function () {
diff --git a/test/functional/apps/visualize/_data_table.js b/test/functional/apps/visualize/_data_table.js
index bd7511d373b90..5b0b7af56b332 100644
--- a/test/functional/apps/visualize/_data_table.js
+++ b/test/functional/apps/visualize/_data_table.js
@@ -209,6 +209,29 @@ export default function ({ getService, getPageObjects }) {
]);
});
+ it('should show correct data when selecting a field by its custom name', async () => {
+ await PageObjects.visualize.navigateToNewAggBasedVisualization();
+ await PageObjects.visualize.clickDataTable();
+ await PageObjects.visualize.clickNewSearch();
+ await PageObjects.timePicker.setDefaultAbsoluteRange();
+ await PageObjects.visEditor.clickBucket('Split rows');
+ await PageObjects.visEditor.selectAggregation('Date Histogram');
+ await PageObjects.visEditor.selectField('UTC time');
+ await PageObjects.visEditor.setInterval('Day');
+ await PageObjects.visEditor.clickGo();
+ const data = await PageObjects.visChart.getTableVisData();
+ expect(data.trim().split('\n')).to.be.eql([
+ '2015-09-20',
+ '4,757',
+ '2015-09-21',
+ '4,614',
+ '2015-09-22',
+ '4,633',
+ ]);
+ const header = await PageObjects.visChart.getTableVisHeader();
+ expect(header).to.contain('UTC time');
+ });
+
it('should correctly filter for applied time filter on the main timefield', async () => {
await filterBar.addFilter('@timestamp', 'is between', '2015-09-19', '2015-09-21');
await PageObjects.visChart.waitForVisualizationRenderingStabilized();
diff --git a/test/functional/fixtures/es_archiver/discover/data.json b/test/functional/fixtures/es_archiver/discover/data.json
index 9158a3023fc5e..0f9820a6c2f6e 100644
--- a/test/functional/fixtures/es_archiver/discover/data.json
+++ b/test/functional/fixtures/es_archiver/discover/data.json
@@ -7,7 +7,8 @@
"index-pattern": {
"fields": "[{\"name\":\"@message\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"@message.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"@message\"}}},{\"name\":\"@tags\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"@tags.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"@tags\"}}},{\"name\":\"@timestamp\",\"type\":\"date\",\"esTypes\":[\"date\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"_id\",\"type\":\"string\",\"esTypes\":[\"_id\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_index\",\"type\":\"string\",\"esTypes\":[\"_index\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_score\",\"type\":\"number\",\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_source\",\"type\":\"_source\",\"esTypes\":[\"_source\"],\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_type\",\"type\":\"string\",\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"agent\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"agent.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"agent\"}}},{\"name\":\"bytes\",\"type\":\"number\",\"esTypes\":[\"long\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"clientip\",\"type\":\"ip\",\"esTypes\":[\"ip\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"extension\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"extension.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"extension\"}}},{\"name\":\"geo.coordinates\",\"type\":\"geo_point\",\"esTypes\":[\"geo_point\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"geo.dest\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"geo.src\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"geo.srcdest\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"headings\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"headings.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"headings\"}}},{\"name\":\"host\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"host.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"host\"}}},{\"name\":\"id\",\"type\":\"number\",\"esTypes\":[\"integer\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"index\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"index.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"index\"}}},{\"name\":\"ip\",\"type\":\"ip\",\"esTypes\":[\"ip\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"links\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"links.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"links\"}}},{\"name\":\"machine.os\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"machine.os.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"machine.os\"}}},{\"name\":\"machine.ram\",\"type\":\"number\",\"esTypes\":[\"long\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"memory\",\"type\":\"number\",\"esTypes\":[\"double\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"meta.char\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"meta.related\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"meta.user.firstname\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"meta.user.lastname\",\"type\":\"number\",\"esTypes\":[\"integer\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"nestedField.child\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"nested\":{\"path\":\"nestedField\"}}},{\"name\":\"phpmemory\",\"type\":\"number\",\"esTypes\":[\"long\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"referer\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"relatedContent.article:modified_time\",\"type\":\"date\",\"esTypes\":[\"date\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"relatedContent.article:published_time\",\"type\":\"date\",\"esTypes\":[\"date\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"relatedContent.article:section\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"relatedContent.article:section.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"relatedContent.article:section\"}}},{\"name\":\"relatedContent.article:tag\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"relatedContent.article:tag.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"relatedContent.article:tag\"}}},{\"name\":\"relatedContent.og:description\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"relatedContent.og:description.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"relatedContent.og:description\"}}},{\"name\":\"relatedContent.og:image\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"relatedContent.og:image.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"relatedContent.og:image\"}}},{\"name\":\"relatedContent.og:image:height\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"relatedContent.og:image:height.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"relatedContent.og:image:height\"}}},{\"name\":\"relatedContent.og:image:width\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"relatedContent.og:image:width.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"relatedContent.og:image:width\"}}},{\"name\":\"relatedContent.og:site_name\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"relatedContent.og:site_name.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"relatedContent.og:site_name\"}}},{\"name\":\"relatedContent.og:title\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"relatedContent.og:title.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"relatedContent.og:title\"}}},{\"name\":\"relatedContent.og:type\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"relatedContent.og:type.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"relatedContent.og:type\"}}},{\"name\":\"relatedContent.og:url\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"relatedContent.og:url.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"relatedContent.og:url\"}}},{\"name\":\"relatedContent.twitter:card\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"relatedContent.twitter:card.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"relatedContent.twitter:card\"}}},{\"name\":\"relatedContent.twitter:description\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"relatedContent.twitter:description.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"relatedContent.twitter:description\"}}},{\"name\":\"relatedContent.twitter:image\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"relatedContent.twitter:image.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"relatedContent.twitter:image\"}}},{\"name\":\"relatedContent.twitter:site\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"relatedContent.twitter:site.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"relatedContent.twitter:site\"}}},{\"name\":\"relatedContent.twitter:title\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"relatedContent.twitter:title.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"relatedContent.twitter:title\"}}},{\"name\":\"relatedContent.url\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"relatedContent.url.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"relatedContent.url\"}}},{\"name\":\"request\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"request.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"request\"}}},{\"name\":\"response\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"response.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"response\"}}},{\"name\":\"spaces\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"spaces.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"spaces\"}}},{\"name\":\"type\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"url\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"url.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"url\"}}},{\"name\":\"utc_time\",\"type\":\"date\",\"esTypes\":[\"date\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"xss\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"xss.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"xss\"}}}]",
"timeFieldName": "@timestamp",
- "title": "logstash-*"
+ "title": "logstash-*",
+ "fieldAttrs": "{\"referer\":{\"customName\":\"Referer custom\"}}"
},
"type": "index-pattern"
}
diff --git a/test/functional/fixtures/es_archiver/discover/mappings.json b/test/functional/fixtures/es_archiver/discover/mappings.json
index 82002c095bcc5..53bbe8a5baa5b 100644
--- a/test/functional/fixtures/es_archiver/discover/mappings.json
+++ b/test/functional/fixtures/es_archiver/discover/mappings.json
@@ -93,6 +93,9 @@
},
"title": {
"type": "text"
+ },
+ "fieldAttrs": {
+ "type": "text"
}
}
},
diff --git a/test/functional/fixtures/es_archiver/visualize/data.json b/test/functional/fixtures/es_archiver/visualize/data.json
index abca5a98bf7fd..c57cdb40ae952 100644
--- a/test/functional/fixtures/es_archiver/visualize/data.json
+++ b/test/functional/fixtures/es_archiver/visualize/data.json
@@ -8,7 +8,8 @@
"fieldFormatMap": "{\"bytes\":{\"id\":\"bytes\"}}",
"fields": "[{\"name\":\"referer\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"agent\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:image:width\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"xss.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"headings.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:description\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"meta.user.lastname\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.article:tag.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"geo.dest\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.twitter:image\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.article:section.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"utc_time\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.twitter:card\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"meta.char\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"clientip\",\"type\":\"ip\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:image:height\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"host\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"machine.ram\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"links\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"id\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"@tags.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"phpmemory\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.twitter:card.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"ip\",\"type\":\"ip\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:image\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.article:modified_time\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"index\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.url\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:site_name.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"request.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.article:tag\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"agent.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"spaces\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:site.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"headings\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"_source\",\"type\":\"_source\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"relatedContent.og:image.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"request\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"index.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"extension\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"memory\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"_index\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"relatedContent.twitter:site\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:description\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:url\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"geo.coordinates\",\"type\":\"geo_point\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.url.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"meta.related\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:title.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:title.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"response.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"@message.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"machine.os\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.article:section\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:url.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"xss\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"links.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:title\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"geo.srcdest\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"url.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"extension.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"machine.os.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"@tags\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"host.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:type.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"geo.src\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"spaces.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:image:height.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"url\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:description.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:site_name\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:title\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"@message\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:image.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"@timestamp\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"bytes\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"response\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"meta.user.firstname\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:image:width.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:description.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.article:published_time\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"_id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"_type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"_score\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false}]",
"timeFieldName": "@timestamp",
- "title": "logstash-*"
+ "title": "logstash-*",
+ "fieldAttrs": "{\"utc_time\":{\"customName\":\"UTC time\"}}"
},
"type": "index-pattern"
}
diff --git a/test/functional/fixtures/es_archiver/visualize/mappings.json b/test/functional/fixtures/es_archiver/visualize/mappings.json
index a50aed233eea6..464f6751eac5c 100644
--- a/test/functional/fixtures/es_archiver/visualize/mappings.json
+++ b/test/functional/fixtures/es_archiver/visualize/mappings.json
@@ -93,6 +93,9 @@
},
"title": {
"type": "text"
+ },
+ "fieldAttrs": {
+ "type": "text"
}
}
},
diff --git a/test/functional/page_objects/discover_page.ts b/test/functional/page_objects/discover_page.ts
index 2423f66a4b34e..9c5bedf7c242d 100644
--- a/test/functional/page_objects/discover_page.ts
+++ b/test/functional/page_objects/discover_page.ts
@@ -246,9 +246,9 @@ export function DiscoverPageProvider({ getService, getPageObjects }: FtrProvider
public async getAllFieldNames() {
const sidebar = await testSubjects.find('discover-sidebar');
const $ = await sidebar.parseDomContent();
- return $('.dscSidebar__item[attr-field]')
+ return $('.dscSidebarField__name')
.toArray()
- .map((field) => $(field).find('span.eui-textTruncate').text());
+ .map((field) => $(field).text());
}
public async getSidebarWidth() {
diff --git a/test/functional/page_objects/visualize_chart_page.ts b/test/functional/page_objects/visualize_chart_page.ts
index 1acea624ad4cd..3e3f60ca17131 100644
--- a/test/functional/page_objects/visualize_chart_page.ts
+++ b/test/functional/page_objects/visualize_chart_page.ts
@@ -328,6 +328,13 @@ export function VisualizeChartPageProvider({ getService, getPageObjects }: FtrPr
return await testSubjects.getVisibleText('paginated-table-body');
}
+ /**
+ * This function returns the text displayed in the Table Vis header
+ */
+ public async getTableVisHeader() {
+ return await testSubjects.getVisibleText('paginated-table-header');
+ }
+
/**
* This function is the newer function to retrieve data from within a table visualization.
* It uses a better return format, than the old getTableVisData, by properly splitting
diff --git a/x-pack/test/functional/es_archives/discover/default/mappings.json b/x-pack/test/functional/es_archives/discover/default/mappings.json
index 82002c095bcc5..53bbe8a5baa5b 100644
--- a/x-pack/test/functional/es_archives/discover/default/mappings.json
+++ b/x-pack/test/functional/es_archives/discover/default/mappings.json
@@ -93,6 +93,9 @@
},
"title": {
"type": "text"
+ },
+ "fieldAttrs": {
+ "type": "text"
}
}
},