From 8e3a5f476a3f6a8bd11344affac3b3a5f344d918 Mon Sep 17 00:00:00 2001 From: Martin Hradil Date: Wed, 6 Mar 2019 10:59:15 +0000 Subject: [PATCH] Container trends chart - wait for loadingDone before displaying pf-trends-chart MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit prevents TypeError: Cannot read property 'layout' of undefined at trendsChartController.e.updateAll (application-d966831b…581bed47155710.js:3) at trendsChartController.e.$onChanges (application-d966831b…581bed47155710.js:3) when the JSON endpoints are taking longer to respond. The controller already has a concept of loadingDone, used to display a spinner. But it was never used to prevent rendering of the pf-trends-chart component, which fails when config is undefined. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1684226 --- app/views/ems_container/_trends-chart.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/ems_container/_trends-chart.html.haml b/app/views/ems_container/_trends-chart.html.haml index 883b9f8f3dd..6e70071b28e 100644 --- a/app/views/ems_container/_trends-chart.html.haml +++ b/app/views/ems_container/_trends-chart.html.haml @@ -5,4 +5,4 @@ {{vm.config.headTitle}} .card-pf-body .spinner.spinner-lg.loading{"ng-if" => "!vm.loadingDone"} - %pf-trends-chart{'ng-if' => "vm.dataAvailable !== false", 'config' => "vm.config", 'chart-data' => "vm.data", 'show-x-axis' => "vm.custShowXAxis", 'show-y-axis' => "vm.custShowYAxis"} + %pf-trends-chart{'ng-if' => "vm.loadingDone && vm.dataAvailable !== false", 'config' => "vm.config", 'chart-data' => "vm.data", 'show-x-axis' => "vm.custShowXAxis", 'show-y-axis' => "vm.custShowYAxis"}