From e1ff11db5a011b042b7020d40851bec0e7b47ec8 Mon Sep 17 00:00:00 2001
From: Simon Knox <psimyn@gmail.com>
Date: Wed, 26 Jun 2019 19:55:52 +1000
Subject: [PATCH] Fix charts on Cluster page

---
 app/assets/javascripts/monitoring/monitoring_bundle.js | 10 ++++++----
 changelogs/unreleased/dohtaset.yml                     |  5 +++++
 2 files changed, 11 insertions(+), 4 deletions(-)
 create mode 100644 changelogs/unreleased/dohtaset.yml

diff --git a/app/assets/javascripts/monitoring/monitoring_bundle.js b/app/assets/javascripts/monitoring/monitoring_bundle.js
index edbcf84b342..97d149e9ad5 100644
--- a/app/assets/javascripts/monitoring/monitoring_bundle.js
+++ b/app/assets/javascripts/monitoring/monitoring_bundle.js
@@ -8,10 +8,12 @@ export default (props = {}) => {
   const el = document.getElementById('prometheus-graphs');
 
   if (el && el.dataset) {
-    store.dispatch('monitoringDashboard/setFeatureFlags', {
-      prometheusEndpointEnabled: gon.features.environmentMetricsUsePrometheusEndpoint,
-      multipleDashboardsEnabled: gon.features.environmentMetricsShowMultipleDashboards,
-    });
+    if (gon.features) {
+      store.dispatch('monitoringDashboard/setFeatureFlags', {
+        prometheusEndpointEnabled: gon.features.environmentMetricsUsePrometheusEndpoint,
+        multipleDashboardsEnabled: gon.features.environmentMetricsShowMultipleDashboards,
+      });
+    }
 
     const [currentDashboard] = getParameterValues('dashboard');
 
diff --git a/changelogs/unreleased/dohtaset.yml b/changelogs/unreleased/dohtaset.yml
new file mode 100644
index 00000000000..5b917bd06d8
--- /dev/null
+++ b/changelogs/unreleased/dohtaset.yml
@@ -0,0 +1,5 @@
+---
+title: Fix charts on Cluster health page
+merge_request: 30073
+author:
+type: fixed
-- 
2.30.9