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

URI link on simple item page always opens in a new page/tab #3241

Closed
saiful-semantic opened this issue Aug 8, 2024 · 5 comments · Fixed by #3322
Closed

URI link on simple item page always opens in a new page/tab #3241

saiful-semantic opened this issue Aug 8, 2024 · 5 comments · Fixed by #3322
Assignees
Labels
affects: 7.x Issue impacts 7.x releases affects: 8.x Issue impacts 8.x releases bug component: Item (Archived) Item display or editing
Milestone

Comments

@saiful-semantic
Copy link

Describe the bug

In DSpace 8.0, the URI link on item page always opens in a new page.

To Reproduce

Steps to reproduce the behavior:

  1. Deploy DSpace Angular UI on a reverse proxy setup with FQDN
  2. Then open any item page page. e.g. https://demo.dspace.org/items/f1e9085d-048c-4203-b769-b7350f56c7a3
  3. Click on the URI. e.g.: https://demo.dspace.org/handle/10673/1431
    It will open a new page despite the item being within the same domain.

Expected behavior

Ideally links belonging to the same FQDN should open within the same page.

Related work

On digging further I think the reason is hasInternalLink function.

In lines 134-136 of src/app/item-page/field-components/metadata-values/metadata-values.component.ts:

hasInternalLink(linkValue: string): boolean {
   return linkValue.startsWith(environment.ui.baseUrl);
}

When we use a reverse proxy for the UI (as in most production deployments), this function always returns a false value. e.g.,
environment.ui.baseUrl = http://localhost:4000
linkValue = https://production-domain/handle/x/xx [assuming the fake handle]

This makes each URI in simple item page opening in a new window/tab.

@saiful-semantic saiful-semantic added bug needs triage New issue needs triage and/or scheduling labels Aug 8, 2024
@github-project-automation github-project-automation bot moved this to 🆕 Triage in DSpace Backlog Aug 8, 2024
@tdonohue tdonohue added component: Item (Archived) Item display or editing help wanted Needs a volunteer to claim to move forward affects: 8.x Issue impacts 8.x releases and removed needs triage New issue needs triage and/or scheduling labels Aug 8, 2024
@tdonohue tdonohue removed this from DSpace Backlog Aug 8, 2024
@Andrea-Guevara
Copy link
Contributor

Good afternoon @tdonohue! My name is Andrea and I'm part of Neki-it. We want to do this activity.

@tdonohue
Copy link
Member

tdonohue commented Sep 3, 2024

Thanks @Andrea-Guevara . I'll assign this to you for your team. Please let us know on this ticket if you need advice on any solution you may be working on.

@tdonohue tdonohue moved this from 📋 To Do to 🏗 In Progress in DSpace 8.x and 7.6.x Maintenance Sep 3, 2024
@tdonohue tdonohue removed the help wanted Needs a volunteer to claim to move forward label Sep 3, 2024
@Andrea-Guevara
Copy link
Contributor

Good afternoon @tdonohue! I was able to reproduce this error a few days ago, but now I can't reproduce the error on https://demo.dspace.org which is on version 8.

I was wondering if this is still a problem?

@saiful-semantic
Copy link
Author

saiful-semantic commented Sep 6, 2024

I was wondering if this is still a problem?

Yes it still is. Try clicking on the URI in this page:
https://demo.dspace.org/handle/10673/1470

@Andrea-Guevara
Copy link
Contributor

Good morning @saiful-semantic, I hope you're well!

We have provided a PR as a possible solution to this problem. If necessary, we welcome suggestions for improving the code.

We look forward to your feedback!

@github-project-automation github-project-automation bot moved this from 🏗 In Progress to ✅ Done in DSpace 8.x and 7.6.x Maintenance Dec 19, 2024
@tdonohue tdonohue added this to the 7.6.3 milestone Dec 19, 2024
@tdonohue tdonohue added the affects: 7.x Issue impacts 7.x releases label Dec 19, 2024
tdonohue added a commit that referenced this issue Dec 19, 2024
[Port dspace-7_x] fix #3241: Configuring the URI link target
tdonohue added a commit that referenced this issue Dec 19, 2024
[Port dspace-8_x] fix #3241: Configuring the URI link target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects: 7.x Issue impacts 7.x releases affects: 8.x Issue impacts 8.x releases bug component: Item (Archived) Item display or editing
Projects
Development

Successfully merging a pull request may close this issue.

3 participants