feat: run through check to all frontend urls

This commit is contained in:
=
2024-12-13 21:38:43 +05:30
parent 24acb98978
commit d1547564f9
6 changed files with 30 additions and 558 deletions
+17 -6
View File
@@ -41,6 +41,7 @@ import { usePopUp, useToggle } from "@app/hooks";
import { useGetOrgTrialUrl, useLogoutUser, useSelectOrganization } from "@app/hooks/api";
import { MfaMethod } from "@app/hooks/api/auth/types";
import { AuthMethod } from "@app/hooks/api/users/types";
import { ProjectType } from "@app/hooks/api/workspace/types";
import { InsecureConnectionBanner } from "@app/layouts/AppLayout/components/InsecureConnectionBanner";
import { ProjectSelect } from "@app/layouts/AppLayout/components/ProjectSelect";
import { navigateUserToOrg } from "@app/views/Login/Login.utils";
@@ -340,30 +341,40 @@ export const AppLayout = ({ children }: LayoutProps) => {
<ProjectSidebarItem />
{router.pathname.startsWith("/org") && (
<Menu className="mt-4">
<Link href={`/org/${currentOrg?.id}/secret-manager/overview`} passHref>
<Link
href={`/org/${currentOrg?.id}/${ProjectType.SecretManager}/overview`}
passHref
>
<a>
<MenuItem
isSelected={router.asPath.includes("/secret-manager/overview")}
isSelected={router.asPath.includes(
`/${ProjectType.SecretManager}/overview`
)}
icon="system-outline-165-view-carousel"
>
Secret Manager
</MenuItem>
</a>
</Link>
<Link href={`/org/${currentOrg?.id}/cert-manager/overview`} passHref>
<Link
href={`/org/${currentOrg?.id}/${ProjectType.CertificateManager}/overview`}
passHref
>
<a>
<MenuItem
isSelected={router.asPath.includes("/cert-manager/overview")}
isSelected={router.asPath.includes(
`/${ProjectType.CertificateManager}/overview`
)}
icon="system-outline-165-view-carousel"
>
Cert Manager
</MenuItem>
</a>
</Link>
<Link href={`/org/${currentOrg?.id}/cmek/overview`} passHref>
<Link href={`/org/${currentOrg?.id}/${ProjectType.Cmek}/overview`} passHref>
<a>
<MenuItem
isSelected={router.asPath.includes("/cmek/overview")}
isSelected={router.asPath.includes(`/${ProjectType.Cmek}/overview`)}
icon="system-outline-165-view-carousel"
>
Cmek
@@ -5,6 +5,7 @@ import { faBugs, faHome } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { Button } from "@app/components/v2";
import { ProjectType } from "@app/hooks/api/workspace/types";
interface ErrorBoundaryProps {
children: ReactNode;
@@ -62,7 +63,7 @@ const ErrorPage = ({ error }: { error: Error | null }) => {
size="xs"
onClick={() =>
// we need to go to /org/${orgId}/overview, but we need to do a full page reload to ensure that the error the user is facing is properly reset.
window.location.assign(`/org/${orgId}/overview`)
window.location.assign(`/org/${orgId}/${ProjectType.SecretManager}/overview`)
}
>
<FontAwesomeIcon icon={faHome} className="mr-2" />