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

UI: Fixes healthy node listing resize on large portrait screens #4564

Merged
merged 3 commits into from
Aug 24, 2018

Conversation

johncowen
Copy link
Contributor

Fixes #4368

Split the resizing functionality of into a separate mixin to be shared across components

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.
@johncowen johncowen added the theme/ui Anything related to the UI label Aug 23, 2018
@johncowen johncowen requested a review from a team August 23, 2018 17:02
Copy link

@DingoEatingFuzz DingoEatingFuzz left a 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);

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?

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 question! Removed

get(this, 'win').removeEventListener('resize', this.handler);
this._super(...arguments);
},
});

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.

Copy link
Contributor Author

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(),

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.

@johncowen johncowen merged commit 4ebd70e into master Aug 24, 2018
@johncowen johncowen deleted the bugfix/gh-4368-tall-nodes branch August 24, 2018 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/ui Anything related to the UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants