Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add return label to studio link #928

Merged
merged 1 commit into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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