From b034e9ceaf032401efcd2fa7209fdbe1772e4249 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Louv-Jansen?= Date: Fri, 28 Dec 2018 12:21:09 +0100 Subject: [PATCH] Revert changes to Monitoring accidentally introduced in #27591 (#27830) --- .../public/directives/main/index.js | 48 +++++++++++-------- .../public/views/logstash/pipeline/index.js | 3 ++ 2 files changed, 31 insertions(+), 20 deletions(-) diff --git a/x-pack/plugins/monitoring/public/directives/main/index.js b/x-pack/plugins/monitoring/public/directives/main/index.js index 1d7bf72ac242..191ce9261b9c 100644 --- a/x-pack/plugins/monitoring/public/directives/main/index.js +++ b/x-pack/plugins/monitoring/public/directives/main/index.js @@ -82,27 +82,35 @@ uiModule.directive('monitoringMain', (breadcrumbs, license, kbnUrl, config) => { link(scope, _element, attributes, controller) { config.watch('k7design', (val) => scope.showPluginBreadcrumbs = !val); - controller.setup({ - licenseService: license, - breadcrumbsService: breadcrumbs, - kbnUrlService: kbnUrl, - attributes: { - name: attributes.name, - product: attributes.product, - instance: attributes.instance, - resolver: attributes.resolver, - page: attributes.page, - tabIconClass: attributes.tabIconClass, - tabIconLabel: attributes.tabIconLabel, - pipelineId: attributes.pipelineId, - pipelineHash: attributes.pipelineHash, - pipelineVersions: get(scope, 'pageData.versions') - }, - clusterName: get(scope, 'cluster.cluster_name') - }); + function getSetupObj() { + return { + licenseService: license, + breadcrumbsService: breadcrumbs, + kbnUrlService: kbnUrl, + attributes: { + name: attributes.name, + product: attributes.product, + instance: attributes.instance, + resolver: attributes.resolver, + page: attributes.page, + tabIconClass: attributes.tabIconClass, + tabIconLabel: attributes.tabIconLabel, + pipelineId: attributes.pipelineId, + pipelineHash: attributes.pipelineHash, + pipelineVersions: get(scope, 'pageData.versions') + }, + clusterName: get(scope, 'cluster.cluster_name') + }; + } - attributes.$observe('instance', instance => controller.instance = instance); - attributes.$observe('resolver', resolver => controller.resolver = resolver); + const setupObj = getSetupObj(); + controller.setup(setupObj); + Object.keys(setupObj.attributes).forEach(key => { + attributes.$observe(key, () => controller.setup(getSetupObj())); + }); + scope.$watch('pageData.versions', versions => { + controller.pipelineVersions = versions; + }); } }; }); diff --git a/x-pack/plugins/monitoring/public/views/logstash/pipeline/index.js b/x-pack/plugins/monitoring/public/views/logstash/pipeline/index.js index 2a1a59f48b9c..b6ada2684884 100644 --- a/x-pack/plugins/monitoring/public/views/logstash/pipeline/index.js +++ b/x-pack/plugins/monitoring/public/views/logstash/pipeline/index.js @@ -98,6 +98,9 @@ uiRoutes.when('/logstash/pipelines/:id/:hash?', { getPageData, reactNodeId: 'monitoringLogstashPipelineApp', $scope, + options: { + enableTimeFilter: false, + }, $injector });