From 15f95e8b8e32521dc841e1a00ce1195c09340e90 Mon Sep 17 00:00:00 2001 From: Chris Roberson Date: Wed, 30 Jan 2019 14:25:32 -0500 Subject: [PATCH] Fix issue where the date format isn't passed in properly (#29637) --- .../logstash/pipeline_listing/pipeline_listing.js | 10 +++++----- .../public/views/logstash/node/pipelines/index.js | 2 ++ .../public/views/logstash/pipelines/index.js | 2 ++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/x-pack/plugins/monitoring/public/components/logstash/pipeline_listing/pipeline_listing.js b/x-pack/plugins/monitoring/public/components/logstash/pipeline_listing/pipeline_listing.js index 99dc8afadaf1..73a78434e711 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/pipeline_listing/pipeline_listing.js +++ b/x-pack/plugins/monitoring/public/components/logstash/pipeline_listing/pipeline_listing.js @@ -16,8 +16,8 @@ import { injectI18n } from '@kbn/i18n/react'; import { i18n } from '@kbn/i18n'; class PipelineListingUI extends Component { - tooltipXValueFormatter(xValue) { - return moment(xValue).format(this.props.dateFormat); + tooltipXValueFormatter(xValue, dateFormat) { + return moment(xValue).format(dateFormat); } tooltipYValueFormatter(yValue, format, units) { @@ -25,7 +25,7 @@ class PipelineListingUI extends Component { } getColumns() { - const { onBrush } = this.props; + const { onBrush, dateFormat } = this.props; const { kbnUrl, scope } = this.props.angular; return [ @@ -66,7 +66,7 @@ class PipelineListingUI extends Component { series={throughput.data} onBrush={onBrush} tooltip={{ - xValueFormatter: value => this.tooltipXValueFormatter(value), + xValueFormatter: value => this.tooltipXValueFormatter(value, dateFormat), yValueFormatter: partialRight(this.tooltipYValueFormatter, throughput.metric.format, throughput.metric.units) }} options={{ xaxis: throughput.timeRange }} @@ -100,7 +100,7 @@ class PipelineListingUI extends Component { series={nodesCount.data} onBrush={onBrush} tooltip={{ - xValueFormatter: this.tooltipXValueFormatter, + xValueFormatter: value => this.tooltipXValueFormatter(value, dateFormat), yValueFormatter: partialRight(this.tooltipYValueFormatter, nodesCount.metric.format, nodesCount.metric.units) }} options={{ xaxis: nodesCount.timeRange }} diff --git a/x-pack/plugins/monitoring/public/views/logstash/node/pipelines/index.js b/x-pack/plugins/monitoring/public/views/logstash/node/pipelines/index.js index d4ee05177289..f3adea3ecb75 100644 --- a/x-pack/plugins/monitoring/public/views/logstash/node/pipelines/index.js +++ b/x-pack/plugins/monitoring/public/views/logstash/node/pipelines/index.js @@ -72,6 +72,7 @@ uiRoutes controller: class extends MonitoringViewBaseEuiTableController { constructor($injector, $scope, i18n) { const kbnUrl = $injector.get('kbnUrl'); + const config = $injector.get('config'); super({ defaultData: {}, @@ -103,6 +104,7 @@ uiRoutes sorting={this.sorting} pagination={this.pagination} onTableChange={this.onTableChange} + dateFormat={config.get('dateFormat')} upgradeMessage={makeUpgradeMessage(data.nodeSummary.version, i18n)} angular={{ kbnUrl, diff --git a/x-pack/plugins/monitoring/public/views/logstash/pipelines/index.js b/x-pack/plugins/monitoring/public/views/logstash/pipelines/index.js index 1e88cc678b90..d800e565ba50 100644 --- a/x-pack/plugins/monitoring/public/views/logstash/pipelines/index.js +++ b/x-pack/plugins/monitoring/public/views/logstash/pipelines/index.js @@ -78,6 +78,7 @@ uiRoutes const $route = $injector.get('$route'); const kbnUrl = $injector.get('kbnUrl'); + const config = $injector.get('config'); this.data = $route.current.locals.pageData; const globalState = $injector.get('globalState'); $scope.cluster = find($route.current.locals.clusters, { cluster_uuid: globalState.cluster_uuid }); @@ -110,6 +111,7 @@ uiRoutes pagination={this.pagination} onTableChange={this.onTableChange} upgradeMessage={upgradeMessage} + dateFormat={config.get('dateFormat')} angular={{ kbnUrl, scope: $scope,