ls1intum / Apollon

UML Modeling Editor written in React
https://apollon-library.readthedocs.io
MIT License
65 stars 22 forks source link

Clipboard item diagram type not checked before pasting #120

Closed flodt closed 3 years ago

flodt commented 4 years ago

Describe the bug

When copying items via the clipboard and pasting in to a diagram, the type of the item is not checked before inserting it into the document. It is thus possible to paste, for example, UMLUseCaseActors into class diagrams, or UMLComponents into activity diagrams, etc.

To Reproduce

  1. Create a diagram of any type.
  2. Copy one of the elements of the diagram to the clipboard.
  3. Create a new diagram of another type.
  4. Paste the illegal diagram element into the new diagram.

Expected behavior

Diagram elements of other types are not pasted.

Screenshots

Screenshot 2020-07-24 at 16 04 11

Environment

 - OS: macOS 10.15 Catalina
 - Browser Chrome 84.0.4147.89
jannismain commented 4 years ago

Actually, I like this "feature". Might result in other issues (like unexpected behaviour of components in foreign diagrams), but as an "escape hatch" to create custom diagrams, it might be useful :-)

flodt commented 4 years ago

That's true - it's very practical for creating some more informal, or freely designed models.

Then maybe it would also be nice to choose the components from different diagram types in the sidebar on the fly, rather than when creating the diagram and then being "locked in" to that one type.

TobiasPr commented 4 years ago

The focus of Apollon is on simplicity and not to rebuild advanced tools like draw.io, star-uml, etc. . We do not want to overwhelm inexperienced users with too many choices. I see the potential here for inexperienced users to mix up elements of different diagrams and thereby creating wrong models, but I am happy to discuss if it makes sense to include a more advanced mode, in which this is possible.

@krusche what is your opinion on this?

TobiasPr commented 3 years ago

Implemented a filter which allows only elements of the same diagram type to be pasted