chore(NA): removes server imports from canvas src plugin (#62783)

* chore(NA): remove server imports from canvas src plugin

* chore(NA): correctly import types for demodata
This commit is contained in:
Tiago Costa 2020-04-08 00:44:38 +01:00 committed by GitHub
parent eacdbcd4f5
commit 7e3c68bb7a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 7 deletions

View file

@ -0,0 +1,10 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
export enum DemoRows {
CI = 'ci',
SHIRTS = 'shirts',
}

View file

@ -6,14 +6,10 @@
import { cloneDeep } from 'lodash';
import ci from './ci.json';
import { DemoRows } from './demo_rows_types';
import shirts from './shirts.json';
import { getFunctionErrors } from '../../../../i18n';
export enum DemoRows {
CI = 'ci',
SHIRTS = 'shirts',
}
export function getDemoRows(arg: string | null) {
if (arg === DemoRows.CI) {
return cloneDeep(ci);

View file

@ -8,7 +8,8 @@ import { sortBy } from 'lodash';
import { ExpressionFunctionDefinition } from 'src/plugins/expressions';
// @ts-ignore unconverted lib file
import { queryDatatable } from '../../../../common/lib/datatable/query';
import { DemoRows, getDemoRows } from './get_demo_rows';
import { DemoRows } from './demo_rows_types';
import { getDemoRows } from './get_demo_rows';
import { Filter, Datatable, DatatableColumn, DatatableRow } from '../../../../types';
import { getFunctionHelp } from '../../../../i18n';

View file

@ -8,7 +8,7 @@ import { i18n } from '@kbn/i18n';
import { demodata } from '../../../canvas_plugin_src/functions/server/demodata';
import { FunctionHelp } from '../function_help';
import { FunctionFactory } from '../../../types';
import { DemoRows } from '../../../canvas_plugin_src/functions/server/demodata/get_demo_rows';
import { DemoRows } from '../../../canvas_plugin_src/functions/server/demodata/demo_rows_types';
export const help: FunctionHelp<FunctionFactory<typeof demodata>> = {
help: i18n.translate('xpack.canvas.functions.demodataHelpText', {