Skip to content

Commit

Permalink
Merge branch 'master' into monitoring/config_changes
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Jan 29, 2020
2 parents c305d13 + 16b4ff4 commit 7732829
Show file tree
Hide file tree
Showing 268 changed files with 1,664 additions and 1,335 deletions.
8 changes: 8 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ module.exports = {
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: [
'src/legacy/core_plugins/vis_default_editor/public/components/controls/**/*.{ts,tsx}',
],
rules: {
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['src/legacy/ui/public/vis/**/*.{js,ts,tsx}'],
rules: {
Expand Down
1 change: 1 addition & 0 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"tileMap": "src/legacy/core_plugins/tile_map",
"timelion": ["src/legacy/core_plugins/timelion", "src/legacy/core_plugins/vis_type_timelion", "src/plugins/timelion"],
"uiActions": "src/plugins/ui_actions",
"visDefaultEditor": "src/legacy/core_plugins/vis_default_editor",
"visTypeMarkdown": "src/legacy/core_plugins/vis_type_markdown",
"visTypeMetric": "src/legacy/core_plugins/vis_type_metric",
"visTypeTable": "src/legacy/core_plugins/vis_type_table",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ import {
EuiSelect,
} from '@elastic/eui';

import { VisOptionsProps } from 'src/legacy/core_plugins/vis_default_editor/public';
import { IIndexPattern } from 'src/plugins/data/public';
import { ControlEditor } from './control_editor';
import {
addControl,
Expand All @@ -42,8 +44,6 @@ import {
ControlParamsOptions,
} from '../../editor_utils';
import { getLineageMap, getParentCandidates } from '../../lineage';
import { IIndexPattern } from '../../../../../../plugins/data/public';
import { VisOptionsProps } from '../../legacy_imports';
import { InputControlVisDependencies } from '../../plugin';

interface ControlsTabUiState {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import React from 'react';
import { shallow } from 'enzyme';
import { mountWithIntl } from 'test_utils/enzyme_helpers';

import { Vis } from 'src/legacy/core_plugins/visualizations/public';
import { OptionsTab, OptionsTabProps } from './options_tab';
import { Vis } from '../../legacy_imports';

describe('OptionsTab', () => {
let props: OptionsTabProps;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { EuiForm, EuiFormRow, EuiSwitch } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { EuiSwitchEvent } from '@elastic/eui';

import { VisOptionsProps } from '../../legacy_imports';
import { VisOptionsProps } from 'src/legacy/core_plugins/vis_default_editor/public';

interface OptionsTabParams {
updateFiltersOnChange: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ import { SearchSource as SearchSourceClass, ISearchSource } from '../../../../pl

export { SearchSourceFields } from '../../../../plugins/data/public';

export { Vis, VisParams } from 'ui/vis';
export { VisOptionsProps } from 'ui/vis/editors/default';
export { ValidatedDualRange } from 'ui/validated_range';

export type SearchSource = Class<ISearchSource>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import React from 'react';
import { render, unmountComponentAtNode } from 'react-dom';

import { I18nStart } from 'kibana/public';
import { Vis, VisParams, SearchSource } from './legacy_imports';
import { SearchSource } from './legacy_imports';

import { InputControlVis } from './components/vis/input_control_vis';
import { getControlFactory } from './control/control_factory';
Expand All @@ -31,6 +31,7 @@ import { RangeControl } from './control/range_control_factory';
import { ListControl } from './control/list_control_factory';
import { InputControlVisDependencies } from './plugin';
import { FilterManager, esFilters } from '../../../../plugins/data/public';
import { VisParams, Vis } from '../../visualizations/public';

export const createInputControlVisController = (deps: InputControlVisDependencies) => {
return class InputControlVisController {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ export { unhashUrl } from '../../../../../plugins/kibana_utils/public';
export { formatMsg, formatStack } from 'ui/notify/lib/index';

// EXPORT types
export { Vis } from 'ui/vis';
export {
IndexPatternsContract,
IIndexPattern,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ import {
stateMonitorFactory,
subscribeWithScope,
tabifyAggResponse,
Vis,
SavedObjectSaveModal,
getAngularModule,
ensureDefaultIndexPattern,
registerTimefilterWithGlobalStateFactory,
} from '../../kibana_services';
import { Vis } from '../../../../../visualizations/public';

const {
core,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ export { KbnUrlProvider, RedirectWhenMissingProvider } from 'ui/url';
export { absoluteToParsedUrl } from 'ui/url/absolute_to_parsed_url';
export { KibanaParsedUrl } from 'ui/url/kibana_parsed_url';

export { VisType } from 'ui/vis';
export { wrapInI18nContext } from 'ui/i18n';

export { DashboardConstants } from '../dashboard/np_ready/dashboard_constants';
export { VisSavedObject } from '../../../visualizations/public/embeddable/visualize_embeddable';
export { VISUALIZE_EMBEDDABLE_TYPE } from '../../../visualizations/public/embeddable';
export { VisType } from '../../../visualizations/public';
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export function initEditorDirective(app, deps) {
};
});

initVisEditorDirective(app);
initVisEditorDirective(app, deps);
initVisualizationDirective(app, deps);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

export function initVisEditorDirective(app) {
export function initVisEditorDirective(app, deps) {
app.directive('visualizationEditor', function($timeout, getAppState) {
return {
restrict: 'E',
Expand All @@ -34,6 +34,9 @@ export function initVisEditorDirective(app) {

$scope.renderFunction = () => {
editor.render({
core: deps.core,
data: deps.data,
embeddables: deps.embeddables,
uiState: $scope.uiState,
timeRange: $scope.timeRange,
filters: $scope.filters,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@
* under the License.
*/

import { TimeRange, Query, esFilters } from 'src/plugins/data/public';
import { TimeRange, Query, esFilters, DataPublicPluginStart } from 'src/plugins/data/public';
import { IEmbeddableStart } from 'src/plugins/embeddable/public';
import { LegacyCoreStart } from 'kibana/public';
import { VisSavedObject, AppState, PersistedState } from '../legacy_imports';

export interface EditorRenderProps {
appState: AppState;
core: LegacyCoreStart;
data: DataPublicPluginStart;
embeddables: IEmbeddableStart;
filters: esFilters.Filter[];
uiState: PersistedState;
timeRange: TimeRange;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import ngMock from 'ng_mock';
import _ from 'lodash';
import ChoroplethLayer from '../choropleth_layer';
import LogstashIndexPatternStubProvider from 'fixtures/stubbed_logstash_index_pattern';
import { Vis } from 'ui/vis';
import { ImageComparator } from 'test_utils/image_comparator';
import worldJson from './world.json';
import EMS_CATALOGUE from '../../../../ui/public/vis/__tests__/map/ems_mocks/sample_manifest.json';
Expand All @@ -40,6 +39,7 @@ import afterdatachangeandresizePng from './afterdatachangeandresize.png';
import aftercolorchangePng from './aftercolorchange.png';
import changestartupPng from './changestartup.png';
import { setup as visualizationsSetup } from '../../../visualizations/public/np_ready/public/legacy';
import { Vis } from '../../../visualizations/public/np_ready/public/vis';

import { createRegionMapVisualization } from '../region_map_visualization';
import { createRegionMapTypeDefinition } from '../region_map_type';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';

import { FileLayerField, VectorLayer, ServiceSettings } from 'ui/vis/map/service_settings';
import { VisOptionsProps } from 'ui/vis/editors/default';
import { VisOptionsProps } from 'src/legacy/core_plugins/vis_default_editor/public';
import { NumberInputOption, SelectOption, SwitchOption } from '../../../vis_type_vislib/public';
import { WmsOptions } from '../../../tile_map/public/components/wms_options';
import { RegionMapVisParams } from '../types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
import React from 'react';
import { i18n } from '@kbn/i18n';
import { Schemas } from 'ui/vis/editors/default/schemas';
import { Schemas } from 'ui/agg_types';
import { mapToLayerWithId } from './util';
import { createRegionMapVisualization } from './region_map_visualization';
import { Status } from '../../visualizations/public';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import expect from '@kbn/expect';
import ngMock from 'ng_mock';
import LogstashIndexPatternStubProvider from 'fixtures/stubbed_logstash_index_pattern';
import { Vis } from 'ui/vis';
import { ImageComparator } from 'test_utils/image_comparator';
import dummyESResponse from './dummy_es_response.json';
import initial from './initial.png';
Expand All @@ -34,6 +33,7 @@ import EMS_STYLE_ROAD_MAP_BRIGHT from '../../../../ui/public/vis/__tests__/map/e
import EMS_STYLE_ROAD_MAP_DESATURATED from '../../../../ui/public/vis/__tests__/map/ems_mocks/sample_style_desaturated';
import EMS_STYLE_DARK_MAP from '../../../../ui/public/vis/__tests__/map/ems_mocks/sample_style_dark';
import { setup as visualizationsSetup } from '../../../visualizations/public/np_ready/public/legacy';
import { Vis } from '../../../visualizations/public/np_ready/public/vis';

import { createTileMapVisualization } from '../tile_map_visualization';
import { createTileMapTypeDefinition } from '../tile_map_type';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import React, { useEffect } from 'react';
import { EuiPanel, EuiSpacer } from '@elastic/eui';
import { i18n } from '@kbn/i18n';

import { VisOptionsProps } from 'ui/vis/editors/default';
import { VisOptionsProps } from 'src/legacy/core_plugins/vis_default_editor/public';
import {
BasicOptions,
RangeOption,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';

import { TmsLayer } from 'ui/vis/map/service_settings';
import { Vis } from 'ui/vis';
import { Vis } from '../../../visualizations/public';
import { RegionMapVisParams } from '../../../region_map/public/types';
import { SelectOption, SwitchOption } from '../../../vis_type_vislib/public';
import { WmsInternalOptions } from './wms_internal_options';
Expand Down
4 changes: 2 additions & 2 deletions src/legacy/core_plugins/tile_map/public/tile_map_type.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
import React from 'react';
import { i18n } from '@kbn/i18n';

import { Schemas } from 'ui/vis/editors/default/schemas';
import { convertToGeoJson } from 'ui/vis/map/convert_to_geojson';
import { Schemas } from 'ui/agg_types';

import { createTileMapVisualization } from './tile_map_visualization';
import { Status } from '../../visualizations/public';
import { createTileMapVisualization } from './tile_map_visualization';
import { TileMapOptions } from './components/tile_map_options';
import { MapTypes } from './map_types';
import { supportsCssFilters } from './css_filters';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,26 @@
* under the License.
*/

import { BaseVisType } from '../../../../core_plugins/visualizations/public/np_ready/public/types/base_vis_type';
import { ReactVisType } from '../../../../core_plugins/visualizations/public/np_ready/public/types/react_vis_type';
import { resolve } from 'path';
import { Legacy } from 'kibana';

export { BaseVisType, ReactVisType };
import { LegacyPluginApi, LegacyPluginInitializer } from '../../../../src/legacy/types';

const vidDefaultEditorPluginInitializer: LegacyPluginInitializer = ({ Plugin }: LegacyPluginApi) =>
new Plugin({
id: 'vis_default_editor',
require: [],
publicDir: resolve(__dirname, 'public'),
uiExports: {
styleSheetPaths: resolve(__dirname, 'public/index.scss'),
},
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 vidDefaultEditorPluginInitializer;
4 changes: 4 additions & 0 deletions src/legacy/core_plugins/vis_default_editor/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "vis_default_editor",
"version": "kibana"
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,6 @@
+ .visEditorSidebar__section {
margin-top: $euiSizeS;
}

label:not([class^='eui']) {
@include __legacyLabelStyles__bad;
display: block;
}

.form-group label {
margin-bottom: $euiSizeS;
}
}

// Collapsible section
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,18 @@

import React from 'react';
import { mount, shallow } from 'enzyme';
import { VisState } from '../../..';
import { AggGroupNames } from '../agg_groups';
import { DefaultEditorAgg, DefaultEditorAggProps } from './agg';
import { act } from 'react-dom/test-utils';

import { IndexPattern } from 'src/plugins/data/public';
import { VisState } from 'src/legacy/core_plugins/visualizations/public';

import { AggType, AggGroupNames } from '../legacy_imports';
import { DefaultEditorAgg, DefaultEditorAggProps } from './agg';
import { DefaultEditorAggParams } from './agg_params';
import { AggType } from 'ui/agg_types';
import { IndexPattern } from '../../../../../../../plugins/data/public';
import { AGGS_ACTION_KEYS } from './agg_group_state';

jest.mock('ui/new_platform');

jest.mock('./agg_params', () => ({
DefaultEditorAggParams: () => null,
}));
Expand Down Expand Up @@ -173,11 +176,11 @@ describe('DefaultEditorAgg component', () => {

it('should add schema component', () => {
defaultProps.agg.schema = {
editorComponent: () => <div className="schemaComponent" />,
name: 'split',
} as any;
const comp = mount(<DefaultEditorAgg {...defaultProps} />);

expect(comp.find('.schemaComponent').exists()).toBeTruthy();
expect(comp.find('RowsOrColumnsControl').exists()).toBeTruthy();
});

describe('agg actions', () => {
Expand Down
Loading

0 comments on commit 7732829

Please sign in to comment.