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/06/08 15:10:13 UTC

[GitHub] [superset] AAfghahi opened a new pull request #15041: centralized headers with conditional logic

AAfghahi opened a new pull request #15041:
URL: https://github.com/apache/superset/pull/15041


   ### SUMMARY
   Adding step markers and centralizing the headers. Before the headers were in two separate files, now they are in the main index.tsx component. 
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   ![Screen Shot 2021-06-08 at 11 07 51 AM](https://user-images.githubusercontent.com/48933336/121210830-001d7e00-c84a-11eb-8e3d-570a3a60134a.png)
   ![Screen Shot 2021-06-08 at 11 07 59 AM](https://user-images.githubusercontent.com/48933336/121210847-04499b80-c84a-11eb-9800-595bf7055c50.png)
   ![Screen Shot 2021-06-08 at 11 08 21 AM](https://user-images.githubusercontent.com/48933336/121210876-090e4f80-c84a-11eb-8902-efd2dd3271c8.png)
   
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] 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.

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 #15041: feat: Added Steps and centralized Headers

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



##########
File path: superset-frontend/src/views/CRUD/data/database/DatabaseModal/DatabaseConnectionForm.tsx
##########
@@ -127,17 +132,20 @@ const credentialsInfo = ({
             className="input-upload"
             type="file"
             onChange={async event => {
-              const file = event?.target?.files[0];
-              setFileToUpload(file.name);
+              let file;
+              if (event.target.files) {
+                file = event.target.files[0];
+              }

Review comment:
       yeah it is




-- 
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.

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 #15041: feat: Added Steps and centralized Headers

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



##########
File path: superset-frontend/src/views/CRUD/data/database/DatabaseModal/ModalHeader.tsx
##########
@@ -0,0 +1,108 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import React from 'react';
+import {
+  EditHeaderTitle,
+  EditHeaderSubtitle,
+  CreateHeaderTitle,
+  CreateHeaderSubtitle,
+  StyledFormHeader,
+} from './styles';
+import { DatabaseForm, DatabaseObject } from '../types';
+
+export const DOCUMENTATION_LINK =
+  'https://superset.apache.org/docs/databases/installing-database-drivers';
+
+const ModalHeader = ({
+  isLoading,
+  isEditMode,
+  useSqlAlchemyForm,
+  hasConnectedDb,
+  db,
+  dbName,
+  dbModel,
+}: {
+  isLoading: boolean;
+  isEditMode: boolean;
+  useSqlAlchemyForm: boolean;
+  hasConnectedDb: boolean;
+  db: Partial<DatabaseObject> | null;
+  dbName: string;
+  dbModel: DatabaseForm;
+}) => {
+  const isEditHeader = (
+    <>
+      <EditHeaderTitle>{db?.backend}</EditHeaderTitle>
+      <EditHeaderSubtitle>{dbName}</EditHeaderSubtitle>
+    </>
+  );
+  const useSqlAlchemyFormHeader = (
+    <>
+      <p className="helper"> Step 2 of 2 </p>
+      <CreateHeaderTitle>Enter Primary Credentials</CreateHeaderTitle>
+      <CreateHeaderSubtitle>
+        Need help? Learn how to connect your database{' '}
+        <a href={DOCUMENTATION_LINK} target="_blank" rel="noopener noreferrer">
+          here
+        </a>
+        .
+      </CreateHeaderSubtitle>
+    </>
+  );
+  const hasConnectedDbHeader = (
+    <StyledFormHeader>
+      <p className="helper"> Step 3 of 3 </p>

Review comment:
       Add additional informationn from spec
   https://www.figma.com/file/NbuTOMaUdv2GCBoDyihdLw/Database-Connection?node-id=1698%3A401419

##########
File path: superset-frontend/src/views/CRUD/data/database/DatabaseModal/DatabaseConnectionForm.tsx
##########
@@ -59,25 +63,26 @@ interface FieldPropTypes {
   db?: DatabaseObject;
   isEditMode?: boolean;
   sslForced?: boolean;
+  uploadOption?: string | null;
+  setUploadOption: (obj: any) => void;
+  fileToUpload?: string;
+  setFileToUpload: (obj: any) => void;

Review comment:
       Remove these

##########
File path: superset-frontend/src/views/CRUD/data/database/DatabaseModal/ModalHeader.tsx
##########
@@ -0,0 +1,108 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import React from 'react';
+import {
+  EditHeaderTitle,
+  EditHeaderSubtitle,
+  CreateHeaderTitle,
+  CreateHeaderSubtitle,
+  StyledFormHeader,
+} from './styles';
+import { DatabaseForm, DatabaseObject } from '../types';
+
+export const DOCUMENTATION_LINK =
+  'https://superset.apache.org/docs/databases/installing-database-drivers';
+
+const ModalHeader = ({
+  isLoading,
+  isEditMode,
+  useSqlAlchemyForm,
+  hasConnectedDb,
+  db,
+  dbName,
+  dbModel,
+}: {
+  isLoading: boolean;
+  isEditMode: boolean;
+  useSqlAlchemyForm: boolean;
+  hasConnectedDb: boolean;
+  db: Partial<DatabaseObject> | null;
+  dbName: string;
+  dbModel: DatabaseForm;
+}) => {
+  const isEditHeader = (
+    <>
+      <EditHeaderTitle>{db?.backend}</EditHeaderTitle>
+      <EditHeaderSubtitle>{dbName}</EditHeaderSubtitle>
+    </>
+  );
+  const useSqlAlchemyFormHeader = (
+    <>
+      <p className="helper"> Step 2 of 2 </p>
+      <CreateHeaderTitle>Enter Primary Credentials</CreateHeaderTitle>
+      <CreateHeaderSubtitle>
+        Need help? Learn how to connect your database{' '}
+        <a href={DOCUMENTATION_LINK} target="_blank" rel="noopener noreferrer">
+          here
+        </a>
+        .
+      </CreateHeaderSubtitle>
+    </>
+  );
+  const hasConnectedDbHeader = (
+    <StyledFormHeader>
+      <p className="helper"> Step 3 of 3 </p>
+    </StyledFormHeader>
+  );
+  const hasDbHeader = (
+    <StyledFormHeader>
+      <p className="helper"> Step 2 of 3 </p>
+      <h4>Enter the required {dbModel.name} credentials</h4>
+      <p className="helper">
+        Need help? Learn more about connecting to {dbModel.name}.
+      </p>
+    </StyledFormHeader>
+  );
+  const noDbHeader = (
+    <StyledFormHeader>
+      <div className="select-db">
+        <p className="helper"> Step 1 of 3 </p>
+        <h4>Select a database to connect</h4>
+      </div>
+    </StyledFormHeader>
+  );
+
+  if (isLoading) return <></>;

Review comment:
       nit: prefer a switch statement here

##########
File path: superset-frontend/src/views/CRUD/data/database/DatabaseModal/DatabaseConnectionForm.tsx
##########
@@ -127,17 +132,20 @@ const credentialsInfo = ({
             className="input-upload"
             type="file"
             onChange={async event => {
-              const file = event?.target?.files[0];
-              setFileToUpload(file.name);
+              let file;
+              if (event.target.files) {
+                file = event.target.files[0];
+              }

Review comment:
       Is this to stop typescript errors?




-- 
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.

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 merged pull request #15041: feat: Added Steps and centralized Headers

Posted by GitBox <gi...@apache.org>.
hughhhh merged pull request #15041:
URL: https://github.com/apache/superset/pull/15041


   


-- 
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.

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] codecov[bot] commented on pull request #15041: feat: Added Steps and centralized Headers

Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on pull request #15041:
URL: https://github.com/apache/superset/pull/15041#issuecomment-858204322


   # [Codecov](https://codecov.io/gh/apache/superset/pull/15041?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#15041](https://codecov.io/gh/apache/superset/pull/15041?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (9fb68e0) into [pexdax/db-connection-ui](https://codecov.io/gh/apache/superset/commit/4cf8a350d6cfa3c0c76e821cb2d3e175569328a4?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4cf8a35) will **increase** coverage by `0.15%`.
   > The diff coverage is `65.92%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/15041/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/superset/pull/15041?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@                     Coverage Diff                     @@
   ##           pexdax/db-connection-ui   #15041      +/-   ##
   ===========================================================
   + Coverage                    77.35%   77.51%   +0.15%     
   ===========================================================
     Files                          965      967       +2     
     Lines                        49436    49756     +320     
     Branches                      6247     6360     +113     
   ===========================================================
   + Hits                         38243    38567     +324     
   + Misses                       10992    10986       -6     
   - Partials                       201      203       +2     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `72.40% <64.64%> (-0.02%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/15041?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...rontend/src/SqlLab/components/QueryTable/index.jsx](https://codecov.io/gh/apache/superset/pull/15041/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1F1ZXJ5VGFibGUvaW5kZXguanN4) | `61.64% <0.00%> (-2.65%)` | :arrow_down: |
   | [...c/components/ErrorMessage/DatabaseErrorMessage.tsx](https://codecov.io/gh/apache/superset/pull/15041/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvRXJyb3JNZXNzYWdlL0RhdGFiYXNlRXJyb3JNZXNzYWdlLnRzeA==) | `94.73% <ø> (ø)` | |
   | [...onents/ErrorMessage/ErrorMessageWithStackTrace.tsx](https://codecov.io/gh/apache/superset/pull/15041/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvRXJyb3JNZXNzYWdlL0Vycm9yTWVzc2FnZVdpdGhTdGFja1RyYWNlLnRzeA==) | `77.77% <0.00%> (ø)` | |
   | [.../components/ErrorMessage/ParameterErrorMessage.tsx](https://codecov.io/gh/apache/superset/pull/15041/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvRXJyb3JNZXNzYWdlL1BhcmFtZXRlckVycm9yTWVzc2FnZS50c3g=) | `96.87% <ø> (ø)` | |
   | [...rset-frontend/src/components/ErrorMessage/types.ts](https://codecov.io/gh/apache/superset/pull/15041/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvRXJyb3JNZXNzYWdlL3R5cGVzLnRz) | `100.00% <ø> (ø)` | |
   | [...end/src/components/Form/LabeledErrorBoundInput.tsx](https://codecov.io/gh/apache/superset/pull/15041/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvRm9ybS9MYWJlbGVkRXJyb3JCb3VuZElucHV0LnRzeA==) | `100.00% <ø> (ø)` | |
   | [superset-frontend/src/dashboard/actions/hydrate.js](https://codecov.io/gh/apache/superset/pull/15041/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9hY3Rpb25zL2h5ZHJhdGUuanM=) | `1.72% <ø> (ø)` | |
   | [.../components/Header/HeaderActionsDropdown/index.jsx](https://codecov.io/gh/apache/superset/pull/15041/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0hlYWRlci9IZWFkZXJBY3Rpb25zRHJvcGRvd24vaW5kZXguanN4) | `68.42% <ø> (ø)` | |
   | [...rBar/CascadeFilters/CascadeFilterControl/index.tsx](https://codecov.io/gh/apache/superset/pull/15041/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQmFyL0Nhc2NhZGVGaWx0ZXJzL0Nhc2NhZGVGaWx0ZXJDb250cm9sL2luZGV4LnRzeA==) | `92.30% <ø> (ø)` | |
   | [...Filters/FilterBar/FilterControls/FilterControl.tsx](https://codecov.io/gh/apache/superset/pull/15041/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQmFyL0ZpbHRlckNvbnRyb2xzL0ZpbHRlckNvbnRyb2wudHN4) | `100.00% <ø> (ø)` | |
   | ... and [83 more](https://codecov.io/gh/apache/superset/pull/15041/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/15041?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/15041?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [a95e416...9fb68e0](https://codecov.io/gh/apache/superset/pull/15041?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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.

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