fixes: general properties of widgets are not getting saved (#7638)

This commit is contained in:
Arpit 2023-10-06 16:36:03 +05:30 committed by GitHub
parent b3625d6cef
commit 139967132b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 2 deletions

View file

@ -1709,6 +1709,10 @@ export const buildComponentMetaDefinition = (components = {}) => {
...componentMeta.definition.others,
...currentComponentData?.component.definition.others,
},
general: {
...componentMeta.definition.general,
...currentComponentData?.component.definition.general,
},
};
const mergedComponent = {

View file

@ -37,6 +37,11 @@ export class CreateComponentTable1691006952074 implements MigrationInterface {
type: 'json',
isNullable: true,
},
{
name: 'general_properties',
type: 'json',
isNullable: true,
},
{
name: 'styles',
type: 'json',

View file

@ -33,6 +33,9 @@ export class Component {
@Column('simple-json')
properties: any;
@Column('simple-json', { name: 'general_properties', nullable: true })
general: any;
@Column('simple-json')
styles: any;

View file

@ -208,8 +208,9 @@ export class ComponentsService {
return transformedComponents;
}
createComponentWithLayout(componentData, layoutData) {
const { id, name, properties, styles, generalStyles, validations, parent, displayPreferences } = componentData;
createComponentWithLayout(componentData: Component, layoutData) {
const { id, name, properties, styles, generalStyles, validations, parent, displayPreferences, general } =
componentData;
const { type, top, left, width, height } = layoutData;
const componentWithLayout = {
[id]: {
@ -221,6 +222,7 @@ export class ComponentsService {
styles,
generalStyles,
validations,
general,
others: displayPreferences,
},
parent,