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

fix(aio): fix SideNav height and auto-close when necessary #21538

Closed
wants to merge 2 commits into from

Conversation

gkalpak
Copy link
Member

@gkalpak gkalpak commented Jan 15, 2018

This PR addresses points 2 and 3 of #21520.

@gkalpak gkalpak added type: bug/fix action: review The PR is still awaiting reviews from at least one requested reviewer comp: aio target: patch This PR is targeted for the next patch release labels Jan 15, 2018
@gkalpak gkalpak added this to REVIEW in docs-infra Jan 15, 2018
@mary-poppins
Copy link

You can preview 1633bad at https://pr21538-1633bad.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 9d875f5 at https://pr21538-9d875f5.ngbuilds.io/.

navigateTo(doc);
expect(sidenav.opened).toBe(false);

resizeTo(sideBySideBreakPoint + 1);
Copy link
Member

Choose a reason for hiding this comment

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

In the beforeEach we resize to sideBySideBreakpoint + 1 so isn't this line a noop?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ooops! I meant resizeTo(sideBySideBreakPoint - 1) 😇

const sidenavDocs = ['api/a/b/c/d', 'guide/pipes'];
const nonSidenavDocs = ['features', 'about'];

beforeEach(() => resizeTo(sideBySideBreakPoint + 1)); // initially side-by-side
Copy link
Member

Choose a reason for hiding this comment

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

it would be easier to follow if this was moved into the actual it clauses

navigateTo('api/a/b/c/d');
expect(sidenav.opened).toBe(false);
});
it('should close when click in gray content area overlay', () => {
Copy link
Member

Choose a reason for hiding this comment

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

click -> clicking

navigateTo('features');
expect(sidenav.opened).toBe(false);
});
it('should close when nav to another guide page', () => {
Copy link
Member

Choose a reason for hiding this comment

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

nav -> navigating

locationService.go(path);
component.updateSideNav();
if (toggleSidenav) {
hamburger.click();
}
Copy link
Member

Choose a reason for hiding this comment

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

I think it would make the tests more readable if the toggle was in its own helper function.
Note that this could then be used in the other tests that are currently doing this the "long" way below.

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, the navigateTo() helper can already be used in these other tests as well, but I totally agree that making it more explicit (instead of a boolean arg in an unrelated helper 😁) is worth the extra fixture.detectChanges() 💯
Moved to a separate helper.

Copy link
Member

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

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

@petebacondarwin petebacondarwin added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jan 19, 2018
Since we specify `bottom: 0`, specifying the height is unnecessary and
leads to wrong height (unless updated) on narrow screens where the
topbar height is decreased.

Partly addresses angular#21520.
@gkalpak gkalpak added action: review The PR is still awaiting reviews from at least one requested reviewer and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Jan 22, 2018
@gkalpak
Copy link
Member Author

gkalpak commented Jan 22, 2018

Updated. PTAL

@mary-poppins
Copy link

You can preview 67054e1 at https://pr21538-67054e1.ngbuilds.io/.

@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this State. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

@mary-poppins
Copy link

You can preview 2d63760 at https://pr21538-2d63760.ngbuilds.io/.

@mary-poppins
Copy link

You can preview b5f6ef5 at https://pr21538-b5f6ef5.ngbuilds.io/.

@petebacondarwin petebacondarwin added action: merge The PR is ready for merge by the caretaker cla: yes and removed action: review The PR is still awaiting reviews from at least one requested reviewer cla: no labels Jan 26, 2018
@petebacondarwin
Copy link
Member

Not sure what happened with the CLA, @gkalpak ??

@gkalpak
Copy link
Member Author

gkalpak commented Jan 26, 2018

Sorry, about the CLA. We were trying something out with @jbogarthyde and @dennispbrown 😁

mhevery pushed a commit that referenced this pull request Jan 26, 2018
Since we specify `bottom: 0`, specifying the height is unnecessary and
leads to wrong height (unless updated) on narrow screens where the
topbar height is decreased.

Partly addresses #21520.

PR Close #21538
mhevery pushed a commit that referenced this pull request Jan 26, 2018
@mhevery mhevery closed this in 1b2271a Jan 26, 2018
mhevery pushed a commit that referenced this pull request Jan 26, 2018
@gkalpak gkalpak deleted the fix-aio-layout branch January 29, 2018 13:04
@gkalpak gkalpak removed this from REVIEW in docs-infra Jan 30, 2018
jbogarthyde pushed a commit to jbogarthyde/angular that referenced this pull request Feb 23, 2018
Since we specify `bottom: 0`, specifying the height is unnecessary and
leads to wrong height (unless updated) on narrow screens where the
topbar height is decreased.

Partly addresses angular#21520.

PR Close angular#21538
jbogarthyde pushed a commit to jbogarthyde/angular that referenced this pull request Feb 23, 2018
leo6104 pushed a commit to leo6104/angular that referenced this pull request Mar 25, 2018
Since we specify `bottom: 0`, specifying the height is unnecessary and
leads to wrong height (unless updated) on narrow screens where the
topbar height is decreased.

Partly addresses angular#21520.

PR Close angular#21538
leo6104 pushed a commit to leo6104/angular that referenced this pull request Mar 25, 2018
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes target: patch This PR is targeted for the next patch release type: bug/fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants