fix: don't show filter popover on explore view load (#8729)

* fix: don't show filter popover on explore view load

There's this confusing "feature" that I thought was a bug that shows the
metric popover opened when entering the explore view when the filter
comes from an active dashboard filter, based on the "fromFormData"
attribute of the filter.

The popover is confusing and often shows as misaligned with the actual
element it's supposed to float over when overflowing.

* warn

* fix cypress

* also shut off  metrics
This commit is contained in:
Maxime Beauchemin 2019-12-09 21:59:53 -08:00 committed by GitHub
parent 8b1022f66b
commit 9f16d053e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -168,7 +168,7 @@ describe('AdhocFilters', () => {
.trigger('mousedown')
.click();
});
cy.get('.adhoc-filter-option').click({ force: true });
cy.get('#filter-edit-popover').within(() => {
cy.get('[data-test=adhoc-filter-simple-value]').within(() => {
cy.get('div.select-input').click({ force: true });
@ -201,6 +201,7 @@ describe('AdhocFilters', () => {
.click();
});
cy.get('.adhoc-filter-option').click({ force: true });
cy.get('#filter-edit-popover').within(() => {
cy.get('#adhoc-filter-edit-tabs-tab-SQL').click();
cy.get('.ace_content').click();

View File

@ -45,7 +45,7 @@ export default class AdhocFilterOption extends React.PureComponent {
this.onPopoverResize = this.onPopoverResize.bind(this);
this.onOverlayEntered = this.onOverlayEntered.bind(this);
this.onOverlayExited = this.onOverlayExited.bind(this);
this.state = { overlayShown: !this.props.adhocFilter.fromFormData };
this.state = { overlayShown: false };
}
onPopoverResize() {
@ -90,7 +90,6 @@ export default class AdhocFilterOption extends React.PureComponent {
overlay={overlay}
rootClose
shouldUpdatePosition
defaultOverlayShown={!adhocFilter.fromFormData}
onEntered={this.onOverlayEntered}
onExited={this.onOverlayExited}
>

View File

@ -39,7 +39,7 @@ export default class AdhocMetricOption extends React.PureComponent {
this.onOverlayEntered = this.onOverlayEntered.bind(this);
this.onOverlayExited = this.onOverlayExited.bind(this);
this.onPopoverResize = this.onPopoverResize.bind(this);
this.state = { overlayShown: !this.props.adhocMetric.fromFormData };
this.state = { overlayShown: false };
}
onPopoverResize() {
@ -47,7 +47,7 @@ export default class AdhocMetricOption extends React.PureComponent {
}
onOverlayEntered() {
this.setState({ overlayShown: true });
this.setState({ overlayShown: false });
}
onOverlayExited() {