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 timelion vis #62819

Merged
merged 24 commits into from
Apr 17, 2020
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
dd7fb2a
Move the default_editor to NP
sulemanof Apr 2, 2020
9bbe16d
Fix paths
sulemanof Apr 3, 2020
ed59024
Merge remote-tracking branch 'upstream/master' into np/vis_default_ed…
sulemanof Apr 3, 2020
51e775f
Import styles through the visualize
sulemanof Apr 3, 2020
5f10f36
Other fixes
sulemanof Apr 3, 2020
de82d3a
Merge remote-tracking branch 'upstream/master' into np/vis_default_ed…
sulemanof Apr 6, 2020
bca5eab
Fix ip_ranges exhaustive-deps array
sulemanof Apr 6, 2020
ccdf5a7
Fix filters and extend bounds
sulemanof Apr 6, 2020
90fe035
Other fixes
sulemanof Apr 6, 2020
e82b931
Merge remote-tracking branch 'upstream/master' into np/vis_default_ed…
sulemanof Apr 6, 2020
4de5a19
Fix date_ranges tests
sulemanof Apr 6, 2020
17612d2
Merge branch 'master' into np/vis_default_editor
elasticmachine Apr 7, 2020
02c42b5
move timelion vis to the new platform
flash1293 Apr 7, 2020
a93c32e
Merge remote-tracking branch 'upstream/master' into migrate-timelion-vis
flash1293 Apr 8, 2020
5e96a62
fix path
flash1293 Apr 8, 2020
4c9397e
revert merge mistakes and pass in all services
flash1293 Apr 8, 2020
d12fe0e
fix tsconfig files
flash1293 Apr 8, 2020
7bf065f
fix timelion test
flash1293 Apr 9, 2020
5f786b2
Merge remote-tracking branch 'upstream/master' into migrate-timelion-vis
flash1293 Apr 13, 2020
5ebd38f
Merge remote-tracking branch 'upstream/master' into migrate-timelion-vis
flash1293 Apr 15, 2020
9b0e441
remove unnecssary scss imports and adjust codeowner file
flash1293 Apr 15, 2020
64987ff
Merge remote-tracking branch 'upstream/master' into migrate-timelion-vis
flash1293 Apr 16, 2020
9750e36
fix timelion app i18n and simplify stylesheet
flash1293 Apr 16, 2020
53d4ba7
Merge remote-tracking branch 'upstream/master' into migrate-timelion-vis
flash1293 Apr 16, 2020
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
4 changes: 2 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ bower_components
/built_assets
/html_docs
/src/plugins/data/common/es_query/kuery/ast/_generated_/**
/src/legacy/core_plugins/vis_type_timelion/public/_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
/src/legacy/core_plugins/console/public/tests/webpackShims
/src/legacy/ui/public/utils/decode_geo_hash.js
/src/legacy/core_plugins/vis_type_timelion/public/webpackShims/jquery.flot.*
/src/plugins/vis_type_timelion/public/webpackShims/jquery.flot.*
/src/core/lib/kbn_internal_native_observable
/packages/*/target
/packages/eslint-config-kibana
Expand Down
2 changes: 1 addition & 1 deletion .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"src/plugins/telemetry_management_section"
],
"tileMap": "src/legacy/core_plugins/tile_map",
"timelion": ["src/legacy/core_plugins/timelion", "src/legacy/core_plugins/vis_type_timelion", "src/plugins/timelion"],
"timelion": ["src/legacy/core_plugins/timelion", "src/plugins/vis_type_timelion"],
"uiActions": "src/plugins/ui_actions",
"visDefaultEditor": "src/plugins/vis_default_editor",
"visTypeMarkdown": "src/legacy/core_plugins/vis_type_markdown",
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/core_plugins/timelion/public/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { fatalError, toastNotifications } from 'ui/notify';
import { timefilter } from 'ui/timefilter';
import { npStart } from 'ui/new_platform';
import { getSavedSheetBreadcrumbs, getCreateBreadcrumbs } from './breadcrumbs';
import { getTimezone } from '../../vis_type_timelion/public';
import { getTimezone } from '../../../../plugins/vis_type_timelion/public';

