fix: Remove button is broken for metrics on Explore (#22940)

This commit is contained in:
Michael S. Molina 2023-02-01 10:33:42 -05:00 committed by GitHub
parent eaf53dbb27
commit ebed50fd12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 6 deletions

View File

@ -121,7 +121,10 @@ class AdhocFilterControl extends React.Component {
sections={this.props.sections}
operators={this.props.operators}
datasource={this.props.datasource}
onRemoveFilter={() => this.onRemoveFilter(index)}
onRemoveFilter={e => {
e.stopPropagation();
this.onRemoveFilter(index);
}}
onMoveLabel={this.moveLabel}
onDropLabel={() => this.props.onChange(this.state.values)}
partitionColumn={this.state.partitionColumn}
@ -195,6 +198,7 @@ class AdhocFilterControl extends React.Component {
onRemoveFilter(index) {
const { confirmDeletion } = this.props;
const { values } = this.state;
const { removeFilter } = this;
if (confirmDeletion) {
const { confirmationText, confirmationTitle, triggerCondition } =
confirmDeletion;
@ -203,7 +207,7 @@ class AdhocFilterControl extends React.Component {
title: confirmationTitle,
content: confirmationText,
onOk() {
this.removeFilter(index);
removeFilter(index);
},
});
return;

View File

@ -308,10 +308,7 @@ export const OptionControlLabel = ({
<CloseContainer
role="button"
data-test="remove-control-button"
onClick={e => {
e.stopPropagation();
onRemove();
}}
onClick={onRemove}
>
<Icons.XSmall iconColor={theme.colors.grayscale.light1} />
</CloseContainer>