Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[index patterns] Field custom name => custom label #83717

Merged
merged 3 commits into from
Nov 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [IFieldType](./kibana-plugin-plugins-data-public.ifieldtype.md) &gt; [customName](./kibana-plugin-plugins-data-public.ifieldtype.customname.md)
[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [IFieldType](./kibana-plugin-plugins-data-public.ifieldtype.md) &gt; [customLabel](./kibana-plugin-plugins-data-public.ifieldtype.customlabel.md)

## IFieldType.customName property
## IFieldType.customLabel property

<b>Signature:</b>

```typescript
customName?: string;
customLabel?: string;
```
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface IFieldType
| --- | --- | --- |
| [aggregatable](./kibana-plugin-plugins-data-public.ifieldtype.aggregatable.md) | <code>boolean</code> | |
| [count](./kibana-plugin-plugins-data-public.ifieldtype.count.md) | <code>number</code> | |
| [customName](./kibana-plugin-plugins-data-public.ifieldtype.customname.md) | <code>string</code> | |
| [customLabel](./kibana-plugin-plugins-data-public.ifieldtype.customlabel.md) | <code>string</code> | |
| [displayName](./kibana-plugin-plugins-data-public.ifieldtype.displayname.md) | <code>string</code> | |
| [esTypes](./kibana-plugin-plugins-data-public.ifieldtype.estypes.md) | <code>string[]</code> | |
| [filterable](./kibana-plugin-plugins-data-public.ifieldtype.filterable.md) | <code>boolean</code> | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
```typescript
getFieldAttrs: () => {
[x: string]: {
customName: string;
customLabel: string;
};
};
```
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export declare class IndexPattern implements IIndexPattern
| [flattenHit](./kibana-plugin-plugins-data-public.indexpattern.flattenhit.md) | | <code>(hit: Record&lt;string, any&gt;, deep?: boolean) =&gt; Record&lt;string, any&gt;</code> | |
| [formatField](./kibana-plugin-plugins-data-public.indexpattern.formatfield.md) | | <code>FormatFieldFn</code> | |
| [formatHit](./kibana-plugin-plugins-data-public.indexpattern.formathit.md) | | <code>{</code><br/><code> (hit: Record&lt;string, any&gt;, type?: string): any;</code><br/><code> formatField: FormatFieldFn;</code><br/><code> }</code> | |
| [getFieldAttrs](./kibana-plugin-plugins-data-public.indexpattern.getfieldattrs.md) | | <code>() =&gt; {</code><br/><code> [x: string]: {</code><br/><code> customName: string;</code><br/><code> };</code><br/><code> }</code> | |
| [getFieldAttrs](./kibana-plugin-plugins-data-public.indexpattern.getfieldattrs.md) | | <code>() =&gt; {</code><br/><code> [x: string]: {</code><br/><code> customLabel: string;</code><br/><code> };</code><br/><code> }</code> | |
| [getOriginalSavedObjectBody](./kibana-plugin-plugins-data-public.indexpattern.getoriginalsavedobjectbody.md) | | <code>() =&gt; {</code><br/><code> fieldAttrs?: string &#124; undefined;</code><br/><code> title?: string &#124; undefined;</code><br/><code> timeFieldName?: string &#124; undefined;</code><br/><code> intervalName?: string &#124; undefined;</code><br/><code> fields?: string &#124; undefined;</code><br/><code> sourceFilters?: string &#124; undefined;</code><br/><code> fieldFormatMap?: string &#124; undefined;</code><br/><code> typeMeta?: string &#124; undefined;</code><br/><code> type?: string &#124; undefined;</code><br/><code> }</code> | Get last saved saved object fields |
| [id](./kibana-plugin-plugins-data-public.indexpattern.id.md) | | <code>string</code> | |
| [intervalName](./kibana-plugin-plugins-data-public.indexpattern.intervalname.md) | | <code>string &#124; undefined</code> | |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [IndexPatternField](./kibana-plugin-plugins-data-public.indexpatternfield.md) &gt; [customName](./kibana-plugin-plugins-data-public.indexpatternfield.customname.md)
[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [IndexPatternField](./kibana-plugin-plugins-data-public.indexpatternfield.md) &gt; [customLabel](./kibana-plugin-plugins-data-public.indexpatternfield.customlabel.md)

## IndexPatternField.customName property
## IndexPatternField.customLabel property

<b>Signature:</b>

```typescript
get customName(): string | undefined;
get customLabel(): string | undefined;

set customName(label: string | undefined);
set customLabel(customLabel: string | undefined);
```
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export declare class IndexPatternField implements IFieldType
| [aggregatable](./kibana-plugin-plugins-data-public.indexpatternfield.aggregatable.md) | | <code>boolean</code> | |
| [conflictDescriptions](./kibana-plugin-plugins-data-public.indexpatternfield.conflictdescriptions.md) | | <code>Record&lt;string, string[]&gt; &#124; undefined</code> | Description of field type conflicts across different indices in the same index pattern |
| [count](./kibana-plugin-plugins-data-public.indexpatternfield.count.md) | | <code>number</code> | Count is used for field popularity |
| [customName](./kibana-plugin-plugins-data-public.indexpatternfield.customname.md) | | <code>string &#124; undefined</code> | |
| [customLabel](./kibana-plugin-plugins-data-public.indexpatternfield.customlabel.md) | | <code>string &#124; undefined</code> | |
| [displayName](./kibana-plugin-plugins-data-public.indexpatternfield.displayname.md) | | <code>string</code> | |
| [esTypes](./kibana-plugin-plugins-data-public.indexpatternfield.estypes.md) | | <code>string[] &#124; undefined</code> | |
| [filterable](./kibana-plugin-plugins-data-public.indexpatternfield.filterable.md) | | <code>boolean</code> | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ toJSON(): {
aggregatable: boolean;
readFromDocValues: boolean;
subType: import("../types").IFieldSubType | undefined;
customName: string | undefined;
customLabel: string | undefined;
};
```
<b>Returns:</b>
Expand All @@ -38,6 +38,6 @@ toJSON(): {
aggregatable: boolean;
readFromDocValues: boolean;
subType: import("../types").IFieldSubType | undefined;
customName: string | undefined;
customLabel: string | undefined;
}`

Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) &gt; [IFieldType](./kibana-plugin-plugins-data-server.ifieldtype.md) &gt; [customName](./kibana-plugin-plugins-data-server.ifieldtype.customname.md)
[Home](./index.md) &gt; [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) &gt; [IFieldType](./kibana-plugin-plugins-data-server.ifieldtype.md) &gt; [customLabel](./kibana-plugin-plugins-data-server.ifieldtype.customlabel.md)

## IFieldType.customName property
## IFieldType.customLabel property

<b>Signature:</b>

```typescript
customName?: string;
customLabel?: string;
```
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface IFieldType
| --- | --- | --- |
| [aggregatable](./kibana-plugin-plugins-data-server.ifieldtype.aggregatable.md) | <code>boolean</code> | |
| [count](./kibana-plugin-plugins-data-server.ifieldtype.count.md) | <code>number</code> | |
| [customName](./kibana-plugin-plugins-data-server.ifieldtype.customname.md) | <code>string</code> | |
| [customLabel](./kibana-plugin-plugins-data-server.ifieldtype.customlabel.md) | <code>string</code> | |
| [displayName](./kibana-plugin-plugins-data-server.ifieldtype.displayname.md) | <code>string</code> | |
| [esTypes](./kibana-plugin-plugins-data-server.ifieldtype.estypes.md) | <code>string[]</code> | |
| [filterable](./kibana-plugin-plugins-data-server.ifieldtype.filterable.md) | <code>boolean</code> | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
```typescript
getFieldAttrs: () => {
[x: string]: {
customName: string;
customLabel: string;
};
};
```
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export declare class IndexPattern implements IIndexPattern
| [flattenHit](./kibana-plugin-plugins-data-server.indexpattern.flattenhit.md) | | <code>(hit: Record&lt;string, any&gt;, deep?: boolean) =&gt; Record&lt;string, any&gt;</code> | |
| [formatField](./kibana-plugin-plugins-data-server.indexpattern.formatfield.md) | | <code>FormatFieldFn</code> | |
| [formatHit](./kibana-plugin-plugins-data-server.indexpattern.formathit.md) | | <code>{</code><br/><code> (hit: Record&lt;string, any&gt;, type?: string): any;</code><br/><code> formatField: FormatFieldFn;</code><br/><code> }</code> | |
| [getFieldAttrs](./kibana-plugin-plugins-data-server.indexpattern.getfieldattrs.md) | | <code>() =&gt; {</code><br/><code> [x: string]: {</code><br/><code> customName: string;</code><br/><code> };</code><br/><code> }</code> | |
| [getFieldAttrs](./kibana-plugin-plugins-data-server.indexpattern.getfieldattrs.md) | | <code>() =&gt; {</code><br/><code> [x: string]: {</code><br/><code> customLabel: string;</code><br/><code> };</code><br/><code> }</code> | |
| [getOriginalSavedObjectBody](./kibana-plugin-plugins-data-server.indexpattern.getoriginalsavedobjectbody.md) | | <code>() =&gt; {</code><br/><code> fieldAttrs?: string &#124; undefined;</code><br/><code> title?: string &#124; undefined;</code><br/><code> timeFieldName?: string &#124; undefined;</code><br/><code> intervalName?: string &#124; undefined;</code><br/><code> fields?: string &#124; undefined;</code><br/><code> sourceFilters?: string &#124; undefined;</code><br/><code> fieldFormatMap?: string &#124; undefined;</code><br/><code> typeMeta?: string &#124; undefined;</code><br/><code> type?: string &#124; undefined;</code><br/><code> }</code> | Get last saved saved object fields |
| [id](./kibana-plugin-plugins-data-server.indexpattern.id.md) | | <code>string</code> | |
| [intervalName](./kibana-plugin-plugins-data-server.indexpattern.intervalname.md) | | <code>string &#124; undefined</code> | |
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ export class IndexPatternField implements IFieldType {
this.spec.lang = lang;
}

public get customName() {
return this.spec.customName;
public get customLabel() {
return this.spec.customLabel;
}

public set customName(label) {
this.spec.customName = label;
public set customLabel(customLabel) {
this.spec.customLabel = customLabel;
}

/**
Expand All @@ -93,8 +93,8 @@ export class IndexPatternField implements IFieldType {
}

public get displayName(): string {
return this.spec.customName
? this.spec.customName
return this.spec.customLabel
? this.spec.customLabel
: this.spec.shortDotsEnable
? shortenDottedString(this.spec.name)
: this.spec.name;
Expand Down Expand Up @@ -163,7 +163,7 @@ export class IndexPatternField implements IFieldType {
aggregatable: this.aggregatable,
readFromDocValues: this.readFromDocValues,
subType: this.subType,
customName: this.customName,
customLabel: this.customLabel,
};
}

Expand All @@ -186,7 +186,7 @@ export class IndexPatternField implements IFieldType {
readFromDocValues: this.readFromDocValues,
subType: this.subType,
format: getFormatterForField ? getFormatterForField(this).toJSON() : undefined,
customName: this.customName,
customLabel: this.customLabel,
shortDotsEnable: this.spec.shortDotsEnable,
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/data/common/index_patterns/fields/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export interface IFieldType {
scripted?: boolean;
subType?: IFieldSubType;
displayName?: string;
customName?: string;
customLabel?: string;
format?: any;
toSpec?: (options?: { getFormatterForField?: IndexPattern['getFormatterForField'] }) => FieldSpec;
}
Loading