Skip to content

Commit

Permalink
Timelion api migration (#53005)
Browse files Browse the repository at this point in the history
  • Loading branch information
flash1293 authored Jan 23, 2020
1 parent a4cf4f4 commit 38fd963
Show file tree
Hide file tree
Showing 157 changed files with 517 additions and 573 deletions.
2 changes: 1 addition & 1 deletion .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"statusPage": "src/legacy/core_plugins/status_page",
"telemetry": "src/legacy/core_plugins/telemetry",
"tileMap": "src/legacy/core_plugins/tile_map",
"timelion": ["src/legacy/core_plugins/timelion", "src/legacy/core_plugins/vis_type_timelion"],
"timelion": ["src/legacy/core_plugins/timelion", "src/legacy/core_plugins/vis_type_timelion", "src/plugins/timelion"],
"uiActions": "src/plugins/ui_actions",
"visTypeMarkdown": "src/legacy/core_plugins/vis_type_markdown",
"visTypeMetric": "src/legacy/core_plugins/vis_type_metric",
Expand Down
9 changes: 0 additions & 9 deletions src/legacy/core_plugins/timelion/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ import { resolve } from 'path';
import { i18n } from '@kbn/i18n';
import { Legacy } from 'kibana';
import { LegacyPluginApi, LegacyPluginInitializer } from 'src/legacy/plugin_discovery/types';
import { CoreSetup, PluginInitializerContext } from 'src/core/server';
import { DEFAULT_APP_CATEGORIES } from '../../../core/utils';
import { plugin } from './server';
import { CustomCoreSetup } from './server/plugin';

const experimentalLabel = i18n.translate('timelion.uiSettings.experimentalLabel', {
defaultMessage: 'experimental',
Expand Down Expand Up @@ -195,12 +192,6 @@ const timelionPluginInitializer: LegacyPluginInitializer = ({ Plugin }: LegacyPl
},
},
},
init: (server: Legacy.Server) => {
const initializerContext = {} as PluginInitializerContext;
const core = { http: { server } } as CoreSetup & CustomCoreSetup;

plugin(initializerContext).setup(core);
},
});

// eslint-disable-next-line import/no-default-export
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import _ from 'lodash';
import $ from 'jquery';
import PEG from 'pegjs';
import grammar from 'raw-loader!../../../vis_type_timelion/public/chain.peg';
import grammar from 'raw-loader!../../../../../plugins/timelion/common/chain.peg';
import timelionExpressionInputTemplate from './timelion_expression_input.html';
import {
SUGGESTION_TYPE,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ import moment from 'moment-timezone';
import { timefilter } from 'ui/timefilter';
// @ts-ignore
import observeResize from '../../lib/observe_resize';
import { calculateInterval, DEFAULT_TIME_FORMAT } from '../../../../vis_type_timelion/common/lib';
import {
calculateInterval,
DEFAULT_TIME_FORMAT,
// @ts-ignore
} from '../../../../../../plugins/timelion/common/lib';
import { tickFormatters } from '../../../../vis_type_timelion/public/helpers/tick_formatters';
import { TimelionVisualizationDependencies } from '../../plugin';
import { xaxisFormatterProvider } from '../../../../vis_type_timelion/public/helpers/xaxis_formatter';
Expand Down
62 changes: 0 additions & 62 deletions src/legacy/core_plugins/timelion/server/plugin.ts

This file was deleted.

32 changes: 0 additions & 32 deletions src/legacy/core_plugins/timelion/server/routes/index.ts

This file was deleted.

125 changes: 0 additions & 125 deletions src/legacy/core_plugins/timelion/server/routes/run.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { debounce, compact, get, each, cloneDeep, last, map } from 'lodash';

import { useKibana } from '../../../../../plugins/kibana_react/public';
import '../flot';
import { DEFAULT_TIME_FORMAT } from '../../common/lib';
import { DEFAULT_TIME_FORMAT } from '../../../../../plugins/timelion/common/lib';

import {
buildSeriesData,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ import * as monacoEditor from 'monaco-editor/esm/vs/editor/editor.api';

import { CodeEditor, useKibana } from '../../../../../plugins/kibana_react/public';
import { suggest, getSuggestion } from './timelion_expression_input_helpers';
import { ITimelionFunction, TimelionFunctionArgs } from '../../common/types';
import { getArgValueSuggestions } from '../helpers/arg_value_suggestions';
import {
ITimelionFunction,
TimelionFunctionArgs,
} from '../../../../../plugins/timelion/common/types';

const LANGUAGE_ID = 'timelion_expression';
monacoEditor.languages.register({ id: LANGUAGE_ID });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { getArgValueSuggestions } from '../helpers/arg_value_suggestions';
import { setIndexPatterns, setSavedObjectsClient } from '../helpers/plugin_services';
import { IndexPatterns } from 'src/plugins/data/public';
import { SavedObjectsClient } from 'kibana/public';
import { ITimelionFunction } from '../../common/types';
import { ITimelionFunction } from '../../../../../plugins/timelion/common/types';

describe('Timelion expression suggestions', () => {
setIndexPatterns({} as IndexPatterns);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,19 @@
*/

import { get, startsWith } from 'lodash';
import { i18n } from '@kbn/i18n';
import * as monacoEditor from 'monaco-editor/esm/vs/editor/editor.api';

import { i18n } from '@kbn/i18n';
import { Parser } from 'pegjs';

// @ts-ignore
import { parse } from '../_generated_/chain';

import { ITimelionFunction, TimelionFunctionArgs } from '../../common/types';
import { ArgValueSuggestions, FunctionArg, Location } from '../helpers/arg_value_suggestions';
import {
ITimelionFunction,
TimelionFunctionArgs,
} from '../../../../../plugins/timelion/common/types';

export enum SUGGESTION_TYPE {
ARGUMENTS = 'arguments',
Expand Down
Loading

0 comments on commit 38fd963

Please sign in to comment.