Skip to content

Commit

Permalink
Fix db connection test result, #1590
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderzobnin committed Mar 22, 2023
1 parent 2470803 commit 1605b76
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/datasource/components/ConfigEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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);
}
}
}, []);
Expand Down Expand Up @@ -225,13 +225,13 @@ export const ConfigEditor = (props: Props) => {
<h3 className="page-heading">Other</h3>
<Switch
label="Disable acknowledges for read-only users"
labelClass="width-16"
labelClass="width-20"
checked={options.jsonData.disableReadOnlyUsersAck}
onChange={jsonDataSwitchHandler('disableReadOnlyUsersAck', options, onOptionsChange)}
/>
<Switch
label="Disable data alignment"
labelClass="width-16"
labelClass="width-20"
checked={!!options.jsonData.disableDataAlignment}
onChange={jsonDataSwitchHandler('disableDataAlignment', options, onOptionsChange)}
tooltip="Data alignment feature aligns points based on item update interval.
Expand Down
2 changes: 1 addition & 1 deletion src/datasource/zabbix/zabbix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export class Zabbix implements ZabbixConnector {
.then((testResult) => {
if (testResult) {
dbConnectorStatus = {
dsType: this.dbConnector.datasourceTypeName,
dsType: this.dbConnector.datasourceTypeName || this.dbConnector.datasourceTypeId,
dsName: this.dbConnector.datasourceName,
};
}
Expand Down

0 comments on commit 1605b76

Please sign in to comment.