* index pattern management to kibana platform Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
|
@ -1240,6 +1240,7 @@ import { npStart: { plugins } } from 'ui/new_platform';
|
|||
| `ui/filter_manager` | `plugins.data.filter` | -- |
|
||||
| `ui/index_patterns` | `plugins.data.indexPatterns` |
|
||||
| `import 'ui/management'` | `plugins.management.sections` | |
|
||||
| `import 'ui/registry/field_format_editors'` | `plugins.indexPatternManagement.fieldFormatEditors` | |
|
||||
| `ui/registry/field_formats` | `plugins.data.fieldFormats` | |
|
||||
| `ui/registry/feature_catalogue` | `plugins.home.featureCatalogue.register` | Must add `home` as a dependency in your kibana.json. |
|
||||
| `ui/registry/vis_types` | `plugins.visualizations` | -- |
|
||||
|
|
|
@ -21,7 +21,6 @@ import React from 'react';
|
|||
import { render, unmountComponentAtNode } from 'react-dom';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
|
||||
import './sections';
|
||||
import uiRoutes from 'ui/routes';
|
||||
import { I18nContext } from 'ui/i18n';
|
||||
import { uiModules } from 'ui/modules';
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
<kbn-management-app section="kibana/index_patterns">
|
||||
<div class="euiPanel euiPanel--paddingLarge">
|
||||
<div id="createIndexPatternReact"></div>
|
||||
</div>
|
||||
</kbn-management-app>
|
|
@ -1,110 +0,0 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import React, { Fragment } from 'react';
|
||||
|
||||
import {
|
||||
EuiBetaBadge,
|
||||
EuiSpacer,
|
||||
EuiTitle,
|
||||
EuiFlexGroup,
|
||||
EuiFlexItem,
|
||||
EuiText,
|
||||
EuiTextColor,
|
||||
EuiSwitch,
|
||||
} from '@elastic/eui';
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
|
||||
export const Header = ({
|
||||
prompt,
|
||||
indexPatternName,
|
||||
showSystemIndices = false,
|
||||
isIncludingSystemIndices,
|
||||
onChangeIncludingSystemIndices,
|
||||
isBeta = false,
|
||||
}: {
|
||||
prompt?: React.ReactNode;
|
||||
indexPatternName: string;
|
||||
showSystemIndices?: boolean;
|
||||
isIncludingSystemIndices: boolean;
|
||||
onChangeIncludingSystemIndices: () => void;
|
||||
isBeta?: boolean;
|
||||
}) => (
|
||||
<div>
|
||||
<EuiTitle>
|
||||
<h1>
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPatternHeader"
|
||||
defaultMessage="Create {indexPatternName}"
|
||||
values={{
|
||||
indexPatternName,
|
||||
}}
|
||||
/>
|
||||
{isBeta ? (
|
||||
<Fragment>
|
||||
{' '}
|
||||
<EuiBetaBadge
|
||||
label={i18n.translate('kbn.management.createIndexPattern.betaLabel', {
|
||||
defaultMessage: 'Beta',
|
||||
})}
|
||||
/>
|
||||
</Fragment>
|
||||
) : null}
|
||||
</h1>
|
||||
</EuiTitle>
|
||||
<EuiFlexGroup justifyContent="spaceBetween" alignItems="flexEnd">
|
||||
<EuiFlexItem grow={false}>
|
||||
<EuiText size="s">
|
||||
<p>
|
||||
<EuiTextColor color="subdued">
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPatternLabel"
|
||||
defaultMessage="Kibana uses index patterns to retrieve data from Elasticsearch indices for things like visualizations."
|
||||
/>
|
||||
</EuiTextColor>
|
||||
</p>
|
||||
</EuiText>
|
||||
</EuiFlexItem>
|
||||
{showSystemIndices ? (
|
||||
<EuiFlexItem grow={false}>
|
||||
<EuiSwitch
|
||||
label={
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.includeSystemIndicesToggleSwitchLabel"
|
||||
defaultMessage="Include system indices"
|
||||
/>
|
||||
}
|
||||
id="checkboxShowSystemIndices"
|
||||
checked={isIncludingSystemIndices}
|
||||
onChange={onChangeIncludingSystemIndices}
|
||||
/>
|
||||
</EuiFlexItem>
|
||||
) : null}
|
||||
</EuiFlexGroup>
|
||||
{prompt ? (
|
||||
<Fragment>
|
||||
<EuiSpacer size="s" />
|
||||
{prompt}
|
||||
</Fragment>
|
||||
) : null}
|
||||
<EuiSpacer size="m" />
|
||||
</div>
|
||||
);
|
|
@ -1,58 +0,0 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import uiRoutes from 'ui/routes';
|
||||
import angularTemplate from './angular_template.html';
|
||||
import { npStart } from 'ui/new_platform';
|
||||
import { getCreateBreadcrumbs } from '../breadcrumbs';
|
||||
|
||||
import { renderCreateIndexPatternWizard, destroyCreateIndexPatternWizard } from './render';
|
||||
|
||||
uiRoutes.when('/management/kibana/index_pattern', {
|
||||
template: angularTemplate,
|
||||
k7Breadcrumbs: getCreateBreadcrumbs,
|
||||
controller: function($scope, $injector) {
|
||||
// Wait for the directives to execute
|
||||
const kbnUrl = $injector.get('kbnUrl');
|
||||
$scope.$$postDigest(() => {
|
||||
const $routeParams = $injector.get('$routeParams');
|
||||
const indexPatternCreationType = npStart.plugins.indexPatternManagement.creation.getType(
|
||||
$routeParams.type
|
||||
);
|
||||
const services = {
|
||||
uiSettings: npStart.core.uiSettings,
|
||||
es: npStart.plugins.data.search.__LEGACY.esClient,
|
||||
indexPatterns: npStart.plugins.data.indexPatterns,
|
||||
savedObjectsClient: npStart.core.savedObjects.client,
|
||||
indexPatternCreationType,
|
||||
changeUrl: url => {
|
||||
$scope.$evalAsync(() => kbnUrl.changePath(url));
|
||||
},
|
||||
openConfirm: npStart.core.overlays.openConfirm,
|
||||
prependBasePath: npStart.core.http.basePath.prepend,
|
||||
};
|
||||
|
||||
const initialQuery = $routeParams.id ? decodeURIComponent($routeParams.id) : undefined;
|
||||
|
||||
renderCreateIndexPatternWizard(initialQuery, services);
|
||||
});
|
||||
|
||||
$scope.$on('$destroy', destroyCreateIndexPatternWizard);
|
||||
},
|
||||
});
|
|
@ -1,45 +0,0 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { render, unmountComponentAtNode } from 'react-dom';
|
||||
import { CreateIndexPatternWizard } from './create_index_pattern_wizard';
|
||||
|
||||
import { I18nContext } from 'ui/i18n';
|
||||
|
||||
const CREATE_INDEX_PATTERN_DOM_ELEMENT_ID = 'createIndexPatternReact';
|
||||
|
||||
export function renderCreateIndexPatternWizard(initialQuery, services) {
|
||||
const node = document.getElementById(CREATE_INDEX_PATTERN_DOM_ELEMENT_ID);
|
||||
if (!node) {
|
||||
return;
|
||||
}
|
||||
|
||||
render(
|
||||
<I18nContext>
|
||||
<CreateIndexPatternWizard initialQuery={initialQuery} services={services} />
|
||||
</I18nContext>,
|
||||
node
|
||||
);
|
||||
}
|
||||
|
||||
export function destroyCreateIndexPatternWizard() {
|
||||
const node = document.getElementById(CREATE_INDEX_PATTERN_DOM_ELEMENT_ID);
|
||||
node && unmountComponentAtNode(node);
|
||||
}
|
|
@ -1,63 +0,0 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
const render = jest.fn();
|
||||
const unmountComponentAtNode = jest.fn();
|
||||
|
||||
jest.doMock('react-dom', () => ({ render, unmountComponentAtNode }));
|
||||
|
||||
jest.mock('ui/chrome', () => ({
|
||||
getUiSettingsClient: () => ({
|
||||
get: () => '',
|
||||
}),
|
||||
addBasePath: () => {},
|
||||
}));
|
||||
|
||||
jest.mock('ui/i18n', () => ({
|
||||
I18nContext: () => {},
|
||||
}));
|
||||
|
||||
const { renderCreateIndexPatternWizard, destroyCreateIndexPatternWizard } = require('./render');
|
||||
|
||||
describe('CreateIndexPatternWizardRender', () => {
|
||||
beforeEach(() => {
|
||||
jest.spyOn(document, 'getElementById').mockImplementation(() => ({}));
|
||||
render.mockClear();
|
||||
unmountComponentAtNode.mockClear();
|
||||
});
|
||||
|
||||
it('should call render', () => {
|
||||
renderCreateIndexPatternWizard('', {
|
||||
es: {},
|
||||
indexPatterns: {},
|
||||
savedObjectsClient: {},
|
||||
config: {},
|
||||
changeUrl: () => {},
|
||||
indexPatternCreationType: {},
|
||||
openConfirm: jest.fn(),
|
||||
});
|
||||
|
||||
expect(render.mock.calls.length).toBe(1);
|
||||
});
|
||||
|
||||
it('should call unmountComponentAtNode', () => {
|
||||
destroyCreateIndexPatternWizard();
|
||||
expect(unmountComponentAtNode.mock.calls.length).toBe(1);
|
||||
});
|
||||
});
|
|
@ -1,5 +0,0 @@
|
|||
<kbn-management-app section="kibana/index_patterns">
|
||||
<div class="euiPanel euiPanel--paddingLarge">
|
||||
<div id="reactFieldEditor"></div>
|
||||
</div>
|
||||
</kbn-management-app>
|
|
@ -1,12 +0,0 @@
|
|||
<kbn-management-app section="kibana/index_patterns" omit-breadcrumb-pages="['index_patterns']">
|
||||
<div class="euiPanel euiPanel--paddingLarge">
|
||||
<div
|
||||
ng-controller="managementIndexPatternsEdit"
|
||||
data-test-subj="editIndexPattern"
|
||||
role="region"
|
||||
aria-label="{{::'kbn.management.editIndexPattern.detailsAria' | i18n: { defaultMessage: 'Index pattern details' } }}"
|
||||
>
|
||||
<div id="reactEditIndexPattern"></div>
|
||||
</div>
|
||||
</div>
|
||||
</kbn-management-app>
|
|
@ -1,177 +0,0 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { HashRouter } from 'react-router-dom';
|
||||
import { render, unmountComponentAtNode } from 'react-dom';
|
||||
import { RegistryFieldFormatEditorsProvider } from 'ui/registry/field_format_editors';
|
||||
import uiRoutes from 'ui/routes';
|
||||
import { uiModules } from 'ui/modules';
|
||||
import { I18nContext } from 'ui/i18n';
|
||||
import { npStart } from 'ui/new_platform';
|
||||
import template from './edit_index_pattern.html';
|
||||
import createEditFieldtemplate from './create_edit_field.html';
|
||||
import {
|
||||
getEditBreadcrumbs,
|
||||
getEditFieldBreadcrumbs,
|
||||
getCreateFieldBreadcrumbs,
|
||||
} from '../breadcrumbs';
|
||||
import { EditIndexPattern } from './edit_index_pattern';
|
||||
import { CreateEditField } from './create_edit_field';
|
||||
|
||||
const REACT_EDIT_INDEX_PATTERN_DOM_ELEMENT_ID = 'reactEditIndexPattern';
|
||||
|
||||
function destroyEditIndexPattern() {
|
||||
const node = document.getElementById(REACT_EDIT_INDEX_PATTERN_DOM_ELEMENT_ID);
|
||||
node && unmountComponentAtNode(node);
|
||||
}
|
||||
|
||||
function renderEditIndexPattern($scope, config, $route) {
|
||||
$scope.$$postDigest(() => {
|
||||
const node = document.getElementById(REACT_EDIT_INDEX_PATTERN_DOM_ELEMENT_ID);
|
||||
if (!node) {
|
||||
return;
|
||||
}
|
||||
|
||||
render(
|
||||
<HashRouter>
|
||||
<I18nContext>
|
||||
<EditIndexPattern
|
||||
indexPattern={$route.current.locals.indexPattern}
|
||||
indexPatterns={$route.current.locals.indexPatterns}
|
||||
config={config}
|
||||
services={{
|
||||
notifications: npStart.core.notifications,
|
||||
docTitle: npStart.core.chrome.docTitle,
|
||||
overlays: npStart.core.overlays,
|
||||
indexPatternManagement: npStart.plugins.indexPatternManagement,
|
||||
}}
|
||||
/>
|
||||
</I18nContext>
|
||||
</HashRouter>,
|
||||
node
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
uiRoutes.when('/management/kibana/index_patterns/:indexPatternId', {
|
||||
template,
|
||||
k7Breadcrumbs: getEditBreadcrumbs,
|
||||
resolve: {
|
||||
indexPattern: function($route, Promise, redirectWhenMissing) {
|
||||
const { indexPatterns } = npStart.plugins.data;
|
||||
return Promise.resolve(indexPatterns.get($route.current.params.indexPatternId)).catch(
|
||||
redirectWhenMissing('/management/kibana/index_patterns')
|
||||
);
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
uiModules
|
||||
.get('apps/management')
|
||||
.controller('managementIndexPatternsEdit', function($scope, $route, config) {
|
||||
$scope.$on('$destroy', () => {
|
||||
destroyEditIndexPattern();
|
||||
});
|
||||
|
||||
renderEditIndexPattern($scope, config, $route);
|
||||
});
|
||||
|
||||
// routes for create edit field. Will be removed after migartion all component to react.
|
||||
const REACT_FIELD_EDITOR_ID = 'reactFieldEditor';
|
||||
const renderCreateEditField = ($scope, $route, getConfig, fieldFormatEditors) => {
|
||||
$scope.$$postDigest(() => {
|
||||
const node = document.getElementById(REACT_FIELD_EDITOR_ID);
|
||||
if (!node) {
|
||||
return;
|
||||
}
|
||||
|
||||
render(
|
||||
<HashRouter>
|
||||
<I18nContext>
|
||||
<CreateEditField
|
||||
indexPattern={$route.current.locals.indexPattern}
|
||||
mode={$route.current.mode}
|
||||
fieldName={$route.current.params.fieldName}
|
||||
fieldFormatEditors={fieldFormatEditors}
|
||||
getConfig={getConfig}
|
||||
services={{
|
||||
dataStart: npStart.plugins.data,
|
||||
getHttpStart: () => npStart.core.http,
|
||||
notifications: npStart.core.notifications,
|
||||
docTitle: npStart.core.chrome.docTitle,
|
||||
docLinksScriptedFields: npStart.core.docLinks.links.scriptedFields,
|
||||
}}
|
||||
/>
|
||||
</I18nContext>
|
||||
</HashRouter>,
|
||||
node
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
const destroyCreateEditField = () => {
|
||||
const node = document.getElementById(REACT_FIELD_EDITOR_ID);
|
||||
node && unmountComponentAtNode(node);
|
||||
};
|
||||
|
||||
uiRoutes
|
||||
.when('/management/kibana/index_patterns/:indexPatternId/field/:fieldName*', {
|
||||
mode: 'edit',
|
||||
k7Breadcrumbs: getEditFieldBreadcrumbs,
|
||||
})
|
||||
.when('/management/kibana/index_patterns/:indexPatternId/create-field/', {
|
||||
mode: 'create',
|
||||
k7Breadcrumbs: getCreateFieldBreadcrumbs,
|
||||
})
|
||||
.defaults(/management\/kibana\/index_patterns\/[^\/]+\/(field|create-field)(\/|$)/, {
|
||||
template: createEditFieldtemplate,
|
||||
mapBreadcrumbs($route, breadcrumbs) {
|
||||
const { indexPattern } = $route.current.locals;
|
||||
return breadcrumbs.map(crumb => {
|
||||
if (crumb.id !== indexPattern.id) {
|
||||
return crumb;
|
||||
}
|
||||
|
||||
return {
|
||||
...crumb,
|
||||
display: indexPattern.title,
|
||||
};
|
||||
});
|
||||
},
|
||||
resolve: {
|
||||
indexPattern: function($route, Promise, redirectWhenMissing) {
|
||||
const { indexPatterns } = npStart.plugins.data;
|
||||
return Promise.resolve(indexPatterns.get($route.current.params.indexPatternId)).catch(
|
||||
redirectWhenMissing('/management/kibana/index_patterns')
|
||||
);
|
||||
},
|
||||
},
|
||||
controllerAs: 'fieldSettings',
|
||||
controller: function FieldEditorPageController($scope, $route, Private, config) {
|
||||
const getConfig = (...args) => config.get(...args);
|
||||
const fieldFormatEditors = Private(RegistryFieldFormatEditorsProvider);
|
||||
|
||||
renderCreateEditField($scope, $route, getConfig, fieldFormatEditors);
|
||||
|
||||
$scope.$on('$destroy', () => {
|
||||
destroyCreateEditField();
|
||||
});
|
||||
},
|
||||
});
|
|
@ -1,44 +0,0 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Header should render normally 1`] = `
|
||||
<EuiFlexGroup
|
||||
alignItems="center"
|
||||
>
|
||||
<EuiFlexItem>
|
||||
<EuiTitle
|
||||
size="s"
|
||||
>
|
||||
<h3>
|
||||
<FormattedMessage
|
||||
defaultMessage="Scripted fields"
|
||||
id="kbn.management.editIndexPattern.scriptedHeader"
|
||||
values={Object {}}
|
||||
/>
|
||||
</h3>
|
||||
</EuiTitle>
|
||||
<EuiText>
|
||||
<p>
|
||||
<FormattedMessage
|
||||
defaultMessage="You can use scripted fields in visualizations and display them in your documents. However, you cannot search scripted fields."
|
||||
id="kbn.management.editIndexPattern.scriptedLabel"
|
||||
values={Object {}}
|
||||
/>
|
||||
</p>
|
||||
</EuiText>
|
||||
</EuiFlexItem>
|
||||
<EuiFlexItem
|
||||
grow={false}
|
||||
>
|
||||
<EuiButton
|
||||
data-test-subj="addScriptedFieldLink"
|
||||
href=""
|
||||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="Add scripted field"
|
||||
id="kbn.management.editIndexPattern.scripted.addFieldButton"
|
||||
values={Object {}}
|
||||
/>
|
||||
</EuiButton>
|
||||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
`;
|
|
@ -1,5 +0,0 @@
|
|||
<div>
|
||||
<div>
|
||||
<div id="indexPatternListReact" role="region" aria-label="{{'kbn.management.editIndexPatternLiveRegionAriaLabel' | i18n: { defaultMessage: 'Index patterns' } }}"></div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,173 +0,0 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import { management } from 'ui/management';
|
||||
import { ManagementSectionId } from '../../../../../../../plugins/management/public';
|
||||
import './create_index_pattern_wizard';
|
||||
import './edit_index_pattern';
|
||||
import uiRoutes from 'ui/routes';
|
||||
import { uiModules } from 'ui/modules';
|
||||
import indexTemplate from './index.html';
|
||||
import indexPatternListTemplate from './list.html';
|
||||
import { IndexPatternTable } from './index_pattern_table';
|
||||
import { npStart } from 'ui/new_platform';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { I18nContext } from 'ui/i18n';
|
||||
import { UICapabilitiesProvider } from 'ui/capabilities/react';
|
||||
import { getListBreadcrumbs } from './breadcrumbs';
|
||||
|
||||
import React from 'react';
|
||||
import { render, unmountComponentAtNode } from 'react-dom';
|
||||
|
||||
const INDEX_PATTERN_LIST_DOM_ELEMENT_ID = 'indexPatternListReact';
|
||||
|
||||
export function updateIndexPatternList(indexPatterns, kbnUrl, indexPatternCreationOptions) {
|
||||
const node = document.getElementById(INDEX_PATTERN_LIST_DOM_ELEMENT_ID);
|
||||
if (!node) {
|
||||
return;
|
||||
}
|
||||
|
||||
render(
|
||||
<I18nContext>
|
||||
<UICapabilitiesProvider>
|
||||
<IndexPatternTable
|
||||
indexPatterns={indexPatterns}
|
||||
navTo={kbnUrl.redirect}
|
||||
indexPatternCreationOptions={indexPatternCreationOptions}
|
||||
/>
|
||||
</UICapabilitiesProvider>
|
||||
</I18nContext>,
|
||||
node
|
||||
);
|
||||
}
|
||||
|
||||
export const destroyIndexPatternList = () => {
|
||||
const node = document.getElementById(INDEX_PATTERN_LIST_DOM_ELEMENT_ID);
|
||||
node && unmountComponentAtNode(node);
|
||||
};
|
||||
|
||||
const indexPatternsResolutions = {
|
||||
indexPatterns: function() {
|
||||
const savedObjectsClient = npStart.core.savedObjects.client;
|
||||
|
||||
return savedObjectsClient
|
||||
.find({
|
||||
type: 'index-pattern',
|
||||
fields: ['title', 'type'],
|
||||
perPage: 10000,
|
||||
})
|
||||
.then(response => response.savedObjects);
|
||||
},
|
||||
};
|
||||
|
||||
// add a dependency to all of the subsection routes
|
||||
uiRoutes.defaults(/management\/kibana\/(index_patterns|index_pattern)/, {
|
||||
resolve: indexPatternsResolutions,
|
||||
requireUICapability: 'management.kibana.index_patterns',
|
||||
badge: uiCapabilities => {
|
||||
if (uiCapabilities.indexPatterns.save) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return {
|
||||
text: i18n.translate('kbn.management.indexPatterns.badge.readOnly.text', {
|
||||
defaultMessage: 'Read only',
|
||||
}),
|
||||
tooltip: i18n.translate('kbn.management.indexPatterns.badge.readOnly.tooltip', {
|
||||
defaultMessage: 'Unable to save index patterns',
|
||||
}),
|
||||
iconType: 'glasses',
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
uiRoutes.when('/management/kibana/index_patterns', {
|
||||
template: indexPatternListTemplate,
|
||||
k7Breadcrumbs: getListBreadcrumbs,
|
||||
});
|
||||
|
||||
// wrapper directive, which sets some global stuff up like the left nav
|
||||
uiModules
|
||||
.get('apps/management')
|
||||
.directive('kbnManagementIndexPatterns', function($route, config, kbnUrl) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
transclude: true,
|
||||
template: indexTemplate,
|
||||
link: async function($scope) {
|
||||
const indexPatternCreationOptions = await npStart.plugins.indexPatternManagement.creation.getIndexPatternCreationOptions(
|
||||
url => {
|
||||
$scope.$evalAsync(() => kbnUrl.change(url));
|
||||
}
|
||||
);
|
||||
|
||||
const renderList = () => {
|
||||
$scope.indexPatternList =
|
||||
$route.current.locals.indexPatterns
|
||||
.map(pattern => {
|
||||
const id = pattern.id;
|
||||
const title = pattern.get('title');
|
||||
const isDefault = $scope.defaultIndex === id;
|
||||
const tags = npStart.plugins.indexPatternManagement.list.getIndexPatternTags(
|
||||
pattern,
|
||||
isDefault
|
||||
);
|
||||
|
||||
return {
|
||||
id,
|
||||
title,
|
||||
url: kbnUrl.eval('#/management/kibana/index_patterns/{{id}}', { id: id }),
|
||||
active: $scope.editingId === id,
|
||||
default: isDefault,
|
||||
tags,
|
||||
//the prepending of 0 at the default pattern takes care of prioritization
|
||||
//so the sorting will but the default index on top
|
||||
//or on bottom of a the table
|
||||
sort: `${isDefault ? '0' : '1'}${title}`,
|
||||
};
|
||||
})
|
||||
.sort((a, b) => {
|
||||
if (a.sort < b.sort) {
|
||||
return -1;
|
||||
} else if (a.sort > b.sort) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}) || [];
|
||||
|
||||
updateIndexPatternList($scope.indexPatternList, kbnUrl, indexPatternCreationOptions);
|
||||
};
|
||||
|
||||
$scope.$on('$destroy', destroyIndexPatternList);
|
||||
$scope.editingId = $route.current.params.indexPatternId;
|
||||
$scope.$watch('defaultIndex', () => renderList());
|
||||
config.bindToScope($scope, 'defaultIndex');
|
||||
$scope.$apply();
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
management.getSection(ManagementSectionId.Kibana).register('index_patterns', {
|
||||
display: i18n.translate('kbn.management.indexPattern.sectionsHeader', {
|
||||
defaultMessage: 'Index Patterns',
|
||||
}),
|
||||
order: 0,
|
||||
url: '#/management/kibana/index_patterns/',
|
||||
});
|
|
@ -1,154 +0,0 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
EuiBadge,
|
||||
EuiButtonEmpty,
|
||||
EuiButtonIcon,
|
||||
EuiFlexGroup,
|
||||
EuiFlexItem,
|
||||
// @ts-ignore
|
||||
EuiInMemoryTable,
|
||||
EuiPanel,
|
||||
EuiSpacer,
|
||||
EuiText,
|
||||
} from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import React from 'react';
|
||||
import { CreateButton } from '../create_button';
|
||||
import { CreateIndexPatternPrompt } from '../create_index_pattern_prompt';
|
||||
import { IndexPattern, IndexPatternCreationOption } from '../types';
|
||||
|
||||
const columns = [
|
||||
{
|
||||
field: 'title',
|
||||
name: 'Pattern',
|
||||
render: (
|
||||
name: string,
|
||||
index: {
|
||||
id: string;
|
||||
tags?: Array<{
|
||||
key: string;
|
||||
name: string;
|
||||
}>;
|
||||
}
|
||||
) => (
|
||||
<EuiButtonEmpty size="xs" href={`#/management/kibana/index_patterns/${index.id}`}>
|
||||
{name}
|
||||
{index.tags &&
|
||||
index.tags.map(({ key: tagKey, name: tagName }) => (
|
||||
<EuiBadge className="indexPatternList__badge" key={tagKey}>
|
||||
{tagName}
|
||||
</EuiBadge>
|
||||
))}
|
||||
</EuiButtonEmpty>
|
||||
),
|
||||
dataType: 'string' as const,
|
||||
sortable: ({ sort }: { sort: string }) => sort,
|
||||
},
|
||||
];
|
||||
|
||||
const pagination = {
|
||||
initialPageSize: 10,
|
||||
pageSizeOptions: [5, 10, 25, 50],
|
||||
};
|
||||
|
||||
const sorting = {
|
||||
sort: {
|
||||
field: 'title',
|
||||
direction: 'asc' as const,
|
||||
},
|
||||
};
|
||||
|
||||
const search = {
|
||||
box: {
|
||||
incremental: true,
|
||||
schema: {
|
||||
fields: { title: { type: 'string' } },
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
interface Props {
|
||||
indexPatterns: IndexPattern[];
|
||||
indexPatternCreationOptions: IndexPatternCreationOption[];
|
||||
}
|
||||
|
||||
interface State {
|
||||
showFlyout: boolean;
|
||||
}
|
||||
|
||||
export class IndexPatternTable extends React.Component<Props, State> {
|
||||
public readonly state = {
|
||||
showFlyout: this.props.indexPatterns.length === 0,
|
||||
};
|
||||
|
||||
public render() {
|
||||
return (
|
||||
<EuiPanel paddingSize="l" data-test-subj="indexPatternTable">
|
||||
{this.state.showFlyout && (
|
||||
<CreateIndexPatternPrompt onClose={() => this.setState({ showFlyout: false })} />
|
||||
)}
|
||||
<EuiFlexGroup justifyContent="spaceBetween">
|
||||
<EuiFlexItem grow={false} className="euiIEFlexWrapFix">
|
||||
<EuiFlexGroup alignItems="center" gutterSize="s">
|
||||
<EuiFlexItem grow={false}>
|
||||
<EuiText>
|
||||
<h2>
|
||||
<FormattedMessage
|
||||
id="kbn.management.indexPatternTable.title"
|
||||
defaultMessage="Index patterns"
|
||||
/>
|
||||
</h2>
|
||||
</EuiText>
|
||||
</EuiFlexItem>
|
||||
<EuiFlexItem grow={false}>
|
||||
<EuiButtonIcon
|
||||
iconSize="l"
|
||||
iconType="questionInCircle"
|
||||
onClick={() => this.setState({ showFlyout: true })}
|
||||
aria-label="Help"
|
||||
/>
|
||||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
</EuiFlexItem>
|
||||
<EuiFlexItem grow={false}>
|
||||
<CreateButton options={this.props.indexPatternCreationOptions}>
|
||||
<FormattedMessage
|
||||
id="kbn.management.indexPatternTable.createBtn"
|
||||
defaultMessage="Create index pattern"
|
||||
/>
|
||||
</CreateButton>
|
||||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
<EuiSpacer />
|
||||
<EuiInMemoryTable
|
||||
allowNeutralSort={false}
|
||||
itemId="id"
|
||||
isSelectable={false}
|
||||
items={this.props.indexPatterns}
|
||||
columns={columns}
|
||||
pagination={pagination}
|
||||
sorting={sorting}
|
||||
search={search}
|
||||
/>
|
||||
</EuiPanel>
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
<kbn-management-app section="kibana/index_patterns">
|
||||
<kbn-management-index-patterns
|
||||
index-pattern="fieldSettings.indexPattern">
|
||||
</kbn-management-index-patterns>
|
||||
</kbn-management-app>
|
|
@ -65,11 +65,11 @@ const savedObjectsManagement = getManagementaMock({
|
|||
return obj.attributes.title;
|
||||
},
|
||||
getEditUrl(obj) {
|
||||
return `/management/kibana/index_patterns/${encodeURIComponent(obj.id)}`;
|
||||
return `/management/kibana/indexPatterns/patterns/${encodeURIComponent(obj.id)}`;
|
||||
},
|
||||
getInAppUrl(obj) {
|
||||
return {
|
||||
path: `/app/kibana#/management/kibana/index_patterns/${encodeURIComponent(obj.id)}`,
|
||||
path: `/app/kibana#/management/kibana/indexPatterns/patterns/${encodeURIComponent(obj.id)}`,
|
||||
uiCapabilitiesPath: 'management.kibana.index_patterns',
|
||||
};
|
||||
},
|
||||
|
@ -323,9 +323,9 @@ describe('findRelationships', () => {
|
|||
meta: {
|
||||
icon: 'indexPatternApp',
|
||||
title: 'My Index Pattern',
|
||||
editUrl: '/management/kibana/index_patterns/1',
|
||||
editUrl: '/management/kibana/indexPatterns/patterns/1',
|
||||
inAppUrl: {
|
||||
path: '/app/kibana#/management/kibana/index_patterns/1',
|
||||
path: '/app/kibana#/management/kibana/indexPatterns/patterns/1',
|
||||
uiCapabilitiesPath: 'management.kibana.index_patterns',
|
||||
},
|
||||
},
|
||||
|
@ -437,9 +437,9 @@ describe('findRelationships', () => {
|
|||
meta: {
|
||||
icon: 'indexPatternApp',
|
||||
title: 'My Index Pattern',
|
||||
editUrl: '/management/kibana/index_patterns/1',
|
||||
editUrl: '/management/kibana/indexPatterns/patterns/1',
|
||||
inAppUrl: {
|
||||
path: '/app/kibana#/management/kibana/index_patterns/1',
|
||||
path: '/app/kibana#/management/kibana/indexPatterns/patterns/1',
|
||||
uiCapabilitiesPath: 'management.kibana.index_patterns',
|
||||
},
|
||||
},
|
||||
|
|
|
@ -11,5 +11,3 @@
|
|||
@import './accessibility/index';
|
||||
@import './directives/index';
|
||||
@import './error_url_overflow/index';
|
||||
@import './field_editor/index';
|
||||
@import '../../../plugins/management/public/components/index';
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
@import './components/field_format_editor/samples/index';
|
||||
@import './components/scripting_help/test_script';
|
|
@ -1,26 +0,0 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import '!!file-loader?name=[path][name].[ext]!ui/field_editor/components/field_format_editor/editors/url/icons/go.png';
|
||||
import '!!file-loader?name=[path][name].[ext]!ui/field_editor/components/field_format_editor/editors/url/icons/stop.png';
|
||||
import '!!file-loader?name=[path][name].[ext]!ui/field_editor/components/field_format_editor/editors/url/icons/de.png';
|
||||
import '!!file-loader?name=[path][name].[ext]!ui/field_editor/components/field_format_editor/editors/url/icons/ne.png';
|
||||
import '!!file-loader?name=[path][name].[ext]!ui/field_editor/components/field_format_editor/editors/url/icons/us.png';
|
||||
import '!!file-loader?name=[path][name].[ext]!ui/field_editor/components/field_format_editor/editors/url/icons/ni.png';
|
||||
import '!!file-loader?name=[path][name].[ext]!ui/field_editor/components/field_format_editor/editors/url/icons/cv.png';
|
|
@ -1,43 +0,0 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import { RegistryFieldFormatEditorsProvider } from 'ui/registry/field_format_editors';
|
||||
import { BytesFormatEditor } from './editors/bytes';
|
||||
import { ColorFormatEditor } from './editors/color';
|
||||
import { DateFormatEditor } from './editors/date';
|
||||
import { DateNanosFormatEditor } from './editors/date_nanos';
|
||||
import { DurationFormatEditor } from './editors/duration';
|
||||
import { NumberFormatEditor } from './editors/number';
|
||||
import { PercentFormatEditor } from './editors/percent';
|
||||
import { StaticLookupFormatEditor } from './editors/static_lookup';
|
||||
import { StringFormatEditor } from './editors/string';
|
||||
import { TruncateFormatEditor } from './editors/truncate';
|
||||
import { UrlFormatEditor } from './editors/url/url';
|
||||
|
||||
RegistryFieldFormatEditorsProvider.register(() => BytesFormatEditor);
|
||||
RegistryFieldFormatEditorsProvider.register(() => ColorFormatEditor);
|
||||
RegistryFieldFormatEditorsProvider.register(() => DateFormatEditor);
|
||||
RegistryFieldFormatEditorsProvider.register(() => DateNanosFormatEditor);
|
||||
RegistryFieldFormatEditorsProvider.register(() => DurationFormatEditor);
|
||||
RegistryFieldFormatEditorsProvider.register(() => NumberFormatEditor);
|
||||
RegistryFieldFormatEditorsProvider.register(() => PercentFormatEditor);
|
||||
RegistryFieldFormatEditorsProvider.register(() => StaticLookupFormatEditor);
|
||||
RegistryFieldFormatEditorsProvider.register(() => StringFormatEditor);
|
||||
RegistryFieldFormatEditorsProvider.register(() => TruncateFormatEditor);
|
||||
RegistryFieldFormatEditorsProvider.register(() => UrlFormatEditor);
|
|
@ -1 +0,0 @@
|
|||
@import './samples';
|
|
@ -43,7 +43,5 @@ export const UI_EXPORT_DEFAULTS = {
|
|||
},
|
||||
})),
|
||||
|
||||
appExtensions: {
|
||||
fieldFormatEditors: ['ui/field_editor/components/field_format_editor/register'],
|
||||
},
|
||||
appExtensions: {},
|
||||
};
|
||||
|
|
|
@ -61,7 +61,7 @@ export const createEnsureDefaultIndexPattern = (core: CoreStart) => {
|
|||
core.uiSettings.set('defaultIndex', defaultId);
|
||||
} else {
|
||||
const canManageIndexPatterns = core.application.capabilities.management.kibana.index_patterns;
|
||||
const redirectTarget = canManageIndexPatterns ? 'management' : 'home';
|
||||
const redirectTarget = canManageIndexPatterns ? '/management/kibana/indexPatterns' : '/home';
|
||||
|
||||
if (timeoutId) {
|
||||
clearTimeout(timeoutId);
|
||||
|
@ -88,11 +88,11 @@ export const createEnsureDefaultIndexPattern = (core: CoreStart) => {
|
|||
timeoutId = undefined;
|
||||
}, 15000);
|
||||
|
||||
if (redirectTarget === 'home') {
|
||||
if (redirectTarget === '/home') {
|
||||
core.application.navigateToApp('home');
|
||||
} else {
|
||||
window.location.href = core.http.basePath.prepend(
|
||||
`/app/kibana#/management/kibana/index_pattern?bannerMessage=${bannerMessage}`
|
||||
`/app/kibana#/management/kibana/indexPatterns?bannerMessage=${bannerMessage}`
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -180,7 +180,7 @@ export class IndexPattern implements IIndexPattern {
|
|||
|
||||
private async updateFromElasticSearch(response: any, forceFieldRefresh: boolean = false) {
|
||||
if (!response.found) {
|
||||
throw new SavedObjectNotFound(type, this.id, '#/management/kibana/index_pattern');
|
||||
throw new SavedObjectNotFound(type, this.id, '#/management/kibana/indexPatterns');
|
||||
}
|
||||
|
||||
_.forOwn(this.mapping, (fieldMapping: FieldMappingSpec, name: string | undefined) => {
|
||||
|
|
|
@ -32,11 +32,11 @@ export const indexPatternSavedObjectType: SavedObjectsType = {
|
|||
return obj.attributes.title;
|
||||
},
|
||||
getEditUrl(obj) {
|
||||
return `/management/kibana/index_patterns/${encodeURIComponent(obj.id)}`;
|
||||
return `/management/kibana/indexPatterns/patterns/${encodeURIComponent(obj.id)}`;
|
||||
},
|
||||
getInAppUrl(obj) {
|
||||
return {
|
||||
path: `/app/kibana#/management/kibana/index_patterns/${encodeURIComponent(obj.id)}`,
|
||||
path: `/app/kibana#/management/kibana/indexPatterns/patterns/${encodeURIComponent(obj.id)}`,
|
||||
uiCapabilitiesPath: 'management.kibana.index_patterns',
|
||||
};
|
||||
},
|
||||
|
|
|
@ -42,7 +42,7 @@ const DiscoverFetchError = ({ fetchError }: Props) => {
|
|||
const { chrome } = getServices();
|
||||
const mangagementUrlObj = chrome.navLinks.get('kibana:stack_management');
|
||||
const managementUrl = mangagementUrlObj ? mangagementUrlObj.url : '';
|
||||
const url = `${managementUrl}/kibana/index_patterns`;
|
||||
const url = `${managementUrl}/kibana/indexPatterns`;
|
||||
|
||||
body = (
|
||||
<p>
|
||||
|
|
|
@ -277,7 +277,7 @@ exports[`apmUiEnabled 1`] = `
|
|||
/>
|
||||
</strong>
|
||||
<EuiLink
|
||||
href="#/management/kibana/index_pattern"
|
||||
href="#/management/kibana/indexPatterns"
|
||||
style={
|
||||
Object {
|
||||
"display": "block",
|
||||
|
@ -543,7 +543,7 @@ exports[`isNewKibanaInstance 1`] = `
|
|||
/>
|
||||
</strong>
|
||||
<EuiLink
|
||||
href="#/management/kibana/index_pattern"
|
||||
href="#/management/kibana/indexPatterns"
|
||||
style={
|
||||
Object {
|
||||
"display": "block",
|
||||
|
@ -876,7 +876,7 @@ exports[`mlEnabled 1`] = `
|
|||
/>
|
||||
</strong>
|
||||
<EuiLink
|
||||
href="#/management/kibana/index_pattern"
|
||||
href="#/management/kibana/indexPatterns"
|
||||
style={
|
||||
Object {
|
||||
"display": "block",
|
||||
|
@ -1142,7 +1142,7 @@ exports[`render 1`] = `
|
|||
/>
|
||||
</strong>
|
||||
<EuiLink
|
||||
href="#/management/kibana/index_pattern"
|
||||
href="#/management/kibana/indexPatterns"
|
||||
style={
|
||||
Object {
|
||||
"display": "block",
|
||||
|
|
|
@ -296,7 +296,7 @@ const AddDataUi = ({ apmUiEnabled, isNewKibanaInstance, intl, mlEnabled }) => {
|
|||
</strong>
|
||||
<EuiLink
|
||||
style={{ display: 'block', textAlign: 'center' }}
|
||||
href="#/management/kibana/index_pattern"
|
||||
href="#/management/kibana/indexPatterns"
|
||||
>
|
||||
<FormattedMessage
|
||||
id="home.addData.yourDataLink"
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
"version": "kibana",
|
||||
"server": false,
|
||||
"ui": true,
|
||||
"requiredPlugins": []
|
||||
"requiredPlugins": ["management", "data", "kibanaLegacy"]
|
||||
}
|
||||
|
|
Before Width: | Height: | Size: 802 B After Width: | Height: | Size: 802 B |
Before Width: | Height: | Size: 124 B After Width: | Height: | Size: 124 B |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 336 B After Width: | Height: | Size: 336 B |
Before Width: | Height: | Size: 919 B After Width: | Height: | Size: 919 B |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1 KiB |
20
src/plugins/index_pattern_management/public/components/__snapshots__/utils.test.ts.snap
generated
Normal file
|
@ -0,0 +1,20 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`getting index patterns 1`] = `
|
||||
Array [
|
||||
Object {
|
||||
"default": true,
|
||||
"id": "test",
|
||||
"sort": "0test name",
|
||||
"tags": undefined,
|
||||
"title": "test name",
|
||||
},
|
||||
Object {
|
||||
"default": false,
|
||||
"id": "test1",
|
||||
"sort": "1test name 1",
|
||||
"tags": undefined,
|
||||
"title": "test name 1",
|
||||
},
|
||||
]
|
||||
`;
|
|
@ -17,17 +17,16 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import { MANAGEMENT_BREADCRUMB } from 'ui/management';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { IndexPattern } from '../../../data/public';
|
||||
|
||||
export function getListBreadcrumbs() {
|
||||
return [
|
||||
MANAGEMENT_BREADCRUMB,
|
||||
{
|
||||
text: i18n.translate('kbn.management.indexPatterns.listBreadcrumb', {
|
||||
text: i18n.translate('indexPatternManagement.indexPatterns.listBreadcrumb', {
|
||||
defaultMessage: 'Index patterns',
|
||||
}),
|
||||
href: '#/management/kibana/index_patterns',
|
||||
href: `#/management/kibana/indexPatterns/`,
|
||||
},
|
||||
];
|
||||
}
|
||||
|
@ -36,42 +35,38 @@ export function getCreateBreadcrumbs() {
|
|||
return [
|
||||
...getListBreadcrumbs(),
|
||||
{
|
||||
text: i18n.translate('kbn.management.indexPatterns.createBreadcrumb', {
|
||||
text: i18n.translate('indexPatternManagement.indexPatterns.createBreadcrumb', {
|
||||
defaultMessage: 'Create index pattern',
|
||||
}),
|
||||
href: '#/management/kibana/index_pattern',
|
||||
href: `#/management/kibana/indexPatterns/create`,
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
export function getEditBreadcrumbs($route) {
|
||||
const { indexPattern } = $route.current.locals;
|
||||
|
||||
export function getEditBreadcrumbs(indexPattern: IndexPattern) {
|
||||
return [
|
||||
...getListBreadcrumbs(),
|
||||
{
|
||||
text: indexPattern.title,
|
||||
href: `#/management/kibana/index_patterns/${indexPattern.id}`,
|
||||
href: `#/management/kibana/indexPatterns/patterns/${indexPattern.id}`,
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
export function getEditFieldBreadcrumbs($route) {
|
||||
const { fieldName } = $route.current.params;
|
||||
|
||||
export function getEditFieldBreadcrumbs(indexPattern: IndexPattern, fieldName: string) {
|
||||
return [
|
||||
...getEditBreadcrumbs($route),
|
||||
...getEditBreadcrumbs(indexPattern),
|
||||
{
|
||||
text: fieldName,
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
export function getCreateFieldBreadcrumbs($route) {
|
||||
export function getCreateFieldBreadcrumbs(indexPattern: IndexPattern) {
|
||||
return [
|
||||
...getEditBreadcrumbs($route),
|
||||
...getEditBreadcrumbs(indexPattern),
|
||||
{
|
||||
text: i18n.translate('kbn.management.indexPatterns.createFieldBreadcrumb', {
|
||||
text: i18n.translate('indexPatternManagement.indexPatterns.createFieldBreadcrumb', {
|
||||
defaultMessage: 'Create field',
|
||||
}),
|
||||
},
|
|
@ -33,8 +33,6 @@ import {
|
|||
} from '@elastic/eui';
|
||||
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { UICapabilities } from 'ui/capabilities';
|
||||
import { injectUICapabilities } from 'ui/capabilities/react';
|
||||
|
||||
interface State {
|
||||
isPopoverOpen: boolean;
|
||||
|
@ -48,26 +46,21 @@ interface Props {
|
|||
isBeta?: boolean;
|
||||
onClick: () => void;
|
||||
}>;
|
||||
uiCapabilities: UICapabilities;
|
||||
}
|
||||
|
||||
class CreateButtonComponent extends Component<Props, State> {
|
||||
export class CreateButton extends Component<Props, State> {
|
||||
public state = {
|
||||
isPopoverOpen: false,
|
||||
};
|
||||
|
||||
public render() {
|
||||
const { options, children, uiCapabilities } = this.props;
|
||||
const { options, children } = this.props;
|
||||
const { isPopoverOpen } = this.state;
|
||||
|
||||
if (!options || !options.length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!uiCapabilities.indexPatterns.save) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (options.length === 1) {
|
||||
return (
|
||||
<EuiButton
|
||||
|
@ -146,12 +139,10 @@ class CreateButtonComponent extends Component<Props, State> {
|
|||
return (
|
||||
<EuiBadge color={euiColorAccent}>
|
||||
<FormattedMessage
|
||||
id="kbn.management.indexPatternList.createButton.betaLabel"
|
||||
id="indexPatternManagement.indexPatternList.createButton.betaLabel"
|
||||
defaultMessage="Beta"
|
||||
/>
|
||||
</EuiBadge>
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
export const CreateButton = injectUICapabilities(CreateButtonComponent);
|
|
@ -37,7 +37,7 @@ export const CreateIndexPatternPrompt = ({ onClose }: { onClose: () => void }) =
|
|||
<EuiText grow={false}>
|
||||
<h2>
|
||||
<FormattedMessage
|
||||
id="kbn.management.indexPatternPrompt.title"
|
||||
id="indexPatternManagement.indexPatternPrompt.title"
|
||||
defaultMessage="About index patterns"
|
||||
/>
|
||||
</h2>
|
||||
|
@ -47,7 +47,7 @@ export const CreateIndexPatternPrompt = ({ onClose }: { onClose: () => void }) =
|
|||
<EuiText textAlign="left">
|
||||
<p>
|
||||
<FormattedMessage
|
||||
id="kbn.management.indexPatternPrompt.subtitle"
|
||||
id="indexPatternManagement.indexPatternPrompt.subtitle"
|
||||
defaultMessage="Index patterns allow you to bucket disparate data sources together so their shared fields may be queried in
|
||||
Kibana."
|
||||
/>
|
||||
|
@ -57,7 +57,7 @@ export const CreateIndexPatternPrompt = ({ onClose }: { onClose: () => void }) =
|
|||
<EuiText textAlign="left">
|
||||
<h3>
|
||||
<FormattedMessage
|
||||
id="kbn.management.indexPatternPrompt.examplesTitle"
|
||||
id="indexPatternManagement.indexPatternPrompt.examplesTitle"
|
||||
defaultMessage="Examples of index patterns"
|
||||
/>
|
||||
</h3>
|
||||
|
@ -66,38 +66,38 @@ export const CreateIndexPatternPrompt = ({ onClose }: { onClose: () => void }) =
|
|||
<EuiDescriptionList className="indexPatternListPrompt__descList">
|
||||
<EuiDescriptionListTitle>
|
||||
<FormattedMessage
|
||||
id="kbn.management.indexPatternPrompt.exampleOneTitle"
|
||||
id="indexPatternManagement.indexPatternPrompt.exampleOneTitle"
|
||||
defaultMessage="Single data source"
|
||||
/>
|
||||
</EuiDescriptionListTitle>
|
||||
<EuiDescriptionListDescription>
|
||||
<FormattedMessage
|
||||
id="kbn.management.indexPatternPrompt.exampleOne"
|
||||
id="indexPatternManagement.indexPatternPrompt.exampleOne"
|
||||
defaultMessage="Index a single data source named log-west-001 so you can build charts or query its contents fast."
|
||||
/>
|
||||
</EuiDescriptionListDescription>
|
||||
<EuiDescriptionListTitle>
|
||||
<FormattedMessage
|
||||
id="kbn.management.indexPatternPrompt.exampleTwoTitle"
|
||||
id="indexPatternManagement.indexPatternPrompt.exampleTwoTitle"
|
||||
defaultMessage="Multiple data sources"
|
||||
/>
|
||||
</EuiDescriptionListTitle>
|
||||
<EuiDescriptionListDescription>
|
||||
<FormattedMessage
|
||||
id="kbn.management.indexPatternPrompt.exampleTwo"
|
||||
id="indexPatternManagement.indexPatternPrompt.exampleTwo"
|
||||
defaultMessage="Group all incoming data sources starting with log-west* so you can query against all your west coast server
|
||||
logs."
|
||||
/>
|
||||
</EuiDescriptionListDescription>
|
||||
<EuiDescriptionListTitle>
|
||||
<FormattedMessage
|
||||
id="kbn.management.indexPatternPrompt.exampleThreeTitle"
|
||||
id="indexPatternManagement.indexPatternPrompt.exampleThreeTitle"
|
||||
defaultMessage="Custom groupings"
|
||||
/>
|
||||
</EuiDescriptionListTitle>
|
||||
<EuiDescriptionListDescription>
|
||||
<FormattedMessage
|
||||
id="kbn.management.indexPatternPrompt.exampleThree"
|
||||
id="indexPatternManagement.indexPatternPrompt.exampleThree"
|
||||
defaultMessage="Specifically group your archived, monthly, roll-up metrics of those logs into a separate index pattern so
|
||||
you can aggregate historical trends to compare."
|
||||
/>
|
|
@ -1,9 +1,12 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`CreateIndexPatternWizard defaults to the loading state 1`] = `
|
||||
<Fragment>
|
||||
<EuiPanel
|
||||
paddingSize="l"
|
||||
>
|
||||
<div>
|
||||
<Header
|
||||
changeTitle={[MockFunction]}
|
||||
indexPatternName="name"
|
||||
isBeta={false}
|
||||
isIncludingSystemIndices={false}
|
||||
|
@ -18,13 +21,16 @@ exports[`CreateIndexPatternWizard defaults to the loading state 1`] = `
|
|||
toastLifeTimeMs={6000}
|
||||
toasts={Array []}
|
||||
/>
|
||||
</Fragment>
|
||||
</EuiPanel>
|
||||
`;
|
||||
|
||||
exports[`CreateIndexPatternWizard renders index pattern step when there are indices 1`] = `
|
||||
<Fragment>
|
||||
<EuiPanel
|
||||
paddingSize="l"
|
||||
>
|
||||
<div>
|
||||
<Header
|
||||
changeTitle={[MockFunction]}
|
||||
indexPatternName="name"
|
||||
isBeta={false}
|
||||
isIncludingSystemIndices={false}
|
||||
|
@ -57,7 +63,6 @@ exports[`CreateIndexPatternWizard renders index pattern step when there are indi
|
|||
"type": "default",
|
||||
}
|
||||
}
|
||||
initialQuery=""
|
||||
isIncludingSystemIndices={false}
|
||||
savedObjectsClient={
|
||||
Object {
|
||||
|
@ -95,13 +100,16 @@ exports[`CreateIndexPatternWizard renders index pattern step when there are indi
|
|||
toastLifeTimeMs={6000}
|
||||
toasts={Array []}
|
||||
/>
|
||||
</Fragment>
|
||||
</EuiPanel>
|
||||
`;
|
||||
|
||||
exports[`CreateIndexPatternWizard renders the empty state when there are no indices 1`] = `
|
||||
<Fragment>
|
||||
<EuiPanel
|
||||
paddingSize="l"
|
||||
>
|
||||
<div>
|
||||
<Header
|
||||
changeTitle={[MockFunction]}
|
||||
indexPatternName="name"
|
||||
isBeta={false}
|
||||
isIncludingSystemIndices={false}
|
||||
|
@ -111,7 +119,7 @@ exports[`CreateIndexPatternWizard renders the empty state when there are no indi
|
|||
/>
|
||||
<EmptyState
|
||||
onRefresh={[Function]}
|
||||
prependBasePath={[MockFunction]}
|
||||
prependBasePath={[Function]}
|
||||
/>
|
||||
</div>
|
||||
<EuiGlobalToastList
|
||||
|
@ -119,13 +127,16 @@ exports[`CreateIndexPatternWizard renders the empty state when there are no indi
|
|||
toastLifeTimeMs={6000}
|
||||
toasts={Array []}
|
||||
/>
|
||||
</Fragment>
|
||||
</EuiPanel>
|
||||
`;
|
||||
|
||||
exports[`CreateIndexPatternWizard renders time field step when step is set to 2 1`] = `
|
||||
<Fragment>
|
||||
<EuiPanel
|
||||
paddingSize="l"
|
||||
>
|
||||
<div>
|
||||
<Header
|
||||
changeTitle={[MockFunction]}
|
||||
indexPatternName="name"
|
||||
isBeta={false}
|
||||
isIncludingSystemIndices={false}
|
||||
|
@ -164,13 +175,16 @@ exports[`CreateIndexPatternWizard renders time field step when step is set to 2
|
|||
toastLifeTimeMs={6000}
|
||||
toasts={Array []}
|
||||
/>
|
||||
</Fragment>
|
||||
</EuiPanel>
|
||||
`;
|
||||
|
||||
exports[`CreateIndexPatternWizard renders when there are no indices but there are remote clusters 1`] = `
|
||||
<Fragment>
|
||||
<EuiPanel
|
||||
paddingSize="l"
|
||||
>
|
||||
<div>
|
||||
<Header
|
||||
changeTitle={[MockFunction]}
|
||||
indexPatternName="name"
|
||||
isBeta={false}
|
||||
isIncludingSystemIndices={false}
|
||||
|
@ -197,7 +211,6 @@ exports[`CreateIndexPatternWizard renders when there are no indices but there ar
|
|||
"type": "default",
|
||||
}
|
||||
}
|
||||
initialQuery=""
|
||||
isIncludingSystemIndices={false}
|
||||
savedObjectsClient={
|
||||
Object {
|
||||
|
@ -235,13 +248,16 @@ exports[`CreateIndexPatternWizard renders when there are no indices but there ar
|
|||
toastLifeTimeMs={6000}
|
||||
toasts={Array []}
|
||||
/>
|
||||
</Fragment>
|
||||
</EuiPanel>
|
||||
`;
|
||||
|
||||
exports[`CreateIndexPatternWizard shows system indices even if there are no other indices if the include system indices is toggled 1`] = `
|
||||
<Fragment>
|
||||
<EuiPanel
|
||||
paddingSize="l"
|
||||
>
|
||||
<div>
|
||||
<Header
|
||||
changeTitle={[MockFunction]}
|
||||
indexPatternName="name"
|
||||
isBeta={false}
|
||||
isIncludingSystemIndices={true}
|
||||
|
@ -274,7 +290,6 @@ exports[`CreateIndexPatternWizard shows system indices even if there are no othe
|
|||
"type": "default",
|
||||
}
|
||||
}
|
||||
initialQuery=""
|
||||
isIncludingSystemIndices={true}
|
||||
savedObjectsClient={
|
||||
Object {
|
||||
|
@ -312,5 +327,5 @@ exports[`CreateIndexPatternWizard shows system indices even if there are no othe
|
|||
toastLifeTimeMs={6000}
|
||||
toasts={Array []}
|
||||
/>
|
||||
</Fragment>
|
||||
</EuiPanel>
|
||||
`;
|
|
@ -7,7 +7,7 @@ exports[`EmptyState should render normally 1`] = `
|
|||
title={
|
||||
<FormattedMessage
|
||||
defaultMessage="Couldn't find any Elasticsearch data"
|
||||
id="kbn.management.createIndexPattern.emptyStateHeader"
|
||||
id="indexPatternManagement.createIndexPattern.emptyStateHeader"
|
||||
values={Object {}}
|
||||
/>
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ exports[`EmptyState should render normally 1`] = `
|
|||
<p>
|
||||
<FormattedMessage
|
||||
defaultMessage="{needToIndex} {learnHowLink} or {getStartedLink}"
|
||||
id="kbn.management.createIndexPattern.emptyStateLabel.emptyStateDetail"
|
||||
id="indexPatternManagement.createIndexPattern.emptyStateLabel.emptyStateDetail"
|
||||
values={
|
||||
Object {
|
||||
"getStartedLink": <ForwardRef
|
||||
|
@ -23,7 +23,7 @@ exports[`EmptyState should render normally 1`] = `
|
|||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="get started with some sample data sets."
|
||||
id="kbn.management.createIndexPattern.emptyStateLabel.getStartedLink"
|
||||
id="indexPatternManagement.createIndexPattern.emptyStateLabel.getStartedLink"
|
||||
values={Object {}}
|
||||
/>
|
||||
</ForwardRef>,
|
||||
|
@ -32,7 +32,7 @@ exports[`EmptyState should render normally 1`] = `
|
|||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="Learn how"
|
||||
id="kbn.management.createIndexPattern.emptyStateLabel.learnHowLink"
|
||||
id="indexPatternManagement.createIndexPattern.emptyStateLabel.learnHowLink"
|
||||
values={Object {}}
|
||||
/>
|
||||
</ForwardRef>,
|
||||
|
@ -41,7 +41,7 @@ exports[`EmptyState should render normally 1`] = `
|
|||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="You'll need to index some data into Elasticsearch before you can create an index pattern."
|
||||
id="kbn.management.createIndexPattern.emptyStateLabel.needToIndexLabel"
|
||||
id="indexPatternManagement.createIndexPattern.emptyStateLabel.needToIndexLabel"
|
||||
values={Object {}}
|
||||
/>
|
||||
</EuiTextColor>,
|
||||
|
@ -57,7 +57,7 @@ exports[`EmptyState should render normally 1`] = `
|
|||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="Check for new data"
|
||||
id="kbn.management.createIndexPattern.emptyState.checkDataButton"
|
||||
id="indexPatternManagement.createIndexPattern.emptyState.checkDataButton"
|
||||
values={Object {}}
|
||||
/>
|
||||
</EuiButton>
|
|
@ -36,20 +36,20 @@ export const EmptyState = ({
|
|||
color="warning"
|
||||
title={
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.emptyStateHeader"
|
||||
id="indexPatternManagement.createIndexPattern.emptyStateHeader"
|
||||
defaultMessage="Couldn't find any Elasticsearch data"
|
||||
/>
|
||||
}
|
||||
>
|
||||
<p>
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.emptyStateLabel.emptyStateDetail"
|
||||
id="indexPatternManagement.createIndexPattern.emptyStateLabel.emptyStateDetail"
|
||||
defaultMessage="{needToIndex} {learnHowLink} or {getStartedLink}"
|
||||
values={{
|
||||
needToIndex: (
|
||||
<EuiTextColor color="subdued">
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.emptyStateLabel.needToIndexLabel"
|
||||
id="indexPatternManagement.createIndexPattern.emptyStateLabel.needToIndexLabel"
|
||||
defaultMessage="You'll need to index some data into Elasticsearch before you can create an index pattern."
|
||||
/>
|
||||
</EuiTextColor>
|
||||
|
@ -57,7 +57,7 @@ export const EmptyState = ({
|
|||
learnHowLink: (
|
||||
<EuiLink href={prependBasePath('/app/home#/tutorial_directory')}>
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.emptyStateLabel.learnHowLink"
|
||||
id="indexPatternManagement.createIndexPattern.emptyStateLabel.learnHowLink"
|
||||
defaultMessage="Learn how"
|
||||
/>
|
||||
</EuiLink>
|
||||
|
@ -65,7 +65,7 @@ export const EmptyState = ({
|
|||
getStartedLink: (
|
||||
<EuiLink href={prependBasePath('/app/home#/tutorial_directory/sampleData')}>
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.emptyStateLabel.getStartedLink"
|
||||
id="indexPatternManagement.createIndexPattern.emptyStateLabel.getStartedLink"
|
||||
defaultMessage="get started with some sample data sets."
|
||||
/>
|
||||
</EuiLink>
|
||||
|
@ -81,7 +81,7 @@ export const EmptyState = ({
|
|||
color="warning"
|
||||
>
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.emptyState.checkDataButton"
|
||||
id="indexPatternManagement.createIndexPattern.emptyState.checkDataButton"
|
||||
defaultMessage="Check for new data"
|
||||
/>
|
||||
</EuiButton>
|
|
@ -4,15 +4,7 @@ exports[`Header should render a different name, prompt, and beta tag if provided
|
|||
<div>
|
||||
<EuiTitle>
|
||||
<h1>
|
||||
<FormattedMessage
|
||||
defaultMessage="Create {indexPatternName}"
|
||||
id="kbn.management.createIndexPatternHeader"
|
||||
values={
|
||||
Object {
|
||||
"indexPatternName": "test index pattern",
|
||||
}
|
||||
}
|
||||
/>
|
||||
Create test index pattern
|
||||
|
||||
<EuiBetaBadge
|
||||
label="Beta"
|
||||
|
@ -35,7 +27,7 @@ exports[`Header should render a different name, prompt, and beta tag if provided
|
|||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="Kibana uses index patterns to retrieve data from Elasticsearch indices for things like visualizations."
|
||||
id="kbn.management.createIndexPatternLabel"
|
||||
id="indexPatternManagement.createIndexPatternLabel"
|
||||
values={Object {}}
|
||||
/>
|
||||
</EuiTextColor>
|
||||
|
@ -59,15 +51,7 @@ exports[`Header should render normally 1`] = `
|
|||
<div>
|
||||
<EuiTitle>
|
||||
<h1>
|
||||
<FormattedMessage
|
||||
defaultMessage="Create {indexPatternName}"
|
||||
id="kbn.management.createIndexPatternHeader"
|
||||
values={
|
||||
Object {
|
||||
"indexPatternName": "test index pattern",
|
||||
}
|
||||
}
|
||||
/>
|
||||
Create test index pattern
|
||||
</h1>
|
||||
</EuiTitle>
|
||||
<EuiFlexGroup
|
||||
|
@ -86,7 +70,7 @@ exports[`Header should render normally 1`] = `
|
|||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="Kibana uses index patterns to retrieve data from Elasticsearch indices for things like visualizations."
|
||||
id="kbn.management.createIndexPatternLabel"
|
||||
id="indexPatternManagement.createIndexPatternLabel"
|
||||
values={Object {}}
|
||||
/>
|
||||
</EuiTextColor>
|
||||
|
@ -104,15 +88,7 @@ exports[`Header should render without including system indices 1`] = `
|
|||
<div>
|
||||
<EuiTitle>
|
||||
<h1>
|
||||
<FormattedMessage
|
||||
defaultMessage="Create {indexPatternName}"
|
||||
id="kbn.management.createIndexPatternHeader"
|
||||
values={
|
||||
Object {
|
||||
"indexPatternName": "test index pattern",
|
||||
}
|
||||
}
|
||||
/>
|
||||
Create test index pattern
|
||||
</h1>
|
||||
</EuiTitle>
|
||||
<EuiFlexGroup
|
||||
|
@ -131,7 +107,7 @@ exports[`Header should render without including system indices 1`] = `
|
|||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="Kibana uses index patterns to retrieve data from Elasticsearch indices for things like visualizations."
|
||||
id="kbn.management.createIndexPatternLabel"
|
||||
id="indexPatternManagement.createIndexPatternLabel"
|
||||
values={Object {}}
|
||||
/>
|
||||
</EuiTextColor>
|
|
@ -29,6 +29,7 @@ describe('Header', () => {
|
|||
indexPatternName={indexPatternName}
|
||||
isIncludingSystemIndices={true}
|
||||
onChangeIncludingSystemIndices={() => {}}
|
||||
changeTitle={() => {}}
|
||||
/>
|
||||
);
|
||||
|
||||
|
@ -41,6 +42,7 @@ describe('Header', () => {
|
|||
indexPatternName={indexPatternName}
|
||||
isIncludingSystemIndices={false}
|
||||
onChangeIncludingSystemIndices={() => {}}
|
||||
changeTitle={() => {}}
|
||||
/>
|
||||
);
|
||||
|
||||
|
@ -55,6 +57,7 @@ describe('Header', () => {
|
|||
prompt={<div>Test prompt</div>}
|
||||
indexPatternName={indexPatternName}
|
||||
isBeta={true}
|
||||
changeTitle={() => {}}
|
||||
/>
|
||||
);
|
||||
|
|
@ -0,0 +1,118 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import React, { Fragment } from 'react';
|
||||
|
||||
import {
|
||||
EuiBetaBadge,
|
||||
EuiSpacer,
|
||||
EuiTitle,
|
||||
EuiFlexGroup,
|
||||
EuiFlexItem,
|
||||
EuiText,
|
||||
EuiTextColor,
|
||||
EuiSwitch,
|
||||
} from '@elastic/eui';
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
|
||||
export const Header = ({
|
||||
prompt,
|
||||
indexPatternName,
|
||||
showSystemIndices = false,
|
||||
isIncludingSystemIndices,
|
||||
onChangeIncludingSystemIndices,
|
||||
isBeta = false,
|
||||
changeTitle,
|
||||
}: {
|
||||
prompt?: React.ReactNode;
|
||||
indexPatternName: string;
|
||||
showSystemIndices?: boolean;
|
||||
isIncludingSystemIndices: boolean;
|
||||
onChangeIncludingSystemIndices: () => void;
|
||||
isBeta?: boolean;
|
||||
changeTitle: (title: string) => void;
|
||||
}) => {
|
||||
const createIndexPatternHeader = i18n.translate(
|
||||
'indexPatternManagement.createIndexPatternHeader',
|
||||
{
|
||||
defaultMessage: 'Create {indexPatternName}',
|
||||
values: { indexPatternName },
|
||||
}
|
||||
);
|
||||
|
||||
changeTitle(createIndexPatternHeader);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<EuiTitle>
|
||||
<h1>
|
||||
{createIndexPatternHeader}
|
||||
{isBeta ? (
|
||||
<Fragment>
|
||||
{' '}
|
||||
<EuiBetaBadge
|
||||
label={i18n.translate('indexPatternManagement.createIndexPattern.betaLabel', {
|
||||
defaultMessage: 'Beta',
|
||||
})}
|
||||
/>
|
||||
</Fragment>
|
||||
) : null}
|
||||
</h1>
|
||||
</EuiTitle>
|
||||
<EuiFlexGroup justifyContent="spaceBetween" alignItems="flexEnd">
|
||||
<EuiFlexItem grow={false}>
|
||||
<EuiText size="s">
|
||||
<p>
|
||||
<EuiTextColor color="subdued">
|
||||
<FormattedMessage
|
||||
id="indexPatternManagement.createIndexPatternLabel"
|
||||
defaultMessage="Kibana uses index patterns to retrieve data from Elasticsearch indices for things like visualizations."
|
||||
/>
|
||||
</EuiTextColor>
|
||||
</p>
|
||||
</EuiText>
|
||||
</EuiFlexItem>
|
||||
{showSystemIndices ? (
|
||||
<EuiFlexItem grow={false}>
|
||||
<EuiSwitch
|
||||
label={
|
||||
<FormattedMessage
|
||||
id="indexPatternManagement.createIndexPattern.includeSystemIndicesToggleSwitchLabel"
|
||||
defaultMessage="Include system indices"
|
||||
/>
|
||||
}
|
||||
id="checkboxShowSystemIndices"
|
||||
checked={isIncludingSystemIndices}
|
||||
onChange={onChangeIncludingSystemIndices}
|
||||
/>
|
||||
</EuiFlexItem>
|
||||
) : null}
|
||||
</EuiFlexGroup>
|
||||
{prompt ? (
|
||||
<Fragment>
|
||||
<EuiSpacer size="s" />
|
||||
{prompt}
|
||||
</Fragment>
|
||||
) : null}
|
||||
<EuiSpacer size="m" />
|
||||
</div>
|
||||
);
|
||||
};
|
|
@ -22,7 +22,7 @@ exports[`LoadingState should render normally 1`] = `
|
|||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="Checking for Elasticsearch data"
|
||||
id="kbn.management.createIndexPattern.loadingState.checkingLabel"
|
||||
id="indexPatternManagement.createIndexPattern.loadingState.checkingLabel"
|
||||
values={Object {}}
|
||||
/>
|
||||
</h2>
|
|
@ -29,7 +29,7 @@ export const LoadingState = () => (
|
|||
<EuiTitle size="s">
|
||||
<h2 style={{ textAlign: 'center' }}>
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.loadingState.checkingLabel"
|
||||
id="indexPatternManagement.createIndexPattern.loadingState.checkingLabel"
|
||||
defaultMessage="Checking for Elasticsearch data"
|
||||
/>
|
||||
</h2>
|
|
@ -8,7 +8,7 @@ exports[`Header should mark the input as invalid 1`] = `
|
|||
<h2>
|
||||
<FormattedMessage
|
||||
defaultMessage="Step 1 of 2: Define index pattern"
|
||||
id="kbn.management.createIndexPattern.stepHeader"
|
||||
id="indexPatternManagement.createIndexPattern.stepHeader"
|
||||
values={Object {}}
|
||||
/>
|
||||
</h2>
|
||||
|
@ -42,7 +42,7 @@ exports[`Header should mark the input as invalid 1`] = `
|
|||
<p>
|
||||
<FormattedMessage
|
||||
defaultMessage="You can use a {asterisk} as a wildcard in your index pattern."
|
||||
id="kbn.management.createIndexPattern.step.indexPattern.allowLabel"
|
||||
id="indexPatternManagement.createIndexPattern.step.indexPattern.allowLabel"
|
||||
values={
|
||||
Object {
|
||||
"asterisk": <strong>
|
||||
|
@ -55,7 +55,7 @@ exports[`Header should mark the input as invalid 1`] = `
|
|||
<p>
|
||||
<FormattedMessage
|
||||
defaultMessage="You can't use spaces or the characters {characterList}."
|
||||
id="kbn.management.createIndexPattern.step.indexPattern.disallowLabel"
|
||||
id="indexPatternManagement.createIndexPattern.step.indexPattern.disallowLabel"
|
||||
values={
|
||||
Object {
|
||||
"characterList": <strong>
|
||||
|
@ -71,7 +71,7 @@ exports[`Header should mark the input as invalid 1`] = `
|
|||
label={
|
||||
<FormattedMessage
|
||||
defaultMessage="Index pattern"
|
||||
id="kbn.management.createIndexPattern.step.indexPatternLabel"
|
||||
id="indexPatternManagement.createIndexPattern.step.indexPatternLabel"
|
||||
values={Object {}}
|
||||
/>
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ exports[`Header should mark the input as invalid 1`] = `
|
|||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="Next step"
|
||||
id="kbn.management.createIndexPattern.step.nextStepButton"
|
||||
id="indexPatternManagement.createIndexPattern.step.nextStepButton"
|
||||
values={Object {}}
|
||||
/>
|
||||
</EuiButton>
|
||||
|
@ -116,7 +116,7 @@ exports[`Header should render normally 1`] = `
|
|||
<h2>
|
||||
<FormattedMessage
|
||||
defaultMessage="Step 1 of 2: Define index pattern"
|
||||
id="kbn.management.createIndexPattern.stepHeader"
|
||||
id="indexPatternManagement.createIndexPattern.stepHeader"
|
||||
values={Object {}}
|
||||
/>
|
||||
</h2>
|
||||
|
@ -146,7 +146,7 @@ exports[`Header should render normally 1`] = `
|
|||
<p>
|
||||
<FormattedMessage
|
||||
defaultMessage="You can use a {asterisk} as a wildcard in your index pattern."
|
||||
id="kbn.management.createIndexPattern.step.indexPattern.allowLabel"
|
||||
id="indexPatternManagement.createIndexPattern.step.indexPattern.allowLabel"
|
||||
values={
|
||||
Object {
|
||||
"asterisk": <strong>
|
||||
|
@ -159,7 +159,7 @@ exports[`Header should render normally 1`] = `
|
|||
<p>
|
||||
<FormattedMessage
|
||||
defaultMessage="You can't use spaces or the characters {characterList}."
|
||||
id="kbn.management.createIndexPattern.step.indexPattern.disallowLabel"
|
||||
id="indexPatternManagement.createIndexPattern.step.indexPattern.disallowLabel"
|
||||
values={
|
||||
Object {
|
||||
"characterList": <strong>
|
||||
|
@ -175,7 +175,7 @@ exports[`Header should render normally 1`] = `
|
|||
label={
|
||||
<FormattedMessage
|
||||
defaultMessage="Index pattern"
|
||||
id="kbn.management.createIndexPattern.step.indexPatternLabel"
|
||||
id="indexPatternManagement.createIndexPattern.step.indexPatternLabel"
|
||||
values={Object {}}
|
||||
/>
|
||||
}
|
||||
|
@ -203,7 +203,7 @@ exports[`Header should render normally 1`] = `
|
|||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="Next step"
|
||||
id="kbn.management.createIndexPattern.step.nextStepButton"
|
||||
id="indexPatternManagement.createIndexPattern.step.nextStepButton"
|
||||
values={Object {}}
|
||||
/>
|
||||
</EuiButton>
|
|
@ -57,7 +57,7 @@ export const Header: React.FC<HeaderProps> = ({
|
|||
<EuiTitle size="s">
|
||||
<h2>
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.stepHeader"
|
||||
id="indexPatternManagement.createIndexPattern.stepHeader"
|
||||
defaultMessage="Step 1 of 2: Define index pattern"
|
||||
/>
|
||||
</h2>
|
||||
|
@ -69,7 +69,7 @@ export const Header: React.FC<HeaderProps> = ({
|
|||
<EuiFormRow
|
||||
label={
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.step.indexPatternLabel"
|
||||
id="indexPatternManagement.createIndexPattern.step.indexPatternLabel"
|
||||
defaultMessage="Index pattern"
|
||||
/>
|
||||
}
|
||||
|
@ -79,14 +79,14 @@ export const Header: React.FC<HeaderProps> = ({
|
|||
<div>
|
||||
<p>
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.step.indexPattern.allowLabel"
|
||||
id="indexPatternManagement.createIndexPattern.step.indexPattern.allowLabel"
|
||||
defaultMessage="You can use a {asterisk} as a wildcard in your index pattern."
|
||||
values={{ asterisk: <strong>*</strong> }}
|
||||
/>
|
||||
</p>
|
||||
<p>
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.step.indexPattern.disallowLabel"
|
||||
id="indexPatternManagement.createIndexPattern.step.indexPattern.disallowLabel"
|
||||
defaultMessage="You can't use spaces or the characters {characterList}."
|
||||
values={{ characterList: <strong>{characterList}</strong> }}
|
||||
/>
|
||||
|
@ -97,7 +97,7 @@ export const Header: React.FC<HeaderProps> = ({
|
|||
<EuiFieldText
|
||||
name="indexPattern"
|
||||
placeholder={i18n.translate(
|
||||
'kbn.management.createIndexPattern.step.indexPatternPlaceholder',
|
||||
'indexPatternManagement.createIndexPattern.step.indexPatternPlaceholder',
|
||||
{
|
||||
defaultMessage: 'index-name-*',
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ export const Header: React.FC<HeaderProps> = ({
|
|||
data-test-subj="createIndexPatternGoToStep2Button"
|
||||
>
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.step.nextStepButton"
|
||||
id="indexPatternManagement.createIndexPattern.step.nextStepButton"
|
||||
defaultMessage="Next step"
|
||||
/>
|
||||
</EuiButton>
|
|
@ -44,7 +44,7 @@ exports[`IndicesList should change pages 1`] = `
|
|||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="Rows per page: {perPage}"
|
||||
id="kbn.management.createIndexPattern.step.pagingLabel"
|
||||
id="indexPatternManagement.createIndexPattern.step.pagingLabel"
|
||||
values={
|
||||
Object {
|
||||
"perPage": 1,
|
||||
|
@ -135,7 +135,7 @@ exports[`IndicesList should change per page 1`] = `
|
|||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="Rows per page: {perPage}"
|
||||
id="kbn.management.createIndexPattern.step.pagingLabel"
|
||||
id="indexPatternManagement.createIndexPattern.step.pagingLabel"
|
||||
values={
|
||||
Object {
|
||||
"perPage": 1,
|
||||
|
@ -248,7 +248,7 @@ exports[`IndicesList should highlight the query in the matches 1`] = `
|
|||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="Rows per page: {perPage}"
|
||||
id="kbn.management.createIndexPattern.step.pagingLabel"
|
||||
id="indexPatternManagement.createIndexPattern.step.pagingLabel"
|
||||
values={
|
||||
Object {
|
||||
"perPage": 10,
|
||||
|
@ -347,7 +347,7 @@ exports[`IndicesList should render normally 1`] = `
|
|||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="Rows per page: {perPage}"
|
||||
id="kbn.management.createIndexPattern.step.pagingLabel"
|
||||
id="indexPatternManagement.createIndexPattern.step.pagingLabel"
|
||||
values={
|
||||
Object {
|
||||
"perPage": 10,
|
||||
|
@ -510,7 +510,7 @@ exports[`IndicesList updating props should render all new indices 1`] = `
|
|||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="Rows per page: {perPage}"
|
||||
id="kbn.management.createIndexPattern.step.pagingLabel"
|
||||
id="indexPatternManagement.createIndexPattern.step.pagingLabel"
|
||||
values={
|
||||
Object {
|
||||
"perPage": 10,
|
|
@ -107,7 +107,7 @@ export class IndicesList extends React.Component<IndicesListProps, IndicesListSt
|
|||
onClick={this.openPerPageControl}
|
||||
>
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.step.pagingLabel"
|
||||
id="indexPatternManagement.createIndexPattern.step.pagingLabel"
|
||||
defaultMessage="Rows per page: {perPage}"
|
||||
values={{ perPage }}
|
||||
/>
|
|
@ -21,7 +21,7 @@ exports[`LoadingIndices should render normally 1`] = `
|
|||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="Looking for matching indices…"
|
||||
id="kbn.management.createIndexPattern.step.loadingHeader"
|
||||
id="indexPatternManagement.createIndexPattern.step.loadingHeader"
|
||||
values={Object {}}
|
||||
/>
|
||||
</EuiTextColor>
|
||||
|
@ -39,7 +39,7 @@ exports[`LoadingIndices should render normally 1`] = `
|
|||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="Just a sec…"
|
||||
id="kbn.management.createIndexPattern.step.loadingLabel"
|
||||
id="indexPatternManagement.createIndexPattern.step.loadingLabel"
|
||||
values={Object {}}
|
||||
/>
|
||||
</EuiTextColor>
|
|
@ -33,7 +33,7 @@ export const LoadingIndices = ({ ...rest }) => (
|
|||
<EuiText>
|
||||
<EuiTextColor color="subdued">
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.step.loadingHeader"
|
||||
id="indexPatternManagement.createIndexPattern.step.loadingHeader"
|
||||
defaultMessage="Looking for matching indices…"
|
||||
/>
|
||||
</EuiTextColor>
|
||||
|
@ -42,7 +42,7 @@ export const LoadingIndices = ({ ...rest }) => (
|
|||
<EuiText size="s" style={{ textAlign: 'center' }}>
|
||||
<EuiTextColor color="subdued">
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.step.loadingLabel"
|
||||
id="indexPatternManagement.createIndexPattern.step.loadingLabel"
|
||||
defaultMessage="Just a sec…"
|
||||
/>
|
||||
</EuiTextColor>
|
|
@ -15,13 +15,13 @@ exports[`StatusMessage should render with exact matches 1`] = `
|
|||
|
||||
<FormattedMessage
|
||||
defaultMessage="{strongSuccess} Your index pattern matches {strongIndices}."
|
||||
id="kbn.management.createIndexPattern.step.status.successLabel.successDetail"
|
||||
id="indexPatternManagement.createIndexPattern.step.status.successLabel.successDetail"
|
||||
values={
|
||||
Object {
|
||||
"strongIndices": <strong>
|
||||
<FormattedMessage
|
||||
defaultMessage="{indicesLength, plural, one {# index} other {# indices}}"
|
||||
id="kbn.management.createIndexPattern.step.status.successLabel.strongIndicesLabel"
|
||||
id="indexPatternManagement.createIndexPattern.step.status.successLabel.strongIndicesLabel"
|
||||
values={
|
||||
Object {
|
||||
"indicesLength": 1,
|
||||
|
@ -32,7 +32,7 @@ exports[`StatusMessage should render with exact matches 1`] = `
|
|||
"strongSuccess": <strong>
|
||||
<FormattedMessage
|
||||
defaultMessage="Success!"
|
||||
id="kbn.management.createIndexPattern.step.status.successLabel.strongSuccessLabel"
|
||||
id="indexPatternManagement.createIndexPattern.step.status.successLabel.strongSuccessLabel"
|
||||
values={Object {}}
|
||||
/>
|
||||
</strong>,
|
||||
|
@ -55,14 +55,14 @@ exports[`StatusMessage should render with no partial matches 1`] = `
|
|||
<span>
|
||||
<FormattedMessage
|
||||
defaultMessage="The index pattern you've entered doesn't match any indices. You can match {indicesLength, plural, one {your} other {any of your}} {strongIndices}, below."
|
||||
id="kbn.management.createIndexPattern.step.status.notMatchLabel.notMatchDetail"
|
||||
id="indexPatternManagement.createIndexPattern.step.status.notMatchLabel.notMatchDetail"
|
||||
values={
|
||||
Object {
|
||||
"indicesLength": 2,
|
||||
"strongIndices": <strong>
|
||||
<FormattedMessage
|
||||
defaultMessage="{indicesLength, plural, one {# index} other {# indices}}"
|
||||
id="kbn.management.createIndexPattern.step.status.notMatchLabel.allIndicesLabel"
|
||||
id="indexPatternManagement.createIndexPattern.step.status.notMatchLabel.allIndicesLabel"
|
||||
values={
|
||||
Object {
|
||||
"indicesLength": 2,
|
||||
|
@ -89,14 +89,14 @@ exports[`StatusMessage should render with partial matches 1`] = `
|
|||
<span>
|
||||
<FormattedMessage
|
||||
defaultMessage="Your index pattern doesn't match any indices, but you have {strongIndices} which {matchedIndicesLength, plural, one {looks} other {look}} similar."
|
||||
id="kbn.management.createIndexPattern.step.status.partialMatchLabel.partialMatchDetail"
|
||||
id="indexPatternManagement.createIndexPattern.step.status.partialMatchLabel.partialMatchDetail"
|
||||
values={
|
||||
Object {
|
||||
"matchedIndicesLength": 1,
|
||||
"strongIndices": <strong>
|
||||
<FormattedMessage
|
||||
defaultMessage="{matchedIndicesLength, plural, one {# index} other {# indices}}"
|
||||
id="kbn.management.createIndexPattern.step.status.partialMatchLabel.strongIndicesLabel"
|
||||
id="indexPatternManagement.createIndexPattern.step.status.partialMatchLabel.strongIndicesLabel"
|
||||
values={
|
||||
Object {
|
||||
"matchedIndicesLength": 1,
|
||||
|
@ -123,7 +123,7 @@ exports[`StatusMessage should render without a query 1`] = `
|
|||
<span>
|
||||
<FormattedMessage
|
||||
defaultMessage="Your index pattern can match any of your {strongIndices}, below."
|
||||
id="kbn.management.createIndexPattern.step.status.matchAnyLabel.matchAnyDetail"
|
||||
id="indexPatternManagement.createIndexPattern.step.status.matchAnyLabel.matchAnyDetail"
|
||||
values={
|
||||
Object {
|
||||
"strongIndices": <strong>
|
||||
|
@ -149,7 +149,7 @@ exports[`StatusMessage should show that no indices exist 1`] = `
|
|||
<span>
|
||||
<FormattedMessage
|
||||
defaultMessage="No Elasticsearch indices match your pattern."
|
||||
id="kbn.management.createIndexPattern.step.status.noSystemIndicesLabel"
|
||||
id="indexPatternManagement.createIndexPattern.step.status.noSystemIndicesLabel"
|
||||
values={Object {}}
|
||||
/>
|
||||
</span>
|
||||
|
@ -168,7 +168,7 @@ exports[`StatusMessage should show that system indices exist 1`] = `
|
|||
<span>
|
||||
<FormattedMessage
|
||||
defaultMessage="No Elasticsearch indices match your pattern."
|
||||
id="kbn.management.createIndexPattern.step.status.noSystemIndicesLabel"
|
||||
id="indexPatternManagement.createIndexPattern.step.status.noSystemIndicesLabel"
|
||||
values={Object {}}
|
||||
/>
|
||||
</span>
|
|
@ -55,7 +55,7 @@ export const StatusMessage: React.FC<StatusMessageProps> = ({
|
|||
statusMessage = (
|
||||
<span>
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.step.status.matchAnyLabel.matchAnyDetail"
|
||||
id="indexPatternManagement.createIndexPattern.step.status.matchAnyLabel.matchAnyDetail"
|
||||
defaultMessage="Your index pattern can match any of your {strongIndices}, below."
|
||||
values={{ strongIndices: <strong>{allIndicesLength} indices</strong> }}
|
||||
/>
|
||||
|
@ -65,7 +65,7 @@ export const StatusMessage: React.FC<StatusMessageProps> = ({
|
|||
statusMessage = (
|
||||
<span>
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.step.status.noSystemIndicesWithPromptLabel"
|
||||
id="indexPatternManagement.createIndexPattern.step.status.noSystemIndicesWithPromptLabel"
|
||||
defaultMessage="No Elasticsearch indices match your pattern. To view the matching system indices, toggle the switch in
|
||||
the upper right."
|
||||
/>
|
||||
|
@ -75,7 +75,7 @@ export const StatusMessage: React.FC<StatusMessageProps> = ({
|
|||
statusMessage = (
|
||||
<span>
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.step.status.noSystemIndicesLabel"
|
||||
id="indexPatternManagement.createIndexPattern.step.status.noSystemIndicesLabel"
|
||||
defaultMessage="No Elasticsearch indices match your pattern."
|
||||
/>
|
||||
</span>
|
||||
|
@ -88,13 +88,13 @@ export const StatusMessage: React.FC<StatusMessageProps> = ({
|
|||
<span>
|
||||
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.step.status.successLabel.successDetail"
|
||||
id="indexPatternManagement.createIndexPattern.step.status.successLabel.successDetail"
|
||||
defaultMessage="{strongSuccess} Your index pattern matches {strongIndices}."
|
||||
values={{
|
||||
strongSuccess: (
|
||||
<strong>
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.step.status.successLabel.strongSuccessLabel"
|
||||
id="indexPatternManagement.createIndexPattern.step.status.successLabel.strongSuccessLabel"
|
||||
defaultMessage="Success!"
|
||||
/>
|
||||
</strong>
|
||||
|
@ -102,7 +102,7 @@ export const StatusMessage: React.FC<StatusMessageProps> = ({
|
|||
strongIndices: (
|
||||
<strong>
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.step.status.successLabel.strongIndicesLabel"
|
||||
id="indexPatternManagement.createIndexPattern.step.status.successLabel.strongIndicesLabel"
|
||||
defaultMessage="{indicesLength, plural, one {# index} other {# indices}}"
|
||||
values={{ indicesLength: exactMatchedIndices.length }}
|
||||
/>
|
||||
|
@ -118,7 +118,7 @@ export const StatusMessage: React.FC<StatusMessageProps> = ({
|
|||
statusMessage = (
|
||||
<span>
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.step.status.partialMatchLabel.partialMatchDetail"
|
||||
id="indexPatternManagement.createIndexPattern.step.status.partialMatchLabel.partialMatchDetail"
|
||||
defaultMessage="Your index pattern doesn't match any indices, but you have {strongIndices} which
|
||||
{matchedIndicesLength, plural, one {looks} other {look}} similar."
|
||||
values={{
|
||||
|
@ -126,7 +126,7 @@ export const StatusMessage: React.FC<StatusMessageProps> = ({
|
|||
strongIndices: (
|
||||
<strong>
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.step.status.partialMatchLabel.strongIndicesLabel"
|
||||
id="indexPatternManagement.createIndexPattern.step.status.partialMatchLabel.strongIndicesLabel"
|
||||
defaultMessage="{matchedIndicesLength, plural, one {# index} other {# indices}}"
|
||||
values={{ matchedIndicesLength: partialMatchedIndices.length }}
|
||||
/>
|
||||
|
@ -142,14 +142,14 @@ export const StatusMessage: React.FC<StatusMessageProps> = ({
|
|||
statusMessage = (
|
||||
<span>
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.step.status.notMatchLabel.notMatchDetail"
|
||||
id="indexPatternManagement.createIndexPattern.step.status.notMatchLabel.notMatchDetail"
|
||||
defaultMessage="The index pattern you've entered doesn't match any indices.
|
||||
You can match {indicesLength, plural, one {your} other {any of your}} {strongIndices}, below."
|
||||
values={{
|
||||
strongIndices: (
|
||||
<strong>
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.step.status.notMatchLabel.allIndicesLabel"
|
||||
id="indexPatternManagement.createIndexPattern.step.status.notMatchLabel.allIndicesLabel"
|
||||
defaultMessage="{indicesLength, plural, one {# index} other {# indices}}"
|
||||
values={{ indicesLength: allIndicesLength }}
|
||||
/>
|
|
@ -21,10 +21,10 @@ import React from 'react';
|
|||
import { StepIndexPattern } from '../step_index_pattern';
|
||||
import { shallowWithI18nProvider } from 'test_utils/enzyme_helpers';
|
||||
import { Header } from './components/header';
|
||||
import { IndexPatternCreationConfig } from '../../../../../../../../../../plugins/index_pattern_management/public';
|
||||
import { coreMock } from '../../../../../../../../../../core/public/mocks';
|
||||
import { dataPluginMock } from '../../../../../../../../../../plugins/data/public/mocks';
|
||||
import { SavedObjectsFindResponsePublic } from '../../../../../../../../../../core/public';
|
||||
import { IndexPatternCreationConfig } from '../../../../../../../plugins/index_pattern_management/public';
|
||||
import { coreMock } from '../../../../../../../core/public/mocks';
|
||||
import { dataPluginMock } from '../../../../../../../plugins/data/public/mocks';
|
||||
import { SavedObjectsFindResponsePublic } from 'src/core/public';
|
||||
|
||||
jest.mock('../../lib/ensure_minimum_time', () => ({
|
||||
ensureMinimumTime: async (promises: Array<Promise<any>>) =>
|
|
@ -25,8 +25,8 @@ import {
|
|||
indexPatterns,
|
||||
DataPublicPluginStart,
|
||||
IndexPatternAttributes,
|
||||
} from '../../../../../../../../../../plugins/data/public';
|
||||
import { SavedObjectsClient, IUiSettingsClient } from '../../../../../../../../../../core/public';
|
||||
} from '../../../../../../../plugins/data/public';
|
||||
import { SavedObjectsClientContract, IUiSettingsClient } from '../../../../../../../core/public';
|
||||
import { MAX_SEARCH_SIZE } from '../../constants';
|
||||
import {
|
||||
getIndices,
|
||||
|
@ -39,14 +39,14 @@ import { LoadingIndices } from './components/loading_indices';
|
|||
import { StatusMessage } from './components/status_message';
|
||||
import { IndicesList } from './components/indices_list';
|
||||
import { Header } from './components/header';
|
||||
import { IndexPatternCreationConfig } from '../../../../../../../../../../plugins/index_pattern_management/public';
|
||||
import { IndexPatternCreationConfig } from '../../../../../../../plugins/index_pattern_management/public';
|
||||
import { MatchedIndex } from '../../types';
|
||||
|
||||
interface StepIndexPatternProps {
|
||||
allIndices: MatchedIndex[];
|
||||
isIncludingSystemIndices: boolean;
|
||||
esService: DataPublicPluginStart['search']['__LEGACY']['esClient'];
|
||||
savedObjectsClient: SavedObjectsClient;
|
||||
savedObjectsClient: SavedObjectsClientContract;
|
||||
indexPatternCreationType: IndexPatternCreationConfig;
|
||||
goToNextStep: (query: string) => void;
|
||||
initialQuery?: string;
|
||||
|
@ -237,7 +237,7 @@ export class StepIndexPattern extends Component<StepIndexPatternProps, StepIndex
|
|||
<EuiCallOut
|
||||
title={
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.step.warningHeader"
|
||||
id="indexPatternManagement.createIndexPattern.step.warningHeader"
|
||||
defaultMessage="There's already an index pattern called {query}"
|
||||
values={{ query }}
|
||||
/>
|
||||
|
@ -270,7 +270,7 @@ export class StepIndexPattern extends Component<StepIndexPatternProps, StepIndex
|
|||
containsErrors = true;
|
||||
} else if (containsIllegalCharacters(query, indexPatterns.ILLEGAL_CHARACTERS)) {
|
||||
const errorMessage = i18n.translate(
|
||||
'kbn.management.createIndexPattern.step.invalidCharactersErrorMessage',
|
||||
'indexPatternManagement.createIndexPattern.step.invalidCharactersErrorMessage',
|
||||
{
|
||||
defaultMessage:
|
||||
'A {indexPatternName} cannot contain spaces or the characters: {characterList}',
|
|
@ -52,7 +52,7 @@ exports[`StepTimeField should render "Custom index pattern ID already exists" wh
|
|||
title={
|
||||
<FormattedMessage
|
||||
defaultMessage="Error"
|
||||
id="kbn.management.createIndexPattern.stepTime.error"
|
||||
id="indexPatternManagement.createIndexPattern.stepTime.error"
|
||||
values={Object {}}
|
||||
/>
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ exports[`StepTimeField should render "Custom index pattern ID already exists" wh
|
|||
<p>
|
||||
<FormattedMessage
|
||||
defaultMessage="Custom index pattern ID already exists."
|
||||
id="kbn.management.createIndexPattern.stepTime.patterAlreadyExists"
|
||||
id="indexPatternManagement.createIndexPattern.stepTime.patterAlreadyExists"
|
||||
values={Object {}}
|
||||
/>
|
||||
</p>
|
||||
|
@ -92,7 +92,7 @@ exports[`StepTimeField should render a loading state when creating the index pat
|
|||
<EuiText>
|
||||
<FormattedMessage
|
||||
defaultMessage="Creating index pattern…"
|
||||
id="kbn.management.createIndexPattern.stepTime.creatingLabel"
|
||||
id="indexPatternManagement.createIndexPattern.stepTime.creatingLabel"
|
||||
values={Object {}}
|
||||
/>
|
||||
</EuiText>
|
||||
|
@ -269,7 +269,7 @@ exports[`StepTimeField should render any error message 1`] = `
|
|||
title={
|
||||
<FormattedMessage
|
||||
defaultMessage="Error"
|
||||
id="kbn.management.createIndexPattern.stepTime.error"
|
||||
id="indexPatternManagement.createIndexPattern.stepTime.error"
|
||||
values={Object {}}
|
||||
/>
|
||||
}
|
|
@ -36,7 +36,7 @@ export const ActionButtons = ({
|
|||
<EuiFlexItem grow={false}>
|
||||
<EuiButtonEmpty iconType="arrowLeft" onClick={goToPreviousStep}>
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.stepTime.backButton"
|
||||
id="indexPatternManagement.createIndexPattern.stepTime.backButton"
|
||||
defaultMessage="Back"
|
||||
/>
|
||||
</EuiButtonEmpty>
|
||||
|
@ -49,7 +49,7 @@ export const ActionButtons = ({
|
|||
onClick={createIndexPattern}
|
||||
>
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.stepTime.createPatternButton"
|
||||
id="indexPatternManagement.createIndexPattern.stepTime.createPatternButton"
|
||||
defaultMessage="Create index pattern"
|
||||
/>
|
||||
</EuiButton>
|
|
@ -8,7 +8,7 @@ exports[`AdvancedOptions should hide if not showing 1`] = `
|
|||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="Show advanced options"
|
||||
id="kbn.management.createIndexPattern.stepTime.options.showButton"
|
||||
id="indexPatternManagement.createIndexPattern.stepTime.options.showButton"
|
||||
values={Object {}}
|
||||
/>
|
||||
</EuiButtonEmpty>
|
||||
|
@ -26,7 +26,7 @@ exports[`AdvancedOptions should render normally 1`] = `
|
|||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="Hide advanced options"
|
||||
id="kbn.management.createIndexPattern.stepTime.options.hideButton"
|
||||
id="indexPatternManagement.createIndexPattern.stepTime.options.hideButton"
|
||||
values={Object {}}
|
||||
/>
|
||||
</EuiButtonEmpty>
|
||||
|
@ -43,14 +43,14 @@ exports[`AdvancedOptions should render normally 1`] = `
|
|||
helpText={
|
||||
<FormattedMessage
|
||||
defaultMessage="Kibana will provide a unique identifier for each index pattern. If you do not want to use this unique ID, enter a custom one."
|
||||
id="kbn.management.createIndexPattern.stepTime.options.patternLabel"
|
||||
id="indexPatternManagement.createIndexPattern.stepTime.options.patternLabel"
|
||||
values={Object {}}
|
||||
/>
|
||||
}
|
||||
label={
|
||||
<FormattedMessage
|
||||
defaultMessage="Custom index pattern ID"
|
||||
id="kbn.management.createIndexPattern.stepTime.options.patternHeader"
|
||||
id="indexPatternManagement.createIndexPattern.stepTime.options.patternHeader"
|
||||
values={Object {}}
|
||||
/>
|
||||
}
|
|
@ -44,12 +44,12 @@ export const AdvancedOptions: React.FC<AdvancedOptionsProps> = ({
|
|||
>
|
||||
{isVisible ? (
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.stepTime.options.hideButton"
|
||||
id="indexPatternManagement.createIndexPattern.stepTime.options.hideButton"
|
||||
defaultMessage="Hide advanced options"
|
||||
/>
|
||||
) : (
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.stepTime.options.showButton"
|
||||
id="indexPatternManagement.createIndexPattern.stepTime.options.showButton"
|
||||
defaultMessage="Show advanced options"
|
||||
/>
|
||||
)}
|
||||
|
@ -60,13 +60,13 @@ export const AdvancedOptions: React.FC<AdvancedOptionsProps> = ({
|
|||
<EuiFormRow
|
||||
label={
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.stepTime.options.patternHeader"
|
||||
id="indexPatternManagement.createIndexPattern.stepTime.options.patternHeader"
|
||||
defaultMessage="Custom index pattern ID"
|
||||
/>
|
||||
}
|
||||
helpText={
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.stepTime.options.patternLabel"
|
||||
id="indexPatternManagement.createIndexPattern.stepTime.options.patternLabel"
|
||||
defaultMessage="Kibana will provide a unique identifier for each index pattern. If you do not want to use this unique ID,
|
||||
enter a custom one."
|
||||
/>
|
||||
|
@ -78,7 +78,7 @@ export const AdvancedOptions: React.FC<AdvancedOptionsProps> = ({
|
|||
value={indexPatternId}
|
||||
onChange={onChangeIndexPatternId}
|
||||
placeholder={i18n.translate(
|
||||
'kbn.management.createIndexPattern.stepTime.options.patternPlaceholder',
|
||||
'indexPatternManagement.createIndexPattern.stepTime.options.patternPlaceholder',
|
||||
{
|
||||
defaultMessage: 'custom-index-pattern-id',
|
||||
}
|
|
@ -8,7 +8,7 @@ exports[`Header should render normally 1`] = `
|
|||
<h2>
|
||||
<FormattedMessage
|
||||
defaultMessage="Step 2 of 2: Configure settings"
|
||||
id="kbn.management.createIndexPattern.stepTimeHeader"
|
||||
id="indexPatternManagement.createIndexPattern.stepTimeHeader"
|
||||
values={Object {}}
|
||||
/>
|
||||
</h2>
|
||||
|
@ -21,7 +21,7 @@ exports[`Header should render normally 1`] = `
|
|||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="You've defined {indexPattern} as your {indexPatternName}. Now you can specify some settings before we create it."
|
||||
id="kbn.management.createIndexPattern.stepTimeLabel"
|
||||
id="indexPatternManagement.createIndexPattern.stepTimeLabel"
|
||||
values={
|
||||
Object {
|
||||
"indexPattern": <strong>
|
|
@ -33,7 +33,7 @@ export const Header: React.FC<HeaderProps> = ({ indexPattern, indexPatternName }
|
|||
<EuiTitle size="s">
|
||||
<h2>
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.stepTimeHeader"
|
||||
id="indexPatternManagement.createIndexPattern.stepTimeHeader"
|
||||
defaultMessage="Step 2 of 2: Configure settings"
|
||||
/>
|
||||
</h2>
|
||||
|
@ -41,7 +41,7 @@ export const Header: React.FC<HeaderProps> = ({ indexPattern, indexPatternName }
|
|||
<EuiSpacer size="m" />
|
||||
<EuiText color="subdued">
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.stepTimeLabel"
|
||||
id="indexPatternManagement.createIndexPattern.stepTimeLabel"
|
||||
defaultMessage="You've defined {indexPattern} as your {indexPatternName}. Now you can specify some settings before we create it."
|
||||
values={{
|
||||
indexPattern: <strong>{indexPattern}</strong>,
|
|
@ -13,14 +13,14 @@ exports[`TimeField should render a loading state 1`] = `
|
|||
<p>
|
||||
<FormattedMessage
|
||||
defaultMessage="The Time Filter will use this field to filter your data by time."
|
||||
id="kbn.management.createIndexPattern.stepTime.fieldLabel"
|
||||
id="indexPatternManagement.createIndexPattern.stepTime.fieldLabel"
|
||||
values={Object {}}
|
||||
/>
|
||||
</p>
|
||||
<p>
|
||||
<FormattedMessage
|
||||
defaultMessage="You can choose not to have a time field, but you will not be able to narrow down your data by a time range."
|
||||
id="kbn.management.createIndexPattern.stepTime.fieldWarningLabel"
|
||||
id="indexPatternManagement.createIndexPattern.stepTime.fieldWarningLabel"
|
||||
values={Object {}}
|
||||
/>
|
||||
</p>
|
||||
|
@ -38,7 +38,7 @@ exports[`TimeField should render a loading state 1`] = `
|
|||
<span>
|
||||
<FormattedMessage
|
||||
defaultMessage="Time Filter field name"
|
||||
id="kbn.management.createIndexPattern.stepTime.fieldHeader"
|
||||
id="indexPatternManagement.createIndexPattern.stepTime.fieldHeader"
|
||||
values={Object {}}
|
||||
/>
|
||||
</span>
|
||||
|
@ -84,14 +84,14 @@ exports[`TimeField should render a selected time field 1`] = `
|
|||
<p>
|
||||
<FormattedMessage
|
||||
defaultMessage="The Time Filter will use this field to filter your data by time."
|
||||
id="kbn.management.createIndexPattern.stepTime.fieldLabel"
|
||||
id="indexPatternManagement.createIndexPattern.stepTime.fieldLabel"
|
||||
values={Object {}}
|
||||
/>
|
||||
</p>
|
||||
<p>
|
||||
<FormattedMessage
|
||||
defaultMessage="You can choose not to have a time field, but you will not be able to narrow down your data by a time range."
|
||||
id="kbn.management.createIndexPattern.stepTime.fieldWarningLabel"
|
||||
id="indexPatternManagement.createIndexPattern.stepTime.fieldWarningLabel"
|
||||
values={Object {}}
|
||||
/>
|
||||
</p>
|
||||
|
@ -109,7 +109,7 @@ exports[`TimeField should render a selected time field 1`] = `
|
|||
<span>
|
||||
<FormattedMessage
|
||||
defaultMessage="Time Filter field name"
|
||||
id="kbn.management.createIndexPattern.stepTime.fieldHeader"
|
||||
id="indexPatternManagement.createIndexPattern.stepTime.fieldHeader"
|
||||
values={Object {}}
|
||||
/>
|
||||
</span>
|
||||
|
@ -123,7 +123,7 @@ exports[`TimeField should render a selected time field 1`] = `
|
|||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="Refresh"
|
||||
id="kbn.management.createIndexPattern.stepTime.refreshButton"
|
||||
id="indexPatternManagement.createIndexPattern.stepTime.refreshButton"
|
||||
values={Object {}}
|
||||
/>
|
||||
</ForwardRef>
|
||||
|
@ -165,14 +165,14 @@ exports[`TimeField should render normally 1`] = `
|
|||
<p>
|
||||
<FormattedMessage
|
||||
defaultMessage="The Time Filter will use this field to filter your data by time."
|
||||
id="kbn.management.createIndexPattern.stepTime.fieldLabel"
|
||||
id="indexPatternManagement.createIndexPattern.stepTime.fieldLabel"
|
||||
values={Object {}}
|
||||
/>
|
||||
</p>
|
||||
<p>
|
||||
<FormattedMessage
|
||||
defaultMessage="You can choose not to have a time field, but you will not be able to narrow down your data by a time range."
|
||||
id="kbn.management.createIndexPattern.stepTime.fieldWarningLabel"
|
||||
id="indexPatternManagement.createIndexPattern.stepTime.fieldWarningLabel"
|
||||
values={Object {}}
|
||||
/>
|
||||
</p>
|
||||
|
@ -190,7 +190,7 @@ exports[`TimeField should render normally 1`] = `
|
|||
<span>
|
||||
<FormattedMessage
|
||||
defaultMessage="Time Filter field name"
|
||||
id="kbn.management.createIndexPattern.stepTime.fieldHeader"
|
||||
id="indexPatternManagement.createIndexPattern.stepTime.fieldHeader"
|
||||
values={Object {}}
|
||||
/>
|
||||
</span>
|
||||
|
@ -204,7 +204,7 @@ exports[`TimeField should render normally 1`] = `
|
|||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="Refresh"
|
||||
id="kbn.management.createIndexPattern.stepTime.refreshButton"
|
||||
id="indexPatternManagement.createIndexPattern.stepTime.refreshButton"
|
||||
values={Object {}}
|
||||
/>
|
||||
</ForwardRef>
|
||||
|
@ -239,7 +239,7 @@ exports[`TimeField should render something if hiding time field 1`] = `
|
|||
<p>
|
||||
<FormattedMessage
|
||||
defaultMessage="The indices which match this index pattern don't contain any time fields."
|
||||
id="kbn.management.createIndexPattern.stepTime.field.noTimeFieldsLabel"
|
||||
id="indexPatternManagement.createIndexPattern.stepTime.field.noTimeFieldsLabel"
|
||||
values={Object {}}
|
||||
/>
|
||||
</p>
|
|
@ -1,6 +1,7 @@
|
|||
/**
|
||||
* 1. Bring the line-height down or else this link expands its container when it becomes visible.
|
||||
*/
|
||||
.timeFieldRefreshButton {
|
||||
|
||||
.timeFieldRefreshButton {
|
||||
line-height: 1 !important; /* 1 */
|
||||
}
|
|
@ -17,9 +17,9 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import './time_field.scss';
|
||||
|
||||
import './time_field.css';
|
||||
import React from 'react';
|
||||
|
||||
import {
|
||||
EuiForm,
|
||||
|
@ -60,7 +60,7 @@ export const TimeField: React.FC<TimeFieldProps> = ({
|
|||
<EuiFlexItem grow={false}>
|
||||
<span>
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.stepTime.fieldHeader"
|
||||
id="indexPatternManagement.createIndexPattern.stepTime.fieldHeader"
|
||||
defaultMessage="Time Filter field name"
|
||||
/>
|
||||
</span>
|
||||
|
@ -71,7 +71,7 @@ export const TimeField: React.FC<TimeFieldProps> = ({
|
|||
) : (
|
||||
<EuiLink className="timeFieldRefreshButton" onClick={fetchTimeFields}>
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.stepTime.refreshButton"
|
||||
id="indexPatternManagement.createIndexPattern.stepTime.refreshButton"
|
||||
defaultMessage="Refresh"
|
||||
/>
|
||||
</EuiLink>
|
||||
|
@ -83,13 +83,13 @@ export const TimeField: React.FC<TimeFieldProps> = ({
|
|||
<div>
|
||||
<p>
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.stepTime.fieldLabel"
|
||||
id="indexPatternManagement.createIndexPattern.stepTime.fieldLabel"
|
||||
defaultMessage="The Time Filter will use this field to filter your data by time."
|
||||
/>
|
||||
</p>
|
||||
<p>
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.stepTime.fieldWarningLabel"
|
||||
id="indexPatternManagement.createIndexPattern.stepTime.fieldWarningLabel"
|
||||
defaultMessage="You can choose not to have a time field, but you will not be able to narrow down your data by a time range."
|
||||
/>
|
||||
</p>
|
||||
|
@ -103,7 +103,7 @@ export const TimeField: React.FC<TimeFieldProps> = ({
|
|||
options={[
|
||||
{
|
||||
text: i18n.translate(
|
||||
'kbn.management.createIndexPattern.stepTime.field.loadingDropDown',
|
||||
'indexPatternManagement.createIndexPattern.stepTime.field.loadingDropDown',
|
||||
{
|
||||
defaultMessage: 'Loading…',
|
||||
}
|
||||
|
@ -129,7 +129,7 @@ export const TimeField: React.FC<TimeFieldProps> = ({
|
|||
<EuiText>
|
||||
<p>
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.stepTime.field.noTimeFieldsLabel"
|
||||
id="indexPatternManagement.createIndexPattern.stepTime.field.noTimeFieldsLabel"
|
||||
defaultMessage="The indices which match this index pattern don't contain any time fields."
|
||||
/>
|
||||
</p>
|
|
@ -19,8 +19,8 @@
|
|||
|
||||
import React from 'react';
|
||||
import { shallowWithI18nProvider } from 'test_utils/enzyme_helpers';
|
||||
import { IndexPatternCreationConfig } from '../../../../../../../../../../plugins/index_pattern_management/public';
|
||||
import { IFieldType } from '../../../../../../../../../../plugins/data/public';
|
||||
import { IndexPatternCreationConfig } from '../../../../../../../plugins/index_pattern_management/public';
|
||||
import { IFieldType } from '../../../../../../../plugins/data/public';
|
||||
|
||||
import { StepTimeField } from '../step_time_field';
|
||||
|
||||
|
@ -32,9 +32,6 @@ jest.mock('./../../lib', () => ({
|
|||
extractTimeFields: require.requireActual('./../../lib').extractTimeFields,
|
||||
ensureMinimumTime: async (fields: IFieldType) => Promise.resolve(fields),
|
||||
}));
|
||||
jest.mock('ui/chrome', () => ({
|
||||
addBasePath: () => {},
|
||||
}));
|
||||
|
||||
const mockIndexPatternCreationType = new IndexPatternCreationConfig({
|
||||
type: 'default',
|
|
@ -34,8 +34,8 @@ import { Header } from './components/header';
|
|||
import { TimeField } from './components/time_field';
|
||||
import { AdvancedOptions } from './components/advanced_options';
|
||||
import { ActionButtons } from './components/action_buttons';
|
||||
import { IndexPatternCreationConfig } from '../../../../../../../../../../plugins/index_pattern_management/public';
|
||||
import { DataPublicPluginStart } from '../../../../../../../../../../plugins/data/public';
|
||||
import { IndexPatternCreationConfig } from '../../../..';
|
||||
import { DataPublicPluginStart } from '../../../../../../data/public';
|
||||
|
||||
interface StepTimeFieldProps {
|
||||
indexPattern: string;
|
||||
|
@ -157,7 +157,7 @@ export class StepTimeField extends Component<StepTimeFieldProps, StepTimeFieldSt
|
|||
// `createIndexPattern` throws "Conflict" when index pattern ID already exists.
|
||||
return message === 'Conflict' ? (
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.stepTime.patterAlreadyExists"
|
||||
id="indexPatternManagement.createIndexPattern.stepTime.patterAlreadyExists"
|
||||
defaultMessage="Custom index pattern ID already exists."
|
||||
/>
|
||||
) : (
|
||||
|
@ -187,7 +187,7 @@ export class StepTimeField extends Component<StepTimeFieldProps, StepTimeFieldSt
|
|||
<EuiFlexItem grow={false}>
|
||||
<EuiText>
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.stepTime.creatingLabel"
|
||||
id="indexPatternManagement.createIndexPattern.stepTime.creatingLabel"
|
||||
defaultMessage="Creating index pattern…"
|
||||
/>
|
||||
</EuiText>
|
||||
|
@ -218,7 +218,7 @@ export class StepTimeField extends Component<StepTimeFieldProps, StepTimeFieldSt
|
|||
<EuiCallOut
|
||||
title={
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.stepTime.error"
|
||||
id="indexPatternManagement.createIndexPattern.stepTime.error"
|
||||
defaultMessage="Error"
|
||||
/>
|
||||
}
|
|
@ -20,12 +20,15 @@
|
|||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import { CreateIndexPatternWizard } from './create_index_pattern_wizard';
|
||||
import { coreMock } from '../../../../../../../../core/public/mocks';
|
||||
import { dataPluginMock } from '../../../../../../../../plugins/data/public/mocks';
|
||||
import { IndexPatternCreationConfig } from '../../../../../../../../plugins/index_pattern_management/public';
|
||||
import { IndexPattern } from '../../../../../../../../plugins/data/public';
|
||||
import { SavedObjectsClient } from '../../../../../../../../core/public';
|
||||
import {
|
||||
CreateIndexPatternWizard,
|
||||
CreateIndexPatternWizardProps,
|
||||
} from './create_index_pattern_wizard';
|
||||
import { coreMock } from '../../../../../core/public/mocks';
|
||||
import { dataPluginMock } from '../../../../../plugins/data/public/mocks';
|
||||
import { IndexPattern } from '../../../../../plugins/data/public';
|
||||
import { SavedObjectsClient } from '../../../../../core/public';
|
||||
import { IndexPatternCreationConfig } from '../../service/creation';
|
||||
|
||||
jest.mock('./components/step_index_pattern', () => ({ StepIndexPattern: 'StepIndexPattern' }));
|
||||
jest.mock('./components/step_time_field', () => ({ StepTimeField: 'StepTimeField' }));
|
||||
|
@ -37,33 +40,42 @@ jest.mock('./lib/get_indices', () => ({
|
|||
return [{ name: 'kibana' }];
|
||||
},
|
||||
}));
|
||||
jest.mock('ui/chrome', () => ({
|
||||
addBasePath: () => {},
|
||||
}));
|
||||
|
||||
const { savedObjects, overlays, uiSettings } = coreMock.createStart();
|
||||
const { savedObjects, overlays, uiSettings, chrome, http } = coreMock.createStart();
|
||||
const { indexPatterns, search } = dataPluginMock.createStartContract();
|
||||
|
||||
const mockIndexPatternCreationType = new IndexPatternCreationConfig({
|
||||
type: 'default',
|
||||
name: 'name',
|
||||
});
|
||||
|
||||
const initialQuery = '';
|
||||
const services = {
|
||||
const services = ({
|
||||
indexPatternCreation: {
|
||||
getType: jest.fn(() => mockIndexPatternCreationType),
|
||||
},
|
||||
es: search.__LEGACY.esClient,
|
||||
indexPatterns,
|
||||
savedObjectsClient: savedObjects.client as SavedObjectsClient,
|
||||
uiSettings,
|
||||
changeUrl: jest.fn(),
|
||||
openConfirm: overlays.openConfirm,
|
||||
indexPatternCreationType: mockIndexPatternCreationType,
|
||||
prependBasePath: jest.fn(x => x),
|
||||
setBreadcrumbs: jest.fn(),
|
||||
docTitle: chrome.docTitle,
|
||||
prependBasePath: http.basePath.prepend,
|
||||
} as unknown) as CreateIndexPatternWizardProps['services'];
|
||||
|
||||
const routeComponentPropsMock = {
|
||||
history: {
|
||||
push: jest.fn(),
|
||||
} as any,
|
||||
location: {} as any,
|
||||
match: {} as any,
|
||||
};
|
||||
|
||||
describe('CreateIndexPatternWizard', () => {
|
||||
test(`defaults to the loading state`, () => {
|
||||
const component = shallow(
|
||||
<CreateIndexPatternWizard initialQuery={initialQuery} services={services} />
|
||||
<CreateIndexPatternWizard {...routeComponentPropsMock} services={services} />
|
||||
);
|
||||
|
||||
expect(component).toMatchSnapshot();
|
||||
|
@ -71,7 +83,7 @@ describe('CreateIndexPatternWizard', () => {
|
|||
|
||||
test('renders the empty state when there are no indices', async () => {
|
||||
const component = shallow(
|
||||
<CreateIndexPatternWizard initialQuery={initialQuery} services={services} />
|
||||
<CreateIndexPatternWizard {...routeComponentPropsMock} services={services} />
|
||||
);
|
||||
|
||||
component.setState({
|
||||
|
@ -86,7 +98,7 @@ describe('CreateIndexPatternWizard', () => {
|
|||
|
||||
test('renders when there are no indices but there are remote clusters', async () => {
|
||||
const component = shallow(
|
||||
<CreateIndexPatternWizard initialQuery={initialQuery} services={services} />
|
||||
<CreateIndexPatternWizard {...routeComponentPropsMock} services={services} />
|
||||
);
|
||||
|
||||
component.setState({
|
||||
|
@ -101,7 +113,7 @@ describe('CreateIndexPatternWizard', () => {
|
|||
|
||||
test('shows system indices even if there are no other indices if the include system indices is toggled', async () => {
|
||||
const component = shallow(
|
||||
<CreateIndexPatternWizard initialQuery={initialQuery} services={services} />
|
||||
<CreateIndexPatternWizard {...routeComponentPropsMock} services={services} />
|
||||
);
|
||||
|
||||
component.setState({
|
||||
|
@ -116,7 +128,7 @@ describe('CreateIndexPatternWizard', () => {
|
|||
|
||||
test('renders index pattern step when there are indices', async () => {
|
||||
const component = shallow(
|
||||
<CreateIndexPatternWizard initialQuery={initialQuery} services={services} />
|
||||
<CreateIndexPatternWizard {...routeComponentPropsMock} services={services} />
|
||||
);
|
||||
|
||||
component.setState({
|
||||
|
@ -130,7 +142,7 @@ describe('CreateIndexPatternWizard', () => {
|
|||
|
||||
test('renders time field step when step is set to 2', async () => {
|
||||
const component = shallow(
|
||||
<CreateIndexPatternWizard initialQuery={initialQuery} services={services} />
|
||||
<CreateIndexPatternWizard {...routeComponentPropsMock} services={services} />
|
||||
);
|
||||
|
||||
component.setState({
|
||||
|
@ -159,7 +171,7 @@ describe('CreateIndexPatternWizard', () => {
|
|||
};
|
||||
|
||||
const component = shallow<CreateIndexPatternWizard>(
|
||||
<CreateIndexPatternWizard initialQuery={initialQuery} services={services} />
|
||||
<CreateIndexPatternWizard {...routeComponentPropsMock} services={services} />
|
||||
);
|
||||
|
||||
component.setState({ indexPattern: 'foo' });
|
||||
|
@ -167,6 +179,6 @@ describe('CreateIndexPatternWizard', () => {
|
|||
expect(services.uiSettings.get).toBeCalled();
|
||||
expect(create).toBeCalled();
|
||||
expect(clear).toBeCalledWith('id');
|
||||
expect(services.changeUrl).toBeCalledWith(`/management/kibana/index_patterns/id`);
|
||||
expect(routeComponentPropsMock.history.push).toBeCalledWith(`/patterns/id`);
|
||||
});
|
||||
});
|
|
@ -19,38 +19,42 @@
|
|||
|
||||
import React, { ReactElement, Component } from 'react';
|
||||
|
||||
import { EuiGlobalToastList, EuiGlobalToastListToast } from '@elastic/eui';
|
||||
import { EuiGlobalToastList, EuiGlobalToastListToast, EuiPanel } from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { withRouter, RouteComponentProps } from 'react-router-dom';
|
||||
|
||||
import {
|
||||
SavedObjectsClientContract,
|
||||
IUiSettingsClient,
|
||||
OverlayStart,
|
||||
ChromeDocTitle,
|
||||
IBasePath,
|
||||
} from 'src/core/public';
|
||||
import { DataPublicPluginStart } from 'src/plugins/data/public';
|
||||
import { ManagementAppMountParams } from '../../../../management/public';
|
||||
import { StepIndexPattern } from './components/step_index_pattern';
|
||||
import { StepTimeField } from './components/step_time_field';
|
||||
import { Header } from './components/header';
|
||||
import { LoadingState } from './components/loading_state';
|
||||
import { EmptyState } from './components/empty_state';
|
||||
|
||||
import { getCreateBreadcrumbs } from '../breadcrumbs';
|
||||
import { MAX_SEARCH_SIZE } from './constants';
|
||||
import { ensureMinimumTime, getIndices } from './lib';
|
||||
import {
|
||||
SavedObjectsClient,
|
||||
IUiSettingsClient,
|
||||
OverlayStart,
|
||||
IBasePath,
|
||||
} from '../../../../../../../../core/public';
|
||||
import { DataPublicPluginStart } from '../../../../../../../../plugins/data/public';
|
||||
import { IndexPatternCreationConfig } from '../../../../../../../../plugins/index_pattern_management/public';
|
||||
import { IndexPatternCreationConfig, IndexPatternManagementStart } from '../..';
|
||||
import { MatchedIndex } from './types';
|
||||
|
||||
interface CreateIndexPatternWizardProps {
|
||||
initialQuery: string;
|
||||
export interface CreateIndexPatternWizardProps extends RouteComponentProps {
|
||||
services: {
|
||||
indexPatternCreationType: IndexPatternCreationConfig;
|
||||
indexPatternCreation: IndexPatternManagementStart['creation'];
|
||||
es: DataPublicPluginStart['search']['__LEGACY']['esClient'];
|
||||
indexPatterns: DataPublicPluginStart['indexPatterns'];
|
||||
savedObjectsClient: SavedObjectsClient;
|
||||
savedObjectsClient: SavedObjectsClientContract;
|
||||
uiSettings: IUiSettingsClient;
|
||||
changeUrl: (url: string) => void;
|
||||
openConfirm: OverlayStart['openConfirm'];
|
||||
setBreadcrumbs: ManagementAppMountParams['setBreadcrumbs'];
|
||||
docTitle: ChromeDocTitle;
|
||||
prependBasePath: IBasePath['prepend'];
|
||||
};
|
||||
}
|
||||
|
@ -63,21 +67,35 @@ interface CreateIndexPatternWizardState {
|
|||
isInitiallyLoadingIndices: boolean;
|
||||
isIncludingSystemIndices: boolean;
|
||||
toasts: EuiGlobalToastListToast[];
|
||||
indexPatternCreationType: IndexPatternCreationConfig;
|
||||
}
|
||||
|
||||
export class CreateIndexPatternWizard extends Component<
|
||||
CreateIndexPatternWizardProps,
|
||||
CreateIndexPatternWizardState
|
||||
> {
|
||||
state = {
|
||||
step: 1,
|
||||
indexPattern: '',
|
||||
allIndices: [],
|
||||
remoteClustersExist: false,
|
||||
isInitiallyLoadingIndices: true,
|
||||
isIncludingSystemIndices: false,
|
||||
toasts: [],
|
||||
};
|
||||
constructor(props: CreateIndexPatternWizardProps) {
|
||||
super(props);
|
||||
const {
|
||||
services: { indexPatternCreation, setBreadcrumbs },
|
||||
location,
|
||||
} = props;
|
||||
|
||||
setBreadcrumbs(getCreateBreadcrumbs());
|
||||
|
||||
const type = new URLSearchParams(location.search).get('type') || undefined;
|
||||
|
||||
this.state = {
|
||||
step: 1,
|
||||
indexPattern: '',
|
||||
allIndices: [],
|
||||
remoteClustersExist: false,
|
||||
isInitiallyLoadingIndices: true,
|
||||
isIncludingSystemIndices: false,
|
||||
toasts: [],
|
||||
indexPatternCreationType: indexPatternCreation.getType(type),
|
||||
};
|
||||
}
|
||||
|
||||
async UNSAFE_componentWillMount() {
|
||||
this.fetchData();
|
||||
|
@ -116,14 +134,14 @@ export class CreateIndexPatternWizard extends Component<
|
|||
|
||||
const indicesFailMsg = (
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.loadIndicesFailMsg"
|
||||
id="indexPatternManagement.createIndexPattern.loadIndicesFailMsg"
|
||||
defaultMessage="Failed to load indices"
|
||||
/>
|
||||
);
|
||||
|
||||
const clustersFailMsg = (
|
||||
<FormattedMessage
|
||||
id="kbn.management.createIndexPattern.loadClustersFailMsg"
|
||||
id="indexPatternManagement.createIndexPattern.loadClustersFailMsg"
|
||||
defaultMessage="Failed to load remote clusters"
|
||||
/>
|
||||
);
|
||||
|
@ -131,7 +149,7 @@ export class CreateIndexPatternWizard extends Component<
|
|||
// query local and remote indices, updating state independently
|
||||
ensureMinimumTime(
|
||||
this.catchAndWarn(
|
||||
getIndices(services.es, services.indexPatternCreationType, `*`, MAX_SEARCH_SIZE),
|
||||
getIndices(services.es, this.state.indexPatternCreationType, `*`, MAX_SEARCH_SIZE),
|
||||
[],
|
||||
indicesFailMsg
|
||||
)
|
||||
|
@ -142,7 +160,7 @@ export class CreateIndexPatternWizard extends Component<
|
|||
this.catchAndWarn(
|
||||
// if we get an error from remote cluster query, supply fallback value that allows user entry.
|
||||
// ['a'] is fallback value
|
||||
getIndices(services.es, services.indexPatternCreationType, `*:*`, 1),
|
||||
getIndices(services.es, this.state.indexPatternCreationType, `*:*`, 1),
|
||||
['a'],
|
||||
clustersFailMsg
|
||||
).then((remoteIndices: string[] | MatchedIndex[]) =>
|
||||
|
@ -151,7 +169,7 @@ export class CreateIndexPatternWizard extends Component<
|
|||
};
|
||||
|
||||
createIndexPattern = async (timeFieldName: string | undefined, indexPatternId: string) => {
|
||||
const { services } = this.props;
|
||||
const { services, history } = this.props;
|
||||
const { indexPattern } = this.state;
|
||||
|
||||
const emptyPattern = await services.indexPatterns.make();
|
||||
|
@ -160,24 +178,30 @@ export class CreateIndexPatternWizard extends Component<
|
|||
id: indexPatternId,
|
||||
title: indexPattern,
|
||||
timeFieldName,
|
||||
...services.indexPatternCreationType.getIndexPatternMappings(),
|
||||
...this.state.indexPatternCreationType.getIndexPatternMappings(),
|
||||
});
|
||||
|
||||
const createdId = await emptyPattern.create();
|
||||
if (!createdId) {
|
||||
const confirmMessage = i18n.translate('kbn.management.indexPattern.titleExistsLabel', {
|
||||
values: { title: emptyPattern.title },
|
||||
defaultMessage: "An index pattern with the title '{title}' already exists.",
|
||||
});
|
||||
const confirmMessage = i18n.translate(
|
||||
'indexPatternManagement.indexPattern.titleExistsLabel',
|
||||
{
|
||||
values: { title: emptyPattern.title },
|
||||
defaultMessage: "An index pattern with the title '{title}' already exists.",
|
||||
}
|
||||
);
|
||||
|
||||
const isConfirmed = await services.openConfirm(confirmMessage, {
|
||||
confirmButtonText: i18n.translate('kbn.management.indexPattern.goToPatternButtonLabel', {
|
||||
defaultMessage: 'Go to existing pattern',
|
||||
}),
|
||||
confirmButtonText: i18n.translate(
|
||||
'indexPatternManagement.indexPattern.goToPatternButtonLabel',
|
||||
{
|
||||
defaultMessage: 'Go to existing pattern',
|
||||
}
|
||||
),
|
||||
});
|
||||
|
||||
if (isConfirmed) {
|
||||
return services.changeUrl(`/management/kibana/index_patterns/${indexPatternId}`);
|
||||
return history.push(`/patterns/${indexPatternId}`);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
@ -188,7 +212,7 @@ export class CreateIndexPatternWizard extends Component<
|
|||
}
|
||||
|
||||
services.indexPatterns.clearCache(createdId);
|
||||
services.changeUrl(`/management/kibana/index_patterns/${createdId}`);
|
||||
history.push(`/patterns/${createdId}`);
|
||||
};
|
||||
|
||||
goToTimeFieldStep = (indexPattern: string) => {
|
||||
|
@ -211,12 +235,13 @@ export class CreateIndexPatternWizard extends Component<
|
|||
|
||||
return (
|
||||
<Header
|
||||
prompt={services.indexPatternCreationType.renderPrompt()}
|
||||
showSystemIndices={services.indexPatternCreationType.getShowSystemIndices()}
|
||||
prompt={this.state.indexPatternCreationType.renderPrompt()}
|
||||
showSystemIndices={this.state.indexPatternCreationType.getShowSystemIndices()}
|
||||
isIncludingSystemIndices={isIncludingSystemIndices}
|
||||
onChangeIncludingSystemIndices={this.onChangeIncludingSystemIndices}
|
||||
indexPatternName={services.indexPatternCreationType.getIndexPatternName()}
|
||||
isBeta={services.indexPatternCreationType.getIsBeta()}
|
||||
indexPatternName={this.state.indexPatternCreationType.getIndexPatternName()}
|
||||
isBeta={this.state.indexPatternCreationType.getIsBeta()}
|
||||
changeTitle={services.docTitle.change}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
@ -246,7 +271,9 @@ export class CreateIndexPatternWizard extends Component<
|
|||
}
|
||||
|
||||
if (step === 1) {
|
||||
const { services, initialQuery } = this.props;
|
||||
const { services, location } = this.props;
|
||||
const initialQuery = new URLSearchParams(location.search).get('id') || undefined;
|
||||
|
||||
return (
|
||||
<StepIndexPattern
|
||||
allIndices={allIndices}
|
||||
|
@ -254,7 +281,7 @@ export class CreateIndexPatternWizard extends Component<
|
|||
isIncludingSystemIndices={isIncludingSystemIndices}
|
||||
esService={services.es}
|
||||
savedObjectsClient={services.savedObjectsClient}
|
||||
indexPatternCreationType={services.indexPatternCreationType}
|
||||
indexPatternCreationType={this.state.indexPatternCreationType}
|
||||
goToNextStep={this.goToTimeFieldStep}
|
||||
uiSettings={services.uiSettings}
|
||||
/>
|
||||
|
@ -269,7 +296,7 @@ export class CreateIndexPatternWizard extends Component<
|
|||
indexPatternsService={services.indexPatterns}
|
||||
goToPreviousStep={this.goToIndexPatternStep}
|
||||
createIndexPattern={this.createIndexPattern}
|
||||
indexPatternCreationType={services.indexPatternCreationType}
|
||||
indexPatternCreationType={this.state.indexPatternCreationType}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
@ -288,7 +315,7 @@ export class CreateIndexPatternWizard extends Component<
|
|||
const content = this.renderContent();
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<EuiPanel paddingSize={'l'}>
|
||||
<div>
|
||||
{header}
|
||||
{content}
|
||||
|
@ -300,7 +327,9 @@ export class CreateIndexPatternWizard extends Component<
|
|||
}}
|
||||
toastLifeTimeMs={6000}
|
||||
/>
|
||||
</React.Fragment>
|
||||
</EuiPanel>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export const CreateIndexPatternWizardWithRouter = withRouter(CreateIndexPatternWizard);
|
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
export { CreateIndexPatternWizardWithRouter } from './create_index_pattern_wizard';
|