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