You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/09/29 18:53:56 UTC

[GitHub] [superset] gabester78 opened a new pull request #16907: Copied over changes from original branch 'gabe/SSL_Tooltip_update'

gabester78 opened a new pull request #16907:
URL: https://github.com/apache/superset/pull/16907


   <!---
   Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   Changed the SSL tooltip text to updated based on the database the user selects.
   https://trello.com/c/B4i4wtpq/29-update-ssl-tooltip-text
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   <img width="1440" alt="Screen Shot 2021-09-22 at 12 49 32 PM" src="https://user-images.githubusercontent.com/48218164/134405197-6674713b-1b5b-4f5b-83f5-e3b94b43187f.png">
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   - From Welcome screen navigate to Data > Databases
   - Click on "+ Database" button
   - Click on PostgreSQL or MySql icons or select Amazon Redshift from the supported databases dropdown menu
   - Hover over SLL Tooltip at the bottom of the form 
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [x] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] hughhhh commented on a change in pull request #16907: style: update text for SLL Tooltip Revised

Posted by GitBox <gi...@apache.org>.
hughhhh commented on a change in pull request #16907:
URL: https://github.com/apache/superset/pull/16907#discussion_r718849983



##########
File path: setup.cfg
##########
@@ -30,7 +30,7 @@ combine_as_imports = true
 include_trailing_comma = true
 line_length = 88
 known_first_party = superset
-known_third_party =alembic,apispec,backoff,bleach,cachelib,celery,click,colorama,cron_descriptor,croniter,cryptography,dateutil,deprecation,flask,flask_appbuilder,flask_babel,flask_caching,flask_compress,flask_jwt_extended,flask_login,flask_migrate,flask_sqlalchemy,flask_talisman,flask_testing,flask_wtf,freezegun,geohash,geopy,graphlib,holidays,humanize,isodate,jinja2,jwt,markdown,markupsafe,marshmallow,marshmallow_enum,msgpack,numpy,pandas,parameterized,parsedatetime,pgsanity,pkg_resources,polyline,prison,progress,pyarrow,pyhive,pyparsing,pytest,pytest_mock,pytz,redis,requests,selenium,setuptools,simplejson,slack,sqlalchemy,sqlalchemy_utils,sqlparse,typing_extensions,urllib3,werkzeug,wtforms,wtforms_json,yaml

Review comment:
       did you want to add `graphlib` here? 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] hughhhh commented on a change in pull request #16907: style: update text for SLL Tooltip Revised

Posted by GitBox <gi...@apache.org>.
hughhhh commented on a change in pull request #16907:
URL: https://github.com/apache/superset/pull/16907#discussion_r718849983



##########
File path: setup.cfg
##########
@@ -30,7 +30,7 @@ combine_as_imports = true
 include_trailing_comma = true
 line_length = 88
 known_first_party = superset
-known_third_party =alembic,apispec,backoff,bleach,cachelib,celery,click,colorama,cron_descriptor,croniter,cryptography,dateutil,deprecation,flask,flask_appbuilder,flask_babel,flask_caching,flask_compress,flask_jwt_extended,flask_login,flask_migrate,flask_sqlalchemy,flask_talisman,flask_testing,flask_wtf,freezegun,geohash,geopy,graphlib,holidays,humanize,isodate,jinja2,jwt,markdown,markupsafe,marshmallow,marshmallow_enum,msgpack,numpy,pandas,parameterized,parsedatetime,pgsanity,pkg_resources,polyline,prison,progress,pyarrow,pyhive,pyparsing,pytest,pytest_mock,pytz,redis,requests,selenium,setuptools,simplejson,slack,sqlalchemy,sqlalchemy_utils,sqlparse,typing_extensions,urllib3,werkzeug,wtforms,wtforms_json,yaml

Review comment:
       did you want to add `graphlib` here? 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] gabester78 commented on a change in pull request #16907: style: update text for SLL Tooltip Revised

Posted by GitBox <gi...@apache.org>.
gabester78 commented on a change in pull request #16907:
URL: https://github.com/apache/superset/pull/16907#discussion_r720524616



