mirror of
https://github.com/apache/superset.git
synced 2026-06-06 16:19:18 +00:00
[explore-v2] control panel fixes (#1529)
* make fieldset conditions more clear * make label required * use render* pattern * use slugify util for turning labels into ids * use field rather than html * don't need panel-title class here
This commit is contained in:
@@ -40,22 +40,25 @@ export default class FieldSet extends React.Component {
|
||||
|
||||
render() {
|
||||
const type = this.props.type;
|
||||
let html;
|
||||
const selectTypes = [
|
||||
'SelectField',
|
||||
'SelectCustomMultiField',
|
||||
'SelectMultipleSortableField',
|
||||
'FreeFormSelectField',
|
||||
];
|
||||
let field;
|
||||
|
||||
if (type === 'CheckboxField') {
|
||||
html = this.renderCheckBoxField();
|
||||
} else if (type === 'SelectField' ||
|
||||
type === 'SelectCustomMultiField' ||
|
||||
type === 'SelectMultipleSortableField' ||
|
||||
type === 'FreeFormSelectField') {
|
||||
html = this.renderSelectField();
|
||||
} else if (type === 'TextField' || type === 'IntegerField') {
|
||||
html = this.renderTextField();
|
||||
field = this.renderCheckBoxField();
|
||||
} else if (selectTypes.includes(type)) {
|
||||
field = this.renderSelectField();
|
||||
} else if (['TextField', 'IntegerField'].includes(type)) {
|
||||
field = this.renderTextField();
|
||||
} else if (type === 'TextAreaField') {
|
||||
this.renderTextAreaField();
|
||||
field = this.renderTextAreaField();
|
||||
}
|
||||
|
||||
return html;
|
||||
return field;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user