diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx b/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx index 5d994306ecd07..826de7e7083e3 100644 --- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx +++ b/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx @@ -47,7 +47,7 @@ import { IndexHeader } from './index_header'; import { IndexPatternTableItem } from '../types'; import { getIndexPatterns } from '../utils'; -export interface EditIndexPatternProps extends RouteComponentProps { +interface EditIndexPatternProps extends RouteComponentProps { indexPattern: IndexPattern; config: IUiSettingsClient; services: { @@ -134,7 +134,7 @@ export const EditIndexPattern = withRouter( }); }; - const removePattern = () => { + const removePatternClick = () => { async function doRemove() { if (indexPattern.id === defaultIndex) { const indexPatterns: IndexPatternTableItem[] = await getIndexPatterns( @@ -198,7 +198,7 @@ export const EditIndexPattern = withRouter( indexPattern={indexPattern} setDefault={setDefaultPattern} refreshFields={refreshFields} - deleteIndexPattern={removePattern} + deleteIndexPatternClick={removePatternClick} defaultIndex={defaultIndex} /> diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx b/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx index 7681facda19bf..635cc16f363ee 100644 --- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx +++ b/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx @@ -33,7 +33,7 @@ import { getEditBreadcrumbs } from '../breadcrumbs'; import { EditIndexPattern } from '../edit_index_pattern'; -export interface EditIndexPatternContainerProps extends RouteComponentProps<{ id: string }> { +interface EditIndexPatternContainerProps extends RouteComponentProps<{ id: string }> { getIndexPattern: (id: string) => Promise; config: IUiSettingsClient; services: { diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx b/src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx index b38ce7e192e47..4cf43d63d5839 100644 --- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx +++ b/src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx @@ -34,7 +34,7 @@ interface IndexHeaderProps { defaultIndex?: string; setDefault?: () => void; refreshFields?: () => void; - deleteIndexPattern?: () => void; + deleteIndexPatternClick?: () => void; } const setDefaultAriaLabel = i18n.translate( @@ -72,7 +72,7 @@ export function IndexHeader({ indexPattern, setDefault, refreshFields, - deleteIndexPattern, + deleteIndexPatternClick, }: IndexHeaderProps) { return ( @@ -120,12 +120,12 @@ export function IndexHeader({ )} - {deleteIndexPattern && ( + {deleteIndexPatternClick && ( - - + + + + + Scripted fields + + + + + + You can use scripted fields in visualizations and display them in your documents. However, you cannot search scripted fields. + + + + + + + + + + Add scripted field + + + + + + `; diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/header/header.test.tsx b/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/header/header.test.tsx index 370f47553b1eb..11fdae39aee3c 100644 --- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/header/header.test.tsx +++ b/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/header/header.test.tsx @@ -18,13 +18,21 @@ */ import React from 'react'; -import { shallow } from 'enzyme'; +import { render } from 'enzyme'; +import { RouteComponentProps } from 'react-router-dom'; import { Header } from './header'; describe('Header', () => { test('should render normally', () => { - const component = shallow(); + const component = render( + + ); expect(component).toMatchSnapshot(); }); 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 01afdae464283..a7ed4e1c9cafd 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 @@ -19,57 +19,14 @@ exports[`FieldEditor should render create new scripted field correctly 1`] = ` isVisible={false} /> , "painlessLink": ({})); -jest.mock('ui/new_platform'); import { FieldEdiorProps, FieldEditor } from './field_editor'; import { dataPluginMock } from '../../../../data/public/mocks'; @@ -113,11 +109,11 @@ describe('FieldEditor', () => { getConfig: () => {}, fieldFormatEditors: [], redirectAway: () => {}, - docLinksScriptedFields: docLinksServiceMock.createStartContract().links.scriptedFields, + docLinksScriptedFields: {}, fieldFormats: dataStartServices.fieldFormats, toasts: coreStartServices.notifications.toasts, - http: coreStartServices.http, - uiSettings: coreStartServices.uiSettings, + http: {}, + uiSettings: {}, SearchBar: dataStartServices.ui.SearchBar, indexPatterns: dataStartServices.indexPatterns, } as unknown) as FieldEdiorProps['services'];
+ + You can use scripted fields in visualizations and display them in your documents. However, you cannot search scripted fields. + +