Migrate pagelayout position frontend (#18229)
## Context Part 1 of migrating gridPosition in favor of typed position FE should now always send both values to the BE and use both. Next steps: - Update the backend to enforce and validate the new position field + DB migrations gridPositon -> position (type: GRID) - Cleanup frontend usage - Cleanup backend
This commit is contained in:
+12
-1
@@ -1,6 +1,9 @@
|
||||
import { type DraftPageLayout } from '@/page-layout/types/DraftPageLayout';
|
||||
import { isDynamicRelationWidget } from '@/page-layout/utils/isDynamicRelationWidget';
|
||||
import { type UpdatePageLayoutWithTabsInput } from '~/generated-metadata/graphql';
|
||||
import {
|
||||
PageLayoutTabLayoutMode,
|
||||
type UpdatePageLayoutWithTabsInput,
|
||||
} from '~/generated-metadata/graphql';
|
||||
|
||||
export const convertPageLayoutDraftToUpdateInput = (
|
||||
pageLayoutDraft: DraftPageLayout,
|
||||
@@ -27,6 +30,14 @@ export const convertPageLayoutDraftToUpdateInput = (
|
||||
rowSpan: widget.gridPosition.rowSpan,
|
||||
columnSpan: widget.gridPosition.columnSpan,
|
||||
},
|
||||
position: {
|
||||
layoutMode:
|
||||
widget.position?.layoutMode ?? PageLayoutTabLayoutMode.GRID,
|
||||
row: widget.gridPosition.row,
|
||||
column: widget.gridPosition.column,
|
||||
rowSpan: widget.gridPosition.rowSpan,
|
||||
columnSpan: widget.gridPosition.columnSpan,
|
||||
},
|
||||
configuration: widget.configuration ?? null,
|
||||
})),
|
||||
})),
|
||||
|
||||
Reference in New Issue
Block a user