add fix for extra comments for #11781 (#11902)

This commit is contained in:
Grace Guo 2020-12-02 18:13:42 -08:00 committed by GitHub
parent 721f9119e1
commit 61064b9634
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 6 deletions

View File

@ -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();
});

View File

@ -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}
/>
}

View File

@ -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}