未验证 提交 64b49778 编写于 作者: Y Yongjie Zhao 提交者: GitHub

fix(explore): adhoc metric label and control value not consistent (#12381)

* fix(explore): adhoc metric label and control value not consistent

* minor fix

* fix lint
上级 662b6496
......@@ -67,6 +67,7 @@ export default class AdhocMetricEditPopover extends React.Component {
constructor(props) {
super(props);
this.onSave = this.onSave.bind(this);
this.onRestStateAndClose = this.onRestStateAndClose.bind(this);
this.onColumnChange = this.onColumnChange.bind(this);
this.onAggregateChange = this.onAggregateChange.bind(this);
this.onSavedMetricChange = this.onSavedMetricChange.bind(this);
......@@ -117,6 +118,16 @@ export default class AdhocMetricEditPopover extends React.Component {
this.props.onClose();
}
onRestStateAndClose() {
this.setState(
{
adhocMetric: this.props.adhocMetric,
savedMetric: this.props.savedMetric,
},
this.props.onClose,
);
}
onColumnChange(columnId) {
const column = this.props.columns.find(column => column.id === columnId);
this.setState(prevState => ({
......@@ -390,7 +401,7 @@ export default class AdhocMetricEditPopover extends React.Component {
<div>
<Button
buttonSize="small"
onClick={this.props.onClose}
onClick={this.onRestStateAndClose}
data-test="AdhocMetricEdit#cancel"
cta
>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册