diff --git a/frontend-v2/src/components/navigation/RegionSelect.tsx b/frontend-v2/src/components/navigation/RegionSelect.tsx index bd916fe73..7cbc22230 100644 --- a/frontend-v2/src/components/navigation/RegionSelect.tsx +++ b/frontend-v2/src/components/navigation/RegionSelect.tsx @@ -1,6 +1,6 @@ import { faCheck } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { useLocation, useNavigate } from "@tanstack/react-router"; +import { useLocation } from "@tanstack/react-router"; import { Modal, ModalContent, ModalTrigger, Select, SelectItem } from "@app/components/v2"; import { isInfisicalCloud } from "@app/helpers/platform"; @@ -73,11 +73,10 @@ const regions = [ ]; export const RegionSelect = () => { - const navigate = useNavigate(); const location = useLocation(); const handleRegionSelect = (value: Region) => { - navigate({ to: `https://${value}.infisical.com/${location.pathname}` }); + window.location.assign(`https://${value}.infisical.com/${location.pathname}`); }; const shouldDisplay = diff --git a/frontend-v2/src/hooks/api/reactQuery.tsx b/frontend-v2/src/hooks/api/reactQuery.tsx index da4113645..095ad1a7a 100644 --- a/frontend-v2/src/hooks/api/reactQuery.tsx +++ b/frontend-v2/src/hooks/api/reactQuery.tsx @@ -27,9 +27,7 @@ export const queryClient = new QueryClient({ onError: (error) => { if (axios.isAxiosError(error)) { const serverResponse = error.response?.data as TApiErrors; - console.log(serverResponse); if (serverResponse?.error === ApiErrorTypes.ValidationError) { - console.log("entered"); createNotification( { title: "Validation Error", diff --git a/frontend-v2/src/main.tsx b/frontend-v2/src/main.tsx index aa0d2acda..1fbbbf28f 100644 --- a/frontend-v2/src/main.tsx +++ b/frontend-v2/src/main.tsx @@ -5,6 +5,8 @@ import NProgress from "nprogress"; import { ContentLoader } from "./components/v2"; import { queryClient } from "./hooks/api/reactQuery"; +import { ErrorPage } from "./pages/public/ErrorPage/ErrorPage"; +import { NotFoundPage } from "./pages/public/NotFoundPage/NotFoundPage"; // Import the generated route tree import { routeTree } from "./routeTree.gen"; @@ -29,7 +31,9 @@ const router = createRouter({
Organization Access Control
diff --git a/frontend-v2/src/pages/public/ErrorPage/ErrorPage.tsx b/frontend-v2/src/pages/public/ErrorPage/ErrorPage.tsx new file mode 100644 index 000000000..c20533915 --- /dev/null +++ b/frontend-v2/src/pages/public/ErrorPage/ErrorPage.tsx @@ -0,0 +1,62 @@ +import { faBugs, faHome } from "@fortawesome/free-solid-svg-icons"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import { ErrorComponentProps, Link } from "@tanstack/react-router"; +import { AxiosError } from "axios"; + +import { Button } from "@app/components/v2"; + +export const ErrorPage = ({ error }: ErrorComponentProps) => { + return ( ++ Something went wrong. Please contact{" "} + + support@infisical.com + + , or{" "} + + join our Slack community + {" "} + if the issue persists. +
+ + + + {error?.message && ( + <> + +
+
+ {window.location.pathname}
+
+
+ {error.name}
+
+ {error.message}
+
+ {error instanceof AxiosError && (
+
+
Oops, something went wrong
++ Think this is a mistake? Email{" "} + + team@infisical.com + {" "} + and we`ll fix it!{" "} +
+ +