Skip to content

Commit 9b7d07c

Browse files
authored
DYN-8469: Disallow empty groups with pins #2 (DynamoDS#15934)
1 parent 5888eaf commit 9b7d07c

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

src/DynamoCore/Models/DynamoModel.cs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2793,12 +2793,19 @@ internal void UngroupModel(List<ModelBase> modelsToUngroup)
27932793
CurrentWorkspace.RecordGroupModelBeforeUngroup(annotation);
27942794
if (list.Remove(model))
27952795
{
2796-
if (model is ConnectorPinModel pinModel)
2796+
if (!list.Any(n => n is not ConnectorPinModel))
27972797
{
2798-
annotation.MarkPinAsRemoved(pinModel);
2798+
emptyGroup.Add(annotation);
2799+
}
2800+
else
2801+
{
2802+
if (model is ConnectorPinModel pinModel)
2803+
{
2804+
annotation.MarkPinAsRemoved(pinModel);
2805+
}
2806+
annotation.Nodes = list;
2807+
annotation.UpdateBoundaryFromSelection();
27992808
}
2800-
annotation.Nodes = list;
2801-
annotation.UpdateBoundaryFromSelection();
28022809
}
28032810
}
28042811
else

0 commit comments

Comments
 (0)