From afdfc3679f2194ff8fe1e15fd8f0d0ab0282dbc9 Mon Sep 17 00:00:00 2001 From: Naumov Alexey Date: Wed, 29 Sep 2021 13:28:06 +0300 Subject: [PATCH] fix(core-connections): CB-1168 check ssh password for changes --- .../SSH/ConnectionSSHTabService.ts | 18 ++++++++++-------- .../PublicConnectionForm.tsx | 3 +-- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/webapp/packages/core-connections/src/ConnectionForm/SSH/ConnectionSSHTabService.ts b/webapp/packages/core-connections/src/ConnectionForm/SSH/ConnectionSSHTabService.ts index 3a6f22b2e3..732bf71b96 100644 --- a/webapp/packages/core-connections/src/ConnectionForm/SSH/ConnectionSSHTabService.ts +++ b/webapp/packages/core-connections/src/ConnectionForm/SSH/ConnectionSSHTabService.ts @@ -191,15 +191,17 @@ export class ConnectionSSHTabService extends Bootstrap { const port = Number(initialConfig?.properties?.port); const formPort = Number(handler.properties?.port); + const passwordChanged = ( + (((initialConfig?.password === null && handler.password !== null) || initialConfig?.password === '') && handler.password !== '') + || !!handler.password?.length + ); + if (handler.enabled !== initialConfig?.enabled - || handler.savePassword !== initialConfig?.savePassword - || handler.userName !== initialConfig?.userName - || ( - ((initialConfig?.password === null || initialConfig?.password === '') && handler.password !== '') - || (handler.password?.length || 0) > 0 - ) - || handler.properties?.host !== initialConfig?.properties?.host - || port !== formPort) { + || handler.savePassword !== initialConfig?.savePassword + || handler.userName !== initialConfig?.userName + || passwordChanged + || handler.properties?.host !== initialConfig?.properties?.host + || port !== formPort) { return true; } diff --git a/webapp/packages/plugin-connections/src/PublicConnectionForm/PublicConnectionForm.tsx b/webapp/packages/plugin-connections/src/PublicConnectionForm/PublicConnectionForm.tsx index b790540266..91c4a68aa1 100644 --- a/webapp/packages/plugin-connections/src/PublicConnectionForm/PublicConnectionForm.tsx +++ b/webapp/packages/plugin-connections/src/PublicConnectionForm/PublicConnectionForm.tsx @@ -8,8 +8,7 @@ import { observer } from 'mobx-react-lite'; import { useCallback } from 'react'; -import styled from 'reshadow'; -import { css } from 'reshadow'; +import styled, { css } from 'reshadow'; import { Loader } from '@cloudbeaver/core-blocks'; import { ConnectionForm } from '@cloudbeaver/core-connections';