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

View File

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