From 0eebdcb5f8ff98cbf3dfd67f74a21dadcb05f2b3 Mon Sep 17 00:00:00 2001
From: Andrea Cordoba <43388408+andre-code@users.noreply.github.com>
Date: Tue, 15 Oct 2024 14:25:07 +0200
Subject: [PATCH] feat: add playful 404 and error pages (#3248)
fix #3235
---
.../error-boundary/ErrorBoundary.module.scss | 13 ---
client/src/error-boundary/ErrorBoundary.tsx | 79 ++++++++++++-------
.../src/features/projectsV2/new/GroupNew.tsx | 10 ++-
.../features/projectsV2/new/ProjectV2New.tsx | 15 +++-
.../projectsV2/notFound/GroupNotFound.tsx | 58 ++++++--------
.../projectsV2/notFound/ProjectNotFound.tsx | 63 +++++++--------
.../projectsV2/notFound/UserNotFound.tsx | 62 +++++++--------
client/src/index.jsx | 2 +-
client/src/namespace/Namespace.present.jsx | 42 +++++++---
client/src/not-found/NotFound.tsx | 53 ++++++++-----
client/src/styles/assets/not-found.svg | 69 ++++++++++++++++
client/src/styles/assets/not-foundV2.svg | 69 ++++++++++++++++
client/src/styles/assets/oops.svg | 28 +++++++
client/src/styles/assets/oopsV2.svg | 28 +++++++
tests/cypress/e2e/adminPage.spec.ts | 4 -
tests/cypress/e2e/groupV2.spec.ts | 5 +-
tests/cypress/e2e/project.spec.ts | 12 ---
tests/cypress/e2e/projectV2.spec.ts | 4 +-
18 files changed, 418 insertions(+), 198 deletions(-)
delete mode 100644 client/src/error-boundary/ErrorBoundary.module.scss
create mode 100644 client/src/styles/assets/not-found.svg
create mode 100644 client/src/styles/assets/not-foundV2.svg
create mode 100644 client/src/styles/assets/oops.svg
create mode 100644 client/src/styles/assets/oopsV2.svg
diff --git a/client/src/error-boundary/ErrorBoundary.module.scss b/client/src/error-boundary/ErrorBoundary.module.scss
deleted file mode 100644
index 76794e9655..0000000000
--- a/client/src/error-boundary/ErrorBoundary.module.scss
+++ /dev/null
@@ -1,13 +0,0 @@
-.error {
- background-image: url("/src/styles/assets/error-background@0.50x.png");
- background-position: center;
- background-size: cover;
- color: var(--bs-rk-pink);
- height: calc(100vh);
- overflow: auto;
- width: calc(100vw);
-
- @media (min-width: 1500px) {
- background-image: url("/src/styles/assets/error-background@1.00x.png");
- }
-}
diff --git a/client/src/error-boundary/ErrorBoundary.tsx b/client/src/error-boundary/ErrorBoundary.tsx
index 302ae9e78b..8e64f0b97b 100644
--- a/client/src/error-boundary/ErrorBoundary.tsx
+++ b/client/src/error-boundary/ErrorBoundary.tsx
@@ -19,10 +19,11 @@
import * as Sentry from "@sentry/react";
import cx from "classnames";
import { ReactNode, useCallback } from "react";
-
-import styles from "./ErrorBoundary.module.scss";
-import v2Styles from "../styles/renku_bootstrap.scss?inline";
-import { Helmet } from "react-helmet";
+import { ArrowLeft } from "react-bootstrap-icons";
+import { StyleHandler } from "../index";
+import rkOopsImg from "../styles/assets/oops.svg";
+import rkOopsV2Img from "../styles/assets/oopsV2.svg";
+import useLegacySelector from "../utils/customHooks/useLegacySelector.hook";
interface AppErrorBoundaryProps {
children?: ReactNode;
@@ -44,41 +45,59 @@ export function AppErrorBoundary({ children }: AppErrorBoundaryProps) {
}, []);
return (
-
- You can try to{" "} - window.location.reload()} - > - reload the page - {" "} - or go to the{" "} - - Renku home page - -
-
+ You can try to{" "}
+ window.location.reload()}
+ >
+ Reload the page
+ {" "}
+ or{" "}
+
+
{notFoundText}
-It is possible that the group has been deleted by its owner.
- -{notFoundText}
+It is possible that the group has been deleted by its owner.
+ {error &&{notFoundText}
-- It is possible that the project has been deleted by its owner or you - do not have permission to access it. -
- -{notFoundText}
++ It is possible that the project has been deleted by its owner or + you do not have permission to access it. +
+ {error &&{notFoundText}
- -{notFoundText}
+It is possible that the user has been deleted.
+ {error &&