Add a new graphql mutation in the pageLayout resolver to handle page layout update with tabs and widgets (#14612)

Add a new graphql mutation in the pageLayout resolver to handle page
layout update with tabs and widgets.

Later we will add validation inside the service to check if the page
layout tab structure is correct (for instance check widgets don't
overlap or aren't out of the grid, or to check that they have a correct
configuration ...).

This mutation will be plugged to the save action of the dashboards in
the frontend.
This commit is contained in:
Raphaël Bosi
2025-09-23 11:00:36 +02:00
committed by GitHub
parent fbd3286792
commit 7cb294169d
20 changed files with 1858 additions and 8 deletions
@@ -0,0 +1,48 @@
import gql from 'graphql-tag';
import { PAGE_LAYOUT_GQL_FIELDS } from 'test/integration/constants/page-layout-gql-fields.constants';
import { type UpdatePageLayoutWithTabsInput } from 'src/engine/core-modules/page-layout/dtos/inputs/update-page-layout-with-tabs.input';
type UpdatePageLayoutWithTabsOperationFactoryParams = {
gqlFields?: string;
pageLayoutId: string;
data: UpdatePageLayoutWithTabsInput;
};
export const updatePageLayoutWithTabsOperationFactory = ({
gqlFields = PAGE_LAYOUT_GQL_FIELDS,
pageLayoutId,
data,
}: UpdatePageLayoutWithTabsOperationFactoryParams) => ({
query: gql`
mutation UpdatePageLayoutWithTabsAndWidgets($id: String!, $input: UpdatePageLayoutWithTabsInput!) {
updatePageLayoutWithTabsAndWidgets(id: $id, input: $input) {
${gqlFields}
tabs {
id
title
position
pageLayoutId
widgets {
id
title
type
pageLayoutTabId
objectMetadataId
gridPosition {
row
column
rowSpan
columnSpan
}
configuration
}
}
}
}
`,
variables: {
id: pageLayoutId,
input: data,
},
});