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
@@ -43,7 +43,7 @@ import {
ProjectPermissionPkiTemplateActions,
ProjectPermissionSub,
useSubscription,
useWorkspace
useProject
} from "@app/context";
import { usePopUp } from "@app/hooks";
import { useDeleteCertTemplateV2 } from "@app/hooks/api";
@@ -55,7 +55,7 @@ import { PkiTemplateForm } from "./components/PkiTemplateForm";
const PER_PAGE_INIT = 25;
export const PkiTemplateListPage = () => {
const { t } = useTranslation();
const { currentWorkspace } = useWorkspace();
const { currentProject } = useProject();
const [page, setPage] = useState(1);
const [perPage, setPerPage] = useState(PER_PAGE_INIT);
const { handlePopUpToggle, popUp, handlePopUpOpen, handlePopUpClose } = usePopUp([
@@ -68,7 +68,7 @@ export const PkiTemplateListPage = () => {
const { subscription } = useSubscription();
const { data, isPending } = useListCertificateTemplates({
projectId: currentWorkspace.id,
projectId: currentProject.id,
offset: (page - 1) * perPage,
limit: perPage
});
@@ -78,7 +78,7 @@ export const PkiTemplateListPage = () => {
const onRemovePkiSubscriberSubmit = async () => {
try {
const pkiTemplate = await deleteCertTemplate.mutateAsync({
projectId: currentWorkspace.id,
projectId: currentProject.id,
templateName: popUp?.deleteTemplate?.data?.name
});
@@ -18,7 +18,7 @@ import {
Input,
Tooltip
} from "@app/components/v2";
import { useWorkspace } from "@app/context";
import { useProject } from "@app/context";
import {
useCreateCertTemplateV2,
useListCasByProjectId,
@@ -72,9 +72,9 @@ type Props = {
};
export const PkiTemplateForm = ({ certTemplate, handlePopUpToggle }: Props) => {
const { currentWorkspace } = useWorkspace();
const { currentProject } = useProject();
const { data: cas, isPending: isCaLoading } = useListCasByProjectId(currentWorkspace.id);
const { data: cas, isPending: isCaLoading } = useListCasByProjectId(currentProject.id);
const { mutateAsync: createCertTemplate } = useCreateCertTemplateV2();
const { mutateAsync: updateCertTemplate } = useUpdateCertTemplateV2();
@@ -124,7 +124,7 @@ export const PkiTemplateForm = ({ certTemplate, handlePopUpToggle }: Props) => {
extendedKeyUsages,
ca
}: FormData) => {
if (!currentWorkspace?.id) {
if (!currentProject?.id) {
return;
}
@@ -132,7 +132,7 @@ export const PkiTemplateForm = ({ certTemplate, handlePopUpToggle }: Props) => {
if (certTemplate) {
await updateCertTemplate({
templateName: certTemplate.name,
projectId: currentWorkspace.id,
projectId: currentProject.id,
caName: ca.name,
name,
commonName,
@@ -152,7 +152,7 @@ export const PkiTemplateForm = ({ certTemplate, handlePopUpToggle }: Props) => {
});
} else {
await createCertTemplate({
projectId: currentWorkspace.id,
projectId: currentProject.id,
caName: ca.name,
name,
commonName,