The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Fix dashboard seeds (#16332)
Raphaël Bosi53d34f4d149a
diff --git a/packages/twenty-server/src/engine/workspace-manager/dev-seeder/core/utils/seed-page-layout-widgets.util.ts b/packages/twenty-server/src/engine/workspace-manager/dev-seeder/core/utils/seed-page-layout-widgets.util.tsindex cb2bf774fea..51601e6080a 100644--- a/packages/twenty-server/src/engine/workspace-manager/dev-seeder/core/utils/seed-page-layout-widgets.util.ts+++ b/packages/twenty-server/src/engine/workspace-manager/dev-seeder/core/utils/seed-page-layout-widgets.util.ts@@ -17,26 +17,30 @@ export const seedPageLayoutWidgets = async ({objectMetadataItems: ObjectMetadataEntity[];isDashboardV2Enabled: boolean;}) => {- const pageLayoutWidgets = getPageLayoutWidgetDataSeeds(+ const widgetSeeds = getPageLayoutWidgetDataSeeds(workspaceId,objectMetadataItems,isDashboardV2Enabled,- ).map((widget) => {- const validatedConfiguration = widget.configuration- ? validateAndTransformWidgetConfiguration({- type: widget.type,- configuration: widget.configuration,- isDashboardV2Enabled,- })- : null;+ );- return {- ...widget,- workspaceId,- gridPosition: widget.gridPosition,- configuration: validatedConfiguration,- };- });+ const pageLayoutWidgets = await Promise.all(+ widgetSeeds.map(async (widget) => {+ const validatedConfiguration = widget.configuration+ ? await validateAndTransformWidgetConfiguration({+ type: widget.type,+ configuration: widget.configuration,+ isDashboardV2Enabled,+ })+ : null;++ return {+ ...widget,+ workspaceId,+ gridPosition: widget.gridPosition,+ configuration: validatedConfiguration,+ };+ }),+ );if (pageLayoutWidgets.length > 0) {await dataSource