Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate vis_type_metric to kibana/new platform #63096

Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"uiActions": "src/plugins/ui_actions",
"visDefaultEditor": "src/plugins/vis_default_editor",
"visTypeMarkdown": "src/legacy/core_plugins/vis_type_markdown",
"visTypeMetric": "src/legacy/core_plugins/vis_type_metric",
"visTypeMetric": "src/plugins/vis_type_metric",
"visTypeTable": "src/legacy/core_plugins/vis_type_table",
"visTypeTagCloud": "src/legacy/core_plugins/vis_type_tagcloud",
"visTypeTimeseries": ["src/legacy/core_plugins/vis_type_timeseries", "src/plugins/vis_type_timeseries"],
Expand Down
44 changes: 0 additions & 44 deletions src/legacy/core_plugins/vis_type_metric/index.ts

This file was deleted.

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

This file was deleted.

34 changes: 0 additions & 34 deletions src/legacy/core_plugins/vis_type_metric/public/legacy.ts

This file was deleted.

8 changes: 8 additions & 0 deletions src/plugins/vis_type_metric/kibana.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "visTypeMetrics",
kertal marked this conversation as resolved.
Show resolved Hide resolved
"version": "8.0.0",
"kibanaVersion": "kibana",
"server": false,
"ui": true,
"requiredPlugins": ["data", "visualizations", "charts","expressions"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import React from 'react';
import { shallow } from 'enzyme';

import { MetricVisComponent, MetricVisComponentProps } from './metric_vis_component';
import { ExprVis } from '../../../../../plugins/visualizations/public';
import { ExprVis } from '../../../visualizations/public';

jest.mock('../services', () => ({
getFormatService: () => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ import React, { Component } from 'react';
import { isColorDark } from '@elastic/eui';
import { MetricVisValue } from './metric_vis_value';
import { Input } from '../metric_vis_fn';
import { FieldFormatsContentType, IFieldFormat } from '../../../../../plugins/data/public';
import { KibanaDatatable } from '../../../../../plugins/expressions/public';
import { getHeatmapColors } from '../../../../../plugins/charts/public';
import { FieldFormatsContentType, IFieldFormat } from '../../../data/public';
import { KibanaDatatable } from '../../../expressions/public';
import { getHeatmapColors } from '../../../charts/public';
import { VisParams, MetricVisMetric } from '../types';
import { getFormatService } from '../services';
import { SchemaConfig, ExprVis } from '../../../../../plugins/visualizations/public';
import { SchemaConfig, ExprVis } from '../../../visualizations/public';

export interface MetricVisComponentProps {
visParams: VisParams;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ import {
SwitchOption,
RangeOption,
SetColorSchemaOptionsValue,
} from '../../../vis_type_vislib/public';
} from '../../../../legacy/core_plugins/vis_type_vislib/public';
import { MetricVisParam, VisParams } from '../types';
import { SetColorRangeValue } from '../../../vis_type_vislib/public/components/common/color_ranges';
import { SetColorRangeValue } from '../../../../legacy/core_plugins/vis_type_vislib/public/components/common/color_ranges';

function MetricVisOptions({
stateParams,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
// mtrChart__legend--small
// mtrChart__legend-isLoading

@import './metric_vis';
kertal marked this conversation as resolved.
Show resolved Hide resolved
@import 'metric_vis';
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
* specific language governing permissions and limitations
* under the License.
*/

import { PluginInitializerContext } from '../../../../core/public';
import './index.scss';
import { PluginInitializerContext } from 'kibana/public';
import { MetricVisPlugin as Plugin } from './plugin';

export function plugin(initializerContext: PluginInitializerContext) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@
*/

import { createMetricVisFn } from './metric_vis_fn';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { functionWrapper } from '../../../../plugins/expressions/common/expression_functions/specs/tests/utils';

jest.mock('ui/new_platform');
import { functionWrapper } from '../../expressions/common/expression_functions/specs/tests/utils';

describe('interpreter/functions#metric', () => {
const fn = functionWrapper(createMetricVisFn());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ import {
Range,
Render,
Style,
} from '../../../../plugins/expressions/public';
import { ColorModes } from '../../vis_type_vislib/public';
} from '../../expressions/public';
import { ColorModes } from '../../../legacy/core_plugins/vis_type_vislib/public';
import { visType, DimensionsVisParam, VisParams } from './types';
import { ColorSchemas, vislibColorMaps } from '../../../../plugins/charts/public';
import { ColorSchemas, vislibColorMaps } from '../../charts/public';

export type Input = KibanaDatatable;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
import { createMetricVisTypeDefinition } from './metric_vis_type';
import { MetricVisComponent } from './components/metric_vis_component';

jest.mock('ui/new_platform');

describe('metric_vis - createMetricVisTypeDefinition', () => {
it('has metric vis component set', () => {
const def = createMetricVisTypeDefinition();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import { i18n } from '@kbn/i18n';

import { MetricVisComponent } from './components/metric_vis_component';
import { MetricVisOptions } from './components/metric_vis_options';
import { ColorModes } from '../../vis_type_vislib/public';
import { ColorSchemas, colorSchemas } from '../../../../plugins/charts/public';
import { AggGroupNames } from '../../../../plugins/data/public';
import { Schemas } from '../../../../plugins/vis_default_editor/public';
import { ColorModes } from '../../../legacy/core_plugins/vis_type_vislib/public';
import { ColorSchemas, colorSchemas } from '../../charts/public';
import { AggGroupNames } from '../../data/public';
import { Schemas } from '../../vis_default_editor/public';

export const createMetricVisTypeDefinition = () => ({
name: 'metric',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
* under the License.
*/

import { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from '../../../../core/public';
import { Plugin as ExpressionsPublicPlugin } from '../../../../plugins/expressions/public';
import { VisualizationsSetup } from '../../../../plugins/visualizations/public';
import { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from 'kibana/public';
import { Plugin as ExpressionsPublicPlugin } from '../../expressions/public';
import { VisualizationsSetup } from '../../visualizations/public';

import { createMetricVisFn } from './metric_vis_fn';
import { createMetricVisTypeDefinition } from './metric_vis_type';
import { ChartsPluginSetup } from '../../../../plugins/charts/public';
import { DataPublicPluginStart } from '../../../../plugins/data/public';
import { ChartsPluginSetup } from '../../charts/public';
import { DataPublicPluginStart } from '../../data/public';
import { setFormatService } from './services';

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

import { createGetterSetter } from '../../../../plugins/kibana_utils/public';
import { DataPublicPluginStart } from '../../../../plugins/data/public';
import { createGetterSetter } from '../../kibana_utils/common';
import { DataPublicPluginStart } from '../../data/public';

export const [getFormatService, setFormatService] = createGetterSetter<
DataPublicPluginStart['fieldFormats']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
* under the License.
*/

import { Range } from '../../../../plugins/expressions/public';
import { SchemaConfig } from '../../../../plugins/visualizations/public';
import { ColorModes, Labels, Style } from '../../vis_type_vislib/public';
import { ColorSchemas } from '../../../../plugins/charts/public';
import { Range } from '../../expressions/public';
import { SchemaConfig } from '../../visualizations/public';
import { ColorModes, Labels, Style } from '../../../legacy/core_plugins/vis_type_vislib/public';
import { ColorSchemas } from '../../charts/public';

export const visType = 'metric';

Expand Down