2
0

(theme) Add theme templates

Allows you to save your themes and select a theme from Typebot's gallery

Closes #275
This commit is contained in:
Baptiste Arnaud
2023-03-28 15:10:06 +02:00
parent c1cf817127
commit 38ed5758fe
49 changed files with 2066 additions and 116 deletions

View File

@ -0,0 +1,17 @@
-- AlterTable
ALTER TABLE "Typebot" ADD COLUMN "selectedThemeTemplateId" TEXT;
-- CreateTable
CREATE TABLE "ThemeTemplate" (
"id" TEXT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"name" TEXT NOT NULL,
"theme" JSONB NOT NULL,
"workspaceId" TEXT NOT NULL,
CONSTRAINT "ThemeTemplate_pkey" PRIMARY KEY ("id")
);
-- AddForeignKey
ALTER TABLE "ThemeTemplate" ADD CONSTRAINT "ThemeTemplate_workspaceId_fkey" FOREIGN KEY ("workspaceId") REFERENCES "Workspace"("id") ON DELETE CASCADE ON UPDATE CASCADE;

View File

@ -89,6 +89,7 @@ model Workspace {
customChatsLimit Int?
customStorageLimit Int?
customSeatsLimit Int?
themeTemplates ThemeTemplate[]
}
model MemberInWorkspace {
@ -164,6 +165,7 @@ model Typebot {
variables Json
edges Json
theme Json
selectedThemeTemplateId String?
settings Json
publicId String? @unique
customDomain String? @unique
@ -304,6 +306,16 @@ model ChatSession {
state Json
}
model ThemeTemplate {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
name String
theme Json
workspace Workspace @relation(fields: [workspaceId], references: [id], onDelete: Cascade)
workspaceId String
}
enum WorkspaceRole {
ADMIN
MEMBER