Skip to content

fix(aio): do not nav to an image url - #16612

Merged
petebacondarwin merged 1 commit into
angular:masterfrom
IdeaBlade:aio-no-nav-to-image-click
May 9, 2017
Merged

petebacondarwin merged 1 commit into
angular:masterfrom
IdeaBlade:aio-no-nav-to-image-click

Conversation

@wardbell

@wardbell wardbell commented May 6, 2017 •

Copy link
Copy Markdown
Contributor

closes #16608
Formerly, tried to navigate when user clicked an anchor with an image url (to view image in a new tab) resulting in 404.
Now ignores href URL with any extension and lets browser handle it.
Affects LocationService whose tests have also been refactored for clarity.

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x")

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:

@wardbell wardbell added comp: aio action: review The PR is still awaiting reviews from at least one requested reviewer labels May 6, 2017
@wardbell wardbell self-assigned this May 6, 2017
@wardbell wardbell changed the title feat(aio): do not nav to an image url fix(aio): do not nav to an image url May 6, 2017
@wardbell
wardbell force-pushed the aio-no-nav-to-image-click branch from 388191a to 21d2f92 Compare May 6, 2017 19:43
@wardbell
wardbell force-pushed the aio-no-nav-to-image-click branch from 21d2f92 to b43f4de Compare May 7, 2017 18:20
@wardbell

wardbell commented May 7, 2017

Copy link
Copy Markdown
Contributor Author

Subsequent to @petebacondarwin approval, after discussion, the rule changed from "ignore any extension except .html" to "ignore any extension". Updated initial comment accordingly.

@wardbell wardbell added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels May 7, 2017
Comment thread aio/src/app/app.component.ts Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The instanceof HTMLAnchorElement part is redundant. Rings any bells? 😛

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not this time @gkalpak. Notice that I moved from target as HTMLAnchorElement in next line to here, if (target instanceof HTMLAnchorElement). TS insists on one or the other (you don't need both). Because I was messing with target inside the if for a while, moving it up was helpful. Now it doesn't matter but I left it there for posterity.

Comment thread aio/src/app/shared/location.service.ts Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

with`go()` --> with `go()` (missing whitespace)

@mhevery

mhevery commented May 8, 2017

Copy link
Copy Markdown
Contributor

@wardbell the CI is red. can you have a look?

@petebacondarwin

Copy link
Copy Markdown
Contributor

@wardbell linting issues

@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: merge The PR is ready for merge by the caretaker labels May 8, 2017
@wardbell
wardbell force-pushed the aio-no-nav-to-image-click branch from b43f4de to ed3b4bb Compare May 9, 2017 00:23
@wardbell

wardbell commented May 9, 2017

Copy link
Copy Markdown
Contributor Author

Yup. Fixed and re-running CI

@wardbell wardbell added action: merge The PR is ready for merge by the caretaker 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 May 9, 2017
closes angular#16608
Formerly, tried to navigate when user clicked an anchor with an image url (to view image in a new tab) resulting in 404.
Now ignores href URL with any extension and lets browser handle it.
@wardbell
wardbell force-pushed the aio-no-nav-to-image-click branch from ed3b4bb to 94ed9ff Compare May 9, 2017 00:27
@mary-poppins

Copy link
Copy Markdown

The angular.io preview for 94ed9ff is available here.

@petebacondarwin
petebacondarwin merged commit 2848f04 into angular:master May 9, 2017
@angular-automatic-lock-bot

Copy link
Copy Markdown

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 11, 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aio: clicking on links to assets fails with 404

6 participants