improvement: address requested feedback

This commit is contained in:
Scott Wilson
2024-11-07 12:38:33 -08:00
parent 61f786e8d8
commit 19c26c680c
24 changed files with 263 additions and 193 deletions
@@ -1,25 +1,5 @@
import { TUnpackedPermission } from "@app/ee/services/project-template/project-template-types";
import { getPredefinedRoles } from "@app/services/project-role/project-role-fns";
export const ProjectTemplateDefaultEnvironments = [
{ name: "Development", slug: "dev", position: 1 },
{ name: "Staging", slug: "staging", position: 2 },
{ name: "Production", slug: "prod", position: 3 }
];
export const DefaultProjectTemplateIdentifier = "default";
export const getDefaultProjectTemplate = (orgId: string) => ({
id: "b11b49a9-09a9-4443-916a-4246f9ff2c69", // random ID to appease zod
name: DefaultProjectTemplateIdentifier,
createdAt: new Date(),
updatedAt: new Date(),
description: "Infisical's default project template",
environments: ProjectTemplateDefaultEnvironments,
roles: [...getPredefinedRoles("project-template")].map(({ name, slug, permissions }) => ({
name,
slug,
permissions: permissions as TUnpackedPermission[]
})),
orgId
});