Persist update on board drag and drop (#328)

* chore: move dnd lib comment aligned with import

* feature: add onUpdate on board

* chore: remove multi entity pipelines

* feature: add pipelineProgressableType field

* feature: fetch progressableType in board

* feature: implement on update to persist progress change
This commit is contained in:
Sammy Teillet
2023-06-20 10:56:36 +02:00
committed by GitHub
parent 950a0b77fe
commit c120903a45
50 changed files with 308 additions and 40 deletions

View File

@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "pipelines" ADD COLUMN "pipelineProgressableType" "PipelineProgressableType" NOT NULL DEFAULT 'Company';

View File

@ -293,6 +293,7 @@ model Pipeline {
icon String
pipelineStages PipelineStage[]
pipelineProgresses PipelineProgress[]
pipelineProgressableType PipelineProgressableType @default(Company)
/// @TypeGraphQL.omit(input: true, output: true)
workspaceId String
/// @TypeGraphQL.omit(input: true, output: true)

View File

@ -8,6 +8,7 @@ export const seedPipelines = async (prisma: PrismaClient) => {
name: 'Sales pipeline',
icon: '💰',
workspaceId: 'twenty-7ed9d212-1c25-4d02-bf25-6aeccf7ea419',
pipelineProgressableType: 'Person',
},
});
@ -97,6 +98,7 @@ export const seedPipelines = async (prisma: PrismaClient) => {
name: 'Customer support pipeline',
icon: '📔',
workspaceId: 'twenty-7ed9d212-1c25-4d02-bf25-6aeccf7ea419',
pipelineProgressableType: 'Person',
},
});
@ -134,6 +136,7 @@ export const seedPipelines = async (prisma: PrismaClient) => {
name: 'Sales pipeline',
icon: '💰',
workspaceId: 'twenty-dev-7ed9d212-1c25-4d02-bf25-6aeccf7ea420',
pipelineProgressableType: 'Person',
},
});
@ -201,17 +204,4 @@ export const seedPipelines = async (prisma: PrismaClient) => {
workspaceId: 'twenty-dev-7ed9d212-1c25-4d02-bf25-6aeccf7ea420',
},
});
await prisma.pipelineProgress.upsert({
where: { id: 'twenty-dev-fe256b39-3ec3-4fe7-8998-b76aa0bfb600' },
update: {},
create: {
id: 'twenty-dev-fe256b39-3ec3-4fe7-8998-b76aa0bfb600',
pipelineId: 'twenty-dev-fe256b39-3ec3-4fe3-8997-b75aa0bfb400',
pipelineStageId: 'twenty-dev-fe256b39-3ec3-4fe3-8998-b76aa0bfb600',
progressableType: 'Company',
progressableId: 'twenty-dev-a674fa6c-1455-4c57-afaf-dd5dc086361e',
workspaceId: 'twenty-dev-7ed9d212-1c25-4d02-bf25-6aeccf7ea420',
},
});
};