Skip to content

Commit 9842665

Browse files
committed
Merge branch 'tobira-urls-improvement' of wsmirnow/opencast-admin-interface into r/17.x
Pull request #1322 Direct link to the Tobira video/series
2 parents 5a77004 + 52c38f3 commit 9842665

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

src/components/events/partials/ModalTabsAndPages/DetailsTobiraTab.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const DetailsTobiraTab = ({ kind, id }: DetailsTobiraTabProps) => {
5858

5959
const i18nKey = kind === "series" ? "SERIES" : "EVENTS";
6060
const prefix = kind === "series" ? "s" : "v";
61-
const directTobiraLink = tobiraData.baseURL + `/!${prefix}/:` + id;
61+
const directTobiraLink = tobiraData.baseURL + `/!${prefix}/` + (tobiraData.id.length > 2 ? tobiraData.id.substring(2) : `:${id}`);
6262

6363
const getBreadcrumbs = (currentPage: TobiraPage) => {
6464
const homepage = {
@@ -204,6 +204,7 @@ type TobiraTableProps = {
204204
const TobiraTable = ({ tobiraData, i18nKey, openSubTab, handleDelete }: TobiraTableProps) => {
205205
const { t } = useTranslation();
206206
const deleteConfirmationModalRef = useRef<ModalHandle>(null);
207+
const prefix = i18nKey === "SERIES" ? 's' : 'v';
207208

208209
return <div className="obj">
209210
<header>{t(`EVENTS.${i18nKey}.DETAILS.TOBIRA.PAGES`)}</header>
@@ -222,7 +223,8 @@ const TobiraTable = ({ tobiraData, i18nKey, openSubTab, handleDelete }: TobiraTa
222223
</tr>}
223224
{tobiraData.hostPages.map(hostPage => <tr key={hostPage.path}>
224225
<td>
225-
<a href={tobiraData.baseURL + hostPage.path}>
226+
<a href={tobiraData.baseURL + hostPage.path +
227+
(tobiraData.id.length > 2 ? `/${prefix}/${tobiraData.id.substring(2)}` : '')}>
226228
{hostPage.path !== '/' && <>
227229
<span className="tobira-page-separator">/</span>
228230
{hostPage.ancestors.map((ancestor, key) => (

src/slices/eventDetailsSlice.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,7 @@ const initialState: EventDetailsState = {
597597
hasStatisticsError: false,
598598
tobiraData: {
599599
baseURL: "",
600+
id: "",
600601
hostPages: [],
601602
},
602603
};

src/slices/seriesDetailsSlice.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import { handleTobiraError } from './shared/tobiraErrors';
3030
*/
3131
export type TobiraData = {
3232
baseURL: string,
33+
id: string,
3334
hostPages: TobiraPage[],
3435
};
3536

@@ -91,6 +92,7 @@ const initialState: SeriesDetailsState = {
9192
tobiraTab: "main",
9293
tobiraData: {
9394
baseURL: "",
95+
id: "",
9496
hostPages: [],
9597
},
9698
};

0 commit comments

Comments
 (0)