Skip to content

Commit

Permalink
Reverted prettier changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
sainthkh committed Sep 5, 2019
1 parent 7e5ba77 commit 90e72de
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 195 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ import './lib/pager';

import { getLimitedSearchResultsMessage } from './doc_table_strings';

uiModules
.get('app/discover')
uiModules.get('app/discover')
.directive('docTable', function (config, getAppState, pagerFactory, $filter) {
return {
restrict: 'E',
Expand All @@ -53,13 +52,13 @@ uiModules
inspectorAdapters: '=?',
},
link: function ($scope, $el) {
$scope.$watch('minimumVisibleRows', minimumVisibleRows => {
$scope.$watch('minimumVisibleRows', (minimumVisibleRows) => {
$scope.limit = Math.max(minimumVisibleRows || 50, $scope.limit || 50);
});

$scope.persist = {
sorting: $scope.sorting,
columns: $scope.columns,
columns: $scope.columns
};

const limitTo = $filter('limitTo');
Expand All @@ -68,9 +67,7 @@ uiModules
$scope.pageOfItems = limitTo($scope.hits, $scope.pager.pageSize, $scope.pager.startIndex);
};

$scope.limitedResultsWarning = getLimitedSearchResultsMessage(
config.get('discover:sampleSize')
);
$scope.limitedResultsWarning = getLimitedSearchResultsMessage(config.get('discover:sampleSize'));

$scope.addRows = function () {
$scope.limit += 50;
Expand Down Expand Up @@ -119,8 +116,9 @@ uiModules
calculateItemsOnPage();
};

$scope.shouldShowLimitedResultsWarning = () =>
!$scope.pager.hasNextPage && $scope.pager.totalItems < $scope.totalHitCount;
},
$scope.shouldShowLimitedResultsWarning = () => (
!$scope.pager.hasNextPage && $scope.pager.totalItems < $scope.totalHitCount
);
}
};
});
16 changes: 9 additions & 7 deletions src/legacy/ui/public/render_complete/directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@
import { uiModules } from '../modules';
import { RenderCompleteHelper } from '../../../../plugins/kibana_utils/public';

uiModules.get('kibana').directive('renderComplete', () => ({
controller($scope, $element) {
const el = $element[0];
const renderCompleteHelper = new RenderCompleteHelper(el);
uiModules
.get('kibana')
.directive('renderComplete', () => ({
controller($scope, $element) {
const el = $element[0];
const renderCompleteHelper = new RenderCompleteHelper(el);

$scope.$on('$destroy', renderCompleteHelper.destroy);
},
}));
$scope.$on('$destroy', renderCompleteHelper.destroy);
}
}));
21 changes: 10 additions & 11 deletions src/legacy/ui/public/vislib/lib/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ import { dispatchRenderComplete } from '../../../../../plugins/kibana_utils/publ

const markdownIt = new MarkdownIt({
html: false,
linkify: true,
linkify: true
});


/**
* Handles building all the components of the visualization
*
Expand All @@ -54,9 +55,7 @@ export class Handler {
this.visConfig = visConfig;
this.data = visConfig.data;

this.categoryAxes = visConfig
.get('categoryAxes')
.map(axisArgs => new Axis(visConfig, axisArgs));
this.categoryAxes = visConfig.get('categoryAxes').map(axisArgs => new Axis(visConfig, axisArgs));
this.valueAxes = visConfig.get('valueAxes').map(axisArgs => new Axis(visConfig, axisArgs));
this.chartTitle = new ChartTitle(visConfig);
this.alerts = new Alerts(this, visConfig.get('alerts'));
Expand All @@ -72,7 +71,11 @@ export class Handler {

this.layout = new Layout(visConfig);
this.binder = new Binder();
this.renderArray = _.filter([this.layout, this.chartTitle, this.alerts], Boolean);
this.renderArray = _.filter([
this.layout,
this.chartTitle,
this.alerts
], Boolean);

this.renderArray = this.renderArray
.concat(this.valueAxes)
Expand Down Expand Up @@ -190,10 +193,7 @@ export class Handler {
* child element removed
*/
removeAll(el) {
return d3
.select(el)
.selectAll('*')
.remove();
return d3.select(el).selectAll('*').remove();
}

/**
Expand All @@ -206,8 +206,7 @@ export class Handler {
error(message) {
this.removeAll(this.el);

const div = d3
.select(this.el)
const div = d3.select(this.el)
.append('div')
// class name needs `chart` in it for the polling checkSize function
// to continuously call render on resize
Expand Down
Loading

0 comments on commit 90e72de

Please sign in to comment.