Skip to content

Commit

Permalink
[NP] Move visTypeVislib into NP (#63963) (#64642)
Browse files Browse the repository at this point in the history
  • Loading branch information
flash1293 authored Apr 28, 2020
1 parent 319af47 commit 298edf9
Show file tree
Hide file tree
Showing 310 changed files with 16,519 additions and 18,516 deletions.
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ bower_components
/html_docs
/src/plugins/data/common/es_query/kuery/ast/_generated_/**
/src/plugins/vis_type_timelion/public/_generated_/**
src/legacy/core_plugins/vis_type_vislib/public/vislib/__tests__/lib/fixtures/mock_data
/src/legacy/ui/public/flot-charts
/test/fixtures/scenarios
/src/legacy/core_plugins/console/public/webpackShims
Expand Down
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ module.exports = {
'examples/**/*',
'!(src|x-pack)/**/*.test.*',
'!(x-pack/)?test/**/*',
// next folder contains legacy browser tests which can't be migrated to jest
// which import np files
'!src/legacy/core_plugins/kibana/public/__tests__/**/*',
],
from: [
'(src|x-pack)/plugins/**/(public|server)/**/*',
Expand Down
6 changes: 3 additions & 3 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@
"visTypeMetric": "src/plugins/vis_type_metric",
"visTypeTable": "src/plugins/vis_type_table",
"visTypeTagCloud": "src/plugins/vis_type_tagcloud",
"visTypeTimeseries": ["src/legacy/core_plugins/vis_type_timeseries", "src/plugins/vis_type_timeseries"],
"visTypeTimeseries": "src/plugins/vis_type_timeseries",
"visTypeVega": "src/plugins/vis_type_vega",
"visTypeVislib": "src/legacy/core_plugins/vis_type_vislib",
"visTypeXy": "src/legacy/core_plugins/vis_type_xy",
"visTypeVislib": "src/plugins/vis_type_vislib",
"visTypeXy": "src/plugins/vis_type_xy",
"visualizations": "src/plugins/visualizations",
"visualize": "src/plugins/visualize"
},
Expand Down
4 changes: 2 additions & 2 deletions .sass-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ files:
include:
- 'src/legacy/core_plugins/metrics/**/*.s+(a|c)ss'
- 'src/legacy/core_plugins/timelion/**/*.s+(a|c)ss'
- 'src/legacy/core_plugins/vis_type_vislib/**/*.s+(a|c)ss'
- 'src/legacy/core_plugins/vis_type_xy/**/*.s+(a|c)ss'
- 'src/plugins/vis_type_vislib/**/*.s+(a|c)ss'
- 'src/plugins/vis_type_xy/**/*.s+(a|c)ss'
- 'x-pack/legacy/plugins/security/**/*.s+(a|c)ss'
- 'x-pack/legacy/plugins/canvas/**/*.s+(a|c)ss'
- 'x-pack/plugins/triggers_actions_ui/**/*.s+(a|c)ss'
Expand Down
1 change: 0 additions & 1 deletion src/dev/precommit_hook/casing_check_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ export const TEMPORARILY_IGNORED_PATHS = [
'src/legacy/core_plugins/tile_map/public/__tests__/shadedCircleMarkers.png',
'src/legacy/core_plugins/tile_map/public/__tests__/shadedGeohashGrid.png',
'src/fixtures/config_upgrade_from_4.0.0_to_4.0.1-snapshot.json',
'src/legacy/core_plugins/vis_type_vislib/public/vislib/__tests__/lib/fixtures/mock_data/terms/_seriesMultiple.js',
'src/core/server/core_app/assets/favicons/android-chrome-192x192.png',
'src/core/server/core_app/assets/favicons/android-chrome-256x256.png',
'src/core/server/core_app/assets/favicons/android-chrome-512x512.png',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,10 @@
import _ from 'lodash';
import $ from 'jquery';

import { Vis } from '../../../vis';
import { Vis } from '../../../../../../plugins/vis_type_vislib/public/vislib/vis';

// TODO: Remove when converted to jest mocks
import {
ColorsService,
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
} from '../../../../../../../../plugins/charts/public/services';
import { ColorsService } from '../../../../../../plugins/charts/public/services';

const $visCanvas = $('<div>')
.attr('id', 'vislib-vis-fixtures')
Expand Down Expand Up @@ -72,17 +69,6 @@ const getDeps = () => {
};
};

export const getMockUiState = () => {
const map = new Map();

return (() => ({
get: (...args) => map.get(...args),
set: (...args) => map.set(...args),
setSilent: (...args) => map.set(...args),
on: () => undefined,
}))();
};

export function getVis(visLibParams, element) {
return new Vis(
element || $visCanvas.new(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import d3 from 'd3';
import _ from 'lodash';
import expect from '@kbn/expect';

import { ChartTitle } from '../../lib/chart_title';
import { VisConfig } from '../../lib/vis_config';
import { getMockUiState } from './fixtures/_vis_fixture';
import { ChartTitle } from '../../../../../../../plugins/vis_type_vislib/public/vislib/lib/chart_title';
import { VisConfig } from '../../../../../../../plugins/vis_type_vislib/public/vislib/lib/vis_config';
import { getMockUiState } from '../../../../../../../plugins/vis_type_vislib/public/fixtures/mocks';

describe('Vislib ChartTitle Class Test Suite', function() {
let mockUiState;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ import d3 from 'd3';
import expect from '@kbn/expect';

// Data
import data from './fixtures/mock_data/date_histogram/_series';
import data from '../../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/date_histogram/_series';

import { getVis, getMockUiState } from './fixtures/_vis_fixture';
import { getMockUiState } from '../../../../../../../plugins/vis_type_vislib/public/fixtures/mocks';
import { getVis } from '../_vis_fixture';

describe('Vislib Dispatch Class Test Suite', function() {
function destroyVis(vis) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ import expect from '@kbn/expect';
import $ from 'jquery';

// Data
import series from '../fixtures/mock_data/date_histogram/_series';
import columns from '../fixtures/mock_data/date_histogram/_columns';
import rows from '../fixtures/mock_data/date_histogram/_rows';
import stackedSeries from '../fixtures/mock_data/date_histogram/_stacked_series';

import { getVis, getMockUiState } from '../fixtures/_vis_fixture';
import series from '../../../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/date_histogram/_series';
import columns from '../../../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/date_histogram/_columns';
import rows from '../../../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/date_histogram/_rows';
import stackedSeries from '../../../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/date_histogram/_stacked_series';
import { getMockUiState } from '../../../../../../../../plugins/vis_type_vislib/public/fixtures/mocks';
import { getVis } from '../../_vis_fixture';

const dateHistogramArray = [series, columns, rows, stackedSeries];
const names = ['series', 'columns', 'rows', 'stackedSeries'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ import expect from '@kbn/expect';
import $ from 'jquery';

// Data
import series from '../fixtures/mock_data/date_histogram/_series';
import columns from '../fixtures/mock_data/date_histogram/_columns';
import rows from '../fixtures/mock_data/date_histogram/_rows';
import stackedSeries from '../fixtures/mock_data/date_histogram/_stacked_series';

import { Layout } from '../../../lib/layout/layout';
import { getVis, getMockUiState } from '../fixtures/_vis_fixture';
import { VisConfig } from '../../../lib/vis_config';
import series from '../../../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/date_histogram/_series';
import columns from '../../../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/date_histogram/_columns';
import rows from '../../../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/date_histogram/_rows';
import stackedSeries from '../../../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/date_histogram/_stacked_series';
import { getMockUiState } from '../../../../../../../../plugins/vis_type_vislib/public/fixtures/mocks';
import { Layout } from '../../../../../../../../plugins/vis_type_vislib/public/vislib/lib/layout/layout';
import { VisConfig } from '../../../../../../../../plugins/vis_type_vislib/public/vislib/lib/vis_config';
import { getVis } from '../../_vis_fixture';

const dateHistogramArray = [series, columns, rows, stackedSeries];
const names = ['series', 'columns', 'rows', 'stackedSeries'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ import _ from 'lodash';
import $ from 'jquery';
import expect from '@kbn/expect';

import series from './lib/fixtures/mock_data/date_histogram/_series';
import columns from './lib/fixtures/mock_data/date_histogram/_columns';
import rows from './lib/fixtures/mock_data/date_histogram/_rows';
import stackedSeries from './lib/fixtures/mock_data/date_histogram/_stacked_series';
import { getVis, getMockUiState } from './lib/fixtures/_vis_fixture';
import series from '../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/date_histogram/_series';
import columns from '../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/date_histogram/_columns';
import rows from '../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/date_histogram/_rows';
import stackedSeries from '../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/date_histogram/_stacked_series';
import { getMockUiState } from '../../../../../../plugins/vis_type_vislib/public/fixtures/mocks';
import { getVis } from './_vis_fixture';

const dataArray = [series, columns, rows, stackedSeries];
const names = ['series', 'columns', 'rows', 'stackedSeries'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,16 @@ import _ from 'lodash';
import $ from 'jquery';
import expect from '@kbn/expect';

import { getVis, getMockUiState } from '../lib/fixtures/_vis_fixture';
import { getMockUiState } from '../../../../../../../plugins/vis_type_vislib/public/fixtures/mocks';
import { getVis } from '../_vis_fixture';

const dataTypesArray = {
'series pos': require('../lib/fixtures/mock_data/date_histogram/_series'),
'series pos neg': require('../lib/fixtures/mock_data/date_histogram/_series_pos_neg'),
'series neg': require('../lib/fixtures/mock_data/date_histogram/_series_neg'),
'term columns': require('../lib/fixtures/mock_data/terms/_columns'),
'range rows': require('../lib/fixtures/mock_data/range/_rows'),
stackedSeries: require('../lib/fixtures/mock_data/date_histogram/_stacked_series'),
'series pos': require('../../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/date_histogram/_series'),
'series pos neg': require('../../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/date_histogram/_series_pos_neg'),
'series neg': require('../../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/date_histogram/_series_neg'),
'term columns': require('../../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/terms/_columns'),
'range rows': require('../../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/range/_rows'),
stackedSeries: require('../../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/date_histogram/_stacked_series'),
};

const visLibParams = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
import d3 from 'd3';
import expect from '@kbn/expect';

import { Chart } from '../../visualizations/_chart';
import { getVis, getMockUiState } from '../lib/fixtures/_vis_fixture';
import { Chart } from '../../../../../../../plugins/vis_type_vislib/public/vislib/visualizations/_chart';
import { getMockUiState } from '../../../../../../../plugins/vis_type_vislib/public/fixtures/mocks';
import { getVis } from '../_vis_fixture';

describe('Vislib _chart Test Suite', function() {
let vis;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,18 @@ import $ from 'jquery';
import expect from '@kbn/expect';

// Data
import series from '../lib/fixtures/mock_data/date_histogram/_series';
import seriesPosNeg from '../lib/fixtures/mock_data/date_histogram/_series_pos_neg';
import seriesNeg from '../lib/fixtures/mock_data/date_histogram/_series_neg';
import termsColumns from '../lib/fixtures/mock_data/terms/_columns';
import histogramRows from '../lib/fixtures/mock_data/histogram/_rows';
import stackedSeries from '../lib/fixtures/mock_data/date_histogram/_stacked_series';

import { seriesMonthlyInterval } from '../lib/fixtures/mock_data/date_histogram/_series_monthly_interval';
import { rowsSeriesWithHoles } from '../lib/fixtures/mock_data/date_histogram/_rows_series_with_holes';
import rowsWithZeros from '../lib/fixtures/mock_data/date_histogram/_rows';
import { getVis, getMockUiState } from '../lib/fixtures/_vis_fixture';
import series from '../../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/date_histogram/_series';
import seriesPosNeg from '../../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/date_histogram/_series_pos_neg';
import seriesNeg from '../../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/date_histogram/_series_neg';
import termsColumns from '../../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/terms/_columns';
import histogramRows from '../../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/histogram/_rows';
import stackedSeries from '../../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/date_histogram/_stacked_series';

import { seriesMonthlyInterval } from '../../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/date_histogram/_series_monthly_interval';
import { rowsSeriesWithHoles } from '../../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/date_histogram/_rows_series_with_holes';
import rowsWithZeros from '../../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/date_histogram/_rows';
import { getMockUiState } from '../../../../../../../plugins/vis_type_vislib/public/fixtures/mocks';
import { getVis } from '../_vis_fixture';

// tuple, with the format [description, mode, data]
const dataTypesArray = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ import $ from 'jquery';
import _ from 'lodash';
import expect from '@kbn/expect';

import data from '../lib/fixtures/mock_data/terms/_seriesMultiple';
import { getVis, getMockUiState } from '../lib/fixtures/_vis_fixture';
import data from '../../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/terms/_series_multiple';
import { getMockUiState } from '../../../../../../../plugins/vis_type_vislib/public/fixtures/mocks';
import { getVis } from '../_vis_fixture';

describe('Vislib Gauge Chart Test Suite', function() {
let vis;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ import d3 from 'd3';
import expect from '@kbn/expect';

// Data
import series from '../lib/fixtures/mock_data/date_histogram/_series';
import seriesPosNeg from '../lib/fixtures/mock_data/date_histogram/_series_pos_neg';
import seriesNeg from '../lib/fixtures/mock_data/date_histogram/_series_neg';
import termsColumns from '../lib/fixtures/mock_data/terms/_columns';
import stackedSeries from '../lib/fixtures/mock_data/date_histogram/_stacked_series';

import { getVis, getMockUiState } from '../lib/fixtures/_vis_fixture';
import series from '../../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/date_histogram/_series';
import seriesPosNeg from '../../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/date_histogram/_series_pos_neg';
import seriesNeg from '../../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/date_histogram/_series_neg';
import termsColumns from '../../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/terms/_columns';
import stackedSeries from '../../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/date_histogram/_stacked_series';
import { getMockUiState } from '../../../../../../../plugins/vis_type_vislib/public/fixtures/mocks';
import { getVis } from '../_vis_fixture';

// tuple, with the format [description, mode, data]
const dataTypesArray = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ import $ from 'jquery';
import _ from 'lodash';

// Data
import seriesPos from '../lib/fixtures/mock_data/date_histogram/_series';
import seriesPosNeg from '../lib/fixtures/mock_data/date_histogram/_series_pos_neg';
import seriesNeg from '../lib/fixtures/mock_data/date_histogram/_series_neg';
import histogramColumns from '../lib/fixtures/mock_data/histogram/_columns';
import rangeRows from '../lib/fixtures/mock_data/range/_rows';
import termSeries from '../lib/fixtures/mock_data/terms/_series';

import { getVis, getMockUiState } from '../lib/fixtures/_vis_fixture';
import seriesPos from '../../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/date_histogram/_series';
import seriesPosNeg from '../../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/date_histogram/_series_pos_neg';
import seriesNeg from '../../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/date_histogram/_series_neg';
import histogramColumns from '../../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/histogram/_columns';
import rangeRows from '../../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/range/_rows';
import termSeries from '../../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/terms/_series';
import { getMockUiState } from '../../../../../../../plugins/vis_type_vislib/public/fixtures/mocks';
import { getVis } from '../_vis_fixture';

const dataTypes = [
['series pos', seriesPos],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import _ from 'lodash';
import $ from 'jquery';
import expect from '@kbn/expect';

import { getVis, getMockUiState } from '../lib/fixtures/_vis_fixture';
import { getMockUiState } from '../../../../../../../plugins/vis_type_vislib/public/fixtures/mocks';
import { getVis } from '../_vis_fixture';
import { pieChartMockData } from './pie_chart_mock_data';

const names = ['rows', 'columns', 'slices'];
Expand Down
7 changes: 0 additions & 7 deletions src/legacy/core_plugins/kibana/public/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,9 @@
// Public UI styles
@import 'src/legacy/ui/public/index';

// vis_type_vislib UI styles
@import 'src/legacy/core_plugins/vis_type_vislib/public/index';

// Discover styles
@import 'discover/index';

// Visualization styles are imported here for running karma Browser tests
// should be somehow included through the "visualizations" plugin initialization
@import '../../../../plugins/visualizations/public/index';

// Has to come after visualize because of some
// bad cascading in the Editor layout
@import '../../../../plugins/maps_legacy/public/index';
Expand Down
2 changes: 2 additions & 0 deletions src/legacy/core_plugins/tests_bundle/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

import { createReadStream } from 'fs';
import { resolve } from 'path';

import globby from 'globby';
import MultiStream from 'multistream';
Expand All @@ -40,6 +41,7 @@ export default kibana => {
},

uiExports: {
styleSheetPaths: resolve(__dirname, 'public/index.scss'),
async __bundleProvider__(kbnServer) {
const modules = new Set();

Expand Down
6 changes: 6 additions & 0 deletions src/legacy/core_plugins/tests_bundle/public/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@import 'src/legacy/ui/public/styles/styling_constants';

// This file pulls some styles of NP plugins into the legacy test stylesheet
// so they are available for karma browser tests.
@import '../../../../plugins/vis_type_vislib/public/index';
@import '../../../../plugins/visualizations/public/index';
44 changes: 0 additions & 44 deletions src/legacy/core_plugins/vis_type_vislib/index.ts

This file was deleted.

4 changes: 0 additions & 4 deletions src/legacy/core_plugins/vis_type_vislib/package.json

This file was deleted.

Loading

0 comments on commit 298edf9

Please sign in to comment.