Skip to content

Commit

Permalink
Also fix apache#11394
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Oct 23, 2020
1 parent 4f5cd4f commit 9a0c46a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import { Tab, Tabs } from 'react-bootstrap';
import Button from 'src/components/Button';
import { t } from '@superset-ui/core';

import columnType from '../propTypes/columnType';
import adhocMetricType from '../propTypes/adhocMetricType';
Expand Down Expand Up @@ -178,21 +179,22 @@ export default class AdhocFilterEditPopover extends React.Component {
</Tab>
</Tabs>
<div>
<Button buttonSize="small" onClick={this.props.onClose} cta>
{t('Close')}
</Button>
<Button
data-test="adhoc-filter-edit-popover-save-button"
disabled={!stateIsValid}
buttonStyle={
hasUnsavedChanges && stateIsValid ? 'primary' : 'default'
}
buttonSize="small"
buttonStyle="primary"
className="m-r-5"
onClick={this.onSave}
cta
>
Save
</Button>
<Button buttonSize="small" onClick={this.props.onClose} cta>
Close
{t('Save')}
</Button>
<i
role="button"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class AdhocFilterOption extends React.PureComponent {
this.onOverlayEntered = this.onOverlayEntered.bind(this);
this.onOverlayExited = this.onOverlayExited.bind(this);
this.handleVisibleChange = this.handleVisibleChange.bind(this);
this.state = { overlayShown: false };
this.state = { overlayShown: props.adhocFilter.isNew };
}

onPopoverResize() {
Expand All @@ -60,7 +60,6 @@ class AdhocFilterOption extends React.PureComponent {
// isNew is used to indicate whether to automatically open the overlay
// once the overlay has been opened, the metric/filter will never be
// considered new again.
this.props.adhocFilter.isNew = false;
this.setState({ overlayShown: true });
}

Expand Down Expand Up @@ -111,7 +110,6 @@ class AdhocFilterOption extends React.PureComponent {
trigger="click"
disabled
content={content}
defaultVisible={adhocFilter.isNew}
visible={this.state.overlayShown}
onVisibleChange={this.handleVisibleChange}
>
Expand Down

0 comments on commit 9a0c46a

Please sign in to comment.