Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Explore][Adhoc Filters] Expanding the Adhoc Filter popover when the content expands #5032

Merged
merged 1 commit into from
May 21, 2018

Conversation

gabe-lyons
Copy link
Contributor

Previously to this PR, when adding/viewing a simple filter with number of comparators this could happen:

image

That doesn't look so great and also makes it quite annoying to make any changes because you are forced to manually expand the box to hit save. In this PR I have the popover expand in reaction when the input field expands.

autoexpanding

test plan:

  • ran the example shown in the above gif
  • ran the spec

reviewers:
@michellethomas @john-bodley @williaster @mistercrunch

@codecov-io
Copy link

codecov-io commented May 18, 2018

Codecov Report

Merging #5032 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #5032   +/-   ##
=======================================
  Coverage   77.35%   77.35%           
=======================================
  Files          44       44           
  Lines        8677     8677           
=======================================
  Hits         6712     6712           
  Misses       1965     1965

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ce0011e...d68c718. Read the comment docs.

@@ -78,6 +79,13 @@ export default class AdhocFilterEditPopover extends React.Component {
document.removeEventListener('mousemove', this.onMouseMove);
}

adjustHeight(heightDifference) {
this.setState(state => ({
...state,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need this? I thought you could just return the update to state.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I think this can be omitted.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good call fixing now

adjustHeight(heightDifference) {
this.setState(state => ({
...state,
height: state.height + heightDifference,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, is there a specific reason to add the height difference instead of just strictly setting the new height?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW the re-resizable library I'm using for the new dashboard passes a delta.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The big issue is that there are two things that can resize the popover ->

  1. the user dragging the box

  2. the input component expanding

tracking deltas just simplified dealing with both of those

@michellethomas
Copy link
Contributor

@GabeLoins a few questions but lgtm otherwise!

@@ -163,6 +188,12 @@ export default class AdhocFilterEditPopoverSimpleTabContent extends React.Compon
}
}

multiComparatorRef(ref) {
if (ref) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are there cases where you don't get a ref? that seems strange but mostly curious.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why but I've seen refs come in as undefined sometimes

Copy link
Contributor

@williaster williaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for fixing this!

lgtm after @michellethomas 's question about ...state

@williaster williaster merged commit a746fce into apache:master May 21, 2018
michellethomas pushed a commit to michellethomas/panoramix that referenced this pull request May 21, 2018
(cherry picked from commit a746fce)
michellethomas pushed a commit to michellethomas/panoramix that referenced this pull request May 24, 2018
timifasubaa pushed a commit to timifasubaa/incubator-superset that referenced this pull request May 31, 2018
wenchma pushed a commit to wenchma/incubator-superset that referenced this pull request Nov 16, 2018
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.26.0 labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.26.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants