-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
UI: Fixes healthy node listing resize on large portrait screens #4564
Conversation
1. Split the resizing functionality of into a separate mixin to be shared across components 2. Add basic integration tests to prove that everything is getting called through out the lifetime of the app. I decided against unit testing as there isn't really any isolated logic to be tested, more checking that things are being called in the correct order etc i.e. the integration is correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I had one question and one suggestion.
const rect = $self.getBoundingClientRect(); | ||
const $footer = [...$$('footer[role="contentinfo"]')][0]; | ||
const space = rect.top + $footer.clientHeight; | ||
const height = new Number(e.detail.height - space); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use the Number constructor here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question! Removed
get(this, 'win').removeEventListener('resize', this.handler); | ||
this._super(...arguments); | ||
}, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice mixin. One suggestion I have is to put emphasis on resize in some manner to make it obvious that that is the interesting part for a consumer of this mixin. This could be as simple as moving resize
to the first thing in the file so it's hard to overlook, or something more aggressive like this, which throws an error if a component/controller/whatever is mixing in the mixin without overriding the expected method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
innerWidth: 0, | ||
innerHeight: 0, | ||
addEventListener: this.stub(), | ||
removeEventListener: this.stub(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat. I need to look into ember-sinon-qunit
. I'm just using plain sinon
right now, but I love spies.
Fixes #4368
Split the resizing functionality of into a separate mixin to be shared across components