From 82a7ea32132ef4850d26dcaffedbbcf3862f0c61 Mon Sep 17 00:00:00 2001 From: Sasini_Sandamali Date: Mon, 24 Jun 2024 17:33:10 +0530 Subject: [PATCH] Fix review comments --- .../api/impl/util/GrafanaRequestHandlerUtil.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/api/impl/util/GrafanaRequestHandlerUtil.java b/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/api/impl/util/GrafanaRequestHandlerUtil.java index 6f9f9f066d..8c0c2df38c 100644 --- a/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/api/impl/util/GrafanaRequestHandlerUtil.java +++ b/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/api/impl/util/GrafanaRequestHandlerUtil.java @@ -129,14 +129,9 @@ public class GrafanaRequestHandlerUtil { log.error(errMsg); throw new RefererNotValid(errMsg); } - GrafanaConfiguration configuration; - try { - configuration = GrafanaConfigurationManager.getInstance().getGrafanaConfiguration(); - } catch (GrafanaManagementException e) { - String msg = "Error occurred while retrieving Grafana configuration"; - log.error(msg, e); - throw e; - } + + GrafanaConfiguration configuration = GrafanaConfigurationManager.getInstance().getGrafanaConfiguration(); + boolean dashboardIntegrationConfig = configuration.getValidationConfig().getDashboardIntegration(); GrafanaPanelIdentifier panelIdentifier = GrafanaUtil.getPanelIdentifierFromReferer(referer); if (!dashboardIntegrationConfig) {