Pre hook for dashboard creation + updates on the entity (#14354)

Closes https://github.com/twentyhq/core-team-issues/issues/1417

- The pre-hook creates a page-layout and links it to the dashboard
- Added `position`, `createdBy`, `attachments`, `searchVector`,
`favorites` to the dashboard entity
- Updated the view seed
- Updated the page layout services to work within a transaction
This commit is contained in:
Raphaël Bosi
2025-09-09 14:55:22 +02:00
committed by GitHub
parent 861cb1c222
commit 3d2d14eb71
19 changed files with 657 additions and 115 deletions
@@ -40,6 +40,7 @@ export const ATTACHMENT_STANDARD_FIELD_IDS = {
person: '20202020-0158-4aa2-965c-5cdafe21ffa2',
company: '20202020-ceab-4a28-b546-73b06b4c08d5',
opportunity: '20202020-7374-499d-bea3-9354890755b5',
dashboard: '20202020-5324-43f3-9dbf-1a33e7de0ce6',
custom: '20202020-302d-43b3-9aea-aa4f89282a9f',
} as const;
@@ -193,6 +194,7 @@ export const TIMELINE_ACTIVITY_STANDARD_FIELD_IDS = {
workflow: '20202020-616c-4ad3-a2e9-c477c341e295',
workflowVersion: '20202020-74f1-4711-a129-e14ca0ecd744',
workflowRun: '20202020-96f0-401b-9186-a3a0759225ac',
dashboard: '20202020-7864-48f5-af7c-9e4b60140948',
custom: '20202020-4a71-41b0-9f83-9cdcca3f8b14',
linkedRecordCachedName: '20202020-cfdb-4bef-bbce-a29f41230934',
linkedRecordId: '20202020-2e0e-48c0-b445-ee6c1e61687d',
@@ -213,6 +215,7 @@ export const FAVORITE_STANDARD_FIELD_IDS = {
view: '20202020-5a93-4fa9-acce-e73481a0bbdf',
custom: '20202020-855a-4bc8-9861-79deef37011f',
favoriteFolder: '20202020-f658-4d12-8b4d-248356aa4bd9',
dashboard: '20202020-6ef9-45e4-b440-cc986f687c91',
} as const;
export const FAVORITE_FOLDER_STANDARD_FIELD_IDS = {
@@ -541,7 +544,13 @@ export const CUSTOM_OBJECT_STANDARD_FIELD_IDS = {
export const DASHBOARD_STANDARD_FIELD_IDS = {
title: '20202020-20ee-4091-95dc-44b57eda3a89',
position: '20202020-38af-409b-95f0-7f08aa5f420f',
pageLayoutId: '20202020-bb53-4648-aa36-1d9d54e6f7f2',
createdBy: '20202020-ff32-4fa1-b7ad-407cc6aa0734',
timelineActivities: '20202020-9b0c-5d6e-7f8a-9b0c1d2e3f4a',
favorites: '20202020-f032-478f-88fa-6426ff6f1e4c',
attachments: '20202020-bf6f-4220-8c55-2764f1175870',
searchVector: '20202020-0bcc-47a4-8360-2e35a7133f7a',
} as const;
export const STANDARD_OBJECT_FIELD_IDS = {