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
@@ -15,7 +15,7 @@ import {
Tooltip
} from "@app/components/v2";
import { ROUTE_PATHS } from "@app/const/routes";
import { ProjectPermissionActions, ProjectPermissionSub, useWorkspace } from "@app/context";
import { ProjectPermissionActions, ProjectPermissionSub, useProject } from "@app/context";
import { CaType, useDeleteCa, useGetCa } from "@app/hooks/api";
import { TInternalCertificateAuthority } from "@app/hooks/api/ca/types";
import { usePopUp } from "@app/hooks/usePopUp";
@@ -30,7 +30,7 @@ import {
} from "./components";
const Page = () => {
const { currentWorkspace } = useWorkspace();
const { currentProject } = useProject();
const navigate = useNavigate();
const params = useParams({
from: ROUTE_PATHS.CertManager.CertAuthDetailsByIDPage.id
@@ -38,11 +38,11 @@ const Page = () => {
const { caName } = params as { caName: string };
const { data } = useGetCa({
caName,
projectId: currentWorkspace?.id || "",
projectId: currentProject?.id || "",
type: CaType.INTERNAL
}) as { data: TInternalCertificateAuthority };
const projectId = currentWorkspace?.id || "";
const projectId = currentProject?.id || "";
const { mutateAsync: deleteCa } = useDeleteCa();
@@ -55,11 +55,11 @@ const Page = () => {
const onRemoveCaSubmit = async () => {
try {
if (!currentWorkspace?.slug) return;
if (!currentProject?.slug) return;
await deleteCa({
caName,
projectId: currentWorkspace.id,
projectId: currentProject.id,
type: CaType.INTERNAL
});
@@ -4,7 +4,7 @@ import { format } from "date-fns";
import { ProjectPermissionCan } from "@app/components/permissions";
import { Button, IconButton, Tooltip } from "@app/components/v2";
import { ProjectPermissionActions, ProjectPermissionSub, useWorkspace } from "@app/context";
import { ProjectPermissionActions, ProjectPermissionSub, useProject } from "@app/context";
import { useTimedReset } from "@app/hooks";
import { CaStatus, CaType, InternalCaType, useGetCa } from "@app/hooks/api";
import { caStatusToNameMap, caTypeToNameMap } from "@app/hooks/api/ca/constants";
@@ -21,7 +21,7 @@ type Props = {
};
export const CaDetailsSection = ({ caName, handlePopUpOpen }: Props) => {
const { currentWorkspace } = useWorkspace();
const { currentProject } = useProject();
const [copyTextId, isCopyingId, setCopyTextId] = useTimedReset<string>({
initialState: "Copy ID to clipboard"
});
@@ -31,7 +31,7 @@ export const CaDetailsSection = ({ caName, handlePopUpOpen }: Props) => {
const { data } = useGetCa({
caName,
projectId: currentWorkspace.id,
projectId: currentProject.id,
type: CaType.INTERNAL
});
@@ -13,7 +13,7 @@ import {
Select,
SelectItem
} from "@app/components/v2";
import { useWorkspace } from "@app/context";
import { useProject } from "@app/context";
import {
CaRenewalType,
useRenewCa
@@ -45,8 +45,8 @@ type Props = {
};
export const CaRenewalModal = ({ popUp, handlePopUpToggle }: Props) => {
const { currentWorkspace } = useWorkspace();
const projectSlug = currentWorkspace?.slug || "";
const { currentProject } = useProject();
const projectSlug = currentProject?.slug || "";
const popUpData = popUp?.renewCa?.data as {
caId: string;