Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
84ee07c
Add runtimeObject to indexPattern
sebelga Jun 29, 2021
c136163
Add parent param to IndexPatternField
sebelga Jun 29, 2021
a376579
Block edit and delete of object subFields
sebelga Jun 29, 2021
14816d8
Handle computedRuntimeFields and computedRuntimeObjects
sebelga Jun 30, 2021
ce5148b
Refactor interface naming, using EnhancedRuntimeField for Kibana
sebelga Jun 30, 2021
6df961a
Cleanup
sebelga Jun 30, 2021
94e08e7
Add comment for getComputedRuntimeObjects()
sebelga Jun 30, 2021
6209b5d
Don't allow saving runtime objects without subfields
sebelga Jun 30, 2021
d922d41
Fix TS issues
sebelga Aug 23, 2021
9b865ed
Update jest snapshot
sebelga Aug 23, 2021
58be09d
Add "composite" option and update Preview to support it
sebelga Aug 23, 2021
f6527d4
Refactor code to use "composite" instead of "object"
sebelga Aug 23, 2021
3929e19
Update IndexPattern to handle composite runtime field
sebelga Aug 24, 2021
46d907b
Update comments
sebelga Aug 24, 2021
9c589e8
Update API docs
sebelga Aug 24, 2021
b10c61a
Fix FieldFormatConfig type
sebelga Aug 24, 2021
cc14ed7
Update API docs
sebelga Aug 25, 2021
85296a5
Update indexPatternSpecSchema on server
sebelga Aug 26, 2021
a4e1113
Fix component integration tests
sebelga Aug 26, 2021
183db29
Update API docs
sebelga Aug 26, 2021
9c7e8d1
Rely on types from the data plugin instead of creating new one
sebelga Aug 26, 2021
a3f0d32
Rename "parent" to "parentComposite" and prevent removing a runtime f…
sebelga Aug 26, 2021
05d13d9
Fix TS issue
sebelga Aug 26, 2021
c466d49
Fix jest snapshot
sebelga Aug 26, 2021
c582c99
Fix TS issue
sebelga Aug 26, 2021
6f9d5a1
Improve types and add comments
sebelga Aug 30, 2021
39095f8
Address CR changes
sebelga Aug 30, 2021
78127ac
Update jest snapshot
sebelga Aug 30, 2021
768e229
Fix TS issues and update server schema for runtime field
sebelga Aug 30, 2021
69e68b7
Merge branch 'index-pattern-field-editor/composite-runtime-field' int…
sebelga Aug 30, 2021
29a4edb
Remove API docs
sebelga Aug 30, 2021
626a7a9
Fix TS issues
sebelga Aug 30, 2021
235d83c
Fix functional test
sebelga Aug 30, 2021
6fbe79e
Small refactor
sebelga Aug 30, 2021
2465b15
Use SerializedFieldFormat interface instead of FieldFormatConfig alias
sebelga Aug 31, 2021
d246459
Export all publicly accessible interfaces
sebelga Aug 31, 2021
4894c29
Add dependency on the "expressions" plugin
sebelga Aug 31, 2021
113a5f3
Set dep on expressions on requiredPlugins and not requiredBundles
sebelga Aug 31, 2021
8fb592a
Revert type change in ml plugin
sebelga Aug 31, 2021
7aae1e7
Fix failing functional test (ml plugin)
sebelga Aug 31, 2021
ca81d0b
Fix old "object" type with "composite" type
sebelga Aug 31, 2021
412380e
Merge branch 'index-pattern-field-editor/composite-runtime-field' int…
sebelga Aug 31, 2021
cd62b78
Fix TS issue
sebelga Aug 31, 2021
e80f385
Fix TS issue
sebelga Aug 31, 2021
c51c0b4
Merge branch 'index-pattern-field-editor/composite-runtime-field' int…
sebelga Sep 1, 2021
38a9628
Add validation to not allow shadowing runtime composite with runtime …
sebelga Sep 1, 2021
62302d4
Use the new "DataView" and "DataViewField" interfaces
sebelga Sep 1, 2021
a864318
Fix TS issues
sebelga Sep 1, 2021
11d967b
Add method to return runtime_mappings of a Data view
sebelga Sep 1, 2021
8397753
Update type comment
sebelga Sep 1, 2021
e2793c0
Revert "Use the new "DataView" and "DataViewField" interfaces"
sebelga Sep 2, 2021
759f102
Don't rely on estypes for the RuntimeField interface
sebelga Sep 2, 2021
72e0108
Don't rely on estypes for the RuntimeField interface (2)
sebelga Sep 2, 2021
7190621
Revert changes server side now that RuntimeField interface is controlled
sebelga Sep 2, 2021
de4275d
Revert "Use the new "DataView" and "DataViewField" interfaces" (2)
sebelga Sep 2, 2021
94a7e37
Merge branch 'index-pattern-field-editor/composite-runtime-field' int…
sebelga Sep 6, 2021
f1f42b3
Refactor to not use runtimeCompositeMap
sebelga Sep 6, 2021
5462209
Update server side code
sebelga Sep 6, 2021
31d735a
Fix tests
sebelga Sep 6, 2021
9f83024
Fix TS issue and API integration test
sebelga Sep 6, 2021
dd43053
Fix TS issue
sebelga Sep 6, 2021
f454c16
Fix tests
sebelga Sep 6, 2021
0339cdd
Move logic to add composite runtime field to its own method
sebelga Sep 7, 2021
d4a75dc
Remove dependency on expressions plugin
sebelga Sep 8, 2021
d104bde
Merge branch 'index-pattern-field-editor/composite-runtime-field' int…
sebelga Sep 8, 2021
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
230 changes: 221 additions & 9 deletions api_docs/index_pattern_field_editor.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@
"text": "FormatEditorProps"
},
"<P>, ",
"FormatEditorState",
{
"pluginId": "indexPatternFieldEditor",
"scope": "public",
"docId": "kibIndexPatternFieldEditorPluginApi",
"section": "def-public.FormatEditorState",
"text": "FormatEditorState"
},
" & S, any>"
],
"path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/default/default.tsx",
Expand All @@ -50,7 +56,13 @@
"label": "state",
"description": [],
"signature": [
"FormatEditorState",
{
"pluginId": "indexPatternFieldEditor",
"scope": "public",
"docId": "kibIndexPatternFieldEditorPluginApi",
"section": "def-public.FormatEditorState",
"text": "FormatEditorState"
},
" & S"
],
"path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/default/default.tsx",
Expand All @@ -73,9 +85,21 @@
"text": "FormatEditorProps"
},
"<{}>, state: ",
"FormatEditorState",
{
"pluginId": "indexPatternFieldEditor",
"scope": "public",
"docId": "kibIndexPatternFieldEditorPluginApi",
"section": "def-public.FormatEditorState",
"text": "FormatEditorState"
},
") => { error: string | undefined; samples: ",
"Sample",
{
"pluginId": "indexPatternFieldEditor",
"scope": "public",
"docId": "kibIndexPatternFieldEditorPluginApi",
"section": "def-public.Sample",
"text": "Sample"
},
"[]; }"
],
"path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/default/default.tsx",
Expand Down Expand Up @@ -110,7 +134,13 @@
"label": "state",
"description": [],
"signature": [
"FormatEditorState"
{
"pluginId": "indexPatternFieldEditor",
"scope": "public",
"docId": "kibIndexPatternFieldEditorPluginApi",
"section": "def-public.FormatEditorState",
"text": "FormatEditorState"
}
],
"path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/default/default.tsx",
"deprecated": false,
Expand Down Expand Up @@ -307,6 +337,53 @@
],
"initialIsOpen": false
},
{
"parentPluginId": "indexPatternFieldEditor",
"id": "def-public.FormatEditorState",
"type": "Interface",
"tags": [],
"label": "FormatEditorState",
"description": [],
"path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/format_editor.tsx",
"deprecated": false,
"children": [
{
"parentPluginId": "indexPatternFieldEditor",
"id": "def-public.FormatEditorState.EditorComponent",
"type": "CompoundType",
"tags": [],
"label": "EditorComponent",
"description": [],
"signature": [
"React.LazyExoticComponent<",
{
"pluginId": "indexPatternFieldEditor",
"scope": "public",
"docId": "kibIndexPatternFieldEditorPluginApi",
"section": "def-public.FieldFormatEditor",
"text": "FieldFormatEditor"
},
"<{}>> | null"
],
"path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/format_editor.tsx",
"deprecated": false
},
{
"parentPluginId": "indexPatternFieldEditor",
"id": "def-public.FormatEditorState.fieldFormatId",
"type": "string",
"tags": [],
"label": "fieldFormatId",
"description": [],
"signature": [
"string | undefined"
],
"path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/format_editor.tsx",
"deprecated": false
}
],
"initialIsOpen": false
},
{
"parentPluginId": "indexPatternFieldEditor",
"id": "def-public.OpenFieldDeleteModalOptions",
Expand Down Expand Up @@ -431,15 +508,15 @@
"section": "def-common.IndexPatternField",
"text": "IndexPatternField"
},
") => void) | undefined"
"[]) => void) | undefined"
],
"path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx",
"deprecated": false,
"children": [
{
"parentPluginId": "indexPatternFieldEditor",
"id": "def-public.OpenFieldEditorOptions.onSave.$1",
"type": "Object",
"type": "Array",
"tags": [],
"label": "field",
"description": [],
Expand All @@ -450,7 +527,8 @@
"docId": "kibDataIndexPatternsPluginApi",
"section": "def-common.IndexPatternField",
"text": "IndexPatternField"
}
},
"[]"
],
"path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx",
"deprecated": false,
Expand All @@ -474,6 +552,134 @@
}
],
"initialIsOpen": false
},
{
"parentPluginId": "indexPatternFieldEditor",
"id": "def-public.Props",
"type": "Interface",
"tags": [],
"label": "Props",
"description": [],
"path": "src/plugins/index_pattern_field_editor/public/components/delete_field_provider.tsx",
"deprecated": false,
"children": [
{
"parentPluginId": "indexPatternFieldEditor",
"id": "def-public.Props.children",
"type": "Function",
"tags": [],
"label": "children",
"description": [],
"signature": [
"(deleteFieldHandler: DeleteFieldFunc) => React.ReactNode"
],
"path": "src/plugins/index_pattern_field_editor/public/components/delete_field_provider.tsx",
"deprecated": false,
"children": [
{
"parentPluginId": "indexPatternFieldEditor",
"id": "def-public.Props.children.$1",
"type": "Function",
"tags": [],
"label": "deleteFieldHandler",
"description": [],
"signature": [
"DeleteFieldFunc"
],
"path": "src/plugins/index_pattern_field_editor/public/components/delete_field_provider.tsx",
"deprecated": false,
"isRequired": true
}
],
"returnComment": []
},
{
"parentPluginId": "indexPatternFieldEditor",
"id": "def-public.Props.indexPattern",
"type": "Object",
"tags": [],
"label": "indexPattern",
"description": [],
"signature": [
{
"pluginId": "data",
"scope": "common",
"docId": "kibDataIndexPatternsPluginApi",
"section": "def-common.IndexPattern",
"text": "IndexPattern"
}
],
"path": "src/plugins/index_pattern_field_editor/public/components/delete_field_provider.tsx",
"deprecated": false
},
{
"parentPluginId": "indexPatternFieldEditor",
"id": "def-public.Props.onDelete",
"type": "Function",
"tags": [],
"label": "onDelete",
"description": [],
"signature": [
"((fieldNames: string[]) => void) | undefined"
],
"path": "src/plugins/index_pattern_field_editor/public/components/delete_field_provider.tsx",
"deprecated": false,
"children": [
{
"parentPluginId": "indexPatternFieldEditor",
"id": "def-public.Props.onDelete.$1",
"type": "Array",
"tags": [],
"label": "fieldNames",
"description": [],
"signature": [
"string[]"
],
"path": "src/plugins/index_pattern_field_editor/public/components/delete_field_provider.tsx",
"deprecated": false,
"isRequired": true
}
],
"returnComment": []
}
],
"initialIsOpen": false
},
{
"parentPluginId": "indexPatternFieldEditor",
"id": "def-public.Sample",
"type": "Interface",
"tags": [],
"label": "Sample",
"description": [],
"path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/types.ts",
"deprecated": false,
"children": [
{
"parentPluginId": "indexPatternFieldEditor",
"id": "def-public.Sample.input",
"type": "CompoundType",
"tags": [],
"label": "input",
"description": [],
"signature": [
"string | number | React.ReactText[] | Record<string, React.ReactText[]>"
],
"path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/types.ts",
"deprecated": false
},
{
"parentPluginId": "indexPatternFieldEditor",
"id": "def-public.Sample.output",
"type": "string",
"tags": [],
"label": "output",
"description": [],
"path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/types.ts",
"deprecated": false
}
],
"initialIsOpen": false
}
],
"enums": [],
Expand Down Expand Up @@ -722,7 +928,13 @@
"description": [],
"signature": [
"React.FunctionComponent<",
"Props",
{
"pluginId": "indexPatternFieldEditor",
"scope": "public",
"docId": "kibIndexPatternFieldEditorPluginApi",
"section": "def-public.Props",
"text": "Props"
},
">"
],
"path": "src/plugins/index_pattern_field_editor/public/types.ts",
Expand Down
2 changes: 1 addition & 1 deletion api_docs/index_pattern_field_editor.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services

