From 26a4ef167d2b9085e32c32f1e3c6671221f9eaac Mon Sep 17 00:00:00 2001 From: David Cui Date: Wed, 27 Oct 2021 16:30:56 -0700 Subject: [PATCH 1/2] add catch statements to notifications get_configs to avoid crashing details pages Signed-off by: David Cui --- .../report_definition_details/report_definition_details.tsx | 3 +++ .../public/components/main/report_details/report_details.tsx | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/dashboards-reports/public/components/main/report_definition_details/report_definition_details.tsx b/dashboards-reports/public/components/main/report_definition_details/report_definition_details.tsx index 35875e47..3498e197 100644 --- a/dashboards-reports/public/components/main/report_definition_details/report_definition_details.tsx +++ b/dashboards-reports/public/components/main/report_definition_details/report_definition_details.tsx @@ -497,6 +497,9 @@ export function ReportDefinitionDetails(props: { match?: any; setBreadcrumbs?: a setChannels(availableChannels); return availableChannels; }) + .catch((error: any) => { + console.log('error when retrieving notification configs:', error); + }) .then((availableChannels: any) => { httpClient .get(`../api/reporting/reportDefinitions/${reportDefinitionId}`) diff --git a/dashboards-reports/public/components/main/report_details/report_details.tsx b/dashboards-reports/public/components/main/report_details/report_details.tsx index 3fc01585..19e02922 100644 --- a/dashboards-reports/public/components/main/report_details/report_details.tsx +++ b/dashboards-reports/public/components/main/report_details/report_details.tsx @@ -292,9 +292,13 @@ export function ReportDetails(props: { match?: any; setBreadcrumbs?: any; httpCl query: getChannelsQueryObject }) .then(async (response: any) => { + console.log('notification get configs is', response); let availableChannels = getAvailableNotificationsChannels(response.config_list); return availableChannels; }) + .catch((error: any) => { + console.log('error when retrieving notification configs:', error); + }) .then((availableChannels: any) => { httpClient .get('../api/reporting/reports/' + reportId) From b344e97b75a47546e463191bac0b1b00f1f11d90 Mon Sep 17 00:00:00 2001 From: David Cui Date: Wed, 27 Oct 2021 16:33:13 -0700 Subject: [PATCH 2/2] remove console log statment Signed-off by: David Cui --- .../public/components/main/report_details/report_details.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/dashboards-reports/public/components/main/report_details/report_details.tsx b/dashboards-reports/public/components/main/report_details/report_details.tsx index 19e02922..fe8551b7 100644 --- a/dashboards-reports/public/components/main/report_details/report_details.tsx +++ b/dashboards-reports/public/components/main/report_details/report_details.tsx @@ -292,7 +292,6 @@ export function ReportDetails(props: { match?: any; setBreadcrumbs?: any; httpCl query: getChannelsQueryObject }) .then(async (response: any) => { - console.log('notification get configs is', response); let availableChannels = getAvailableNotificationsChannels(response.config_list); return availableChannels; })