* Move input_control_vis into NP * Change config paths * Clean up # Conflicts: # .github/CODEOWNERS
This commit is contained in:
parent
6d2097ef17
commit
b57d022a0e
|
@ -14,7 +14,7 @@
|
|||
"esUi": "src/plugins/es_ui_shared",
|
||||
"devTools": "src/plugins/dev_tools",
|
||||
"expressions": "src/plugins/expressions",
|
||||
"inputControl": "src/legacy/core_plugins/input_control_vis",
|
||||
"inputControl": "src/plugins/input_control_vis",
|
||||
"inspector": "src/plugins/inspector",
|
||||
"inspectorViews": "src/legacy/core_plugins/inspector_views",
|
||||
"interpreter": "src/legacy/core_plugins/interpreter",
|
||||
|
|
|
@ -1,44 +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 { resolve } from 'path';
|
||||
import { Legacy } from 'kibana';
|
||||
|
||||
import { LegacyPluginApi, LegacyPluginInitializer } from '../../../../src/legacy/types';
|
||||
|
||||
const inputControlVisPluginInitializer: LegacyPluginInitializer = ({ Plugin }: LegacyPluginApi) =>
|
||||
new Plugin({
|
||||
id: 'input_control_vis',
|
||||
require: ['kibana', 'elasticsearch', 'interpreter'],
|
||||
publicDir: resolve(__dirname, 'public'),
|
||||
uiExports: {
|
||||
styleSheetPaths: resolve(__dirname, 'public/index.scss'),
|
||||
hacks: [resolve(__dirname, 'public/legacy')],
|
||||
injectDefaultVars: server => ({}),
|
||||
},
|
||||
init: (server: Legacy.Server) => ({}),
|
||||
config(Joi: any) {
|
||||
return Joi.object({
|
||||
enabled: Joi.boolean().default(true),
|
||||
}).default();
|
||||
},
|
||||
} as Legacy.PluginSpecOptions);
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default inputControlVisPluginInitializer;
|
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"name": "input_control_vis",
|
||||
"version": "kibana"
|
||||
}
|
|
@ -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 { PluginInitializerContext } from 'kibana/public';
|
||||
import { npSetup, npStart } from 'ui/new_platform';
|
||||
|
||||
import { plugin } from '.';
|
||||
|
||||
import {
|
||||
InputControlVisPluginSetupDependencies,
|
||||
InputControlVisPluginStartDependencies,
|
||||
} from './plugin';
|
||||
|
||||
const setupPlugins: Readonly<InputControlVisPluginSetupDependencies> = {
|
||||
expressions: npSetup.plugins.expressions,
|
||||
data: npSetup.plugins.data,
|
||||
visualizations: npSetup.plugins.visualizations,
|
||||
};
|
||||
|
||||
const startPlugins: Readonly<InputControlVisPluginStartDependencies> = {
|
||||
expressions: npStart.plugins.expressions,
|
||||
data: npStart.plugins.data,
|
||||
visualizations: npStart.plugins.visualizations,
|
||||
};
|
||||
|
||||
const pluginInstance = plugin({} as PluginInitializerContext);
|
||||
|
||||
export const setup = pluginInstance.setup(npSetup.core, setupPlugins);
|
||||
export const start = pluginInstance.start(npStart.core, startPlugins);
|
8
src/plugins/input_control_vis/kibana.json
Normal file
8
src/plugins/input_control_vis/kibana.json
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"id": "inputControlVis",
|
||||
"version": "8.0.0",
|
||||
"kibanaVersion": "kibana",
|
||||
"server": true,
|
||||
"ui": true,
|
||||
"requiredPlugins": ["data", "expressions", "visualizations"]
|
||||
}
|
|
@ -34,7 +34,7 @@ import {
|
|||
import { RangeControlEditor } from './range_control_editor';
|
||||
import { ListControlEditor } from './list_control_editor';
|
||||
import { getTitle, ControlParams, CONTROL_TYPES, ControlParamsOptions } from '../../editor_utils';
|
||||
import { IIndexPattern } from '../../../../../../plugins/data/public';
|
||||
import { IIndexPattern } from '../../../../data/public';
|
||||
import { InputControlVisDependencies } from '../../plugin';
|
||||
|
||||
interface ControlEditorUiProps {
|
|
@ -23,7 +23,7 @@ import { shallowWithIntl, mountWithIntl } from 'test_utils/enzyme_helpers';
|
|||
import { findTestSubject } from '@elastic/eui/lib/test';
|
||||
import { getDepsMock, getIndexPatternMock } from '../../test_utils';
|
||||
import { ControlsTab, ControlsTabUiProps } from './controls_tab';
|
||||
import { Vis } from '../../../../../../plugins/visualizations/public';
|
||||
import { Vis } from '../../../../visualizations/public';
|
||||
|
||||
const indexPatternsMock = {
|
||||
get: getIndexPatternMock,
|
|
@ -24,7 +24,7 @@ import { InjectedIntlProps } from 'react-intl';
|
|||
import { injectI18n, FormattedMessage } from '@kbn/i18n/react';
|
||||
import { EuiFormRow, EuiComboBox, EuiComboBoxOptionOption } from '@elastic/eui';
|
||||
|
||||
import { IIndexPattern, IFieldType } from '../../../../../../plugins/data/public';
|
||||
import { IIndexPattern, IFieldType } from '../../../../data/public';
|
||||
|
||||
interface FieldSelectUiState {
|
||||
isLoading: boolean;
|
|
@ -25,11 +25,7 @@ import { EuiFormRow, EuiFieldNumber, EuiSwitch, EuiSelect } from '@elastic/eui';
|
|||
import { IndexPatternSelectFormRow } from './index_pattern_select_form_row';
|
||||
import { FieldSelect } from './field_select';
|
||||
import { ControlParams, ControlParamsOptions } from '../../editor_utils';
|
||||
import {
|
||||
IIndexPattern,
|
||||
IFieldType,
|
||||
IndexPatternSelect,
|
||||
} from '../../../../../../plugins/data/public';
|
||||
import { IIndexPattern, IFieldType, IndexPatternSelect } from '../../../../data/public';
|
||||
import { InputControlVisDependencies } from '../../plugin';
|
||||
|
||||
interface ListControlEditorState {
|
|
@ -21,7 +21,7 @@ import React from 'react';
|
|||
import { shallow } from 'enzyme';
|
||||
import { mountWithIntl } from 'test_utils/enzyme_helpers';
|
||||
|
||||
import { Vis } from '../../../../../../plugins/visualizations/public';
|
||||
import { Vis } from '../../../../visualizations/public';
|
||||
import { OptionsTab, OptionsTabProps } from './options_tab';
|
||||
|
||||
describe('OptionsTab', () => {
|
|
@ -24,11 +24,7 @@ import { FormattedMessage } from '@kbn/i18n/react';
|
|||
import { IndexPatternSelectFormRow } from './index_pattern_select_form_row';
|
||||
import { FieldSelect } from './field_select';
|
||||
import { ControlParams, ControlParamsOptions } from '../../editor_utils';
|
||||
import {
|
||||
IIndexPattern,
|
||||
IFieldType,
|
||||
IndexPatternSelect,
|
||||
} from '../../../../../../plugins/data/public';
|
||||
import { IIndexPattern, IFieldType, IndexPatternSelect } from '../../../../data/public';
|
||||
import { InputControlVisDependencies } from '../../plugin';
|
||||
|
||||
interface RangeControlEditorProps {
|
|
@ -28,8 +28,6 @@ import { InputControlVis } from './input_control_vis';
|
|||
import { ListControl } from '../../control/list_control_factory';
|
||||
import { RangeControl } from '../../control/range_control_factory';
|
||||
|
||||
jest.mock('ui/new_platform');
|
||||
|
||||
const mockListControl: ListControl = {
|
||||
id: 'mock-list-control',
|
||||
isEnabled: () => {
|
|
@ -23,8 +23,8 @@ import { FormattedMessage } from '@kbn/i18n/react';
|
|||
import { CONTROL_TYPES } from '../../editor_utils';
|
||||
import { ListControl } from '../../control/list_control_factory';
|
||||
import { RangeControl } from '../../control/range_control_factory';
|
||||
import { ListControl as ListControlComponent } from '../vis/list_control';
|
||||
import { RangeControl as RangeControlComponent } from '../vis/range_control';
|
||||
import { ListControl as ListControlComponent } from './list_control';
|
||||
import { RangeControl as RangeControlComponent } from './range_control';
|
||||
|
||||
function isListControl(control: RangeControl | ListControl): control is ListControl {
|
||||
return control.type === CONTROL_TYPES.LIST;
|
|
@ -23,8 +23,6 @@ import { shallowWithIntl } from 'test_utils/enzyme_helpers';
|
|||
import { RangeControl, ceilWithPrecision, floorWithPrecision } from './range_control';
|
||||
import { RangeControl as RangeControlClass } from '../../control/range_control_factory';
|
||||
|
||||
jest.mock('ui/new_platform');
|
||||
|
||||
const control: RangeControlClass = {
|
||||
id: 'mock-range-control',
|
||||
isEnabled: () => {
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
import _ from 'lodash';
|
||||
import React, { PureComponent } from 'react';
|
||||
import { ValidatedDualRange } from '../../../../../../../src/plugins/kibana_react/public';
|
||||
import { ValidatedDualRange } from '../../../../kibana_react/public';
|
||||
import { FormRow } from './form_row';
|
||||
import { RangeControl as RangeControlClass } from '../../control/range_control_factory';
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
import _ from 'lodash';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
import { Filter } from '../../../../../plugins/data/public';
|
||||
import { Filter } from 'src/plugins/data/public';
|
||||
import { ControlParams, ControlParamsOptions, CONTROL_TYPES } from '../editor_utils';
|
||||
import { RangeFilterManager } from './filter_manager/range_filter_manager';
|
||||
import { PhraseFilterManager } from './filter_manager/phrase_filter_manager';
|
|
@ -23,7 +23,7 @@ import {
|
|||
IndexPattern,
|
||||
TimefilterContract,
|
||||
DataPublicPluginStart,
|
||||
} from '../../../../../plugins/data/public';
|
||||
} from 'src/plugins/data/public';
|
||||
|
||||
export function createSearchSource(
|
||||
{ create }: DataPublicPluginStart['search']['searchSource'],
|
|
@ -20,12 +20,8 @@
|
|||
import expect from '@kbn/expect';
|
||||
|
||||
import { FilterManager } from './filter_manager';
|
||||
import { coreMock } from '../../../../../../core/public/mocks';
|
||||
import {
|
||||
Filter,
|
||||
IndexPattern,
|
||||
FilterManager as QueryFilterManager,
|
||||
} from '../../../../../../plugins/data/public';
|
||||
import { coreMock } from '../../../../../core/public/mocks';
|
||||
import { Filter, IndexPattern, FilterManager as QueryFilterManager } from '../../../../data/public';
|
||||
|
||||
const setupMock = coreMock.createSetup();
|
||||
|
|
@ -19,11 +19,7 @@
|
|||
|
||||
import _ from 'lodash';
|
||||
|
||||
import {
|
||||
FilterManager as QueryFilterManager,
|
||||
IndexPattern,
|
||||
Filter,
|
||||
} from '../../../../../../plugins/data/public';
|
||||
import { FilterManager as QueryFilterManager, IndexPattern, Filter } from '../../../../data/public';
|
||||
|
||||
export abstract class FilterManager {
|
||||
constructor(
|
|
@ -19,11 +19,7 @@
|
|||
|
||||
import expect from '@kbn/expect';
|
||||
|
||||
import {
|
||||
Filter,
|
||||
IndexPattern,
|
||||
FilterManager as QueryFilterManager,
|
||||
} from '../../../../../../plugins/data/public';
|
||||
import { Filter, IndexPattern, FilterManager as QueryFilterManager } from '../../../../data/public';
|
||||
import { PhraseFilterManager } from './phrase_filter_manager';
|
||||
|
||||
describe('PhraseFilterManager', function() {
|
|
@ -25,7 +25,7 @@ import {
|
|||
esFilters,
|
||||
IndexPattern,
|
||||
FilterManager as QueryFilterManager,
|
||||
} from '../../../../../../plugins/data/public';
|
||||
} from '../../../../data/public';
|
||||
|
||||
export class PhraseFilterManager extends FilterManager {
|
||||
constructor(
|
|
@ -25,7 +25,7 @@ import {
|
|||
RangeFilterMeta,
|
||||
IndexPattern,
|
||||
FilterManager as QueryFilterManager,
|
||||
} from '../../../../../../plugins/data/public';
|
||||
} from '../../../../data/public';
|
||||
|
||||
describe('RangeFilterManager', function() {
|
||||
const controlId = 'control1';
|
|
@ -20,12 +20,7 @@
|
|||
import _ from 'lodash';
|
||||
|
||||
import { FilterManager } from './filter_manager';
|
||||
import {
|
||||
esFilters,
|
||||
RangeFilter,
|
||||
RangeFilterParams,
|
||||
IFieldType,
|
||||
} from '../../../../../../plugins/data/public';
|
||||
import { esFilters, RangeFilter, RangeFilterParams, IFieldType } from '../../../../data/public';
|
||||
|
||||
interface SliderValue {
|
||||
min?: string | number;
|
|
@ -19,17 +19,17 @@
|
|||
|
||||
import _ from 'lodash';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { Control, noValuesDisableMsg, noIndexPatternMsg } from './control';
|
||||
import { PhraseFilterManager } from './filter_manager/phrase_filter_manager';
|
||||
import { createSearchSource } from './create_search_source';
|
||||
import { ControlParams } from '../editor_utils';
|
||||
import { InputControlVisDependencies } from '../plugin';
|
||||
import {
|
||||
IFieldType,
|
||||
TimefilterContract,
|
||||
SearchSourceFields,
|
||||
DataPublicPluginStart,
|
||||
} from '../../../../../plugins/data/public';
|
||||
} from 'src/plugins/data/public';
|
||||
import { Control, noValuesDisableMsg, noIndexPatternMsg } from './control';
|
||||
import { PhraseFilterManager } from './filter_manager/phrase_filter_manager';
|
||||
import { createSearchSource } from './create_search_source';
|
||||
import { ControlParams } from '../editor_utils';
|
||||
import { InputControlVisDependencies } from '../plugin';
|
||||
|
||||
function getEscapedQuery(query = '') {
|
||||
// https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-regexp-query.html#_standard_operators
|
|
@ -20,16 +20,12 @@
|
|||
import _ from 'lodash';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
import { IFieldType, TimefilterContract, DataPublicPluginStart } from 'src/plugins/data/public';
|
||||
import { Control, noValuesDisableMsg, noIndexPatternMsg } from './control';
|
||||
import { RangeFilterManager } from './filter_manager/range_filter_manager';
|
||||
import { createSearchSource } from './create_search_source';
|
||||
import { ControlParams } from '../editor_utils';
|
||||
import { InputControlVisDependencies } from '../plugin';
|
||||
import {
|
||||
IFieldType,
|
||||
TimefilterContract,
|
||||
DataPublicPluginStart,
|
||||
} from '../.../../../../../../plugins/data/public';
|
||||
|
||||
const minMaxAgg = (field?: IFieldType) => {
|
||||
const aggBody: any = {};
|
|
@ -1,5 +1,3 @@
|
|||
@import 'src/legacy/ui/public/styles/styling_constants';
|
||||
|
||||
// Prefix all styles with "icv" to avoid conflicts.
|
||||
// Examples
|
||||
// icvChart
|
|
@ -17,7 +17,9 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import { PluginInitializerContext } from '../../../../core/public';
|
||||
import './index.scss';
|
||||
|
||||
import { PluginInitializerContext } from '../../../core/public';
|
||||
import { InputControlVisPlugin as Plugin } from './plugin';
|
||||
|
||||
export function plugin(initializerContext: PluginInitializerContext) {
|
|
@ -18,9 +18,7 @@
|
|||
*/
|
||||
|
||||
import { createInputControlVisFn } from './input_control_fn';
|
||||
|
||||
// eslint-disable-next-line
|
||||
import { functionWrapper } from '../../../../plugins/expressions/common/expression_functions/specs/tests/utils';
|
||||
import { functionWrapper } from '../../expressions/common/expression_functions/specs/tests/utils';
|
||||
|
||||
describe('interpreter/functions#input_control_vis', () => {
|
||||
const fn = functionWrapper(createInputControlVisFn());
|
|
@ -19,11 +19,7 @@
|
|||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
import {
|
||||
ExpressionFunctionDefinition,
|
||||
KibanaDatatable,
|
||||
Render,
|
||||
} from '../../../../plugins/expressions/public';
|
||||
import { ExpressionFunctionDefinition, KibanaDatatable, Render } from '../../expressions/public';
|
||||
|
||||
interface Arguments {
|
||||
visConfig: string;
|
|
@ -23,7 +23,7 @@ import { createInputControlVisController } from './vis_controller';
|
|||
import { getControlsTab } from './components/editor/controls_tab';
|
||||
import { OptionsTab } from './components/editor/options_tab';
|
||||
import { InputControlVisDependencies } from './plugin';
|
||||
import { defaultFeedbackMessage } from '../../../../plugins/kibana_utils/public';
|
||||
import { defaultFeedbackMessage } from '../../kibana_utils/public';
|
||||
|
||||
export function createInputControlVisTypeDefinition(deps: InputControlVisDependencies) {
|
||||
const InputControlVisController = createInputControlVisController(deps);
|
|
@ -19,11 +19,8 @@
|
|||
import { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from 'kibana/public';
|
||||
|
||||
import { DataPublicPluginSetup, DataPublicPluginStart } from 'src/plugins/data/public';
|
||||
import { Plugin as ExpressionsPublicPlugin } from '../../../../plugins/expressions/public';
|
||||
import {
|
||||
VisualizationsSetup,
|
||||
VisualizationsStart,
|
||||
} from '../../../../plugins/visualizations/public';
|
||||
import { Plugin as ExpressionsPublicPlugin } from '../../expressions/public';
|
||||
import { VisualizationsSetup, VisualizationsStart } from '../../visualizations/public';
|
||||
import { createInputControlVisFn } from './input_control_fn';
|
||||
import { createInputControlVisTypeDefinition } from './input_control_vis_type';
|
||||
|
|
@ -28,8 +28,8 @@ import { ControlParams } from './editor_utils';
|
|||
import { RangeControl } from './control/range_control_factory';
|
||||
import { ListControl } from './control/list_control_factory';
|
||||
import { InputControlVisDependencies } from './plugin';
|
||||
import { FilterManager, Filter } from '../../../../plugins/data/public';
|
||||
import { VisParams, Vis } from '../../../../plugins/visualizations/public';
|
||||
import { FilterManager, Filter } from '../../data/public';
|
||||
import { VisParams, Vis } from '../../visualizations/public';
|
||||
|
||||
export const createInputControlVisController = (deps: InputControlVisDependencies) => {
|
||||
return class InputControlVisController {
|
30
src/plugins/input_control_vis/server/index.ts
Normal file
30
src/plugins/input_control_vis/server/index.ts
Normal file
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
* 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 { PluginConfigDescriptor } from 'kibana/server';
|
||||
import { schema } from '@kbn/config-schema';
|
||||
|
||||
export const config: PluginConfigDescriptor = {
|
||||
schema: schema.object({ enabled: schema.boolean({ defaultValue: true }) }),
|
||||
};
|
||||
|
||||
export const plugin = () => ({
|
||||
setup() {},
|
||||
start() {},
|
||||
});
|
Loading…
Reference in a new issue