Fix issue where the date format isn't passed in properly (#29637)

This commit is contained in:
Chris Roberson 2019-01-30 14:25:32 -05:00 committed by GitHub
parent 9595ef819d
commit 15f95e8b8e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 5 deletions

View file

@ -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 }}

View file

@ -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,

View file

@ -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,