ktmud commented on a change in pull request #10284:
URL: 
https://github.com/apache/incubator-superset/pull/10284#discussion_r452995039



##########
File path: 
superset-frontend/src/explore/components/controls/DatasourceControl.jsx
##########
@@ -148,11 +160,11 @@ class DatasourceControl extends React.PureComponent {
                   {t('Explore in SQL Lab')}
                 </MenuItem>
               )}
-              {!!this.props.onDatasourceSave && (
+              {this.props.isEditable ? (

Review comment:
       Maybe. I think either is fine since Prettier doesn't complain. 

##########
File path: superset-frontend/src/explore/controls.jsx
##########
@@ -204,9 +204,9 @@ export const controls = {
     label: t('Datasource'),
     default: null,
     description: null,
-    mapStateToProps: (state, control, actions) => ({
-      datasource: state.datasource,
-      onDatasourceSave: actions ? actions.setDatasource : () => {},
+    mapStateToProps: ({ datasource }) => ({
+      datasource,
+      isEditable: !!datasource,

Review comment:
       Let's do that in a future refactor.




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



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

Reply via email to