Eslint/remove last amd modules (#14282)

* [timelion] remove last remaining amd modules

* [eslint-config-kibana] remove env.amd
This commit is contained in:
Spencer 2017-10-10 16:10:56 +02:00 committed by GitHub
parent 6a2bb74407
commit bd53cc6370
4 changed files with 45 additions and 47 deletions

View file

@ -11,7 +11,6 @@ module.exports = {
env: {
es6: true,
amd: true,
node: true,
mocha: true,
browser: true,

View file

@ -1,4 +1,5 @@
/* eslint import/no-unresolved: 0 */
/* global define */
(function (window) {
"use strict";

View file

@ -4,48 +4,45 @@ import image from '../images/icon-timelion.svg';
import { VisTypesRegistryProvider } from 'ui/registry/vis_types';
import { TimelionRequestHandlerProvider } from './timelion_request_handler';
define(function (require) {
// we also need to load the controller and directive used by the template
require('plugins/timelion/vis/timelion_vis_controller');
require('plugins/timelion/directives/timelion_expression_input');
// we also need to load the controller and directive used by the template
import 'plugins/timelion/vis/timelion_vis_controller';
import 'plugins/timelion/directives/timelion_expression_input';
// Stylin
require('plugins/timelion/vis/timelion_vis.less');
// Stylin
import 'plugins/timelion/vis/timelion_vis.less';
// register the provider with the visTypes registry so that other know it exists
VisTypesRegistryProvider.register(TimelionVisProvider);
import visConfigTemplate from 'plugins/timelion/vis/timelion_vis.html';
import editorConfigTemplate from 'plugins/timelion/vis/timelion_vis_params.html';
// register the provider with the visTypes registry so that other know it exists
VisTypesRegistryProvider.register(TimelionVisProvider);
function TimelionVisProvider(Private) {
const VisFactory = Private(VisFactoryProvider);
const timelionRequestHandler = Private(TimelionRequestHandlerProvider);
export default function TimelionVisProvider(Private) {
const VisFactory = Private(VisFactoryProvider);
const timelionRequestHandler = Private(TimelionRequestHandlerProvider);
// return the visType object, which kibana will use to display and configure new
// Vis object of this type.
return VisFactory.createAngularVisualization({
name: 'timelion',
title: 'Timelion',
image,
description: 'Build time-series using functional expressions',
category: CATEGORY.TIME,
visConfig: {
defaults: {
expression: '.es(*)',
interval: 'auto'
},
template: require('plugins/timelion/vis/timelion_vis.html'),
// return the visType object, which kibana will use to display and configure new
// Vis object of this type.
return VisFactory.createAngularVisualization({
name: 'timelion',
title: 'Timelion',
image,
description: 'Build time-series using functional expressions',
category: CATEGORY.TIME,
visConfig: {
defaults: {
expression: '.es(*)',
interval: 'auto'
},
editorConfig: {
optionsTemplate: require('plugins/timelion/vis/timelion_vis_params.html')
},
requestHandler: timelionRequestHandler.handler,
responseHandler: 'none',
options: {
showIndexSelection: false
}
});
}
// export the provider so that the visType can be required with Private()
return TimelionVisProvider;
});
template: visConfigTemplate,
},
editorConfig: {
optionsTemplate: editorConfigTemplate,
},
requestHandler: timelionRequestHandler.handler,
responseHandler: 'none',
options: {
showIndexSelection: false
}
});
}

View file

@ -1,14 +1,15 @@
define(function (require) {
require('plugins/timelion/directives/chart/chart');
require('plugins/timelion/directives/timelion_interval/timelion_interval');
require('ui/state_management/app_state');
const module = require('ui/modules').get('kibana/timelion_vis', ['kibana']);
module.controller('TimelionVisController', function ($scope) {
import 'plugins/timelion/directives/chart/chart';
import 'plugins/timelion/directives/timelion_interval/timelion_interval';
import 'ui/state_management/app_state';
import { uiModules } from 'ui/modules';
uiModules
.get('kibana/timelion_vis', ['kibana'])
.controller('TimelionVisController', function ($scope) {
$scope.$on('renderComplete', event => {
event.stopPropagation();
$scope.renderComplete();
});
});
});