mirror of
https://github.com/apache/superset.git
synced 2026-04-22 17:45:21 +00:00
Allowing config flag to turn off javascript controls (#4400)
* Allowing config flag to turn off javascript controls * lint * one line, avoiding mutation * Setting JS fields as readOnly
This commit is contained in:
committed by
GitHub
parent
c3176579e0
commit
a373db24f0
@@ -14,6 +14,7 @@ const propTypes = {
|
||||
onClick: PropTypes.func,
|
||||
hovered: PropTypes.bool,
|
||||
tooltipOnClick: PropTypes.func,
|
||||
warning: PropTypes.string,
|
||||
};
|
||||
|
||||
const defaultProps = {
|
||||
@@ -75,6 +76,19 @@ export default class ControlHeader extends React.Component {
|
||||
{this.props.label}
|
||||
</span>
|
||||
{' '}
|
||||
{(this.props.warning) &&
|
||||
<span>
|
||||
<OverlayTrigger
|
||||
placement="top"
|
||||
overlay={
|
||||
<Tooltip id={'error-tooltip'}>{this.props.warning}</Tooltip>
|
||||
}
|
||||
>
|
||||
<i className="fa fa-exclamation-circle text-danger" />
|
||||
</OverlayTrigger>
|
||||
{' '}
|
||||
</span>
|
||||
}
|
||||
{(this.props.validationErrors.length > 0) &&
|
||||
<span>
|
||||
<OverlayTrigger
|
||||
|
||||
@@ -25,6 +25,7 @@ const propTypes = {
|
||||
offerEditInModal: PropTypes.bool,
|
||||
language: PropTypes.oneOf([null, 'json', 'html', 'sql', 'markdown', 'javascript']),
|
||||
aboveEditorSection: PropTypes.node,
|
||||
readOnly: PropTypes.bool,
|
||||
};
|
||||
|
||||
const defaultProps = {
|
||||
@@ -34,6 +35,7 @@ const defaultProps = {
|
||||
minLines: 3,
|
||||
maxLines: 10,
|
||||
offerEditInModal: true,
|
||||
readOnly: false,
|
||||
};
|
||||
|
||||
export default class TextAreaControl extends React.Component {
|
||||
@@ -57,6 +59,7 @@ export default class TextAreaControl extends React.Component {
|
||||
editorProps={{ $blockScrolling: true }}
|
||||
enableLiveAutocompletion
|
||||
value={this.props.value}
|
||||
readOnly={this.props.readOnly}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -67,6 +70,7 @@ export default class TextAreaControl extends React.Component {
|
||||
placeholder={t('textarea')}
|
||||
onChange={this.onControlChange.bind(this)}
|
||||
value={this.props.value}
|
||||
disabled={this.props.readOnly}
|
||||
style={{ height: this.props.height }}
|
||||
/>
|
||||
</FormGroup>);
|
||||
|
||||
Reference in New Issue
Block a user