From 304ee3cba8735e0fb5c2dd34c41a41a8202d7992 Mon Sep 17 00:00:00 2001 From: Konstantin Vasilev Date: Wed, 31 Aug 2022 13:00:42 +0300 Subject: [PATCH 01/37] CB-1551 fix(plugin-connections): Disable file button on SSH tab --- .../src/ConnectionForm/SSH/SSH.tsx | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/webapp/packages/plugin-connections/src/ConnectionForm/SSH/SSH.tsx b/webapp/packages/plugin-connections/src/ConnectionForm/SSH/SSH.tsx index b41e5e533f..2472e4f18b 100644 --- a/webapp/packages/plugin-connections/src/ConnectionForm/SSH/SSH.tsx +++ b/webapp/packages/plugin-connections/src/ConnectionForm/SSH/SSH.tsx @@ -73,8 +73,8 @@ export const SSH: TabContainerPanelComponent = observer(function SSH({ const styles = useStyles(SSH_STYLES, BASE_CONTAINERS_STYLES); const translate = useTranslate(); - const disabled = formDisabled || loading; const enabled = handlerState.enabled || false; + const disabled = formDisabled || loading || !enabled; const keyAuth = handlerState.authType === NetworkHandlerAuthType.PublicKey; const passwordFilled = (initialConfig?.password === null && handlerState.password !== '') || !!handlerState.password?.length; const testAvailable = keyAuth ? !!handlerState.key?.length : passwordFilled; @@ -122,7 +122,7 @@ export const SSH: TabContainerPanelComponent = observer(function SSH({ items={authTypes} keySelector={value => value.key} valueSelector={value => value.label} - disabled={disabled || readonly || !enabled} + disabled={disabled || readonly} tiny onSelect={authTypeChangeHandler} > @@ -133,7 +133,7 @@ export const SSH: TabContainerPanelComponent = observer(function SSH({ type="text" name="host" state={handlerState.properties} - disabled={disabled || !enabled} + disabled={disabled} readOnly={readonly} mod='surface' required @@ -145,7 +145,7 @@ export const SSH: TabContainerPanelComponent = observer(function SSH({ type="number" name="port" state={handlerState.properties} - disabled={disabled || !enabled} + disabled={disabled} readOnly={readonly} mod='surface' required @@ -159,7 +159,7 @@ export const SSH: TabContainerPanelComponent = observer(function SSH({ type="text" name="userName" state={handlerState} - disabled={disabled || !enabled} + disabled={disabled} readOnly={readonly} mod='surface' required={handlerState.savePassword} @@ -172,7 +172,7 @@ export const SSH: TabContainerPanelComponent = observer(function SSH({ name="password" autoComplete='new-password' state={handlerState} - disabled={disabled || !enabled} + disabled={disabled} readOnly={readonly} mod='surface' required={!keyAuth && handlerState.savePassword} @@ -186,7 +186,7 @@ export const SSH: TabContainerPanelComponent = observer(function SSH({