You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by gr...@apache.org on 2020/12/03 02:14:18 UTC

[incubator-superset] branch master updated: add fix for extra comments for #11781 (#11902)

This is an automated email from the ASF dual-hosted git repository.

graceguo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 61064b9  add fix for extra comments for #11781 (#11902)
61064b9 is described below

commit 61064b9634958461c4438e19a6ec69a081b01d4d
Author: Grace Guo <gr...@airbnb.com>
AuthorDate: Wed Dec 2 18:13:42 2020 -0800

    add fix for extra comments for #11781 (#11902)
---
 .../spec/javascripts/datasource/DatasourceEditor_spec.jsx           | 4 +---
 superset-frontend/src/datasource/DatasourceEditor.jsx               | 4 ++--
 .../src/explore/components/controls/TextAreaControl.jsx             | 6 +++++-
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/superset-frontend/spec/javascripts/datasource/DatasourceEditor_spec.jsx b/superset-frontend/spec/javascripts/datasource/DatasourceEditor_spec.jsx
index a6758fb..3caa82b 100644
--- a/superset-frontend/spec/javascripts/datasource/DatasourceEditor_spec.jsx
+++ b/superset-frontend/spec/javascripts/datasource/DatasourceEditor_spec.jsx
@@ -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();
     });
 
diff --git a/superset-frontend/src/datasource/DatasourceEditor.jsx b/superset-frontend/src/datasource/DatasourceEditor.jsx
index a03d2cc..e6b21d5 100644
--- a/superset-frontend/src/datasource/DatasourceEditor.jsx
+++ b/superset-frontend/src/datasource/DatasourceEditor.jsx
@@ -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}
                       />
                     }
diff --git a/superset-frontend/src/explore/components/controls/TextAreaControl.jsx b/superset-frontend/src/explore/components/controls/TextAreaControl.jsx
index b1bb5d3..0bcf2d1 100644
--- a/superset-frontend/src/explore/components/controls/TextAreaControl.jsx
+++ b/superset-frontend/src/explore/components/controls/TextAreaControl.jsx
@@ -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}