From 99f34548dbf5d5f67a4194a770b889d5b9159ba5 Mon Sep 17 00:00:00 2001 From: Wroud Date: Mon, 31 Jan 2022 17:14:25 +0300 Subject: [PATCH] fix(plugin-connection): CB-1586 options defaults --- .../src/ConnectionForm/Options/useOptions.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/webapp/packages/plugin-connections/src/ConnectionForm/Options/useOptions.ts b/webapp/packages/plugin-connections/src/ConnectionForm/Options/useOptions.ts index a731fa1f5c..b7f11f3995 100644 --- a/webapp/packages/plugin-connections/src/ConnectionForm/Options/useOptions.ts +++ b/webapp/packages/plugin-connections/src/ConnectionForm/Options/useOptions.ts @@ -67,6 +67,10 @@ export function useOptions(state: IConnectionFormState) { }, } = refObject; + if (info) { + return; + } + if (!prevDriver || config.host === prevDriver.defaultServer) { config.host = driver?.defaultServer || 'localhost'; } @@ -85,7 +89,7 @@ export function useOptions(state: IConnectionFormState) { this.updateNameTemplate(driver); - if (driver?.id !== prevDriver?.id && !info) { + if (driver?.id !== prevDriver?.id) { for (const property of Object.keys(config.credentials)) { delete config.credentials[property]; } @@ -96,6 +100,7 @@ export function useOptions(state: IConnectionFormState) { config.authModelId = driver?.defaultAuthModel; } + }, setAuthModel(model: DatabaseAuthModel) { // const {