From 6fe690ac3593ccc9cbbc761beff140460239537b Mon Sep 17 00:00:00 2001 From: Roy Johnson Date: Thu, 20 Nov 2025 13:00:00 -0600 Subject: [PATCH 1/3] Core 1382: Book tile link should use portal path to details page [CORE-1382] --- src/app/components/book-tile/book-tile-display.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/components/book-tile/book-tile-display.tsx b/src/app/components/book-tile/book-tile-display.tsx index 344799135..794ae7bc3 100644 --- a/src/app/components/book-tile/book-tile-display.tsx +++ b/src/app/components/book-tile/book-tile-display.tsx @@ -4,6 +4,7 @@ import type {Item} from '~/models/book-titles'; import {Book as BookInfo} from '~/pages/subjects/new/specific/context'; import GetTheBookDropdown from './dropdown-menu'; import cn from 'classnames'; +import usePortalContext from '~/contexts/portal'; import './book-tile.scss'; type AdditionalFields = Partial<{ @@ -16,6 +17,7 @@ export default function BookTile({book}: {book: BookInfo & AdditionalFields}) { const comingSoon = book.bookState === 'coming_soon'; const snippets = book.promoteSnippet?.filter((s) => s.value.image); const promoteSnippet = snippets?.find((s) => s.value.image); + const {portalPrefix} = usePortalContext(); const classes = cn({ 'book-tile': true, 'coming-soon': comingSoon, @@ -24,7 +26,7 @@ export default function BookTile({book}: {book: BookInfo & AdditionalFields}) { return (
- + Date: Fri, 21 Nov 2025 10:46:43 -0600 Subject: [PATCH 2/3] Fix Rex portal link --- src/app/helpers/rex-portal.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/helpers/rex-portal.ts b/src/app/helpers/rex-portal.ts index 8351a907d..d29bea25d 100644 --- a/src/app/helpers/rex-portal.ts +++ b/src/app/helpers/rex-portal.ts @@ -8,5 +8,5 @@ export function useRexPortalLinkOrNot(link: string) { if (!portalPrefix) { return link; } - return link.replace('books/', `portal${portalPrefix}/books/`); + return link.replace('books/', `apps/rex/portal${portalPrefix}/books/`); } From 6dde5f045a92735e27c11663800edc9ee45a8867 Mon Sep 17 00:00:00 2001 From: Roy Johnson Date: Fri, 21 Nov 2025 11:42:26 -0600 Subject: [PATCH 3/3] Treat portal book links as external; open in current tab --- src/app/helpers/link.ts | 2 +- .../get-this-title-files/give-before-pdf/content-warning.tsx | 1 + .../get-this-title-files/give-before-pdf/give-before-other.tsx | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/helpers/link.ts b/src/app/helpers/link.ts index 03009df60..ac2f85af3 100644 --- a/src/app/helpers/link.ts +++ b/src/app/helpers/link.ts @@ -2,7 +2,7 @@ import type {WindowWithSettings} from './window-settings'; const EXTERNAL = /^([a-z]+:)/; const ABSOLUTE_OPENSTAX = new RegExp( - `(?:https?://openstax.org|${window.location.origin})(?!/(?:books|accounts|oxauth|blog-feed|documents)/)` + `(?:https?://openstax.org|${window.location.origin})(?!/(?:(?:.*/)?books|accounts|oxauth|blog-feed|documents)/)` ); const MAILTO = /^mailto:(.+)/; diff --git a/src/app/pages/details/common/get-this-title-files/give-before-pdf/content-warning.tsx b/src/app/pages/details/common/get-this-title-files/give-before-pdf/content-warning.tsx index 8b091c2b9..8cbc1321c 100644 --- a/src/app/pages/details/common/get-this-title-files/give-before-pdf/content-warning.tsx +++ b/src/app/pages/details/common/get-this-title-files/give-before-pdf/content-warning.tsx @@ -36,6 +36,7 @@ export default function ContentWarning({ {...(track ? {'data-track': track} : {})} onClick={closeAfterDelay} className="btn go-to" + data-local="true" > Go to your {variant === 'View online' ? 'book' : 'file'} diff --git a/src/app/pages/details/common/get-this-title-files/give-before-pdf/give-before-other.tsx b/src/app/pages/details/common/get-this-title-files/give-before-pdf/give-before-other.tsx index 0cc3d6450..e2409a156 100644 --- a/src/app/pages/details/common/get-this-title-files/give-before-pdf/give-before-other.tsx +++ b/src/app/pages/details/common/get-this-title-files/give-before-pdf/give-before-other.tsx @@ -64,6 +64,7 @@ export default function GiveBeforeOther({ className='btn go-to' {...(track ? {'data-track': track} : {})} data-variant={lookupVariant(variant)} + data-local="true" > Go to your {lookupVariant(variant)}