mirror of https://github.com/apache/superset.git
parent
721f9119e1
commit
61064b9634
|
@ -152,9 +152,7 @@ describe('DatasourceEditor', () => {
|
|||
beforeAll(() => {
|
||||
isFeatureEnabledMock = jest
|
||||
.spyOn(featureFlags, 'isFeatureEnabled')
|
||||
.mockImplementation(
|
||||
feature => feature === 'ENABLE_DATASET_SOURCE_EDIT',
|
||||
);
|
||||
.mockImplementation(() => false);
|
||||
wrapper = shallow(el, { context: { store } }).dive();
|
||||
});
|
||||
|
||||
|
|
|
@ -715,8 +715,8 @@ class DatasourceEditor extends React.PureComponent {
|
|||
<TextAreaControl
|
||||
language="sql"
|
||||
offerEditInModal={false}
|
||||
minLines={25}
|
||||
maxLines={25}
|
||||
minLines={20}
|
||||
maxLines={20}
|
||||
readOnly={!this.state.isEditMode}
|
||||
/>
|
||||
}
|
||||
|
|
|
@ -78,10 +78,14 @@ export default class TextAreaControl extends React.Component {
|
|||
const value = this.props.value || '';
|
||||
const minLines = inModal ? 40 : this.props.minLines || 12;
|
||||
if (this.props.language) {
|
||||
const style = { border: '1px solid #CCC' };
|
||||
if (this.props.readOnly) {
|
||||
style.backgroundColor = '#f2f2f2';
|
||||
}
|
||||
return (
|
||||
<TextAreaEditor
|
||||
mode={this.props.language}
|
||||
style={{ border: '1px solid #CCC' }}
|
||||
style={style}
|
||||
minLines={minLines}
|
||||
maxLines={inModal ? 1000 : this.props.maxLines}
|
||||
onChange={this.onAceChangeDebounce}
|
||||
|
|
Loading…
Reference in New Issue