Skip to content

Commit e1aa29a

Browse files
fix: detail-page links stop going to dev.reactome.org + leave the pathway-browser cleanly when an author is clicked
Three bugs on the detail-page description panel (which is shared between WebsiteAngular's /content/detail/* and the standalone PathwayBrowser app): 1. The dark-blue arrow icon in Events / Parent pathway / Components rows navigated to https://dev.reactome.org/... instead of the host the page was served from. environment.host in pathway-browser/environments/ environment.ts was hardcoded to 'https://dev.reactome.org'; compute it from window.location.origin at module load so every URL built from it (CONTENT_DETAIL, CONTENT_SERVICE, ANALYSIS_SERVICE, DOWNLOAD, OVERLAYS, RESTFUL_API, CONTENT_QUERY) follows the current site. Same pattern as the earlier swagger and search same-origin fixes. 2. Author names under "Authorship" linked to /content/detail/<personDbId>, which hits the generic DetailComponent and renders an "entity not found" view -- Person records belong on /content/detail/person/<id>. 3. The three template links that hopped from pathway-browser to a /content/detail route used [routerLink]. That works when the description-tab is embedded inside WebsiteAngular's DetailComponent (same SPA, same router), but the standalone PathwayBrowser app (/beta/PathwayBrowser/ ...) is a separate Angular bundle with its own router that doesn't define /content/detail/* routes. The RouterLink fired, the URL changed, but PathwayBrowser's router matched no route so its components never tore down -- the user saw the new Person page rendered on top of leftover PathwayBrowser DOM ("Collapse all", download icons, etc). Switch all three links (Details-page button, inline PE link, author link) to plain [href]. Browser navigation is forced, which correctly unloads whichever Angular app was in front and loads WebsiteAngular at the new URL. The embedded use case eats a full reload instead of an SPA transition, which is acceptable for "leave the diagram" navigations. Verified via Playwright on beta: a click on the first author from /content/detail/R-HSA-164843 lands on /content/detail/person/73870 with the person header rendered, zero leftover pathway-browser viewport DOM in the result page. Also confirmed no remaining dev.reactome.org refs in runtime source via grep, and that the existing /content/toc and /content/doi author renderers already use the /person/ route.
1 parent 1a9b924 commit e1aa29a

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

projects/pathway-browser/src/app/details/tabs/description-tab/description-tab.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
</span>
3333
</div>
3434
<div class="details-button">
35-
<a mat-button [routerLink]="`${CONTENT_DETAIL}/${obj().stId}`" target="_blank">
35+
<a mat-button [href]="`${CONTENT_DETAIL_PATH}/${obj().stId}`" target="_blank">
3636
<mat-icon class="custom-icon double-arrow" [svgIcon]="'double-arrow-right'"></mat-icon>
3737
<span class="details-label"> Details page</span>
3838
</a>
@@ -249,7 +249,7 @@ <h4 class="facet-group-title">Disease status</h4>
249249
<div class="label-container">{{ item.key }}</div>
250250
<div class="composition-container">
251251
@for (pe of item.value; let i = $index; track pe.dbId) {
252-
<a [routerLink]="`${CONTENT_DETAIL}/${pe.stId}`">{{ pe.name[0] }}</a>
252+
<a [href]="`${CONTENT_DETAIL_PATH}/${pe.stId}`">{{ pe.name[0] }}</a>
253253
<!-- Add separator except for last item -->
254254
@if (i < item.value.length - 1) {
255255
<span class="margin-right">,</span>
@@ -317,7 +317,7 @@ <h4 class="facet-group-title">Disease status</h4>
317317
@for (ie of item.data; track $index) {
318318
<div class="authorship-item">
319319
@for (author of ie.author; let i = $index; track $index) {
320-
<a [routerLink]="`${CONTENT_DETAIL}/${author.dbId}`"
320+
<a [href]="`${CONTENT_DETAIL_PATH}/person/${author.dbId}`"
321321
[ngClass]="{'margin-right': !author.orcidId}">
322322
{{ author.firstname }} {{ author.surname }}
323323
</a>

projects/pathway-browser/src/environments/environment.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1+
// Resolve the host from the browser's current origin so URLs built from
2+
// environment.host stay on whatever site the user is on -- beta.reactome.org,
3+
// release.reactome.org, reactome.org, localhost during dev. The fallback
4+
// applies when this module is imported in a non-browser context (e.g. unit
5+
// tests, build-time tooling) where window doesn't exist.
6+
const host: string =
7+
typeof window !== 'undefined' ? window.location.origin : 'https://dev.reactome.org';
8+
19
export const environment = {
210
production: false,
3-
host: "https://dev.reactome.org",
11+
host,
412
s3: "https://download.reactome.org",
513
gsaServer: "dev",
614
gtagId: "G-96F1EYHQR3",

0 commit comments

Comments
 (0)