mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 00:48:25 +00:00
fixes: new version child components are not tied to its parent
This commit is contained in:
parent
abc6e85058
commit
04141a8232
1 changed files with 5 additions and 0 deletions
|
|
@ -410,6 +410,7 @@ export class AppsService {
|
|||
|
||||
const newComponents = [];
|
||||
const newComponentLayouts = [];
|
||||
const oldComponentToNewComponentMapping = {};
|
||||
|
||||
for (const page of pages) {
|
||||
const savedPage = await manager.save(
|
||||
|
|
@ -446,12 +447,16 @@ export class AppsService {
|
|||
const componentEvents = allEvents.filter((event) => event.sourceId === component.id);
|
||||
|
||||
newComponent.id = uuid.v4();
|
||||
|
||||
oldComponentToNewComponentMapping[component.id] = newComponent.id;
|
||||
|
||||
newComponent.name = component.name;
|
||||
newComponent.type = component.type;
|
||||
newComponent.pageId = savedPage.id;
|
||||
newComponent.properties = component.properties;
|
||||
newComponent.styles = component.styles;
|
||||
newComponent.validations = component.validations;
|
||||
newComponent.parent = component.parent ? oldComponentToNewComponentMapping[component.parent] : null;
|
||||
newComponent.page = savedPage;
|
||||
|
||||
newComponents.push(newComponent);
|
||||
|
|
|
|||
Loading…
Reference in a new issue