-
-
diff --git a/src/plugins/home/public/application/components/__snapshots__/add_data.test.js.snap b/src/plugins/home/public/application/components/__snapshots__/add_data.test.js.snap
index dea33022fa429..924de9bbd0994 100644
--- a/src/plugins/home/public/application/components/__snapshots__/add_data.test.js.snap
+++ b/src/plugins/home/public/application/components/__snapshots__/add_data.test.js.snap
@@ -277,7 +277,7 @@ exports[`apmUiEnabled 1`] = `
/>
+
+ {mappingConflictLabel}
- {mappingConflictLabel}
+
+ You can use scripted fields in visualizations and display them in your documents. However, you cannot search scripted fields.
+
+
extends PureComponent<
FormatEditorProps ,
FormatEditorState & S
> {
+ static formatId = 'default';
state = defaultState as FormatEditorState & S;
static getDerivedStateFromProps(nextProps: FormatEditorProps<{}>, state: FormatEditorState) {
diff --git a/src/legacy/ui/public/field_editor/components/field_format_editor/editors/default/index.ts b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/default/index.ts
similarity index 100%
rename from src/legacy/ui/public/field_editor/components/field_format_editor/editors/default/index.ts
rename to src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/default/index.ts
diff --git a/src/legacy/ui/public/field_editor/components/field_format_editor/editors/duration/__snapshots__/duration.test.tsx.snap b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/duration/__snapshots__/duration.test.tsx.snap
similarity index 94%
rename from src/legacy/ui/public/field_editor/components/field_format_editor/editors/duration/__snapshots__/duration.test.tsx.snap
rename to src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/duration/__snapshots__/duration.test.tsx.snap
index dbebd324b16b6..b606e60949af5 100644
--- a/src/legacy/ui/public/field_editor/components/field_format_editor/editors/duration/__snapshots__/duration.test.tsx.snap
+++ b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/duration/__snapshots__/duration.test.tsx.snap
@@ -12,7 +12,7 @@ exports[`DurationFormatEditor should render human readable output normally 1`] =
label={
@@ -47,7 +47,7 @@ export const CreateIndexPatternPrompt = ({ onClose }: { onClose: () => void }) =
@@ -66,38 +66,38 @@ export const CreateIndexPatternPrompt = ({ onClose }: { onClose: () => void }) =
-
-
-
+ {createIndexPatternHeader}
+ {isBeta ? (
+
+
diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/components/step_index_pattern/__snapshots__/step_index_pattern.test.tsx.snap b/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_index_pattern/__snapshots__/step_index_pattern.test.tsx.snap
similarity index 100%
rename from src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/components/step_index_pattern/__snapshots__/step_index_pattern.test.tsx.snap
rename to src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_index_pattern/__snapshots__/step_index_pattern.test.tsx.snap
diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/components/step_index_pattern/components/header/__snapshots__/header.test.tsx.snap b/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_index_pattern/components/header/__snapshots__/header.test.tsx.snap
similarity index 85%
rename from src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/components/step_index_pattern/components/header/__snapshots__/header.test.tsx.snap
rename to src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_index_pattern/components/header/__snapshots__/header.test.tsx.snap
index f2fb17cdb0d60..3021292953ff5 100644
--- a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/components/step_index_pattern/components/header/__snapshots__/header.test.tsx.snap
+++ b/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_index_pattern/components/header/__snapshots__/header.test.tsx.snap
@@ -8,7 +8,7 @@ exports[`Header should mark the input as invalid 1`] = `
@@ -42,7 +42,7 @@ exports[`Header should mark the input as invalid 1`] = `
@@ -146,7 +146,7 @@ exports[`Header should render normally 1`] = `
@@ -69,7 +69,7 @@ export const Header: React.FC
@@ -21,7 +21,7 @@ exports[`Header should render normally 1`] = `
>
@@ -41,7 +41,7 @@ export const Header: React.FC
+
+ Scripted fields
+
+
+
@@ -40,7 +41,7 @@ export const Header = ({ addScriptedFieldUrl }: HeaderProps) => (
@@ -17,14 +17,14 @@ exports[`Header should render normally 1`] = `
@@ -35,7 +35,7 @@ export const Header = () => (
@@ -19,31 +19,14 @@ exports[`FieldEditor should render create new scripted field correctly 1`] = `
isVisible={false}
/>
@@ -538,31 +506,14 @@ exports[`FieldEditor should show conflict field warning 1`] = `
isVisible={false}
/>
@@ -1191,31 +1126,14 @@ exports[`FieldEditor should show multiple type field warning with a table contai
isVisible={false}
/>
diff --git a/src/legacy/ui/public/field_editor/components/field_format_editor/editors/url/__snapshots__/url.test.tsx.snap b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/url/__snapshots__/url.test.tsx.snap
similarity index 89%
rename from src/legacy/ui/public/field_editor/components/field_format_editor/editors/url/__snapshots__/url.test.tsx.snap
rename to src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/url/__snapshots__/url.test.tsx.snap
index a3418077ad258..aa69b8da6cf60 100644
--- a/src/legacy/ui/public/field_editor/components/field_format_editor/editors/url/__snapshots__/url.test.tsx.snap
+++ b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/url/__snapshots__/url.test.tsx.snap
@@ -19,7 +19,7 @@ exports[`UrlFormatEditor should render label template help 1`] = `
label={
diff --git a/src/legacy/ui/public/field_editor/components/field_format_editor/editors/url/index.ts b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/url/index.ts
similarity index 100%
rename from src/legacy/ui/public/field_editor/components/field_format_editor/editors/url/index.ts
rename to src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/url/index.ts
diff --git a/src/legacy/ui/public/field_editor/components/field_format_editor/editors/url/label_template_flyout.test.tsx b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/url/label_template_flyout.test.tsx
similarity index 100%
rename from src/legacy/ui/public/field_editor/components/field_format_editor/editors/url/label_template_flyout.test.tsx
rename to src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/url/label_template_flyout.test.tsx
diff --git a/src/legacy/ui/public/field_editor/components/field_format_editor/editors/url/label_template_flyout.tsx b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/url/label_template_flyout.tsx
similarity index 80%
rename from src/legacy/ui/public/field_editor/components/field_format_editor/editors/url/label_template_flyout.tsx
rename to src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/url/label_template_flyout.tsx
index 1ce7bec579e16..d04ee58f26b0a 100644
--- a/src/legacy/ui/public/field_editor/components/field_format_editor/editors/url/label_template_flyout.tsx
+++ b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/url/label_template_flyout.tsx
@@ -35,13 +35,13 @@ const items: LabelTemplateExampleItem[] = [
{
input: 1234,
urlTemplate: 'http://company.net/profiles?user_id={{value}}',
- labelTemplate: i18n.translate('common.ui.fieldEditor.labelTemplate.example.idLabel', {
+ labelTemplate: i18n.translate('indexPatternManagement.labelTemplate.example.idLabel', {
defaultMessage: 'User #{value}',
values: { value: '{{value}}' },
}),
output:
'' +
- i18n.translate('common.ui.fieldEditor.labelTemplate.example.output.idLabel', {
+ i18n.translate('indexPatternManagement.labelTemplate.example.output.idLabel', {
defaultMessage: 'User',
}) +
' #1234',
@@ -49,12 +49,12 @@ const items: LabelTemplateExampleItem[] = [
{
input: '/assets/main.css',
urlTemplate: 'http://site.com{{rawValue}}',
- labelTemplate: i18n.translate('common.ui.fieldEditor.labelTemplate.example.pathLabel', {
+ labelTemplate: i18n.translate('indexPatternManagement.labelTemplate.example.pathLabel', {
defaultMessage: 'View Asset',
}),
output:
'' +
- i18n.translate('common.ui.fieldEditor.labelTemplate.example.output.pathLabel', {
+ i18n.translate('indexPatternManagement.labelTemplate.example.output.pathLabel', {
defaultMessage: 'View Asset',
}) +
'',
@@ -68,13 +68,13 @@ export const LabelTemplateFlyout = ({ isVisible = false, onClose = () => {} }) =
@@ -108,26 +108,26 @@ export const LabelTemplateFlyout = ({ isVisible = false, onClose = () => {} }) =
columns={[
{
field: 'input',
- name: i18n.translate('common.ui.fieldEditor.labelTemplate.inputHeader', {
+ name: i18n.translate('indexPatternManagement.labelTemplate.inputHeader', {
defaultMessage: 'Input',
}),
width: '160px',
},
{
field: 'urlTemplate',
- name: i18n.translate('common.ui.fieldEditor.labelTemplate.urlHeader', {
+ name: i18n.translate('indexPatternManagement.labelTemplate.urlHeader', {
defaultMessage: 'URL Template',
}),
},
{
field: 'labelTemplate',
- name: i18n.translate('common.ui.fieldEditor.labelTemplate.labelHeader', {
+ name: i18n.translate('indexPatternManagement.labelTemplate.labelHeader', {
defaultMessage: 'Label Template',
}),
},
{
field: 'output',
- name: i18n.translate('common.ui.fieldEditor.labelTemplate.outputHeader', {
+ name: i18n.translate('indexPatternManagement.labelTemplate.outputHeader', {
defaultMessage: 'Output',
}),
render: (value: LabelTemplateExampleItem['output']) => {
diff --git a/src/legacy/ui/public/field_editor/components/field_format_editor/editors/url/url.test.tsx b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/url/url.test.tsx
similarity index 94%
rename from src/legacy/ui/public/field_editor/components/field_format_editor/editors/url/url.test.tsx
rename to src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/url/url.test.tsx
index 4d09da84edfb6..a1a1655949432 100644
--- a/src/legacy/ui/public/field_editor/components/field_format_editor/editors/url/url.test.tsx
+++ b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/editors/url/url.test.tsx
@@ -46,10 +46,6 @@ const formatParams = {
const onChange = jest.fn();
const onError = jest.fn();
-jest.mock('ui/chrome', () => ({
- getBasePath: () => 'http://localhost/',
-}));
-
describe('UrlFormatEditor', () => {
it('should have a formatId', () => {
expect(UrlFormatEditor.formatId).toEqual('url');
@@ -58,7 +54,6 @@ describe('UrlFormatEditor', () => {
it('should render normally', async () => {
const component = shallow(
@@ -97,20 +97,20 @@ export const UrlTemplateFlyout = ({ isVisible = false, onClose = () => {} }) =>
columns={[
{
field: 'input',
- name: i18n.translate('common.ui.fieldEditor.urlTemplate.inputHeader', {
+ name: i18n.translate('indexPatternManagement.urlTemplate.inputHeader', {
defaultMessage: 'Input',
}),
width: '160px',
},
{
field: 'template',
- name: i18n.translate('common.ui.fieldEditor.urlTemplate.templateHeader', {
+ name: i18n.translate('indexPatternManagement.urlTemplate.templateHeader', {
defaultMessage: 'Template',
}),
},
{
field: 'output',
- name: i18n.translate('common.ui.fieldEditor.urlTemplate.outputHeader', {
+ name: i18n.translate('indexPatternManagement.urlTemplate.outputHeader', {
defaultMessage: 'Output',
}),
},
diff --git a/src/legacy/ui/public/field_editor/components/field_format_editor/field_format_editor.test.tsx b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/field_format_editor.test.tsx
similarity index 98%
rename from src/legacy/ui/public/field_editor/components/field_format_editor/field_format_editor.test.tsx
rename to src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/field_format_editor.test.tsx
index f6e631c8b7ac0..c94d2e2f861dc 100644
--- a/src/legacy/ui/public/field_editor/components/field_format_editor/field_format_editor.test.tsx
+++ b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/field_format_editor.test.tsx
@@ -37,6 +37,7 @@ const formatEditors = {
ip: TestEditor,
number: TestEditor,
},
+ getById: jest.fn(() => TestEditor),
};
describe('FieldFormatEditor', () => {
diff --git a/src/legacy/ui/public/field_editor/components/field_format_editor/field_format_editor.tsx b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/field_format_editor.tsx
similarity index 93%
rename from src/legacy/ui/public/field_editor/components/field_format_editor/field_format_editor.tsx
rename to src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/field_format_editor.tsx
index 2de6dff5d251a..05aeba1ca107b 100644
--- a/src/legacy/ui/public/field_editor/components/field_format_editor/field_format_editor.tsx
+++ b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/field_format_editor.tsx
@@ -49,13 +49,13 @@ export class FieldFormatEditor extends PureComponent<
constructor(props: FieldFormatEditorProps) {
super(props);
this.state = {
- EditorComponent: props.fieldFormatEditors.byFormatId[props.fieldFormatId],
+ EditorComponent: props.fieldFormatEditors.getById(props.fieldFormatId),
};
}
static getDerivedStateFromProps(nextProps: FieldFormatEditorProps) {
return {
- EditorComponent: nextProps.fieldFormatEditors.byFormatId[nextProps.fieldFormatId] || null,
+ EditorComponent: nextProps.fieldFormatEditors.getById(nextProps.fieldFormatId) || null,
};
}
diff --git a/src/legacy/ui/public/field_editor/components/field_format_editor/index.ts b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/index.ts
similarity index 96%
rename from src/legacy/ui/public/field_editor/components/field_format_editor/index.ts
rename to src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/index.ts
index ccfc98b2d5882..83b36274f40e2 100644
--- a/src/legacy/ui/public/field_editor/components/field_format_editor/index.ts
+++ b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/index.ts
@@ -18,3 +18,4 @@
*/
export { FieldFormatEditor } from './field_format_editor';
+export * from './editors';
diff --git a/src/legacy/ui/public/field_editor/components/field_format_editor/samples/__snapshots__/samples.test.tsx.snap b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/samples/__snapshots__/samples.test.tsx.snap
similarity index 96%
rename from src/legacy/ui/public/field_editor/components/field_format_editor/samples/__snapshots__/samples.test.tsx.snap
rename to src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/samples/__snapshots__/samples.test.tsx.snap
index 2883ffb6bc8a1..ce8c9e70433c8 100644
--- a/src/legacy/ui/public/field_editor/components/field_format_editor/samples/__snapshots__/samples.test.tsx.snap
+++ b/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/samples/__snapshots__/samples.test.tsx.snap
@@ -10,7 +10,7 @@ exports[`FormatEditorSamples should render normally 1`] = `
label={
-
{title}
+