Skip to content

Commit

Permalink
Add return label to studio link
Browse files Browse the repository at this point in the history
  • Loading branch information
owi92 committed Sep 11, 2023
1 parent 694f1f7 commit 79d940b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
8 changes: 6 additions & 2 deletions frontend/src/layout/header/UserBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
} from "@opencast/appkit";

import { BREAKPOINT_MEDIUM } from "../../GlobalStyle";
import { languages } from "../../i18n";
import i18n, { languages } from "../../i18n";
import { Link } from "../../router";
import { User, useUser } from "../../User";
import { ActionIcon, ICON_STYLE } from "./ui";
Expand All @@ -22,6 +22,7 @@ import { REDIRECT_STORAGE_KEY } from "../../routes/Login";
import { focusStyle } from "../../ui";
import { ExternalLink } from "../../relay/auth";
import { COLORS } from "../../color";
import { translatedConfig } from "../../util";


/** User-related UI in the header. */
Expand Down Expand Up @@ -202,7 +203,10 @@ const LoggedIn: React.FC<LoggedInProps> = ({ user }) => {
icon: <FiVideo />,
wrapper: <ExternalLink
service="STUDIO"
params={{ "return.target": new URL(document.location.href) }}
params={{
"return.target": document.location.href,
"return.label": translatedConfig(CONFIG.siteTitle, i18n),
}}
fallback="link"
/>,
keepOpenAfterClick: true,
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/relay/auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export type ExternalLinkProps = PropsWithChildren<{
} & ({
service: "STUDIO";
params: {
"return.target": URL;
"return.target": string;
"return.label": string;
};
} | {
service: "EDITOR";
Expand Down
8 changes: 7 additions & 1 deletion frontend/src/routes/manage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ import {
} from "./__generated__/manageDashboardQuery.graphql";
import { COLORS } from "../../color";
import { useMenu } from "../../layout/MenuState";
import CONFIG from "../../config";
import { translatedConfig } from "../../util";
import i18n from "../../i18n";


const PATH = "/~manage";
Expand Down Expand Up @@ -106,7 +109,10 @@ export const ManageNav: React.FC<ManageNavProps> = ({ active }) => {
items.push(
<ExternalLink
service="STUDIO"
params={{ "return.target": new URL(document.location.href) }}
params={{
"return.target": document.location.href,
"return.label": translatedConfig(CONFIG.siteTitle, i18n),
}}
fallback="link"
css={{
backgroundColor: "inherit",
Expand Down

0 comments on commit 79d940b

Please sign in to comment.