From 28b6efa260e6170bd46e8d898fc1698b0437bde9 Mon Sep 17 00:00:00 2001 From: Chris Roberson Date: Tue, 7 Jan 2020 11:31:15 -0500 Subject: [PATCH 01/64] Fix linting issues (#54068) Co-authored-by: Elastic Machine --- .eslintrc.js | 21 ------------------- x-pack/legacy/plugins/monitoring/index.js | 2 +- .../public/components/chart/chart_target.js | 2 +- .../components/chart/chart_target.test.js | 4 ++-- .../shard_allocation/components/assigned.js | 3 +++ .../pipeline_viewer/views/detail_drawer.js | 6 +++--- .../public/services/executor_provider.js | 2 +- .../public/views/elasticsearch/nodes/index.js | 1 + .../views/logstash/node/pipelines/index.js | 1 + .../public/views/logstash/pipelines/index.js | 1 + .../monitoring/server/cloud/cloud_service.js | 2 +- .../lib/metrics/elasticsearch/classes.js | 2 +- .../server/lib/metrics/logstash/classes.js | 4 ++-- 13 files changed, 18 insertions(+), 33 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 03a674993ab50..5892d20e61e8c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -177,12 +177,6 @@ module.exports = { 'react-hooks/exhaustive-deps': 'off', }, }, - { - files: ['x-pack/legacy/plugins/monitoring/**/*.{js,ts,tsx}'], - rules: { - 'jsx-a11y/click-events-have-key-events': 'off', - }, - }, { files: ['x-pack/legacy/plugins/snapshot_restore/**/*.{js,ts,tsx}'], rules: { @@ -814,21 +808,6 @@ module.exports = { }, }, - /** - * Monitoring overrides - */ - { - files: ['x-pack/legacy/plugins/monitoring/**/*.js'], - rules: { - 'no-unused-vars': ['error', { args: 'all', argsIgnorePattern: '^_' }], - 'no-else-return': 'error', - }, - }, - { - files: ['x-pack/legacy/plugins/monitoring/public/**/*.js'], - env: { browser: true }, - }, - /** * Canvas overrides */ diff --git a/x-pack/legacy/plugins/monitoring/index.js b/x-pack/legacy/plugins/monitoring/index.js index 3d98b11c2045b..8e0201bea710b 100644 --- a/x-pack/legacy/plugins/monitoring/index.js +++ b/x-pack/legacy/plugins/monitoring/index.js @@ -22,7 +22,7 @@ export const monitoring = kibana => id: 'monitoring', configPrefix: 'xpack.monitoring', publicDir: resolve(__dirname, 'public'), - init(server, _options) { + init(server) { const configs = [ 'xpack.monitoring.ui.enabled', 'xpack.monitoring.kibana.collection.enabled', diff --git a/x-pack/legacy/plugins/monitoring/public/components/chart/chart_target.js b/x-pack/legacy/plugins/monitoring/public/components/chart/chart_target.js index c3ca241c73cc0..5c9cddf9c2902 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/chart/chart_target.js +++ b/x-pack/legacy/plugins/monitoring/public/components/chart/chart_target.js @@ -46,7 +46,7 @@ export class ChartTarget extends React.Component { return seriesToShow.some(id => id.toLowerCase() === metric.id.toLowerCase()); }; } - return _metric => true; + return () => true; } UNSAFE_componentWillReceiveProps(newProps) { diff --git a/x-pack/legacy/plugins/monitoring/public/components/chart/chart_target.test.js b/x-pack/legacy/plugins/monitoring/public/components/chart/chart_target.test.js index bf0d5fdd24879..56eb52fa86235 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/chart/chart_target.test.js +++ b/x-pack/legacy/plugins/monitoring/public/components/chart/chart_target.test.js @@ -38,8 +38,8 @@ const props = { max: 1562962539851, }, hasLegend: true, - onBrush: _ => void 0, - tickFormatter: _ => void 0, + onBrush: () => void 0, + tickFormatter: () => void 0, updateLegend: () => void 0, }; diff --git a/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/shard_allocation/components/assigned.js b/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/shard_allocation/components/assigned.js index 012bc81135e34..897c20edc3f74 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/shard_allocation/components/assigned.js +++ b/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/shard_allocation/components/assigned.js @@ -46,6 +46,8 @@ export class Assigned extends React.Component { // TODO: redesign for shard allocation, possibly giving shard display the // ability to use the euiLink CSS class (blue link text instead of white link text) + // Disabling eslint because EuiKeyboardAccessible does it for us + /* eslint-disable jsx-a11y/click-events-have-key-events */ const name = ( @@ -53,6 +55,7 @@ export class Assigned extends React.Component { ); + /* eslint-enable jsx-a11y/click-events-have-key-events */ const master = data.node_type === 'master' ? : null; const shards = sortBy(data.children, 'shard').map(this.createShard); diff --git a/x-pack/legacy/plugins/monitoring/public/components/logstash/pipeline_viewer/views/detail_drawer.js b/x-pack/legacy/plugins/monitoring/public/components/logstash/pipeline_viewer/views/detail_drawer.js index cd9fe5229b640..73faa81af7b55 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/logstash/pipeline_viewer/views/detail_drawer.js +++ b/x-pack/legacy/plugins/monitoring/public/components/logstash/pipeline_viewer/views/detail_drawer.js @@ -164,7 +164,7 @@ function renderPluginBasicStats(vertex, timeseriesTooltipXValueFormatter) { ); } -function renderIfBasicStats(_vertex) { +function renderIfBasicStats() { return (

{ + _api; // to fix eslint const $http = $injector.get('$http'); const globalState = $injector.get('globalState'); const timeBounds = timefilter.getBounds(); diff --git a/x-pack/legacy/plugins/monitoring/public/views/logstash/node/pipelines/index.js b/x-pack/legacy/plugins/monitoring/public/views/logstash/node/pipelines/index.js index bc5ac75931fce..7bfcddf8f283a 100644 --- a/x-pack/legacy/plugins/monitoring/public/views/logstash/node/pipelines/index.js +++ b/x-pack/legacy/plugins/monitoring/public/views/logstash/node/pipelines/index.js @@ -23,6 +23,7 @@ import { DetailStatus } from '../../../../components/logstash/detail_status'; import { CODE_PATH_LOGSTASH } from '../../../../../common/constants'; const getPageData = ($injector, _api = undefined, routeOptions = {}) => { + _api; // fixing eslint const $route = $injector.get('$route'); const $http = $injector.get('$http'); const globalState = $injector.get('globalState'); diff --git a/x-pack/legacy/plugins/monitoring/public/views/logstash/pipelines/index.js b/x-pack/legacy/plugins/monitoring/public/views/logstash/pipelines/index.js index ce49fc2fac97b..03cf7383d1d02 100644 --- a/x-pack/legacy/plugins/monitoring/public/views/logstash/pipelines/index.js +++ b/x-pack/legacy/plugins/monitoring/public/views/logstash/pipelines/index.js @@ -23,6 +23,7 @@ import { CODE_PATH_LOGSTASH } from '../../../../common/constants'; */ const getPageData = ($injector, _api = undefined, routeOptions = {}) => { + _api; // to fix eslint const $http = $injector.get('$http'); const globalState = $injector.get('globalState'); const Private = $injector.get('Private'); diff --git a/x-pack/legacy/plugins/monitoring/server/cloud/cloud_service.js b/x-pack/legacy/plugins/monitoring/server/cloud/cloud_service.js index dcc8ad8fc8b64..2a408f5295aef 100644 --- a/x-pack/legacy/plugins/monitoring/server/cloud/cloud_service.js +++ b/x-pack/legacy/plugins/monitoring/server/cloud/cloud_service.js @@ -48,7 +48,7 @@ export class CloudService { * @param {Object} _request 'request' HTTP handler. * @return {Promise} Never {@code null} {@code CloudServiceResponse}. */ - _checkIfService(_request) { + _checkIfService() { return Promise.reject(new Error('not implemented')); } diff --git a/x-pack/legacy/plugins/monitoring/server/lib/metrics/elasticsearch/classes.js b/x-pack/legacy/plugins/monitoring/server/lib/metrics/elasticsearch/classes.js index 755b89a0409d0..d3a43ed651827 100644 --- a/x-pack/legacy/plugins/monitoring/server/lib/metrics/elasticsearch/classes.js +++ b/x-pack/legacy/plugins/monitoring/server/lib/metrics/elasticsearch/classes.js @@ -116,7 +116,7 @@ export class LatencyMetric extends ElasticsearchMetric { }, }; - this.calculation = (bucket, _key, _metric, _bucketSizeInSeconds) => { + this.calculation = bucket => { const timeInMillisDeriv = _.get(bucket, 'event_time_in_millis_deriv.normalized_value', null); const totalEventsDeriv = _.get(bucket, 'event_total_deriv.normalized_value', null); diff --git a/x-pack/legacy/plugins/monitoring/server/lib/metrics/logstash/classes.js b/x-pack/legacy/plugins/monitoring/server/lib/metrics/logstash/classes.js index c76edf9061396..eddcfabe83b1b 100644 --- a/x-pack/legacy/plugins/monitoring/server/lib/metrics/logstash/classes.js +++ b/x-pack/legacy/plugins/monitoring/server/lib/metrics/logstash/classes.js @@ -90,7 +90,7 @@ export class LogstashEventsLatencyClusterMetric extends LogstashClusterMetric { }, }; - this.calculation = (bucket, _key, _metric, _bucketSizeInSeconds) => { + this.calculation = bucket => { const timeInMillisDeriv = _.get(bucket, 'events_time_in_millis_deriv.normalized_value', null); const totalEventsDeriv = _.get(bucket, 'events_total_deriv.normalized_value', null); @@ -189,7 +189,7 @@ export class LogstashEventsLatencyMetric extends LogstashMetric { }, }; - this.calculation = (bucket, _key, _metric, _bucketSizeInSeconds) => { + this.calculation = bucket => { const timeInMillisDeriv = _.get(bucket, 'events_time_in_millis_deriv.normalized_value', null); const totalEventsDeriv = _.get(bucket, 'events_total_deriv.normalized_value', null); From cca454f7aa11e894c0c12c3aca8d96c2bcb759a2 Mon Sep 17 00:00:00 2001 From: Maja Grubic Date: Tue, 7 Jan 2020 16:36:18 +0000 Subject: [PATCH 02/64] Changing background color to align with EUI color (#54060) * Changing background color to align with EUI color * Removing background-color from theme --- src/core/server/rendering/views/styles.tsx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/core/server/rendering/views/styles.tsx b/src/core/server/rendering/views/styles.tsx index f41627bcfe07f..dfcb4213d90f7 100644 --- a/src/core/server/rendering/views/styles.tsx +++ b/src/core/server/rendering/views/styles.tsx @@ -28,8 +28,6 @@ interface Props { } export const Styles: FunctionComponent = ({ darkMode }) => { - const themeBackground = darkMode ? '#25262e' : '#f5f7fa'; - return (