Skip to content

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

feedback + fix for null groups/users not working

x0322059d463429e605
diff --git a/backend/src/ee/services/project-template/project-template-service.ts b/backend/src/ee/services/project-template/project-template-service.ts
index 02393b6fc0..3b6be9e473 100644
--- a/backend/src/ee/services/project-template/project-template-service.ts
+++ b/backend/src/ee/services/project-template/project-template-service.ts
@@ -424,6 +424,8 @@ export const projectTemplateServiceFactory = ({
const member = orgMemberUsernames.get(u.username.toLowerCase());
return { membershipId: member!.id, roles: u.roles };
});
+ } else if (users === null) {
+ validatedUsers = [];
}
// Validate that groups exist in the organization
@@ -460,6 +462,8 @@ export const projectTemplateServiceFactory = ({
const group = orgGroupBySlug.get(g.groupSlug.toLowerCase());
return { groupId: group!.id, roles: g.roles };
});
+ } else if (groups === null) {
+ validatedGroups = [];
}
if (params.name && projectTemplate.name !== params.name) {
diff --git a/backend/src/lib/api-docs/constants.ts b/backend/src/lib/api-docs/constants.ts
index 0abd68e8c1..0e18ae8c5f 100644
--- a/backend/src/lib/api-docs/constants.ts
+++ b/backend/src/lib/api-docs/constants.ts
@@ -2331,7 +2331,8 @@ export const ProjectTemplates = {
environments: "The environments to be created when the template is applied to a project.",
users:
"The users to be automatically added to projects created from this template. Each user is identified by username and assigned one or more roles.",
- groups: "The groups to be added to projects created from this template."
+ groups:
+ "The groups to be automatically added to projects created from this template. Each group is identified by slug and assigned one or more roles."
},
UPDATE: {
templateId: "The ID of the project template to be updated.",
diff --git a/frontend/src/pages/organization/SettingsPage/components/ProjectTemplatesTab/components/ProjectTemplatesTable.tsx b/frontend/src/pages/organization/SettingsPage/components/ProjectTemplatesTab/components/ProjectTemplatesTable.tsx
index b23b1d3693..3adda754c9 100644
--- a/frontend/src/pages/organization/SettingsPage/components/ProjectTemplatesTab/components/ProjectTemplatesTable.tsx
+++ b/frontend/src/pages/organization/SettingsPage/components/ProjectTemplatesTab/components/ProjectTemplatesTable.tsx
@@ -52,7 +52,7 @@ export const ProjectTemplatesTable = ({ onEdit }: Props) => {
[search, projectTemplates]
);
- const colSpan = 4;
+ const colSpan = 5;
return (
<div>
@@ -125,7 +125,7 @@ export const ProjectTemplatesTable = ({ onEdit }: Props) => {
</Td>
<Td className="pl-8">
{users?.length || 0}
- {users?.length && (
+ {users && Boolean(users.length) && (
<Tooltip
content={
<ul className="ml-2 list-disc">
@@ -145,7 +145,7 @@ export const ProjectTemplatesTable = ({ onEdit }: Props) => {
</Td>
<Td className="pl-8">
{groups?.length || 0}
- {groups?.length && (
+ {groups && Boolean(groups.length) && (
<Tooltip
content={
<ul className="ml-2 list-disc">