feat: removed last bit of workspace in frontend. Fatality!

This commit is contained in:
=
2025-09-16 00:08:41 +05:30
parent 37a80fa1ac
commit ac80242749
356 changed files with 1788 additions and 1890 deletions
@@ -42,7 +42,7 @@ import {
ProjectPermissionSub,
useProjectPermission,
useSubscription,
useWorkspace
useProject
} from "@app/context";
import { ProjectPermissionSecretRotationActions } from "@app/context/ProjectPermissionContext/types";
import { usePopUp } from "@app/hooks";
@@ -56,7 +56,7 @@ import { TSecretRotationProviderTemplate } from "@app/hooks/api/secretRotation/t
import { CreateRotationForm } from "@app/pages/secret-manager/SecretRotationPage/components/CreateRotationForm";
const Page = () => {
const { currentWorkspace } = useWorkspace();
const { currentProject } = useProject();
const { permission } = useProjectPermission();
const navigate = useNavigate();
@@ -68,7 +68,7 @@ const Page = () => {
"upgradePlan",
"secretRotationV2"
] as const);
const workspaceId = currentWorkspace?.id || "";
const workspaceId = currentProject?.id || "";
const canCreateRotation = permission.can(
ProjectPermissionSecretRotationActions.Create,
ProjectPermissionSub.SecretRotation
@@ -173,7 +173,7 @@ const Page = () => {
<Link
className="text-mineshaft-100 underline decoration-primary underline-offset-2 hover:text-mineshaft-200"
to="/projects/secret-management/$projectId/overview"
params={{ projectId: currentWorkspace.id }}
params={{ projectId: currentProject.id }}
>
Secret Manager Dashboard
</Link>{" "}
@@ -408,7 +408,7 @@ const Page = () => {
<Link
className="text-mineshaft-100 underline decoration-primary underline-offset-2 hover:text-mineshaft-200"
to="/projects/secret-management/$projectId/overview"
params={{ projectId: currentWorkspace.id }}
params={{ projectId: currentProject.id }}
>
Secret Manager Dashboard
</Link>{" "}
@@ -425,7 +425,7 @@ const Page = () => {
onClick={() =>
navigate({
to: "/projects/secret-management/$projectId/overview",
params: { projectId: currentWorkspace.id }
params: { projectId: currentProject.id }
})
}
colorSchema="secondary"
@@ -4,7 +4,7 @@ import { z } from "zod";
import { Button, FormControl, Input, Select, SelectItem, Spinner } from "@app/components/v2";
import { SecretPathInput } from "@app/components/v2/SecretPathInput";
import { useWorkspace } from "@app/context";
import { useProject } from "@app/context";
import { useGetProjectSecrets } from "@app/hooks/api";
const formSchema = z.object({
@@ -22,9 +22,9 @@ type Props = {
};
export const RotationOutputForm = ({ onSubmit, onCancel, outputSchema = {} }: Props) => {
const { currentWorkspace } = useWorkspace();
const environments = currentWorkspace?.environments || [];
const workspaceId = currentWorkspace?.id || "";
const { currentProject } = useProject();
const environments = currentProject?.environments || [];
const projectId = currentProject?.id || "";
const {
control,
handleSubmit,
@@ -39,7 +39,7 @@ export const RotationOutputForm = ({ onSubmit, onCancel, outputSchema = {} }: Pr
const selectedSecrets = watch("secrets");
const { data: secrets, isPending: isSecretsLoading } = useGetProjectSecrets({
workspaceId,
projectId,
environment,
secretPath
});