mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
* no unused vars cleanup
This commit is contained in:
parent
41ace26a76
commit
24282a57be
57 changed files with 81 additions and 82 deletions
|
@ -293,7 +293,7 @@ export const ExplorerSwimlane = injectI18n(class ExplorerSwimlane extends React.
|
|||
};
|
||||
}
|
||||
|
||||
function cellMouseover(target, laneLabel, bucketScore, index, time) {
|
||||
function cellMouseover(target, laneLabel, bucketScore, index, time) { // eslint-disable-line no-unused-vars
|
||||
if (bucketScore === undefined || cellMouseoverActive === false) {
|
||||
return;
|
||||
}
|
||||
|
@ -368,7 +368,7 @@ export const ExplorerSwimlane = injectI18n(class ExplorerSwimlane extends React.
|
|||
|
||||
// TODO - mark if zoomed in to bucket width?
|
||||
let time = startTime;
|
||||
Array(numBuckets || 0).fill(null).forEach((v, i) => {
|
||||
Array(numBuckets || 0).fill(null).forEach((v, i) => { // eslint-disable-line no-unused-vars
|
||||
const cell = cellsContainer.append('div')
|
||||
.classed('sl-cell', true)
|
||||
.style('width', `${cellWidth}px`)
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import { Importer } from './importer';
|
||||
|
||||
export class NdjsonImporter extends Importer {
|
||||
constructor(results, settings) {
|
||||
constructor(results, settings) { // eslint-disable-line no-unused-vars
|
||||
super(settings);
|
||||
}
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ export function getQueryEntityFieldNames(job) {
|
|||
entityFieldNames.push(...influencers);
|
||||
}
|
||||
|
||||
detectors.forEach((detector, detectorIndex) => {
|
||||
detectors.forEach((detector, detectorIndex) => { // eslint-disable-line no-unused-vars
|
||||
const partitioningFields = getPartitioningFieldNames(job, detectorIndex);
|
||||
|
||||
partitioningFields.forEach((fieldName) => {
|
||||
|
@ -341,7 +341,7 @@ export function getTestUrl(job, customUrl) {
|
|||
};
|
||||
|
||||
// Look for bucket aggregations which match the tokens in the URL.
|
||||
urlValue.replace((/\$([^?&$\'"]{1,40})\$/g), (match, name) => {
|
||||
urlValue.replace((/\$([^?&$\'"]{1,40})\$/g), (match, name) => { // eslint-disable-line no-unused-vars
|
||||
if (name !== 'earliest' && name !== 'latest' && firstBucket[name] !== undefined) {
|
||||
const tokenBuckets = firstBucket[name];
|
||||
if (tokenBuckets.buckets) {
|
||||
|
|
|
@ -153,7 +153,7 @@ class JobsListUI extends Component {
|
|||
}),
|
||||
sortable: true,
|
||||
field: 'description',
|
||||
render: (description, item) => (
|
||||
render: (description, item) => ( // eslint-disable-line no-unused-vars
|
||||
<JobDescription job={item} />
|
||||
),
|
||||
textOnly: true,
|
||||
|
@ -199,7 +199,7 @@ class JobsListUI extends Component {
|
|||
truncateText: false,
|
||||
field: 'latestTimestampSortValue',
|
||||
sortable: true,
|
||||
render: (time, item) => (
|
||||
render: (time, item) => ( // eslint-disable-line no-unused-vars
|
||||
<span className="euiTableCellContent__text">
|
||||
{
|
||||
(item.latestTimestampMs === undefined) ? '' : moment(item.latestTimestampMs).format(TIME_FORMAT)
|
||||
|
|
|
@ -76,7 +76,7 @@ export class JobsListView extends Component {
|
|||
this.props.angularWrapperScope.$on('jobsUpdated', () => {
|
||||
this.refreshJobSummaryList(true);
|
||||
});
|
||||
this.props.angularWrapperScope.$on('openCreateWatchWindow', (e, job) => {
|
||||
this.props.angularWrapperScope.$on('openCreateWatchWindow', (e, job) => { // eslint-disable-line no-unused-vars
|
||||
this.showCreateWatchFlyout(job.job_id);
|
||||
});
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ export class FieldSelect extends Component {
|
|||
|
||||
function getOptions() {
|
||||
const ops = [];
|
||||
_.each(options, (op, key) => {
|
||||
_.each(options, (op, key) => { // eslint-disable-line no-unused-vars
|
||||
ops.push({ label: key, value: key });
|
||||
});
|
||||
return ops;
|
||||
|
|
|
@ -131,7 +131,7 @@ export function ChartDataUtilsProvider(Private) {
|
|||
)
|
||||
.then((data) => {
|
||||
let dtrIndex = 0;
|
||||
_.each(formConfig.fields, (field, key) => {
|
||||
_.each(formConfig.fields, (field, key) => { // eslint-disable-line no-unused-vars
|
||||
|
||||
const dtr = chartData.detectors[key];
|
||||
const times = data.results[dtrIndex];
|
||||
|
|
|
@ -120,7 +120,7 @@ export const CreateWatch = injectI18n(class CreateWatch extends Component {
|
|||
const { intl } = this.props;
|
||||
const mlSelectSeverityService = {
|
||||
state: {
|
||||
set: (name, threshold) => {
|
||||
set: (name, threshold) => { // eslint-disable-line no-unused-vars
|
||||
this.onThresholdChange(threshold);
|
||||
return {
|
||||
changed: () => {}
|
||||
|
|
|
@ -351,7 +351,7 @@ module
|
|||
})
|
||||
.catch((resp) => {
|
||||
msgs.error(resp.message);
|
||||
_.each($scope.formConfig.fields, (field, id) => {
|
||||
_.each($scope.formConfig.fields, (field, id) => { // eslint-disable-line no-unused-vars
|
||||
$scope.chartStates.fields[id] = CHART_STATE.NO_RESULTS;
|
||||
});
|
||||
$scope.$applyAsync();
|
||||
|
@ -365,7 +365,7 @@ module
|
|||
chartDataUtils.loadDocCountData($scope.formConfig, $scope.chartData)
|
||||
.then((resp) => {
|
||||
if (thisLoadTimestamp === $scope.chartData.lastLoadTimestamp) {
|
||||
_.each(dtrs, (dtr, id) => {
|
||||
_.each(dtrs, (dtr, id) => { // eslint-disable-line no-unused-vars
|
||||
const state = (resp.totalResults) ? CHART_STATE.LOADED : CHART_STATE.NO_RESULTS;
|
||||
$scope.chartStates.fields[id] = state;
|
||||
});
|
||||
|
@ -387,7 +387,7 @@ module
|
|||
};
|
||||
|
||||
function setFieldsChartStates(state) {
|
||||
_.each($scope.chartStates.fields, (chart, key) => {
|
||||
_.each($scope.chartStates.fields, (chart, key) => { // eslint-disable-line no-unused-vars
|
||||
$scope.chartStates.fields[key] = state;
|
||||
});
|
||||
$scope.$applyAsync();
|
||||
|
|
|
@ -374,7 +374,7 @@ module
|
|||
chartDataUtils.loadDocCountData($scope.formConfig, $scope.chartData)
|
||||
.then((resp) => {
|
||||
if (thisLoadTimestamp === $scope.chartData.lastLoadTimestamp) {
|
||||
_.each(dtrs, (dtr, id) => {
|
||||
_.each(dtrs, (dtr, id) => { // eslint-disable-line no-unused-vars
|
||||
const state = (resp.totalResults) ? CHART_STATE.LOADED : CHART_STATE.NO_RESULTS;
|
||||
$scope.chartStates.fields[id] = state;
|
||||
});
|
||||
|
@ -396,7 +396,7 @@ module
|
|||
};
|
||||
|
||||
function setFieldsChartStates(state) {
|
||||
_.each($scope.chartStates.fields, (chart, key) => {
|
||||
_.each($scope.chartStates.fields, (chart, key) => { // eslint-disable-line no-unused-vars
|
||||
$scope.chartStates.fields[key] = state;
|
||||
});
|
||||
$scope.$applyAsync();
|
||||
|
|
|
@ -69,7 +69,7 @@ export function PopulationJobServiceProvider(Private) {
|
|||
fieldIds.splice(0, 0, EVENT_RATE_COUNT_FIELD);
|
||||
}
|
||||
|
||||
fieldIds.forEach((fieldId, i) => {
|
||||
fieldIds.forEach((fieldId, i) => { // eslint-disable-line no-unused-vars
|
||||
this.chartData.detectors[i] = {
|
||||
line: [],
|
||||
swimlane: [],
|
||||
|
|
|
@ -56,7 +56,7 @@ import { uiModules } from 'ui/modules';
|
|||
const module = uiModules.get('apps/ml');
|
||||
|
||||
module
|
||||
.controller('MlCreateRecognizerJobs', function ($scope, $window, $route, Private) {
|
||||
.controller('MlCreateRecognizerJobs', function ($scope, $route, Private) {
|
||||
|
||||
const mlCreateRecognizerJobsService = Private(CreateRecognizerJobsServiceProvider);
|
||||
timefilter.disableTimeRangeSelector();
|
||||
|
|
|
@ -64,7 +64,7 @@ import { uiModules } from 'ui/modules';
|
|||
const module = uiModules.get('apps/ml');
|
||||
|
||||
module
|
||||
.controller('MlCreateSingleMetricJob', function ($scope, $route, $filter, $timeout, Private, AppState) {
|
||||
.controller('MlCreateSingleMetricJob', function ($scope, $route, $timeout, Private, AppState) {
|
||||
|
||||
timefilter.enableTimeRangeSelector();
|
||||
timefilter.disableAutoRefreshSelector();
|
||||
|
@ -515,7 +515,7 @@ module
|
|||
|
||||
// check to see if the percentage is past a threshold for reloading the full model
|
||||
let fullModelRefresh = false;
|
||||
_.each(jobProgressChecks, (c, i) => {
|
||||
_.each(jobProgressChecks, (c, i) => { // eslint-disable-line no-unused-vars
|
||||
if (jobProgressChecks[i] === false && $scope.chartData.percentComplete >= i) {
|
||||
jobProgressChecks[i] = true;
|
||||
fullModelRefresh = true;
|
||||
|
@ -600,7 +600,7 @@ module
|
|||
$scope.jobState = JOB_STATE.NOT_STARTED;
|
||||
angular.element('.model-chart, .swimlane').css('opacity', 0);
|
||||
|
||||
_.each(jobProgressChecks, (c, i) => {
|
||||
_.each(jobProgressChecks, (c, i) => { // eslint-disable-line no-unused-vars
|
||||
jobProgressChecks[i] = false;
|
||||
});
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ import { mlJobService } from 'plugins/ml/services/job_service';
|
|||
|
||||
// Provider for creating the items used for searching and job creation.
|
||||
// Uses the $route object to retrieve the indexPattern and savedSearch from the url
|
||||
export function SearchItemsProvider(Private, $route, config) {
|
||||
export function SearchItemsProvider($route, config) {
|
||||
|
||||
function createSearchItems() {
|
||||
let indexPattern = $route.current.locals.indexPattern;
|
||||
|
|
|
@ -54,7 +54,7 @@ module.directive('mlNewCalendar', function ($route) {
|
|||
restrict: 'E',
|
||||
replace: false,
|
||||
scope: {},
|
||||
link: function (scope, element) {
|
||||
link: function (element) {
|
||||
const props = {
|
||||
calendarId: $route.current.params.calendarId,
|
||||
canCreateCalendar: checkPermission('canCreateCalendar'),
|
||||
|
|
|
@ -46,7 +46,7 @@ module.directive('mlCalendarsList', function () {
|
|||
restrict: 'E',
|
||||
replace: false,
|
||||
scope: {},
|
||||
link: function (scope, element) {
|
||||
link: function (element) {
|
||||
const props = {
|
||||
canCreateCalendar: checkPermission('canCreateCalendar'),
|
||||
canDeleteCalendar: checkPermission('canDeleteCalendar'),
|
||||
|
|
|
@ -53,7 +53,7 @@ module.directive('mlEditFilterList', function ($route) {
|
|||
restrict: 'E',
|
||||
replace: false,
|
||||
scope: {},
|
||||
link: function (scope, element) {
|
||||
link: function (element) {
|
||||
const props = {
|
||||
filterId: $route.current.params.filterId,
|
||||
canCreateFilter: checkPermission('canCreateFilter'),
|
||||
|
|
|
@ -44,7 +44,7 @@ module.directive('mlFilterLists', function () {
|
|||
restrict: 'E',
|
||||
replace: false,
|
||||
scope: {},
|
||||
link: function (scope, element) {
|
||||
link: function (element) {
|
||||
const props = {
|
||||
canCreateFilter: checkPermission('canCreateFilter'),
|
||||
canDeleteFilter: checkPermission('canDeleteFilter'),
|
||||
|
|
|
@ -50,7 +50,7 @@ module.directive('mlSettings', function () {
|
|||
restrict: 'E',
|
||||
replace: false,
|
||||
scope: {},
|
||||
link: function (scope, element) {
|
||||
link: function (element) {
|
||||
timefilter.disableTimeRangeSelector();
|
||||
timefilter.disableAutoRefreshSelector();
|
||||
|
||||
|
|
|
@ -720,7 +720,7 @@ module.controller('MlTimeSeriesExplorerController', function (
|
|||
jobSelectServiceSub.unsubscribe();
|
||||
});
|
||||
|
||||
$scope.$on('contextChartSelected', function (event, selection) {
|
||||
$scope.$on('contextChartSelected', function (event, selection) { // eslint-disable-line no-unused-vars
|
||||
// Save state of zoom (adds to URL) if it is different to the default.
|
||||
if (($scope.contextChartData === undefined || $scope.contextChartData.length === 0) &&
|
||||
($scope.contextForecastData === undefined || $scope.contextForecastData.length === 0)) {
|
||||
|
|
|
@ -119,7 +119,7 @@ export function TimeBucketsCalcAutoIntervalProvider() {
|
|||
|
||||
}),
|
||||
|
||||
atLeast: find(revRoundingRules, function atLeast(upperBound, lowerBound, target) {
|
||||
atLeast: find(revRoundingRules, function atLeast(upperBound, lowerBound, target) { // eslint-disable-line no-unused-vars
|
||||
// Unmodified from Kibana ui/time_buckets/calc_auto_interval.js.
|
||||
if (lowerBound <= target) {
|
||||
return lowerBound;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
|
||||
|
||||
export const elasticsearchJsPlugin = (Client, config, components) => {
|
||||
export const elasticsearchJsPlugin = (Client, config, components) => { // eslint-disable-line no-unused-vars
|
||||
const ca = components.clientAction.factory;
|
||||
|
||||
Client.prototype.ml = components.clientAction.namespaceFactory();
|
||||
|
|
|
@ -12,7 +12,7 @@ const INFLUENCER_LOW_THRESHOLD = 0;
|
|||
const INFLUENCER_HIGH_THRESHOLD = 4;
|
||||
const DETECTOR_FIELD_NAMES_THRESHOLD = 1;
|
||||
|
||||
export async function validateInfluencers(callWithRequest, job) {
|
||||
export async function validateInfluencers(callWithRequest, job) { // eslint-disable-line no-unused-vars
|
||||
validateJobObject(job);
|
||||
|
||||
const messages = [];
|
||||
|
|
|
@ -17,7 +17,7 @@ function generatePngObservableFn(server) {
|
|||
const urlScreenshotsObservable = (url, conditionalHeaders, layout, browserTimezone) => {
|
||||
return Rx.of(url).pipe(
|
||||
mergeMap(url => screenshotsObservable(url, conditionalHeaders, layout, browserTimezone),
|
||||
(outer, inner) => inner,
|
||||
(outer, inner) => inner, // eslint-disable-line no-unused-vars
|
||||
captureConcurrency
|
||||
)
|
||||
);
|
||||
|
|
|
@ -34,7 +34,7 @@ function generatePdfObservableFn(server) {
|
|||
|
||||
const urlScreenshotsObservable = (urls, conditionalHeaders, layout, browserTimezone) => {
|
||||
return Rx.from(urls).pipe(
|
||||
mergeMap(url => screenshotsObservable(url, conditionalHeaders, layout, browserTimezone),
|
||||
mergeMap(url => screenshotsObservable(url, conditionalHeaders, layout, browserTimezone), // eslint-disable-line no-unused-vars
|
||||
(outer, inner) => inner,
|
||||
captureConcurrency
|
||||
)
|
||||
|
|
|
@ -706,7 +706,7 @@ describe('Worker class', function () {
|
|||
});
|
||||
|
||||
it('should update the job with the workerFn output', function () {
|
||||
const workerFn = function (job, jobPayload) {
|
||||
const workerFn = function (job, jobPayload) { // eslint-disable-line no-unused-vars
|
||||
expect(jobPayload).to.eql(payload);
|
||||
return payload;
|
||||
};
|
||||
|
@ -729,7 +729,7 @@ describe('Worker class', function () {
|
|||
|
||||
it('should update the job status and completed time', function () {
|
||||
const startTime = moment().valueOf();
|
||||
const workerFn = function (job, jobPayload) {
|
||||
const workerFn = function (job, jobPayload) { // eslint-disable-line no-unused-vars
|
||||
expect(jobPayload).to.eql(payload);
|
||||
return new Promise(function (resolve) {
|
||||
setTimeout(() => resolve(payload), 10);
|
||||
|
@ -790,7 +790,7 @@ describe('Worker class', function () {
|
|||
|
||||
it('should handle async errors', function () {
|
||||
const workerFn = function () {
|
||||
return new Promise((resolve, reject) => {
|
||||
return new Promise((resolve, reject) => { // eslint-disable-line no-unused-vars
|
||||
reject(new Error('test error'));
|
||||
});
|
||||
};
|
||||
|
@ -807,7 +807,7 @@ describe('Worker class', function () {
|
|||
it('should handle rejecting with strings', function () {
|
||||
const errorMessage = 'this is a string error';
|
||||
const workerFn = function () {
|
||||
return new Promise((resolve, reject) => {
|
||||
return new Promise((resolve, reject) => { // eslint-disable-line no-unused-vars
|
||||
reject(errorMessage);
|
||||
});
|
||||
};
|
||||
|
@ -823,7 +823,7 @@ describe('Worker class', function () {
|
|||
|
||||
it('should handle empty rejection', function (done) {
|
||||
const workerFn = function () {
|
||||
return new Promise((resolve, reject) => {
|
||||
return new Promise((resolve, reject) => { // eslint-disable-line no-unused-vars
|
||||
reject();
|
||||
});
|
||||
};
|
||||
|
@ -904,7 +904,7 @@ describe('Worker class', function () {
|
|||
const timeout = 20;
|
||||
cancellationCallback = function () {};
|
||||
|
||||
const workerFn = function (job, payload, cancellationToken) {
|
||||
const workerFn = function (job, payload, cancellationToken) { // eslint-disable-line no-unused-vars
|
||||
cancellationToken.on(cancellationCallback);
|
||||
return new Promise(function (resolve) {
|
||||
setTimeout(() => {
|
||||
|
@ -991,7 +991,7 @@ describe('Worker class', function () {
|
|||
describe('workerFn rejects promise', function () {
|
||||
beforeEach(function () {
|
||||
const workerFn = function () {
|
||||
return new Promise(function (resolve, reject) {
|
||||
return new Promise(function (resolve, reject) { // eslint-disable-line no-unused-vars
|
||||
setTimeout(() => {
|
||||
reject();
|
||||
}, timeout / 2);
|
||||
|
|
|
@ -8,7 +8,7 @@ import { getReportingUsageCollector } from './get_reporting_usage_collector';
|
|||
|
||||
function getServerMock(customization) {
|
||||
class MockUsageCollector {
|
||||
constructor(_server, { fetch }) {
|
||||
constructor(_server, { fetch }) { // eslint-disable-line no-unused-vars
|
||||
this.fetch = fetch;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -174,7 +174,7 @@ describe('Create Rollup Job, step 1: Logistics', () => {
|
|||
};
|
||||
|
||||
const generateStringSequenceOfNumbers = (total) => (
|
||||
new Array(total).fill('').map((_, i) => i < 10 ? `0${i}` : i.toString())
|
||||
new Array(total).fill('').map((_, i) => i < 10 ? `0${i}` : i.toString()) // eslint-disable-line no-unused-vars
|
||||
);
|
||||
|
||||
describe('frequency', () => {
|
||||
|
|
|
@ -114,7 +114,7 @@ export class JobCreateUi extends Component {
|
|||
this._isMounted = true;
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps, prevState) {
|
||||
componentDidUpdate(prevProps, prevState) { // eslint-disable-line no-unused-vars
|
||||
const indexPattern = this.getIndexPattern();
|
||||
if (indexPattern !== this.getIndexPattern(prevState)) {
|
||||
// If the user hasn't entered anything, then skip validation.
|
||||
|
|
|
@ -12,7 +12,7 @@ export function initAggTypeFieldFilter() {
|
|||
* and limit available fields for a given aggType based on that.
|
||||
*/
|
||||
aggTypeFieldFilters.addFilter(
|
||||
(field, fieldParamType, aggConfig) => {
|
||||
(field, fieldParamType, aggConfig) => { // eslint-disable-line no-unused-vars
|
||||
const indexPattern = aggConfig.getIndexPattern();
|
||||
if(!indexPattern || indexPattern.type !== 'rollup') {
|
||||
return true;
|
||||
|
|
|
@ -9,7 +9,7 @@ import { editorConfigProviders } from 'ui/vis/editors/config/editor_config_provi
|
|||
|
||||
export function initEditorConfig() {
|
||||
// Limit agg params based on rollup capabilities
|
||||
editorConfigProviders.register((aggType, indexPattern, aggConfig) => {
|
||||
editorConfigProviders.register((aggType, indexPattern, aggConfig) => { // eslint-disable-line no-unused-vars
|
||||
if(indexPattern.type !== 'rollup') {
|
||||
return {};
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
export const elasticsearchJsPlugin = (Client, config, components) => {
|
||||
export const elasticsearchJsPlugin = (Client, config, components) => { // eslint-disable-line no-unused-vars
|
||||
const ca = components.clientAction.factory;
|
||||
|
||||
Client.prototype.rollup = components.clientAction.namespaceFactory();
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
import { getRollupSearchCapabilities } from './rollup_search_capabilities';
|
||||
|
||||
class DefaultSearchCapabilities {
|
||||
constructor(request, fieldsCapabilities = {}) {
|
||||
constructor(request, fieldsCapabilities = {}) { // eslint-disable-line no-unused-vars
|
||||
this.fieldsCapabilities = fieldsCapabilities;
|
||||
this.parseInterval = jest.fn((interval) => interval);
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ uiModules
|
|||
return service;
|
||||
});
|
||||
|
||||
function profileVizController($scope, $route, $interval, $http, HighlightService, Private) {
|
||||
function profileVizController($scope, $http, HighlightService, Private) {
|
||||
$scope.title = 'Search Profile';
|
||||
$scope.description = 'Search profiling and visualization';
|
||||
$scope.profileResponse = [];
|
||||
|
|
|
@ -26,7 +26,6 @@ const module = uiModules.get('security', []);
|
|||
module.config(($httpProvider) => {
|
||||
$httpProvider.interceptors.push((
|
||||
$timeout,
|
||||
$window,
|
||||
$q,
|
||||
$injector,
|
||||
sessionTimeout,
|
||||
|
|
|
@ -20,7 +20,7 @@ function isUnauthorizedResponseAllowed(response) {
|
|||
}
|
||||
|
||||
const module = uiModules.get('security');
|
||||
module.factory('onUnauthorizedResponse', ($q, $window, $injector, Private, autoLogout) => {
|
||||
module.factory('onUnauthorizedResponse', ($q, Private, autoLogout) => {
|
||||
const isUnauthenticated = Private(PathProvider).isUnauthenticated();
|
||||
function interceptorFactory(responseHandler) {
|
||||
return function interceptor(response) {
|
||||
|
|
|
@ -17,7 +17,7 @@ import { render, unmountComponentAtNode } from 'react-dom';
|
|||
import { I18nContext } from 'ui/i18n';
|
||||
import { getEditUserBreadcrumbs, getCreateUserBreadcrumbs } from '../breadcrumbs';
|
||||
|
||||
const renderReact = (elem, httpClient, changeUrl, username) => {
|
||||
const renderReact = (elem, changeUrl, username) => {
|
||||
render(
|
||||
<I18nContext>
|
||||
<EditUserPage
|
||||
|
@ -38,7 +38,7 @@ routes.when(`${EDIT_USERS_PATH}/:username?`, {
|
|||
: getCreateUserBreadcrumbs
|
||||
),
|
||||
controllerAs: 'editUser',
|
||||
controller($scope, $route, kbnUrl, $http) {
|
||||
controller($scope, $route, kbnUrl) {
|
||||
$scope.$on('$destroy', () => {
|
||||
const elem = document.getElementById('editUserReactRoot');
|
||||
if (elem) {
|
||||
|
@ -52,7 +52,7 @@ routes.when(`${EDIT_USERS_PATH}/:username?`, {
|
|||
kbnUrl.change(url);
|
||||
$scope.$apply();
|
||||
};
|
||||
renderReact(elem, $http, changeUrl, username);
|
||||
renderReact(elem, changeUrl, username);
|
||||
});
|
||||
},
|
||||
});
|
||||
|
|
|
@ -26,7 +26,7 @@ const renderReact = (elem, changeUrl) => {
|
|||
routes.when(USERS_PATH, {
|
||||
template,
|
||||
k7Breadcrumbs: getUsersBreadcrumbs,
|
||||
controller($scope, $route, $q, confirmModal, $http, kbnUrl) {
|
||||
controller($scope, $http, kbnUrl) {
|
||||
$scope.$on('$destroy', () => {
|
||||
const elem = document.getElementById('usersReactRoot');
|
||||
if (elem) unmountComponentAtNode(elem);
|
||||
|
|
|
@ -10,7 +10,7 @@ export function initLogoutView(server) {
|
|||
server.route({
|
||||
method: 'GET',
|
||||
path: '/logout',
|
||||
handler(request, h) {
|
||||
handler(request, h) { // eslint-disable-line no-unused-vars
|
||||
return h.renderAppWithDefaultConfig(logout);
|
||||
},
|
||||
config: {
|
||||
|
|
|
@ -31,7 +31,7 @@ app.directive('durationSelect', function ($injector) {
|
|||
replace: true,
|
||||
controllerAs: 'durationSelect',
|
||||
bindToController: true,
|
||||
link: function ($scope, $element, $attrs, $ctrl) {
|
||||
link: function ($scope, $ctrl) {
|
||||
$scope.durationSelect.form = $ctrl;
|
||||
},
|
||||
controller: class DurationSelectController extends InitAfterBindingsWorkaround {
|
||||
|
|
|
@ -8,7 +8,7 @@ import { uiModules } from 'ui/modules';
|
|||
|
||||
const app = uiModules.get('xpack/watcher');
|
||||
|
||||
app.controller('WatcherErrorsDisplayController', function WatcherErrorsDisplayController($scope, $modalInstance, params) {
|
||||
app.controller('WatcherErrorsDisplayController', function WatcherErrorsDisplayController($modalInstance, params) {
|
||||
this.title = params.title;
|
||||
this.errors = params.errors;
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ app.directive('kbnTab', function () {
|
|||
controllerAs: 'kbnTab',
|
||||
bindToController: true,
|
||||
controller: class KbnTabController {},
|
||||
link: function ($scope, $ele, attrs, kbnTabs) {
|
||||
link: function ($scope, kbnTabs) {
|
||||
$scope.kbnTabs = kbnTabs;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -151,7 +151,7 @@ app.directive('thresholdPreviewChart', function ($injector) {
|
|||
return options;
|
||||
}
|
||||
|
||||
onPlotHover = (event, pos, item, plot) => {
|
||||
onPlotHover = (event, pos, item, plot) => { // eslint-disable-line no-unused-vars
|
||||
if (!Boolean(item)) {
|
||||
this.dataPointTooltip = undefined;
|
||||
return;
|
||||
|
|
|
@ -12,7 +12,7 @@ const app = uiModules.get('xpack/watcher');
|
|||
app.directive('xpackAriaDescribes', function () {
|
||||
return {
|
||||
restrict: 'A',
|
||||
link: function ($scope, $ele, attr) {
|
||||
link: function ($scope, attr) {
|
||||
if (!Object.keys(attr).includes('id')) {
|
||||
throw new Error(`An element with xpack-aria-describes="${attr.xpackAriaDescribes}" does not have an id attribute defined`);
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ uiModules
|
|||
return {
|
||||
restrict: 'A',
|
||||
require: 'ngModel',
|
||||
link: function (scope, $el, attrs, ngModelCntrl) {
|
||||
link: function (scope, attrs, ngModelCntrl) {
|
||||
ngModelCntrl.$formatters.push(toJSON);
|
||||
ngModelCntrl.$parsers.push(fromJSON);
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ uiModules.get('xpack/watcher')
|
|||
transclude: true,
|
||||
replace: true,
|
||||
scope: true,
|
||||
link: function ($scope, $el, attr) {
|
||||
link: function ($scope, attr) {
|
||||
$scope.text = attr.text;
|
||||
$scope.placement = attr.placement || 'top';
|
||||
$scope.delay = attr.delay || 400;
|
||||
|
|
|
@ -56,7 +56,7 @@ app.directive('watchTable', function () {
|
|||
});
|
||||
}
|
||||
|
||||
onAllSelectedChange = (itemId, allSelected) => {
|
||||
onAllSelectedChange = (itemId, allSelected) => { // eslint-disable-line no-unused-vars
|
||||
_.forEach(this.editableItems, item => {
|
||||
item.selected = allSelected;
|
||||
});
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
export const elasticsearchJsPlugin = (Client, config, components) => {
|
||||
export const elasticsearchJsPlugin = (Client, config, components) => { // eslint-disable-line no-unused-vars
|
||||
const ca = components.clientAction.factory;
|
||||
|
||||
Client.prototype.watcher = components.clientAction.namespaceFactory();
|
||||
|
|
|
@ -32,7 +32,7 @@ function buildDateAgg({ field, interval, timeZone }) {
|
|||
};
|
||||
}
|
||||
|
||||
function buildAggsCount(body, dateAgg) {
|
||||
function buildAggsCount(body, dateAgg) { // eslint-disable-line no-unused-vars
|
||||
return {
|
||||
dateAgg
|
||||
};
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
root.ElasticsearchShield = factory();
|
||||
}
|
||||
}(this, function () {
|
||||
return function addShieldApi(Client, config, components) {
|
||||
return function addShieldApi(Client, config, components) { // eslint-disable-line no-unused-vars
|
||||
const ca = components.clientAction.factory;
|
||||
|
||||
Client.prototype.shield = components.clientAction.namespaceFactory();
|
||||
|
|
|
@ -24,7 +24,7 @@ function convertKeysToSpecifiedCaseDeep(object, caseConversionFunction) {
|
|||
newObject = _.clone(object);
|
||||
|
||||
// Convert top-level keys
|
||||
newObject = _.mapKeys(newObject, (value, key) => caseConversionFunction(key));
|
||||
newObject = _.mapKeys(newObject, (value, key) => caseConversionFunction(key)); // eslint-disable-line no-unused-vars
|
||||
}
|
||||
|
||||
// Recursively convert nested object keys
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
export function mirrorPluginStatus(upstreamPlugin, downstreamPlugin, ...statesToMirror) {
|
||||
upstreamPlugin.status.setMaxListeners(20); // We need more than the default, which is 10
|
||||
|
||||
function mirror(previousState, previousMsg, newState, newMsg) {
|
||||
function mirror(previousState, previousMsg, newState, newMsg) { // eslint-disable-line no-unused-vars
|
||||
if (newState) {
|
||||
downstreamPlugin.status[newState](newMsg);
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ export function watchStatusAndLicenseToInitialize(xpackMainPlugin, downstreamPlu
|
|||
message: upstreamStatus.message,
|
||||
});
|
||||
const newStatus$ = Rx
|
||||
.fromEvent(upstreamStatus, 'change', null, (previousState, previousMsg, state, message) => {
|
||||
.fromEvent(upstreamStatus, 'change', null, (previousState, previousMsg, state, message) => { // eslint-disable-line no-unused-vars
|
||||
return {
|
||||
state,
|
||||
message,
|
||||
|
|
|
@ -87,7 +87,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
|
||||
const alertsAll = await alerts.getOverviewAlertsAll();
|
||||
|
||||
alertsAll.forEach((obj, index) => {
|
||||
alertsAll.forEach((obj, index) => { // eslint-disable-line no-unused-vars
|
||||
expect(alertsAll[index].alertIcon).to.be(panelData[index].alertIcon);
|
||||
expect(alertsAll[index].alertText).to.be(panelData[index].alertText);
|
||||
});
|
||||
|
@ -152,7 +152,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
));
|
||||
expect(alertsAll.length).to.be(tableData.length);
|
||||
|
||||
alertsAll.forEach((obj, index) => {
|
||||
alertsAll.forEach((obj, index) => { // eslint-disable-line no-unused-vars
|
||||
expect(`${alertsAll[index].alertIcon} ${alertsAll[index].alertText}`)
|
||||
.to.be(`${tableData[index].alertIcon} ${tableData[index].alertText}`);
|
||||
});
|
||||
|
|
|
@ -77,7 +77,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
]; /*eslint-enable*/
|
||||
|
||||
// check the all data in the table
|
||||
indicesAll.forEach((obj, index) => {
|
||||
indicesAll.forEach((obj, index) => { // eslint-disable-line no-unused-vars
|
||||
expect(indicesAll[index].name).to.be(tableData[index].name);
|
||||
expect(indicesAll[index].status).to.be(tableData[index].status);
|
||||
expect(indicesAll[index].documentCount).to.be(tableData[index].documentCount);
|
||||
|
|
|
@ -77,7 +77,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
},
|
||||
{ name: 'whatever-03', status: 'Status: Offline' },
|
||||
];
|
||||
nodesAll.forEach((obj, node) => {
|
||||
nodesAll.forEach((obj, node) => { // eslint-disable-line no-unused-vars
|
||||
expect(nodesAll[node].name).to.be(tableData[node].name);
|
||||
expect(nodesAll[node].status).to.be(tableData[node].status);
|
||||
expect(nodesAll[node].cpu).to.be(tableData[node].cpu);
|
||||
|
@ -94,7 +94,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
|
||||
const nodesAll = await nodesList.getNodesAll();
|
||||
const tableData = [{ cpu: '2% \n3% max\n0% min' }, { cpu: '0% \n3% max\n0% min' }, { cpu: undefined }];
|
||||
nodesAll.forEach((obj, node) => {
|
||||
nodesAll.forEach((obj, node) => { // eslint-disable-line no-unused-vars
|
||||
expect(nodesAll[node].cpu).to.be(tableData[node].cpu);
|
||||
});
|
||||
});
|
||||
|
@ -109,7 +109,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
{ load: '3.28 \n3.73 max\n2.29 min' },
|
||||
{ load: undefined },
|
||||
];
|
||||
nodesAll.forEach((obj, node) => {
|
||||
nodesAll.forEach((obj, node) => { // eslint-disable-line no-unused-vars
|
||||
expect(nodesAll[node].load).to.be(tableData[node].load);
|
||||
});
|
||||
});
|
||||
|
@ -125,7 +125,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
{ name: 'whatever-02' },
|
||||
{ name: 'whatever-03' },
|
||||
];
|
||||
nodesAll.forEach((obj, node) => {
|
||||
nodesAll.forEach((obj, node) => { // eslint-disable-line no-unused-vars
|
||||
expect(nodesAll[node].name).to.be(tableData[node].name);
|
||||
});
|
||||
});
|
||||
|
@ -140,7 +140,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
{ status: 'Status: Online' },
|
||||
{ status: 'Status: Offline' },
|
||||
];
|
||||
nodesAll.forEach((obj, node) => {
|
||||
nodesAll.forEach((obj, node) => { // eslint-disable-line no-unused-vars
|
||||
expect(nodesAll[node].status).to.be(tableData[node].status);
|
||||
});
|
||||
});
|
||||
|
@ -155,7 +155,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
{ memory: '25% \n49% max\n25% min' },
|
||||
{ memory: undefined },
|
||||
];
|
||||
nodesAll.forEach((obj, node) => {
|
||||
nodesAll.forEach((obj, node) => { // eslint-disable-line no-unused-vars
|
||||
expect(nodesAll[node].memory).to.be(tableData[node].memory);
|
||||
});
|
||||
});
|
||||
|
@ -170,7 +170,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
{ disk: '173.9 GB \n173.9 GB max\n173.9 GB min' },
|
||||
{ disk: undefined },
|
||||
];
|
||||
nodesAll.forEach((obj, node) => {
|
||||
nodesAll.forEach((obj, node) => { // eslint-disable-line no-unused-vars
|
||||
expect(nodesAll[node].disk).to.be(tableData[node].disk);
|
||||
});
|
||||
});
|
||||
|
@ -185,7 +185,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
{ shards: '38' },
|
||||
{ shards: undefined },
|
||||
];
|
||||
nodesAll.forEach((obj, node) => {
|
||||
nodesAll.forEach((obj, node) => { // eslint-disable-line no-unused-vars
|
||||
expect(nodesAll[node].shards).to.be(tableData[node].shards);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -53,7 +53,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
];
|
||||
|
||||
// check the all data in the table
|
||||
pipelinesAll.forEach((obj, index) => {
|
||||
pipelinesAll.forEach((obj, index) => { // eslint-disable-line no-unused-vars
|
||||
expect(pipelinesAll[index].id).to.be(tableData[index].id);
|
||||
expect(pipelinesAll[index].eventsEmittedRate).to.be(tableData[index].eventsEmittedRate);
|
||||
expect(pipelinesAll[index].nodeCount).to.be(tableData[index].nodeCount);
|
||||
|
@ -76,7 +76,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
];
|
||||
|
||||
// check the all data in the table
|
||||
pipelinesAll.forEach((obj, index) => {
|
||||
pipelinesAll.forEach((obj, index) => { // eslint-disable-line no-unused-vars
|
||||
expect(pipelinesAll[index].id).to.be(tableData[index].id);
|
||||
expect(pipelinesAll[index].eventsEmittedRate).to.be(tableData[index].eventsEmittedRate);
|
||||
expect(pipelinesAll[index].nodeCount).to.be(tableData[index].nodeCount);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue