mirror of
https://github.com/apache/superset.git
synced 2024-09-16 02:29:39 -04:00
fix(explore): changing metric aggregate doesn't update label (#11946)
* fix: [chart]heatmap selecting metrics does not update the query results fixes issue #11866 title's label is overriding metric label. * Using custom label to decide label of metrics. * lint * Tests fixed * early metric label check while saving from ui * early custom label check * removed extra space * no state mutations * simplify * removed log * nned to fix linting issue * Lint fixed
This commit is contained in:
parent
c73904b02e
commit
8cc566792a
@ -100,10 +100,19 @@ export default class AdhocMetricEditPopover extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onSave() {
|
onSave() {
|
||||||
// unset isNew here in case save button was clicked when no changes were made
|
const { title } = this.props;
|
||||||
|
const { hasCustomLabel } = title;
|
||||||
|
let { label } = title;
|
||||||
|
const { adhocMetric } = this.state;
|
||||||
|
const metricLabel = adhocMetric.label;
|
||||||
|
if (!hasCustomLabel) {
|
||||||
|
label = metricLabel;
|
||||||
|
}
|
||||||
this.props.onChange({
|
this.props.onChange({
|
||||||
...this.state.adhocMetric,
|
...adhocMetric,
|
||||||
...this.props.title,
|
label,
|
||||||
|
hasCustomLabel,
|
||||||
|
// unset isNew here in case save button was clicked when no changes were made
|
||||||
isNew: false,
|
isNew: false,
|
||||||
});
|
});
|
||||||
this.props.onClose();
|
this.props.onClose();
|
||||||
|
Loading…
Reference in New Issue
Block a user