mirror of
https://github.com/apache/superset.git
synced 2026-04-20 00:24:38 +00:00
[table editor] hide Edit Datasource option when no onDatasourceSave (#9706)
* [table editor] hide Edit Datasource option when no onDatasourceSave * add !! operator to get truthiness
This commit is contained in:
@@ -48,7 +48,7 @@ const propTypes = {
|
||||
|
||||
const defaultProps = {
|
||||
onChange: () => {},
|
||||
onDatasourceSave: () => {},
|
||||
onDatasourceSave: null,
|
||||
value: null,
|
||||
};
|
||||
|
||||
@@ -150,9 +150,11 @@ class DatasourceControl extends React.PureComponent {
|
||||
{t('Explore in SQL Lab')}
|
||||
</MenuItem>
|
||||
)}
|
||||
<MenuItem eventKey="3" onClick={this.toggleEditDatasourceModal}>
|
||||
{t('Edit Datasource')}
|
||||
</MenuItem>
|
||||
{!!this.props.onDatasourceSave && (
|
||||
<MenuItem eventKey="3" onClick={this.toggleEditDatasourceModal}>
|
||||
{t('Edit Datasource')}
|
||||
</MenuItem>
|
||||
)}
|
||||
</DropdownButton>
|
||||
</TooltipWrapper>
|
||||
<OverlayTrigger
|
||||
|
||||
Reference in New Issue
Block a user