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 pattern - refactor constructor #77791

Merged
merged 72 commits into from
Sep 23, 2020
Merged
Show file tree
Hide file tree
Changes from 64 commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
e679933
index pattern creator take spec
mattkime Aug 30, 2020
cc5884a
partial progress
mattkime Aug 30, 2020
76af115
simpler IndexPatterns.get
mattkime Aug 31, 2020
dd611ed
partial progress
mattkime Sep 1, 2020
ae40414
Merge branch 'master' into index_pattern_class_constructor_refactor
mattkime Sep 1, 2020
0b6e64d
fix field spec
mattkime Sep 1, 2020
262e183
fix field spec
mattkime Sep 1, 2020
be88df3
fix index pattern creation
mattkime Sep 2, 2020
574fce6
Merge branch 'master' into index_pattern_class_constructor_refactor
mattkime Sep 7, 2020
ff971a0
fix types and update docs
mattkime Sep 7, 2020
5084496
update docs
mattkime Sep 7, 2020
010a70f
refresh fields before creating index pattern
mattkime Sep 7, 2020
9c0f0f7
update docs
mattkime Sep 7, 2020
c4f5e67
Merge branch 'master' into index_pattern_class_constructor_refactor
mattkime Sep 7, 2020
00dfeff
update docs
mattkime Sep 7, 2020
33d7860
Merge branch 'master' into index_pattern_class_constructor_refactor
mattkime Sep 8, 2020
40bfe83
functional test fixes
mattkime Sep 9, 2020
b8c79f9
Merge branch 'master' into index_pattern_class_constructor_refactor
mattkime Sep 9, 2020
a46205a
separate create and save
mattkime Sep 10, 2020
ec00ce5
update docs, fix a couple of tests
mattkime Sep 10, 2020
275b152
update docs
mattkime Sep 10, 2020
6bec815
fix file upload indexing service
mattkime Sep 10, 2020
e7920b3
attempt to fix ml and maps tests
mattkime Sep 10, 2020
fc57286
fix index pattern create
mattkime Sep 10, 2020
c4d9b70
refactor index patterns methods
mattkime Sep 10, 2020
a8d0c36
fix tests
mattkime Sep 11, 2020
b4bcfa8
remove comment
mattkime Sep 11, 2020
317cfb7
Merge branch 'master' into index_pattern_class_constructor_refactor
mattkime Sep 11, 2020
f046894
fix saved object import
mattkime Sep 11, 2020
7dc3e8c
fixed jest test
mattkime Sep 12, 2020
584ee33
fix resolve conflict
mattkime Sep 12, 2020
217229b
update snapshot and remove indexPattern.create
mattkime Sep 12, 2020
9fb9e47
update docs
mattkime Sep 12, 2020
1280399
file upload should overwrite and remove clearCache from ml index patt…
mattkime Sep 12, 2020
da2bda8
fix transform creation
mattkime Sep 12, 2020
8dd5104
move field fetcher to server, remove init
mattkime Sep 13, 2020
3bbb19e
remove field fetcher and apiClient from index pattern class
mattkime Sep 13, 2020
a2272c0
remove file type unknown notification
mattkime Sep 14, 2020
d763623
Merge branch 'master' into index_pattern_class_constructor_refactor_test
mattkime Sep 15, 2020
4e7149b
add savedObjectToSpec
mattkime Sep 15, 2020
2f0a68d
renme functions
mattkime Sep 16, 2020
c69cc9a
fix create index pattern
mattkime Sep 16, 2020
2de93f6
field map for spec instead of array
mattkime Sep 16, 2020
0419ad6
fix a couple of missed function renames, make originalBody readonly
mattkime Sep 16, 2020
0988e38
Merge branch 'master' into index_pattern_class_constructor_refactor_test
mattkime Sep 16, 2020
6570f65
move deprecation warning and make isWildcard private
mattkime Sep 16, 2020
4535f58
Merge branch 'master' into index_pattern_class_constructor_refactor_test
mattkime Sep 16, 2020
cad1ed9
fix merge
mattkime Sep 16, 2020
dacf9d4
Merge branch 'master' into index_pattern_class_constructor_refactor_test
mattkime Sep 16, 2020
f166f73
remove usage of initFromSpec
mattkime Sep 16, 2020
03f1eac
Merge branch 'master' into index_pattern_class_constructor_refactor_test
mattkime Sep 16, 2020
8ffa520
update docs and fix functional test
mattkime Sep 16, 2020
1d63577
fix index pattern wizard test
mattkime Sep 17, 2020
9b86c1e
fix index pattern jest test
mattkime Sep 17, 2020
bdcb83a
remove comment
mattkime Sep 17, 2020
45c7b19
Merge branch 'master' into index_pattern_refactor_constructor
mattkime Sep 17, 2020
751d0f4
clean up index pattern jest test
mattkime Sep 18, 2020
0718d99
add index pattern service test
mattkime Sep 18, 2020
9251caa
stop using expandShorthand
mattkime Sep 18, 2020
a109420
stop using expandShorthand
mattkime Sep 18, 2020
9991d62
improved types
mattkime Sep 21, 2020
3f9e4e5
update docs
mattkime Sep 21, 2020
63838e1
Merge branch 'master' into index_pattern_refactor_constructor
mattkime Sep 21, 2020
dd2caff
fix file import
mattkime Sep 21, 2020
5b3d104
add docs
mattkime Sep 21, 2020
28ff17b
Merge branch 'master' into index_pattern_refactor_constructor
mattkime Sep 22, 2020
59ec324
don't load field list for data frame analytics
mattkime Sep 22, 2020
498637b
remove todo
mattkime Sep 22, 2020
e3b5407
catch on field refresh
mattkime Sep 22, 2020
ae0d9ee
remove comment
mattkime Sep 22, 2020
305f3f8
fix return type
mattkime Sep 22, 2020
569e00f
Merge branch 'master' into index_pattern_refactor_constructor
mattkime Sep 22, 2020
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
@@ -0,0 +1,20 @@
<!-- 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; [DuplicateIndexPatternError](./kibana-plugin-plugins-data-public.duplicateindexpatternerror.md) &gt; [(constructor)](./kibana-plugin-plugins-data-public.duplicateindexpatternerror._constructor_.md)

