mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-21 21:28:14 +00:00
feat: removed last bit of workspace in frontend. Fatality!
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user