Skip to content
Open
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
10 changes: 10 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"react-chartjs-2": "^5.3.1",
"react-datepicker": "^8.8.0",
"react-dom": "^19.2.7",
"react-error-boundary": "^6.1.2",
"react-hotkeys-hook": "^5.3.3",
"react-i18next": "17.0.8",
"react-icons": "^5.7.0",
Expand Down
74 changes: 46 additions & 28 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import { useAppDispatch } from "./store";
import { fetchOcVersion, fetchUserInfo } from "./slices/userInfoSlice";
import { subscribeToAuthEvents } from "./utils/broadcastSync";
import { useTableFilterStateValidation } from "./hooks/useTableFilterStateValidation";
import { ErrorBoundary } from "react-error-boundary";
import opencastLogo from "./img/opencast-white.svg?url";

function App() {
const dispatch = useAppDispatch();
Expand All @@ -43,49 +45,65 @@ function App() {
}, []);

return (
<HashRouter>
<Routes>
<Route path={"/events/events"} element={<Events />} />
<ErrorBoundary fallback={
<>
<header className="primary-header">
{/* Opencast logo in upper left corner */}
<div className="header-branding">
<a href="/" target="_self" className="logo">
<img src={opencastLogo} alt="Opencast Logo" />
</a>
</div>
</header>
<div className="about">
Something went wrong. Please reload the page.
</div>
</>
}>
<HashRouter>
<Routes>
<Route path={"/events/events"} element={<Events />} />

<Route path={"/events/series"} element={<Series />} />
<Route path={"/events/series"} element={<Series />} />

<Route path={"/events/playlists"} element={<Playlists />} />
<Route path={"/events/playlists"} element={<Playlists />} />

<Route path={"/recordings/recordings"} element={<Recordings />} />
<Route path={"/recordings/recordings"} element={<Recordings />} />

<Route path={"/systems/jobs"} element={<Jobs />} />
<Route path={"/systems/jobs"} element={<Jobs />} />

<Route path={"/systems/servers"} element={<Servers />} />
<Route path={"/systems/servers"} element={<Servers />} />

<Route path={"/systems/services"} element={<Services />} />
<Route path={"/systems/services"} element={<Services />} />

<Route path={"/users/users"} element={<Users />} />
<Route path={"/users/users"} element={<Users />} />

<Route path={"/users/groups"} element={<Groups />} />
<Route path={"/users/groups"} element={<Groups />} />

<Route path={"/users/acls"} element={<Acls />} />
<Route path={"/users/acls"} element={<Acls />} />

<Route path={"/configuration/themes"} element={<Themes />} />
<Route path={"/configuration/themes"} element={<Themes />} />

<Route path={"/statistics/organization"} element={<Statistics />} />
<Route path={"/statistics/organization"} element={<Statistics />} />

<Route path={"/about/imprint"} element={<About />} />
<Route path={"/about/imprint"} element={<About />} />

<Route path={"/about/privacy"} element={<About />} />
<Route path={"/about/privacy"} element={<About />} />

<Route
path={"*"}
element={<Navigate to={"/events/events"} replace />}
<Route
path={"*"}
element={<Navigate to={"/events/events"} replace />}
/>
</Routes>
<Tooltip
id="my-tooltip"
clickable
className="my-tooltip"
delayShow={100}
delayHide={150}
/>
</Routes>
<Tooltip
id="my-tooltip"
clickable
className="my-tooltip"
delayShow={100}
delayHide={150}
/>
</HashRouter>
</HashRouter>
</ErrorBoundary>
);
}

Expand Down
8 changes: 7 additions & 1 deletion src/components/shared/modals/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { useTranslation } from "react-i18next";
import ButtonLikeAnchor from "../ButtonLikeAnchor";
import { FocusTrap } from "focus-trap-react";
import { LuX } from "react-icons/lu";
import { ErrorBoundary } from "react-error-boundary";

export type ModalProps = {
open?: boolean;
Expand Down Expand Up @@ -88,8 +89,13 @@ export const Modal = forwardRef<ModalHandle, PropsWithChildren<ModalProps>>(
{header}
</h2>
</header>

<ErrorBoundary fallback={
<div className="about">
Something went wrong. Please close the modal and try again.
</div>
}>
{children}
</ErrorBoundary>
</section>
</div>
</FocusTrap>,
Expand Down
Loading