Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

show default template

Matheus Nogueira4bc118d0588d
diff --git a/frontend/src/pages/organization/ProductSettingsPage/SecretsManagement/project-templates/EditProjectTemplateSection/EditProjectTemplateSection.tsx b/frontend/src/pages/organization/ProductSettingsPage/SecretsManagement/project-templates/EditProjectTemplateSection/EditProjectTemplateSection.tsx
index 909d94e4f8..4e2350ff58 100644
--- a/frontend/src/pages/organization/ProductSettingsPage/SecretsManagement/project-templates/EditProjectTemplateSection/EditProjectTemplateSection.tsx
+++ b/frontend/src/pages/organization/ProductSettingsPage/SecretsManagement/project-templates/EditProjectTemplateSection/EditProjectTemplateSection.tsx
@@ -1,10 +1,9 @@
+import { useMemo } from "react";
import { ChevronLeft } from "lucide-react";
import { Button, Empty, EmptyHeader, EmptyTitle, PageLoader } from "@app/components/v3";
-import {
- InfisicalProjectTemplate,
- useGetProjectTemplateById
-} from "@app/hooks/api/projectTemplates";
+import { InfisicalProjectTemplate, useListProjectTemplates } from "@app/hooks/api/projectTemplates";
+import { ProjectType } from "@app/hooks/api/projects/types";
import { EditProjectTemplate } from "./components";
@@ -14,7 +13,23 @@ type Props = {
};
export const EditProjectTemplateSection = ({ templateId, onBack }: Props) => {
- const { data: projectTemplate, isPending } = useGetProjectTemplateById(templateId);
+ const { data: projectTemplates, isPending } = useListProjectTemplates();
+
+ const projectTemplate = useMemo(() => {
+ const template = projectTemplates?.find(
+ (t) => t.id === templateId && t.type === ProjectType.SecretManager
+ );
+ if (!template) return undefined;
+
+ return {
+ ...template,
+ roles: template.roles.map((role) => ({
+ ...role,
+ permissions: role.permissions.filter((perm) => perm.subject !== "secret-events")
+ }))
+ };
+ }, [projectTemplates, templateId]);
+
const isInfisicalTemplate = Object.values(InfisicalProjectTemplate).includes(
projectTemplate?.name as InfisicalProjectTemplate
);
diff --git a/frontend/src/pages/organization/ProductSettingsPage/SecretsManagement/project-templates/ProjectTemplatesTable.tsx b/frontend/src/pages/organization/ProductSettingsPage/SecretsManagement/project-templates/ProjectTemplatesTable.tsx
index d76b99ce83..a6a74b29b2 100644
--- a/frontend/src/pages/organization/ProductSettingsPage/SecretsManagement/project-templates/ProjectTemplatesTable.tsx
+++ b/frontend/src/pages/organization/ProductSettingsPage/SecretsManagement/project-templates/ProjectTemplatesTable.tsx
@@ -57,7 +57,6 @@ export const ProjectTemplatesTable = ({ onEdit }: Props) => {
() =>
projectTemplates?.filter(
(template) =>
- template.name !== 'default' &&
template.type === ProjectType.SecretManager &&
template.name.toLowerCase().includes(search.toLowerCase().trim())
) ?? [],
@@ -130,8 +129,8 @@ export const ProjectTemplatesTable = ({ onEdit }: Props) => {
return (
<TableRow
- onClick={isDefault ? undefined : () => onEdit(template)}
- className={isDefault ? "" : "cursor-pointer hover:bg-mineshaft-700"}
+ onClick={() => onEdit(template)}
+ className="cursor-pointer hover:bg-mineshaft-700"
key={id}
>
<TableCell>