Fix moving a widget to another tab (#19450)
https://github.com/user-attachments/assets/aac81e79-7f2f-4a34-bf68-c76061086821 --------- Co-authored-by: Weiko <corentin@twenty.com>
This commit is contained in:
committed by
GitHub
parent
1e908e5f0f
commit
16e145b036
+5
@@ -22,6 +22,11 @@ import { AllPageLayoutWidgetConfiguration } from 'src/engine/metadata-modules/pa
|
||||
|
||||
@InputType()
|
||||
export class UpdatePageLayoutWidgetInput {
|
||||
@Field(() => UUIDScalarType, { nullable: true })
|
||||
@IsUUID()
|
||||
@IsOptional()
|
||||
pageLayoutTabId?: string;
|
||||
|
||||
@Field({ nullable: true })
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
|
||||
+2
@@ -4,6 +4,7 @@ import {
|
||||
PageLayoutWidgetConditionalDisplay,
|
||||
PageLayoutWidgetPosition,
|
||||
type GridPosition,
|
||||
type SerializedRelation,
|
||||
} from 'twenty-shared/types';
|
||||
import {
|
||||
Column,
|
||||
@@ -30,6 +31,7 @@ export type PageLayoutWidgetOverrides = {
|
||||
title?: string;
|
||||
position?: PageLayoutWidgetPosition | null;
|
||||
conditionalDisplay?: PageLayoutWidgetConditionalDisplay | null;
|
||||
pageLayoutTabId?: SerializedRelation;
|
||||
};
|
||||
|
||||
@Entity({ name: 'pageLayoutWidget', schema: 'core' })
|
||||
|
||||
+6
-2
@@ -18,6 +18,7 @@ import {
|
||||
import { CreatePageLayoutWidgetInput } from 'src/engine/metadata-modules/page-layout-widget/dtos/inputs/create-page-layout-widget.input';
|
||||
import { UpdatePageLayoutWidgetInput } from 'src/engine/metadata-modules/page-layout-widget/dtos/inputs/update-page-layout-widget.input';
|
||||
import { type PageLayoutWidgetDTO } from 'src/engine/metadata-modules/page-layout-widget/dtos/page-layout-widget.dto';
|
||||
import { resolveOverridableEntityProperty } from 'src/engine/metadata-modules/utils/resolve-overridable-entity-property.util';
|
||||
import { WidgetConfigurationType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-configuration-type.type';
|
||||
import {
|
||||
PageLayoutWidgetException,
|
||||
@@ -162,8 +163,8 @@ export class PageLayoutWidgetService {
|
||||
.filter(isDefined)
|
||||
.filter(
|
||||
(widget) =>
|
||||
widget.pageLayoutTabId === pageLayoutTabId &&
|
||||
!isDefined(widget.deletedAt),
|
||||
resolveOverridableEntityProperty(widget, 'pageLayoutTabId') ===
|
||||
pageLayoutTabId && !isDefined(widget.deletedAt),
|
||||
)
|
||||
.sort(
|
||||
(widgetA, widgetB) =>
|
||||
@@ -317,6 +318,7 @@ export class PageLayoutWidgetService {
|
||||
flatFrontComponentMaps: existingFlatFrontComponentMaps,
|
||||
flatViewFieldGroupMaps: existingFlatViewFieldGroupMaps,
|
||||
flatViewMaps: existingFlatViewMaps,
|
||||
flatPageLayoutTabMaps: existingFlatPageLayoutTabMaps,
|
||||
},
|
||||
{ workspaceCustomFlatApplication },
|
||||
] = await Promise.all([
|
||||
@@ -329,6 +331,7 @@ export class PageLayoutWidgetService {
|
||||
'flatFrontComponentMaps',
|
||||
'flatViewFieldGroupMaps',
|
||||
'flatViewMaps',
|
||||
'flatPageLayoutTabMaps',
|
||||
],
|
||||
},
|
||||
),
|
||||
@@ -368,6 +371,7 @@ export class PageLayoutWidgetService {
|
||||
flatFrontComponentMaps: existingFlatFrontComponentMaps,
|
||||
flatViewFieldGroupMaps: existingFlatViewFieldGroupMaps,
|
||||
flatViewMaps: existingFlatViewMaps,
|
||||
flatPageLayoutTabMaps: existingFlatPageLayoutTabMaps,
|
||||
callerApplicationUniversalIdentifier:
|
||||
workspaceCustomFlatApplication.universalIdentifier,
|
||||
workspaceCustomApplicationUniversalIdentifier:
|
||||
|
||||
Reference in New Issue
Block a user