You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by aa...@apache.org on 2023/01/30 20:24:13 UTC

[superset] branch aafghahi/sc-65705/fix-is-assigned-a-value-but-never-used-warnings created (now 3ce4e8cfce)

This is an automated email from the ASF dual-hosted git repository.

aafghahi pushed a change to branch aafghahi/sc-65705/fix-is-assigned-a-value-but-never-used-warnings
in repository https://gitbox.apache.org/repos/asf/superset.git


      at 3ce4e8cfce fix warning in ssh tunnel

This branch includes the following new commits:

     new 3ce4e8cfce fix warning in ssh tunnel

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[superset] 01/01: fix warning in ssh tunnel

Posted by aa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aafghahi pushed a commit to branch aafghahi/sc-65705/fix-is-assigned-a-value-but-never-used-warnings
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 3ce4e8cfce614a22d874b03c26191d7bcb877c06
Author: AAfghahi <ar...@gmail.com>
AuthorDate: Mon Jan 30 15:23:54 2023 -0500

    fix warning in ssh tunnel
---
 .../views/CRUD/data/database/DatabaseModal/index.tsx    | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx
index a721f41cbf..4a8d9d3d00 100644
--- a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx
+++ b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx
@@ -89,6 +89,7 @@ import {
 } from './styles';
 import ModalHeader, { DOCUMENTATION_LINK } from './ModalHeader';
 import SSHTunnelForm from './SSHTunnelForm';
+import { omit } from 'lodash';
 
 const DEFAULT_EXTRA = JSON.stringify({ allows_virtual_table_explore: true });
 
@@ -374,21 +375,27 @@ export function dbReducer(
       };
     case ActionType.setSSHTunnelLoginMethod:
       if (action.payload.login_method === AuthType.privateKey) {
-        const { password, ...rest } = trimmedState?.ssh_tunnel ?? {};
+        const sshTunnel = trimmedState?.ssh_tunnel
+          ? omit(trimmedState?.ssh_tunnel, ['password'])
+          : {};
         return {
           ...trimmedState,
           ssh_tunnel: {
-            ...rest,
+            ...sshTunnel,
           },
         };
       }
       if (action.payload.login_method === AuthType.password) {
-        const { private_key, private_key_password, ...rest } =
-          trimmedState?.ssh_tunnel ?? {};
+        const sshTunnel = trimmedState?.ssh_tunnel
+          ? omit(trimmedState?.ssh_tunnel, [
+              'private_key',
+              'private_key_password',
+            ])
+          : {};
         return {
           ...trimmedState,
           ssh_tunnel: {
-            ...rest,
+            ...sshTunnel,
           },
         };
       }