From 98f6dfc7c28135c66ffe1bb2544732aca7aee812 Mon Sep 17 00:00:00 2001
From: Kacper Wojciechowski <39823706+jog1t@users.noreply.github.com>
Date: Fri, 20 Dec 2024 18:11:14 +0100
Subject: [PATCH] fix: invalid group query
---
.../components/breadcrumbs/breadcrumbs.tsx | 14 ++++---
.../breadcrumbs/group-breadcrumb.tsx | 4 ++
apps/hub/src/components/error-component.tsx | 29 ++++++++++++++-
.../src/components/header/header-sub-nav.tsx | 11 ++----
.../header/links/header-group-links.tsx | 3 ++
.../src/components/not-found-component.tsx | 17 +++++++--
.../domains/project/queries/query-options.tsx | 37 +++++++++++++++----
apps/hub/src/lib/ls.ts | 3 ++
apps/hub/src/queries/global.ts | 1 -
.../_authenticated/_layout/teams/$groupId.tsx | 7 +++-
10 files changed, 99 insertions(+), 27 deletions(-)
diff --git a/apps/hub/src/components/breadcrumbs/breadcrumbs.tsx b/apps/hub/src/components/breadcrumbs/breadcrumbs.tsx
index 981338dc..849dbc62 100644
--- a/apps/hub/src/components/breadcrumbs/breadcrumbs.tsx
+++ b/apps/hub/src/components/breadcrumbs/breadcrumbs.tsx
@@ -1,7 +1,8 @@
import { useAuth } from "@/domains/auth/contexts/auth";
-import { RestOnRouteChange } from "@/lib/utils";
+
import { Skeleton, cn } from "@rivet-gg/components";
-import { CatchBoundary, useMatchRoute } from "@tanstack/react-router";
+import { ErrorBoundary } from "@sentry/react";
+import { useMatchRoute } from "@tanstack/react-router";
import { Suspense, useContext } from "react";
import { EnvironmentBreadcrumb } from "./environment-breadcrumb";
import { GroupBreadcrumb } from "./group-breadcrumb";
@@ -58,9 +59,10 @@ export function Breadcrumbs() {
!isMobile && "items-center gap-2",
)}
>
- Date.now()}
- errorComponent={RestOnRouteChange}
+ {
+ console.log("Error occurred while rendering breadcrumbs.", ...args);
+ }}
>
-
+
);
}
diff --git a/apps/hub/src/components/breadcrumbs/group-breadcrumb.tsx b/apps/hub/src/components/breadcrumbs/group-breadcrumb.tsx
index 37fdf789..1ac7eeb8 100644
--- a/apps/hub/src/components/breadcrumbs/group-breadcrumb.tsx
+++ b/apps/hub/src/components/breadcrumbs/group-breadcrumb.tsx
@@ -32,6 +32,10 @@ export function GroupBreadcrumb({ groupId }: GroupBreadcrumbProps) {
const Element = isMobile ? NavItem : Fragment;
+ if (!data) {
+ return null;
+ }
+
return (
+
+
+
+ Unauthorized
+
+
+
+ You are not a member of this group.
+
+
+
+
+
+ );
+ }
if (error.statusCode === 404) {
return ;
}
@@ -65,6 +91,7 @@ export const ErrorComponent = ({