##########
File path: superset-frontend/src/views/CRUD/data/database/DatabaseModal/DatabaseConnectionForm.tsx
##########
@@ -480,30 +480,40 @@ const forceSSLField = ({
   changeMethods,
   db,
   sslForced,
-}: FieldPropTypes) => (
-  <div css={(theme: SupersetTheme) => infoTooltip(theme)}>
-    <Switch
-      disabled={sslForced && !isEditMode}
-      checked={db?.parameters?.encryption || sslForced}
-      onChange={changed => {
-        changeMethods.onParametersChange({
-          target: {
-            type: 'toggle',
-            name: 'encryption',
-            checked: true,
-            value: changed,
-          },
-        });
-      }}
-    />
-    <span css={toggleStyle}>SSL</span>
-    <InfoTooltip
-      tooltip={t('SSL Mode "require" will be used.')}
-      placement="right"
-      viewBox="0 -5 24 24"
-    />
-  </div>
-);
+}: FieldPropTypes) => {
+  const tooltipText = {
+    PostgreSQL:
+      'Requires a root certificate authority (public, local, or self-signed). SSL Mode "require" will be used.',
+    MySQL:
+      'Requires a root certificate authority (public, local, or self-signed).',
+    'Amazon Redshift':
+      'Requires a root certificate authority (public, local, or self-signed). SSL Mode "verify-ca" will be used.',
+  };
+  return (
+    <div css={(theme: SupersetTheme) => infoTooltip(theme)}>
+      <Switch
+        disabled={sslForced && !isEditMode}
+        checked={db?.parameters?.encryption || sslForced}
+        onChange={changed => {
+          changeMethods.onParametersChange({
+            target: {
+              type: 'toggle',
+              name: 'encryption',
+              checked: true,
+              value: changed,
+            },
+          });
+        }}
+      />
+      <span css={toggleStyle}>SSL</span>
+      <InfoTooltip
+        tooltip={t(tooltipText[db?.database_name!])}

Review comment:
       Yes, it was to solve an error. The code was working on localhost, but the error below wouldn't go away. The data isn't passed through to the tooltip until the user clicks on the card. Typescript assumed there was no data. 
   <img width="1440" alt="Screen Shot 2021-10-01 at 3 28 58 PM" src="https://user-images.githubusercontent.com/48218164/135682831-ce7ab86f-c978-46eb-88dc-216827c098a4.png">
    




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] geido commented on a change in pull request #16907: style: update text for SLL Tooltip Revised

Posted by GitBox <gi...@apache.org>.
geido commented on a change in pull request #16907:
URL: https://github.com/apache/superset/pull/16907#discussion_r719207044



##########
File path: superset-frontend/src/views/CRUD/data/database/DatabaseModal/DatabaseConnectionForm.tsx
##########
@@ -480,30 +480,40 @@ const forceSSLField = ({
   changeMethods,
   db,
   sslForced,
-}: FieldPropTypes) => (
-  <div css={(theme: SupersetTheme) => infoTooltip(theme)}>
-    <Switch
-      disabled={sslForced && !isEditMode}
-      checked={db?.parameters?.encryption || sslForced}
-      onChange={changed => {
-        changeMethods.onParametersChange({
-          target: {
-            type: 'toggle',
-            name: 'encryption',
-            checked: true,
-            value: changed,
-          },
-        });
-      }}
-    />
-    <span css={toggleStyle}>SSL</span>
-    <InfoTooltip
-      tooltip={t('SSL Mode "require" will be used.')}
-      placement="right"
-      viewBox="0 -5 24 24"
-    />
-  </div>
-);
+}: FieldPropTypes) => {
+  const tooltipText = {
+    PostgreSQL:
+      'Requires a root certificate authority (public, local, or self-signed). SSL Mode "require" will be used.',

Review comment:
       ```suggestion
         t('Requires a root certificate authority (public, local, or self-signed). SSL Mode "require" will be used.'),
   ```

##########
File path: superset-frontend/src/views/CRUD/data/database/DatabaseModal/DatabaseConnectionForm.tsx
##########
@@ -480,30 +480,40 @@ const forceSSLField = ({
   changeMethods,
   db,
   sslForced,
-}: FieldPropTypes) => (
-  <div css={(theme: SupersetTheme) => infoTooltip(theme)}>
-    <Switch
-      disabled={sslForced && !isEditMode}
-      checked={db?.parameters?.encryption || sslForced}
-      onChange={changed => {
-        changeMethods.onParametersChange({
-          target: {
-            type: 'toggle',
-            name: 'encryption',
-            checked: true,
-            value: changed,
-          },
-        });
-      }}
-    />
-    <span css={toggleStyle}>SSL</span>
-    <InfoTooltip
-      tooltip={t('SSL Mode "require" will be used.')}
-      placement="right"
-      viewBox="0 -5 24 24"
-    />
-  </div>
-);
+}: FieldPropTypes) => {
+  const tooltipText = {
+    PostgreSQL:
+      'Requires a root certificate authority (public, local, or self-signed). SSL Mode "require" will be used.',
+    MySQL:
+      'Requires a root certificate authority (public, local, or self-signed).',

Review comment:
       ```suggestion
         t('Requires a root certificate authority (public, local, or self-signed).'),
   ```

##########
File path: superset-frontend/src/views/CRUD/data/database/DatabaseModal/DatabaseConnectionForm.tsx
##########
@@ -480,30 +480,40 @@ const forceSSLField = ({
   changeMethods,
   db,
   sslForced,
-}: FieldPropTypes) => (
-  <div css={(theme: SupersetTheme) => infoTooltip(theme)}>
-    <Switch
-      disabled={sslForced && !isEditMode}
-      checked={db?.parameters?.encryption || sslForced}
-      onChange={changed => {
-        changeMethods.onParametersChange({
-          target: {
-            type: 'toggle',
-            name: 'encryption',
-            checked: true,
-            value: changed,
-          },
-        });
-      }}
-    />
-    <span css={toggleStyle}>SSL</span>
-    <InfoTooltip
-      tooltip={t('SSL Mode "require" will be used.')}
-      placement="right"
-      viewBox="0 -5 24 24"
-    />
-  </div>
-);
+}: FieldPropTypes) => {
+  const tooltipText = {
+    PostgreSQL:
+      'Requires a root certificate authority (public, local, or self-signed). SSL Mode "require" will be used.',
+    MySQL:
+      'Requires a root certificate authority (public, local, or self-signed).',
+    'Amazon Redshift':
+      'Requires a root certificate authority (public, local, or self-signed). SSL Mode "verify-ca" will be used.',

Review comment:
       ```suggestion
         t('Requires a root certificate authority (public, local, or self-signed). SSL Mode "verify-ca" will be used.'),
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] AAfghahi commented on a change in pull request #16907: style: update text for SLL Tooltip Revised

Posted by GitBox <gi...@apache.org>.
AAfghahi commented on a change in pull request #16907:
URL: https://github.com/apache/superset/pull/16907#discussion_r718887534



##########
File path: superset-frontend/src/views/CRUD/data/database/DatabaseModal/DatabaseConnectionForm.tsx
##########
@@ -480,30 +480,40 @@ const forceSSLField = ({
   changeMethods,
   db,
   sslForced,
-}: FieldPropTypes) => (
-  <div css={(theme: SupersetTheme) => infoTooltip(theme)}>
-    <Switch
-      disabled={sslForced && !isEditMode}
-      checked={db?.parameters?.encryption || sslForced}
-      onChange={changed => {
-        changeMethods.onParametersChange({
-          target: {
-            type: 'toggle',
-            name: 'encryption',
-            checked: true,
-            value: changed,
-          },
-        });
-      }}
-    />
-    <span css={toggleStyle}>SSL</span>
-    <InfoTooltip
-      tooltip={t('SSL Mode "require" will be used.')}
-      placement="right"
-      viewBox="0 -5 24 24"
-    />
-  </div>
-);
+}: FieldPropTypes) => {
+  const tooltipText = {
+    PostgreSQL:
+      'Requires a root certificate authority (public, local, or self-signed). SSL Mode "require" will be used.',
+    MySQL:
+      'Requires a root certificate authority (public, local, or self-signed).',
+    'Amazon Redshift':
+      'Requires a root certificate authority (public, local, or self-signed). SSL Mode "verify-ca" will be used.',
+  };
+  return (
+    <div css={(theme: SupersetTheme) => infoTooltip(theme)}>
+      <Switch
+        disabled={sslForced && !isEditMode}
+        checked={db?.parameters?.encryption || sslForced}
+        onChange={changed => {
+          changeMethods.onParametersChange({
+            target: {
+              type: 'toggle',
+              name: 'encryption',
+              checked: true,
+              value: changed,
+            },
+          });
+        }}
+      />
+      <span css={toggleStyle}>SSL</span>
+      <InfoTooltip
+        tooltip={t(tooltipText[db?.database_name!])}

Review comment:
       Hey! using the ! is not an encouraged action. Was this to solve a TypeScript error? Also, what happens if a database name isn't in toolTip text? Might be worth to have a || here or a default option. Let me know if you want help with either of those options. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] gabester78 commented on a change in pull request #16907: style: update text for SLL Tooltip Revised

Posted by GitBox <gi...@apache.org>.
gabester78 commented on a change in pull request #16907:
URL: https://github.com/apache/superset/pull/16907#discussion_r720522329



##########
File path: setup.cfg
##########
@@ -30,7 +30,7 @@ combine_as_imports = true
 include_trailing_comma = true
 line_length = 88
 known_first_party = superset
-known_third_party =alembic,apispec,backoff,bleach,cachelib,celery,click,colorama,cron_descriptor,croniter,cryptography,dateutil,deprecation,flask,flask_appbuilder,flask_babel,flask_caching,flask_compress,flask_jwt_extended,flask_login,flask_migrate,flask_sqlalchemy,flask_talisman,flask_testing,flask_wtf,freezegun,geohash,geopy,graphlib,holidays,humanize,isodate,jinja2,jwt,markdown,markupsafe,marshmallow,marshmallow_enum,msgpack,numpy,pandas,parameterized,parsedatetime,pgsanity,pkg_resources,polyline,prison,progress,pyarrow,pyhive,pyparsing,pytest,pytest_mock,pytz,redis,requests,selenium,setuptools,simplejson,slack,sqlalchemy,sqlalchemy_utils,sqlparse,typing_extensions,urllib3,werkzeug,wtforms,wtforms_json,yaml

Review comment:
       Yes, I was trying to. I couldn't find the right way to install it. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] gabester78 commented on pull request #16907: style: update text for SLL Tooltip Revised

Posted by GitBox <gi...@apache.org>.
gabester78 commented on pull request #16907:
URL: https://github.com/apache/superset/pull/16907#issuecomment-932534839


   Closing PR. The feature is being changed back to the same string for all databases the user may choose. [Trello Task](https://trello.com/c/B4i4wtpq/29-update-ssl-tooltip-text)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] gabester78 closed pull request #16907: style: update text for SLL Tooltip Revised

Posted by GitBox <gi...@apache.org>.
gabester78 closed pull request #16907:
URL: https://github.com/apache/superset/pull/16907


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] AAfghahi commented on a change in pull request #16907: style: update text for SLL Tooltip Revised

Posted by GitBox <gi...@apache.org>.
AAfghahi commented on a change in pull request #16907:
URL: https://github.com/apache/superset/pull/16907#discussion_r718887534



##########
File path: superset-frontend/src/views/CRUD/data/database/DatabaseModal/DatabaseConnectionForm.tsx
##########
@@ -480,30 +480,40 @@ const forceSSLField = ({
   changeMethods,
   db,
   sslForced,
-}: FieldPropTypes) => (
-  <div css={(theme: SupersetTheme) => infoTooltip(theme)}>
-    <Switch
-      disabled={sslForced && !isEditMode}
-      checked={db?.parameters?.encryption || sslForced}
-      onChange={changed => {
-        changeMethods.onParametersChange({
-          target: {
-            type: 'toggle',
-            name: 'encryption',
-            checked: true,
-            value: changed,
-          },
-        });
-      }}
-    />
-    <span css={toggleStyle}>SSL</span>
-    <InfoTooltip
-      tooltip={t('SSL Mode "require" will be used.')}
-      placement="right"
-      viewBox="0 -5 24 24"
-    />
-  </div>
-);
+}: FieldPropTypes) => {
+  const tooltipText = {
+    PostgreSQL:
+      'Requires a root certificate authority (public, local, or self-signed). SSL Mode "require" will be used.',
+    MySQL:
+      'Requires a root certificate authority (public, local, or self-signed).',
+    'Amazon Redshift':
+      'Requires a root certificate authority (public, local, or self-signed). SSL Mode "verify-ca" will be used.',
+  };
+  return (
+    <div css={(theme: SupersetTheme) => infoTooltip(theme)}>
+      <Switch
+        disabled={sslForced && !isEditMode}
+        checked={db?.parameters?.encryption || sslForced}
+        onChange={changed => {
+          changeMethods.onParametersChange({
+            target: {
+              type: 'toggle',
+              name: 'encryption',
+              checked: true,
+              value: changed,
+            },
+          });
+        }}
+      />
+      <span css={toggleStyle}>SSL</span>
+      <InfoTooltip
+        tooltip={t(tooltipText[db?.database_name!])}

Review comment:
       Hey! using the ! is not an encouraged action. Was this to solve a TypeScript error? Also, what happens if a database name isn't in toolTip text? Might be worth to have a || here or a default option. Let me know if you want help with either of those options. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org