fix(map): clear modelId recursively on grouped duplicates#234
Draft
fix(map): clear modelId recursively on grouped duplicates#234
Conversation
When duplicating or copy-pasting grouped elements, only top-level cells had their modelId cleared. Children nested inside the group kept their original modelId, causing the backend to overwrite the original element's parentId on save — deleting the parent group. Clear modelId recursively on all descendants in Graph.duplicateCells, and recurse into children in the pasteHere and duplicate actions. MON-181396
|
Great job! No new security vulnerabilities introduced in this pull request |
Yassir-BenBOUBKER
left a comment
There was a problem hiding this comment.
Need to be tested, i well see tomorrow
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
When copying/pasting or duplicating grouped elements in the MAP editor, clicking save deletes the parent group.
Root cause: When a group is duplicated or copy-pasted, only the top-level cells get their
modelIdcleared. Children nested inside the group keep their originalmodelId. On save, both original and cloned children share the samemodelId, causing the backend to overwrite the original element'sparentIdwith the clone's group cell ID. The original group then has zero children and disappears.Fix: Clear
modelIdrecursively on all descendants inGraph.duplicateCells, and recurse into children in thepasteHereandduplicateactions inActions.js.Fixes MON-181396
Type of change
Target serie
How this pull request can be tested ?