From 1605b764c28d89466d83b5bc306c36da9ea4b355 Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Wed, 22 Mar 2023 10:51:40 +0100 Subject: [PATCH] Fix db connection test result, #1590 --- src/datasource/components/ConfigEditor.tsx | 12 ++++++------ src/datasource/zabbix/zabbix.ts | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/datasource/components/ConfigEditor.tsx b/src/datasource/components/ConfigEditor.tsx index a418e07c1..400b8b233 100644 --- a/src/datasource/components/ConfigEditor.tsx +++ b/src/datasource/components/ConfigEditor.tsx @@ -49,8 +49,8 @@ export const ConfigEditor = (props: Props) => { .then((ds) => { if (ds) { const selectedDs = getDirectDBDatasources().find((dsOption) => dsOption.id === ds.id); - setSelectedDBDatasource({ label: selectedDs.name, value: selectedDs.id }); - setCurrentDSType(selectedDs.type); + setSelectedDBDatasource({ label: selectedDs?.name, value: selectedDs?.id }); + setCurrentDSType(selectedDs?.type); onOptionsChange({ ...options, jsonData: { @@ -64,8 +64,8 @@ export const ConfigEditor = (props: Props) => { const selectedDs = getDirectDBDatasources().find( (dsOption) => dsOption.id === options.jsonData.dbConnectionDatasourceId ); - setSelectedDBDatasource({ label: selectedDs.name, value: selectedDs.id }); - setCurrentDSType(selectedDs.type); + setSelectedDBDatasource({ label: selectedDs?.name, value: selectedDs?.id }); + setCurrentDSType(selectedDs?.type); } } }, []); @@ -225,13 +225,13 @@ export const ConfigEditor = (props: Props) => {

Other