mirror of
https://github.com/apache/superset.git
synced 2026-04-21 00:54:44 +00:00
feat: reset metrics on dataset change (#12782)
* reset metrics on dataset change take one * remove code * part 2 or reseting adhoc controls * update input controls and customize defaults * remove conosles * remove extra method * simplify logic for controls reset and have them use their defaults * remove consoles * add annotation control to defaultvalues * remove line
This commit is contained in:
committed by
GitHub
parent
ac3e16d0ac
commit
3bb14ab950
@@ -82,7 +82,10 @@ const defaultProps = {
|
||||
export default class SelectControl extends React.PureComponent {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = { options: this.getOptions(props) };
|
||||
this.state = {
|
||||
options: this.getOptions(props),
|
||||
value: this.props.value,
|
||||
};
|
||||
this.onChange = this.onChange.bind(this);
|
||||
this.createMetaSelectAllOption = this.createMetaSelectAllOption.bind(this);
|
||||
this.select = null; // pointer to the react-select instance
|
||||
@@ -240,7 +243,12 @@ export default class SelectControl extends React.PureComponent {
|
||||
const isMulti = this.props.isMulti || this.props.multi;
|
||||
|
||||
let assistiveText;
|
||||
if (isMulti && optionsRemaining && Array.isArray(value) && !!value.length) {
|
||||
if (
|
||||
isMulti &&
|
||||
optionsRemaining &&
|
||||
Array.isArray(this.state.value) &&
|
||||
!!value.length
|
||||
) {
|
||||
assistiveText = optionRemaingText;
|
||||
}
|
||||
|
||||
@@ -262,12 +270,12 @@ export default class SelectControl extends React.PureComponent {
|
||||
onChange: this.onChange,
|
||||
onFocus,
|
||||
optionRenderer,
|
||||
value,
|
||||
options: this.state.options,
|
||||
placeholder,
|
||||
assistiveText,
|
||||
promptTextCreator,
|
||||
selectRef: this.getSelectRef,
|
||||
value,
|
||||
valueKey,
|
||||
valueRenderer,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user