fisjac commented on code in PR #25106:
URL: https://github.com/apache/superset/pull/25106#discussion_r1316397497


##########
superset-frontend/src/SqlLab/components/SaveQuery/index.tsx:
##########
@@ -98,6 +98,8 @@ const SaveQuery = ({
   const [showSaveDatasetModal, setShowSaveDatasetModal] = useState(false);
   const isSaved = !!query.remoteId;
   const canExploreDatabase = !!database?.allows_virtual_table_explore;
+  const canShowSaveButton =
+    database?.allows_virtual_table_explore !== undefined;

Review Comment:
   database should always be set since the parent component <SqlEditor/> 
returns an <EmptyStateBig/> component if database is not defined.
   The allows_virtual_table_explore property is added to the store when 
dispatch(getDatabases) action is called inside of the <SqlEditorLeftTab/>, and 
then the <SaveQuery/> component gets rerendered with 
databases.allows_virtual_table_explore as a boolean.
   
   While the getDatabases action is awaiting a response 
databases.allows_virtual_table_explore will be undefined, and  
canShowSaveButton prevents the save button from being rendered. Once the 
additional databases data has been added to the redux store, the save button 
will either render a split button, or the original button based upon the value 
canExploreDatabase.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to