Skip to content

Commit

Permalink
Add return link to editor, open studio and editor in current context (#…
Browse files Browse the repository at this point in the history
…1178)

This adds parameters to the editor link that are used to display a
return-to-tobira link in editor. Furthermore studio and editor will now
open in the same context (tab) instead of a new one.
  • Loading branch information
LukasKalbertodt authored Jun 20, 2024
2 parents 77a59d6 + 53e8984 commit f4e8026
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
6 changes: 4 additions & 2 deletions frontend/src/relay/auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ export type ExternalLinkProps = PropsWithChildren<{
} | {
service: "EDITOR";
params: {
mediaPackageId: string;
id: string;
callbackUrl: string;
callbackSystem: string;
};
})>;

Expand Down Expand Up @@ -74,7 +76,7 @@ export const ExternalLink = React.forwardRef<HTMLButtonElement, ExternalLinkProp
form.submit();
};

return <form action={redirect.toString()} method="POST" target="_blank" onSubmit={onSubmit}>
return <form action={redirect.toString()} method="POST" onSubmit={onSubmit}>
<input type="hidden" name="target" value={target.toString()} />
<input type="hidden" name="jwt" />

Expand Down
11 changes: 8 additions & 3 deletions frontend/src/routes/manage/Video/Details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ import { AuthorizedEvent, makeManageVideoRoute, PAGE_WIDTH } from "./Shared";
import { ExternalLink } from "../../../relay/auth";
import { buttonStyle } from "../../../ui/Button";
import { COLORS } from "../../../color";
import { secondsToTimeString } from "../../../util";
import { secondsToTimeString, translatedConfig } from "../../../util";
import { DirectVideoRoute, VideoRoute } from "../../Video";
import { ManageRoute } from "..";
import { ManageVideosRoute } from ".";
import CONFIG from "../../../config";


export const ManageVideoDetailsRoute = makeManageVideoRoute(
Expand All @@ -31,7 +32,7 @@ type Props = {
};

const Page: React.FC<Props> = ({ event }) => {
const { t } = useTranslation();
const { t, i18n } = useTranslation();

const breadcrumbs = [
{ label: t("user.manage-content"), link: ManageRoute.url },
Expand All @@ -56,7 +57,11 @@ const Page: React.FC<Props> = ({ event }) => {
{user.canUseEditor && !event.isLive && event.canWrite && (
<ExternalLink
service="EDITOR"
params={{ mediaPackageId: event.opencastId }}
params={{
id: event.opencastId,
callbackUrl: document.location.href,
callbackSystem: translatedConfig(CONFIG.siteTitle, i18n),
}}
fallback="button"
css={{
marginBottom: 16,
Expand Down

0 comments on commit f4e8026

Please sign in to comment.