feat: union said - bring back overview page!!

This commit is contained in:
=
2025-09-01 14:43:24 +05:30
parent 19a5f52d20
commit b650b142f7
4 changed files with 1690 additions and 71 deletions
+4 -5
View File
@@ -72,15 +72,14 @@ export const getProjectBaseURL = (type: ProjectType) => {
} }
}; };
// @ts-expect-error akhilmhdh: will remove this later
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export const getProjectHomePage = (type: ProjectType, environments: WorkspaceEnv[]) => { export const getProjectHomePage = (type: ProjectType, environments: WorkspaceEnv[]) => {
switch (type) { switch (type) {
case ProjectType.SecretManager: case ProjectType.SecretManager:
if (environments.length > 0) return "/projects/secret-management/$projectId/overview" as const;
return `/projects/secret-management/$projectId/secrets/${environments[0].slug}`;
return "/projects/secret-management/$projectId/overview";
case ProjectType.CertificateManager: case ProjectType.CertificateManager:
return "/projects/cert-management/$projectId/subscribers"; return "/projects/cert-management/$projectId/subscribers" as const;
case ProjectType.SecretScanning: case ProjectType.SecretScanning:
return `/projects/${type}/$projectId/data-sources` as const; return `/projects/${type}/$projectId/data-sources` as const;
default: default:
@@ -72,11 +72,7 @@ export const SecretManagerLayout = () => {
<Menu> <Menu>
<MenuGroup title="Resources"> <MenuGroup title="Resources">
<Link <Link
to={ to="/projects/secret-management/$projectId/overview"
currentWorkspace.environments.length
? "/projects/secret-management/$projectId/secrets/$envSlug"
: "/projects/secret-management/$projectId/overview"
}
params={{ params={{
projectId: currentWorkspace.id, projectId: currentWorkspace.id,
...(currentWorkspace.environments.length ...(currentWorkspace.environments.length
@@ -89,7 +85,7 @@ export const SecretManagerLayout = () => {
isSelected={ isSelected={
isActive || isActive ||
location.pathname.startsWith( location.pathname.startsWith(
`/projects/secret-management/${currentWorkspace.id}/secrets` `/projects/secret-management/${currentWorkspace.id}/overview`
) )
} }
> >
@@ -2,20 +2,20 @@ import { Controller, useForm } from "react-hook-form";
import { faQuestionCircle } from "@fortawesome/free-solid-svg-icons"; import { faQuestionCircle } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { zodResolver } from "@hookform/resolvers/zod"; import { zodResolver } from "@hookform/resolvers/zod";
import { useQuery } from "@tanstack/react-query";
import { twMerge } from "tailwind-merge"; import { twMerge } from "tailwind-merge";
import { z } from "zod"; import { z } from "zod";
import { createNotification } from "@app/components/notifications"; import { createNotification } from "@app/components/notifications";
import { OrgPermissionCan } from "@app/components/permissions";
import { Button, FormControl, Input, Select, SelectItem, Tooltip } from "@app/components/v2"; import { Button, FormControl, Input, Select, SelectItem, Tooltip } from "@app/components/v2";
import { NoticeBannerV2 } from "@app/components/v2/NoticeBannerV2/NoticeBannerV2"; import { NoticeBannerV2 } from "@app/components/v2/NoticeBannerV2/NoticeBannerV2";
import { useImportVault } from "@app/hooks/api/migration/mutations";
import { OrgPermissionCan } from "@app/components/permissions";
import { import {
OrgGatewayPermissionActions, OrgGatewayPermissionActions,
OrgPermissionSubjects OrgPermissionSubjects
} from "@app/context/OrgPermissionContext/types"; } from "@app/context/OrgPermissionContext/types";
import { useQuery } from "@tanstack/react-query";
import { gatewaysQueryKeys } from "@app/hooks/api"; import { gatewaysQueryKeys } from "@app/hooks/api";
import { useImportVault } from "@app/hooks/api/migration/mutations";
type Props = { type Props = {
id?: string; id?: string;
File diff suppressed because it is too large Load Diff