Skip to content

Commit

Permalink
ESLint code errors fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavomatheus committed Oct 10, 2018
1 parent bb44603 commit 0e47b27
Showing 1 changed file with 34 additions and 34 deletions.
68 changes: 34 additions & 34 deletions public/formula_hack.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,45 +16,45 @@ const appId = chrome.getApp().id;
if (appId === 'kibana' || appId === 'dashboardViewer') {

uiModules
.get('datasweet/formula', ['kibana'])
.run((Private) => {
decorateVisAggConfigProvider(Private);
decorateVisAggConfigsProvider(Private);
decorateAggTypes(Private);
decorateTabbedAggResponseWriterProvider(Private);
});
.get('datasweet/formula', ['kibana'])
.run((Private) => {
decorateVisAggConfigProvider(Private);
decorateVisAggConfigsProvider(Private);
decorateAggTypes(Private);
decorateTabbedAggResponseWriterProvider(Private);
});

uiModules
.get('app/visualize')
.config(($provide) => {
$provide.decorator('visEditorAggDirective', ($delegate) => {
// Original
const linkFn = $delegate[0].link;
const tpl = $delegate[0].template;

// Inject template
$delegate[0].template = tpl
.replace(/<!-- title -->[\s\S]*?<\/span>/m, titleTpl)
.replace('<!-- disable aggregation -->', hiddenTpl);

// Inject new function in scope
$delegate[0].compile = function (tElem, tAttr) {
return function newLinkFn($scope, $el, attrs, kbnForm) {
linkFn.apply($delegate[0], arguments);

$scope.canHide = function (aggregation) {
const metricCount = reduce($scope.group, function (count, agg) {
return (agg.schema.name === aggregation.schema.name && !agg.hidden) ? ++count : count;
}, 0);
return metricCount > 1;
.get('app/visualize')
.config(($provide) => {
$provide.decorator('visEditorAggDirective', ($delegate) => {
// Original
const linkFn = $delegate[0].link;
const tpl = $delegate[0].template;

// Inject template
$delegate[0].template = tpl
.replace(/<!-- title -->[\s\S]*?<\/span>/m, titleTpl)
.replace('<!-- disable aggregation -->', hiddenTpl);

// Inject new function in scope
$delegate[0].compile = function () {
return function newLinkFn($scope) {
linkFn.apply($delegate[0], arguments);

$scope.canHide = function (aggregation) {
const metricCount = reduce($scope.group, function (count, agg) {
return (agg.schema.name === aggregation.schema.name && !agg.hidden) ? ++count : count;
}, 0);
return metricCount > 1;
};
};
};
};

// get rid of the old link function since we return a link function in compile
delete $delegate[0].link;
// get rid of the old link function since we return a link function in compile
delete $delegate[0].link;

return $delegate;
return $delegate;
});
});
});
}

0 comments on commit 0e47b27

Please sign in to comment.