import 'uiExports/savedObjectTypes';

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!../../../../../plugins/timelion/common/chain.peg';
import grammar from 'raw-loader!../../../../../plugins/vis_type_timelion/common/chain.peg';
import timelionExpressionInputTemplate from './timelion_expression_input.html';
import {
SUGGESTION_TYPE,
Expand All @@ -52,7 +52,7 @@ import {
insertAtLocation,
} from './timelion_expression_input_helpers';
import { comboBoxKeyCodes } from '@elastic/eui';
import { getArgValueSuggestions } from '../../../vis_type_timelion/public/helpers/arg_value_suggestions';
import { npStart } from 'ui/new_platform';

const Parser = PEG.generate(grammar);

Expand All @@ -68,7 +68,7 @@ export function TimelionExpInput($http, $timeout) {
replace: true,
template: timelionExpressionInputTemplate,
link: function(scope, elem) {
const argValueSuggestions = getArgValueSuggestions();
const argValueSuggestions = npStart.plugins.visTypeTimelion.getArgValueSuggestions();
const expressionInput = elem.find('[data-expression-input]');
const functionReference = {};
let suggestibleFunctionLocation = {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
* under the License.
*/

import '../../../../vis_type_timelion/public/flot';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import '../../../../../../plugins/vis_type_timelion/public/flot';
import _ from 'lodash';
import $ from 'jquery';
import moment from 'moment-timezone';
Expand All @@ -28,11 +29,14 @@ import {
calculateInterval,
DEFAULT_TIME_FORMAT,
// @ts-ignore
} from '../../../../../../plugins/timelion/common/lib';
import { tickFormatters } from '../../../../vis_type_timelion/public/helpers/tick_formatters';
} from '../../../../../../plugins/vis_type_timelion/common/lib';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { tickFormatters } from '../../../../../../plugins/vis_type_timelion/public/helpers/tick_formatters';
import { TimelionVisualizationDependencies } from '../../plugin';
import { xaxisFormatterProvider } from '../../../../vis_type_timelion/public/helpers/xaxis_formatter';
import { generateTicksProvider } from '../../../../vis_type_timelion/public/helpers/tick_generator';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { xaxisFormatterProvider } from '../../../../../../plugins/vis_type_timelion/public/helpers/xaxis_formatter';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { generateTicksProvider } from '../../../../../../plugins/vis_type_timelion/public/helpers/tick_generator';

const DEBOUNCE_DELAY = 50;

Expand Down
44 changes: 0 additions & 44 deletions src/legacy/core_plugins/vis_type_timelion/index.ts

This file was deleted.

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

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions src/legacy/core_plugins/vis_type_timelion/public/index.scss

This file was deleted.

35 changes: 0 additions & 35 deletions src/legacy/core_plugins/vis_type_timelion/public/legacy.ts

This file was deleted.

21 changes: 0 additions & 21 deletions src/legacy/core_plugins/vis_type_timelion/public/legacy_imports.ts

This file was deleted.

2 changes: 2 additions & 0 deletions src/legacy/ui/public/new_platform/new_platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ import {
VisualizationsSetup,
VisualizationsStart,
} from '../../../../plugins/visualizations/public';
import { VisTypeTimelionPluginStart } from '../../../../plugins/vis_type_timelion/public';

export interface PluginsSetup {
bfetch: BfetchPublicSetup;
Expand Down Expand Up @@ -112,6 +113,7 @@ export interface PluginsStart {
telemetry?: TelemetryPluginStart;
dashboard: DashboardStart;
savedObjectsManagement: SavedObjectsManagementPluginStart;
visTypeTimelion: VisTypeTimelionPluginStart;
indexPatternManagement: IndexPatternManagementStart;
}

Expand Down
8 changes: 0 additions & 8 deletions src/plugins/timelion/kibana.json

This file was deleted.

30 changes: 0 additions & 30 deletions src/plugins/timelion/public/index.ts

This file was deleted.

File renamed without changes.
8 changes: 8 additions & 0 deletions src/plugins/vis_type_timelion/kibana.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "visTypeTimelion",
"version": "8.0.0",
"kibanaVersion": "kibana",
"server": true,
"ui": true,
"requiredPlugins": ["visualizations", "data", "expressions"]
}
2 changes: 2 additions & 0 deletions src/plugins/vis_type_timelion/public/components/_index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@import 'panel';
@import 'timelion_expression_input';
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import $ from 'jquery';
import moment from 'moment-timezone';
import { debounce, compact, get, each, cloneDeep, last, map } from 'lodash';

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

import {
buildSeriesData,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,10 @@ import { EuiFormLabel } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { monaco } from '@kbn/ui-shared-deps/monaco';

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

const LANGUAGE_ID = 'timelion_expression';
monaco.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 { IndexPatternsContract } from 'src/plugins/data/public';
import { SavedObjectsClient } from 'kibana/public';
import { ITimelionFunction } from '../../../../../plugins/timelion/common/types';
import { ITimelionFunction } from '../../common/types';

describe('Timelion expression suggestions', () => {
setIndexPatterns({} as IndexPatternsContract);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ import { Parser } from 'pegjs';
import { parse } from '../_generated_/chain';

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

export enum SUGGESTION_TYPE {
ARGUMENTS = 'arguments',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import React, { useMemo, useCallback } from 'react';
import { EuiFormRow, EuiComboBox, EuiComboBoxOptionOption } from '@elastic/eui';
import { i18n } from '@kbn/i18n';

import { search } from '../../../../../plugins/data/public';
import { search } from '../../../data/public';
const { isValidEsInterval } = search.aggs;
import { useValidation } from '../../../../../plugins/vis_default_editor/public';
import { useValidation } from '../../../vis_default_editor/public';

const intervalOptions = [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { IUiSettingsClient } from 'kibana/public';
import { ChartComponent } from './chart';
import { VisParams } from '../timelion_vis_fn';
import { TimelionSuccessResponse } from '../helpers/timelion_request_handler';
import { ExprVis } from '../../../../../plugins/visualizations/public';
import { ExprVis } from '../../../visualizations/public';

export interface TimelionVisComponentProp {
config: IUiSettingsClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
* under the License.
*/

require('jquery.flot');
require('jquery.flot.time');
require('jquery.flot.symbol');
require('jquery.flot.crosshair');
require('jquery.flot.selection');
require('jquery.flot.stack');
require('jquery.flot.axislabels');
import './webpackShims/jquery.flot';
import './webpackShims/jquery.flot.time';
import './webpackShims/jquery.flot.symbol';
import './webpackShims/jquery.flot.crosshair';
import './webpackShims/jquery.flot.selection';
import './webpackShims/jquery.flot.stack';
import './webpackShims/jquery.flot.axislabels';
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@

import { get } from 'lodash';
import { getIndexPatterns, getSavedObjectsClient } from './plugin_services';
import { TimelionFunctionArgs } from '../../../../../plugins/timelion/common/types';
import {
indexPatterns as indexPatternsUtils,
IndexPatternAttributes,
} from '../../../../../plugins/data/public';
import { TimelionFunctionArgs } from '../../common/types';
import { indexPatterns as indexPatternsUtils, IndexPatternAttributes } from '../../../data/public';

export interface Location {
min: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import moment, { Moment } from 'moment-timezone';
import { TimefilterContract } from 'src/plugins/data/public';
import { IUiSettingsClient } from 'kibana/public';

import { calculateInterval } from '../../../../../plugins/timelion/common/lib';
import { calculateInterval } from '../../common/lib';
import { xaxisFormatterProvider } from './xaxis_formatter';
import { Series } from './timelion_request_handler';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import { IndexPatternsContract } from 'src/plugins/data/public';
import { SavedObjectsClientContract } from 'kibana/public';
import { createGetterSetter } from '../../../../../plugins/kibana_utils/public';
import { createGetterSetter } from '../../../kibana_utils/public';

export const [getIndexPatterns, setIndexPatterns] = createGetterSetter<IndexPatternsContract>(
'IndexPatterns'
Expand Down
Loading