Skip to content

Commit 027462c

Browse files
authored
fix(mergeWizard): insert element at valid position (openscd#888)
The merge wizard was implemented before our "choose a valid position automatically" feature was implemented for insert and move actions in Editing (`reference: undefined`). Therefore, all insert actions fired by the merge wizard insert the element at as the parent's last child, resulting in schema invalid files in many cases (e.g. insert a Substation section in a file with an IED or DataTypeTemplates). This fixes that issue, making our Merge and UpdateSubstation plugins schema compliant.
1 parent 4a54a00 commit 027462c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wizards.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function mergeWizardAction(
7373
for (const diff of selectedChildDiffs)
7474
if (!diff.ours)
7575
actions.push({
76-
new: { parent, element: diff.theirs, reference: null },
76+
new: { parent, element: diff.theirs },
7777
});
7878
else if (!diff.theirs)
7979
actions.push({

0 commit comments

Comments
 (0)