## DuplicateIndexPatternError.(constructor)

Constructs a new instance of the `DuplicateIndexPatternError` class

<b>Signature:</b>

```typescript
constructor(message: string);
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| message | <code>string</code> | |

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!-- 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; [DuplicateIndexPatternError](./kibana-plugin-plugins-data-public.duplicateindexpatternerror.md)

## DuplicateIndexPatternError class

<b>Signature:</b>

```typescript
export declare class DuplicateIndexPatternError extends Error
```

## Constructors

| Constructor | Modifiers | Description |
| --- | --- | --- |
| [(constructor)(message)](./kibana-plugin-plugins-data-public.duplicateindexpatternerror._constructor_.md) | | Constructs a new instance of the <code>DuplicateIndexPatternError</code> class |

Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,5 @@
<b>Signature:</b>

```typescript
fieldFormatMap?: Record<string, {
id: string;
params: unknown;
}>;
fieldFormatMap?: Record<string, SerializedFieldFormat<unknown> | undefined>;
```
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface IIndexPattern

| Property | Type | Description |
| --- | --- | --- |
| [fieldFormatMap](./kibana-plugin-plugins-data-public.iindexpattern.fieldformatmap.md) | <code>Record&lt;string, {</code><br/><code> id: string;</code><br/><code> params: unknown;</code><br/><code> }&gt;</code> | |
| [fieldFormatMap](./kibana-plugin-plugins-data-public.iindexpattern.fieldformatmap.md) | <code>Record&lt;string, SerializedFieldFormat&lt;unknown&gt; &#124; undefined&gt;</code> | |
| [fields](./kibana-plugin-plugins-data-public.iindexpattern.fields.md) | <code>IFieldType[]</code> | |
| [id](./kibana-plugin-plugins-data-public.iindexpattern.id.md) | <code>string</code> | |
| [timeFieldName](./kibana-plugin-plugins-data-public.iindexpattern.timefieldname.md) | <code>string</code> | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
```typescript
toSpec(options?: {
getFormatterForField?: IndexPattern['getFormatterForField'];
}): FieldSpec[];
}): IndexPatternFieldMap;
```

## Parameters
Expand All @@ -20,5 +20,5 @@ toSpec(options?: {

<b>Returns:</b>

`FieldSpec[]`
`IndexPatternFieldMap`

Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ Constructs a new instance of the `IndexPattern` class
<b>Signature:</b>

```typescript
constructor(id: string | undefined, { savedObjectsClient, apiClient, patternCache, fieldFormats, indexPatternsService, onNotification, onError, shortDotsEnable, metaFields, }: IndexPatternDeps);
constructor({ spec, savedObjectsClient, fieldFormats, shortDotsEnable, metaFields, }: IndexPatternDeps);
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| id | <code>string &#124; undefined</code> | |
| { savedObjectsClient, apiClient, patternCache, fieldFormats, indexPatternsService, onNotification, onError, shortDotsEnable, metaFields, } | <code>IndexPatternDeps</code> | |
| { spec, savedObjectsClient, fieldFormats, shortDotsEnable, metaFields, } | <code>IndexPatternDeps</code> | |

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@

## IndexPattern.addScriptedField() method

Add scripted field to field list

<b>Signature:</b>

```typescript
addScriptedField(name: string, script: string, fieldType: string | undefined, lang: string): Promise<void>;
addScriptedField(name: string, script: string, fieldType?: string, lang?: string): Promise<void>;
```

## Parameters
Expand All @@ -16,7 +18,7 @@ addScriptedField(name: string, script: string, fieldType: string | undefined, la
| --- | --- | --- |
| name | <code>string</code> | |
| script | <code>string</code> | |
| fieldType | <code>string &#124; undefined</code> | |
| fieldType | <code>string</code> | |
| lang | <code>string</code> | |

<b>Returns:</b>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
<b>Signature:</b>

```typescript
fieldFormatMap: any;
fieldFormatMap: Record<string, any>;
```
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

```typescript
fields: IIndexPatternFieldList & {
toSpec: () => FieldSpec[];
toSpec: () => IndexPatternFieldMap;
};
```

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
<b>Signature:</b>

```typescript
flattenHit: any;
flattenHit: (hit: Record<string, any>, deep?: boolean) => Record<string, any>;
```
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
<b>Signature:</b>

```typescript
formatField: any;
formatField: FormatFieldFn;
```
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@
<b>Signature:</b>

```typescript
formatHit: any;
formatHit: {
(hit: Record<string, any>, type?: string): any;
formatField: FormatFieldFn;
};
```
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<!-- 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; [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) &gt; [prepBody](./kibana-plugin-plugins-data-public.indexpattern.prepbody.md)
[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) &gt; [getAsSavedObjectBody](./kibana-plugin-plugins-data-public.indexpattern.getassavedobjectbody.md)

## IndexPattern.prepBody() method
## IndexPattern.getAsSavedObjectBody() method

Returns index pattern as saved object body for saving

<b>Signature:</b>

```typescript
prepBody(): {
getAsSavedObjectBody(): {
title: string;
timeFieldName: string | undefined;
intervalName: string | undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## IndexPattern.getFormatterForField() method

Provide a field, get its formatter

<b>Signature:</b>

```typescript
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!-- 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; [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) &gt; [getOriginalSavedObjectBody](./kibana-plugin-plugins-data-public.indexpattern.getoriginalsavedobjectbody.md)

## IndexPattern.getOriginalSavedObjectBody property

Get last saved saved object fields

<b>Signature:</b>

```typescript
getOriginalSavedObjectBody: () => {
title?: string | undefined;
timeFieldName?: string | undefined;
intervalName?: string | undefined;
fields?: string | undefined;
sourceFilters?: string | undefined;
fieldFormatMap?: string | undefined;
typeMeta?: string | undefined;
type?: string | undefined;
};
```
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## IndexPattern.getSourceFiltering() method

Get the source filtering configuration for that index.

<b>Signature:</b>

```typescript
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ export declare class IndexPattern implements IIndexPattern

| Constructor | Modifiers | Description |
| --- | --- | --- |
| [(constructor)(id, { savedObjectsClient, apiClient, patternCache, fieldFormats, indexPatternsService, onNotification, onError, shortDotsEnable, metaFields, })](./kibana-plugin-plugins-data-public.indexpattern._constructor_.md) | | Constructs a new instance of the <code>IndexPattern</code> class |
| [(constructor)({ spec, savedObjectsClient, fieldFormats, shortDotsEnable, metaFields, })](./kibana-plugin-plugins-data-public.indexpattern._constructor_.md) | | Constructs a new instance of the <code>IndexPattern</code> class |

## Properties

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [fieldFormatMap](./kibana-plugin-plugins-data-public.indexpattern.fieldformatmap.md) | | <code>any</code> | |
| [fields](./kibana-plugin-plugins-data-public.indexpattern.fields.md) | | <code>IIndexPatternFieldList &amp; {</code><br/><code> toSpec: () =&gt; FieldSpec[];</code><br/><code> }</code> | |
| [fieldsFetcher](./kibana-plugin-plugins-data-public.indexpattern.fieldsfetcher.md) | | <code>any</code> | |
| [flattenHit](./kibana-plugin-plugins-data-public.indexpattern.flattenhit.md) | | <code>any</code> | |
| [formatField](./kibana-plugin-plugins-data-public.indexpattern.formatfield.md) | | <code>any</code> | |
| [formatHit](./kibana-plugin-plugins-data-public.indexpattern.formathit.md) | | <code>any</code> | |
| [fieldFormatMap](./kibana-plugin-plugins-data-public.indexpattern.fieldformatmap.md) | | <code>Record&lt;string, any&gt;</code> | |
| [fields](./kibana-plugin-plugins-data-public.indexpattern.fields.md) | | <code>IIndexPatternFieldList &amp; {</code><br/><code> toSpec: () =&gt; IndexPatternFieldMap;</code><br/><code> }</code> | |
| [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> | |
| [getOriginalSavedObjectBody](./kibana-plugin-plugins-data-public.indexpattern.getoriginalsavedobjectbody.md) | | <code>() =&gt; {</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> | |
| [metaFields](./kibana-plugin-plugins-data-public.indexpattern.metafields.md) | | <code>string[]</code> | |
| [originalBody](./kibana-plugin-plugins-data-public.indexpattern.originalbody.md) | | <code>{</code><br/><code> [key: string]: any;</code><br/><code> }</code> | |
| [resetOriginalSavedObjectBody](./kibana-plugin-plugins-data-public.indexpattern.resetoriginalsavedobjectbody.md) | | <code>() =&gt; void</code> | Reset last saved saved object fields. used after saving |
| [sourceFilters](./kibana-plugin-plugins-data-public.indexpattern.sourcefilters.md) | | <code>SourceFilter[]</code> | |
| [timeFieldName](./kibana-plugin-plugins-data-public.indexpattern.timefieldname.md) | | <code>string &#124; undefined</code> | |
| [title](./kibana-plugin-plugins-data-public.indexpattern.title.md) | | <code>string</code> | |
Expand All @@ -41,26 +41,20 @@ export declare class IndexPattern implements IIndexPattern

| Method | Modifiers | Description |
| --- | --- | --- |
| [\_fetchFields()](./kibana-plugin-plugins-data-public.indexpattern._fetchfields.md) | | |
| [addScriptedField(name, script, fieldType, lang)](./kibana-plugin-plugins-data-public.indexpattern.addscriptedfield.md) | | |
| [create(allowOverride)](./kibana-plugin-plugins-data-public.indexpattern.create.md) | | |
| [addScriptedField(name, script, fieldType, lang)](./kibana-plugin-plugins-data-public.indexpattern.addscriptedfield.md) | | Add scripted field to field list |
| [getAggregationRestrictions()](./kibana-plugin-plugins-data-public.indexpattern.getaggregationrestrictions.md) | | |
| [getAsSavedObjectBody()](./kibana-plugin-plugins-data-public.indexpattern.getassavedobjectbody.md) | | Returns index pattern as saved object body for saving |
| [getComputedFields()](./kibana-plugin-plugins-data-public.indexpattern.getcomputedfields.md) | | |
| [getFieldByName(name)](./kibana-plugin-plugins-data-public.indexpattern.getfieldbyname.md) | | |
| [getFormatterForField(field)](./kibana-plugin-plugins-data-public.indexpattern.getformatterforfield.md) | | |
| [getFormatterForField(field)](./kibana-plugin-plugins-data-public.indexpattern.getformatterforfield.md) | | Provide a field, get its formatter |
| [getNonScriptedFields()](./kibana-plugin-plugins-data-public.indexpattern.getnonscriptedfields.md) | | |
| [getScriptedFields()](./kibana-plugin-plugins-data-public.indexpattern.getscriptedfields.md) | | |
| [getSourceFiltering()](./kibana-plugin-plugins-data-public.indexpattern.getsourcefiltering.md) | | |
| [getSourceFiltering()](./kibana-plugin-plugins-data-public.indexpattern.getsourcefiltering.md) | | Get the source filtering configuration for that index. |
| [getTimeField()](./kibana-plugin-plugins-data-public.indexpattern.gettimefield.md) | | |
| [init()](./kibana-plugin-plugins-data-public.indexpattern.init.md) | | |
| [initFromSpec(spec)](./kibana-plugin-plugins-data-public.indexpattern.initfromspec.md) | | |
| [isTimeBased()](./kibana-plugin-plugins-data-public.indexpattern.istimebased.md) | | |
| [isTimeBasedWildcard()](./kibana-plugin-plugins-data-public.indexpattern.istimebasedwildcard.md) | | |
| [isTimeNanosBased()](./kibana-plugin-plugins-data-public.indexpattern.istimenanosbased.md) | | |
| [isWildcard()](./kibana-plugin-plugins-data-public.indexpattern.iswildcard.md) | | |
| [popularizeField(fieldName, unit)](./kibana-plugin-plugins-data-public.indexpattern.popularizefield.md) | | |
| [prepBody()](./kibana-plugin-plugins-data-public.indexpattern.prepbody.md) | | |
| [refreshFields()](./kibana-plugin-plugins-data-public.indexpattern.refreshfields.md) | | |
| [removeScriptedField(fieldName)](./kibana-plugin-plugins-data-public.indexpattern.removescriptedfield.md) | | |
| [removeScriptedField(fieldName)](./kibana-plugin-plugins-data-public.indexpattern.removescriptedfield.md) | | Remove scripted field from field list |
| [toSpec()](./kibana-plugin-plugins-data-public.indexpattern.tospec.md) | | |

This file was deleted.

Loading