from gaphor.diagram.grouping import AbstractGroup, Group
from gaphor.SysML.blocks.block import BlockItem
from gaphor.SysML.blocks.property import PropertyItem


@Group.register(BlockItem, PropertyItem)
class NodeGroup(AbstractGroup):
    """
    Add node to another node.
    """

    def group(self):
        self.parent.subject.ownedAttribute = self.item.subject

    def ungroup(self):
        del self.parent.subject.ownedAttribute[self.item.subject]

from gaphor.diagram.grouping import AbstractGroup, Group
from gaphor.SysML.blocks.block import BlockItem
from gaphor.SysML.blocks.property import PropertyItem


@Group.register(BlockItem, PropertyItem)
class PropertyGroup(AbstractGroup):
    """
    Add Property to a Block.
    """

    def group(self):
        self.parent.subject.ownedAttribute = self.item.subject

    def ungroup(self):
        del self.parent.subject.ownedAttribute[self.item.subject]

Fix name for property/block group
Fix name for property/block group

  from gaphor.diagram.grouping import AbstractGroup, Group
  from gaphor.SysML.blocks.block import BlockItem
  from gaphor.SysML.blocks.property import PropertyItem
  
  
  @Group.register(BlockItem, PropertyItem)
- class NodeGroup(AbstractGroup):
+ class PropertyGroup(AbstractGroup):
      """
-     Add node to another node.
+     Add Property to a Block.
      """
  
      def group(self):
          self.parent.subject.ownedAttribute = self.item.subject
  
      def ungroup(self):
          del self.parent.subject.ownedAttribute[self.item.subject]
  
Fix name for property/block group
## Code Before:
from gaphor.diagram.grouping import AbstractGroup, Group
from gaphor.SysML.blocks.block import BlockItem
from gaphor.SysML.blocks.property import PropertyItem


@Group.register(BlockItem, PropertyItem)
class NodeGroup(AbstractGroup):
    """
    Add node to another node.
    """

    def group(self):
        self.parent.subject.ownedAttribute = self.item.subject

    def ungroup(self):
        del self.parent.subject.ownedAttribute[self.item.subject]

## Instruction:
Fix name for property/block group
## Code After:
from gaphor.diagram.grouping import AbstractGroup, Group
from gaphor.SysML.blocks.block import BlockItem
from gaphor.SysML.blocks.property import PropertyItem


@Group.register(BlockItem, PropertyItem)
class PropertyGroup(AbstractGroup):
    """
    Add Property to a Block.
    """

    def group(self):
        self.parent.subject.ownedAttribute = self.item.subject

    def ungroup(self):
        del self.parent.subject.ownedAttribute[self.item.subject]