| Public API count | Any count | Items lacking comments | Missing exports |
|-------------------|-----------|------------------------|-----------------|
| 42 | 2 | 39 | 3 |
| 54 | 2 | 51 | 0 |

## Client

Expand Down
1 change: 1 addition & 0 deletions src/plugins/data/common/index_patterns/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const RUNTIME_FIELD_TYPES = [
'ip',
'boolean',
'geo_point',
'composite',
] as const;

/**
Expand Down
5 changes: 3 additions & 2 deletions src/plugins/data/common/index_patterns/fields/field_list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { DataView } from '../index_patterns';
type FieldMap = Map<DataViewField['name'], DataViewField>;

export interface IIndexPatternFieldList extends Array<DataViewField> {
add(field: FieldSpec): void;
add(field: FieldSpec): DataViewField;
getAll(): DataViewField[];
getByName(name: DataViewField['name']): DataViewField | undefined;
getByType(type: DataViewField['type']): DataViewField[];
Expand Down Expand Up @@ -55,11 +55,12 @@ export const fieldList = (
public readonly getByType = (type: DataViewField['type']) => [
...(this.groups.get(type) || new Map()).values(),
];
public readonly add = (field: FieldSpec) => {
public readonly add = (field: FieldSpec): DataViewField => {
const newField = new DataViewField({ ...field, shortDotsEnable });
this.push(newField);
this.setByName(newField);
this.setByGroup(newField);
return newField;
};

public readonly remove = (field: IFieldType) => {
Expand Down
Loading