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

Stop opening links in a new tab #4446

Merged
merged 2 commits into from
Jun 18, 2024
Merged

Conversation

obulat
Copy link
Contributor

@obulat obulat commented Jun 6, 2024

Fixes

Fixes #496 by @obulat

Description

This PR removes target="_blank" from the external links in VLink component. This means that all external links will be opened in the same tab.

There were 4 tests that were opening an external link, including the test that clicks on "Get audio". I updated them, and the unit tests, so I don't think we need a separate test just for checking if the link is opened in the same tab.

Testing Instructions

Run the app and try clicking on the external links: the navbar links such as "API", "get this media" links, license links. These links should open in the same tab, and some of them should still be sending "external click" analytics event.

Checklist

  • My pull request has a descriptive title (not a vague title likeUpdate index.md).
  • My pull request targets the default branch of the repository (main) or a parent feature branch.
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added or updated tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.
  • I ran the DAG documentation generator (just catalog/generate-docs for catalog
    PRs) or the media properties generator (just catalog/generate-docs media-props
    for the catalog or just api/generate-docs for the API) where applicable.

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@obulat obulat requested a review from a team as a code owner June 6, 2024 05:07
@obulat obulat requested review from zackkrida and dhruvkb June 6, 2024 05:07
@openverse-bot openverse-bot added 🟨 priority: medium Not blocking but should be addressed soon ✨ goal: improvement Improvement to an existing user-facing feature ♿️ aspect: a11y Concerns related to the project's accessibility 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work labels Jun 6, 2024
@github-actions github-actions bot added the 🧱 stack: frontend Related to the Nuxt frontend label Jun 6, 2024
@obulat obulat removed the 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work label Jun 6, 2024
@obulat obulat force-pushed the stop-opening-links-in-a-new-tab branch 2 times, most recently from 7797fa8 to 3e1396e Compare June 6, 2024 10:56
Copy link
Member

@zackkrida zackkrida left a comment

Choose a reason for hiding this comment

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

LGTM! Very interesting that our attribution HTML uses the same logic, but it makes sense 😄

@obulat
Copy link
Contributor Author

obulat commented Jun 7, 2024

LGTM! Very interesting that our attribution HTML uses the same logic, but it makes sense 😄

I went back and forth on whether we should leave the attribution HTML with target="_blank" since that came from the CC code, but I guess if the users copying attribution need to open the links in a new tab, they can always add the target piece back. And for most of the users, we would be using the best accessible links :)

@obulat obulat force-pushed the stop-opening-links-in-a-new-tab branch 2 times, most recently from a1495cb to 1ff34d0 Compare June 11, 2024 10:30
obulat added 2 commits June 13, 2024 08:27
Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>

Update tests

Signed-off-by: Olga Bulat <obulat@gmail.com>
@obulat obulat force-pushed the stop-opening-links-in-a-new-tab branch from 1ff34d0 to 4179d60 Compare June 13, 2024 05:27
@openverse-bot
Copy link
Collaborator

Based on the medium urgency of this PR, the following reviewers are being gently reminded to review this PR:

@dhruvkb
This reminder is being automatically generated due to the urgency configuration.

Excluding weekend1 days, this PR was ready for review 7 day(s) ago. PRs labelled with medium urgency are expected to be reviewed within 4 weekday(s)2.

@obulat, if this PR is not ready for a review, please draft it to prevent reviewers from getting further unnecessary pings.

Footnotes

  1. Specifically, Saturday and Sunday.

  2. For the purpose of these reminders we treat Monday - Friday as weekdays. Please note that the operation that generates these reminders runs at midnight UTC on Monday - Friday. This means that depending on your timezone, you may be pinged outside of the expected range.

Copy link
Collaborator

@sarayourfriend sarayourfriend left a comment

Choose a reason for hiding this comment

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

LGTM!

@zackkrida zackkrida merged commit 280dc57 into main Jun 18, 2024
45 checks passed
@zackkrida zackkrida deleted the stop-opening-links-in-a-new-tab branch June 18, 2024 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
♿️ aspect: a11y Concerns related to the project's accessibility ✨ goal: improvement Improvement to an existing user-facing feature 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: frontend Related to the Nuxt frontend
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Do not open external links in new tabs
4 participants