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 2022/07/28 15:25:33 UTC

[GitHub] [superset] AAfghahi commented on a diff in pull request #20880: fix: Save dataset + chart when Chart source is Query

AAfghahi commented on code in PR #20880:
URL: https://github.com/apache/superset/pull/20880#discussion_r932385707


##########
superset/models/sql_lab.py:
##########
@@ -57,7 +57,6 @@
 if TYPE_CHECKING:
     from superset.db_engine_specs import BaseEngineSpec
 
-

Review Comment:
   add this back in?



##########
superset-frontend/src/explore/components/SaveModal.tsx:
##########
@@ -145,6 +166,44 @@ class SaveModal extends React.Component<SaveModalProps, SaveModalState> {
       dashboard_title: string;
     };
 
+    if (this.props.datasource?.type === DatasourceType.Query) {

Review Comment:
   Will this conditional be true for saved queries as well? Is it worth to change this to !== Table?



##########
superset-frontend/src/explore/components/SaveModal.tsx:
##########
@@ -71,8 +84,11 @@ class SaveModal extends React.Component<SaveModalProps, SaveModalState> {
     this.state = {
       saveToDashboardId: null,
       newSliceName: props.sliceName,
+      datasetName: props.datasource?.name,

Review Comment:
   It looks like this is where you want to set the default '' value? I am confused why you had the empty string in the interface



##########
superset-frontend/src/explore/components/SaveModal.tsx:
##########
@@ -55,14 +60,22 @@ type SaveModalState = {
   saveToDashboardId: number | string | null;
   newSliceName?: string;
   newDashboardName?: string;
+  datasetName: '';

Review Comment:
   shouldn't this be string?



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