Update default widget gridPosition (#20740)

move DEFAULT_WIDGET_SIZE to twenty-shared and use it in sync application
manifest
This commit is contained in:
martmull
2026-05-20 08:15:53 +02:00
committed by GitHub
parent d17393e91d
commit 7ab6f5719f
9 changed files with 81 additions and 15 deletions
@@ -1,5 +1,7 @@
import { WidgetType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-type.enum';
import { DEFAULT_WIDGET_SIZE } from 'twenty-shared/constants';
import { fromPageLayoutWidgetManifestToUniversalFlatPageLayoutWidget } from 'src/engine/core-modules/application/application-manifest/converters/from-page-layout-widget-manifest-to-universal-flat-page-layout-widget.util';
import { WidgetType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-type.enum';
describe('fromPageLayoutWidgetManifestToUniversalFlatPageLayoutWidget', () => {
const now = '2026-01-01T00:00:00.000Z';
@@ -33,8 +35,8 @@ describe('fromPageLayoutWidgetManifestToUniversalFlatPageLayoutWidget', () => {
expect(result.gridPosition).toEqual({
row: 0,
column: 0,
rowSpan: 1,
columnSpan: 1,
rowSpan: DEFAULT_WIDGET_SIZE.default.h,
columnSpan: DEFAULT_WIDGET_SIZE.default.w,
});
expect(result.position).toBeNull();
expect(result.universalConfiguration).toEqual({
@@ -65,8 +67,8 @@ describe('fromPageLayoutWidgetManifestToUniversalFlatPageLayoutWidget', () => {
expect(result.gridPosition).toEqual({
row: 0,
column: 0,
rowSpan: 1,
columnSpan: 1,
rowSpan: DEFAULT_WIDGET_SIZE.default.h,
columnSpan: DEFAULT_WIDGET_SIZE.default.w,
});
expect(result.universalConfiguration).toEqual({
configurationType: 'IFRAME',
@@ -1,4 +1,5 @@
import { type PageLayoutWidgetManifest } from 'twenty-shared/application';
import { DEFAULT_WIDGET_SIZE } from 'twenty-shared/constants';
import { type WidgetType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-type.enum';
import { type UniversalFlatPageLayoutWidget } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-page-layout-widget.type';
@@ -27,8 +28,8 @@ export const fromPageLayoutWidgetManifestToUniversalFlatPageLayoutWidget = ({
gridPosition: pageLayoutWidgetManifest.gridPosition ?? {
row: 0,
column: 0,
rowSpan: 1,
columnSpan: 1,
rowSpan: DEFAULT_WIDGET_SIZE.default.h,
columnSpan: DEFAULT_WIDGET_SIZE.default.w,
},
position: null,
universalConfiguration: