mermaid-js / zenuml-core

The ZenUML renderer
https://embed.zenuml.com
MIT License
31 stars 8 forks source link

Feat/editable participant #142

Closed dontry closed 5 months ago

dontry commented 5 months ago

This PR enables users to edit participant name:

  1. Add a new member participantPositions to Pariticipants class. participantPositions is a map where to keep track of participant names and their positions.

  2. Record participant's position when traversing the parseTree.

  3. Create a new component PariticipantLabel for editing label names and updating the participant instances in code

  4. Disable edit in static render mode

https://github.com/mermaid-js/zenuml-core/assets/3481791/7e94e357-10fb-4f17-8915-ebc783fb9225

MrCoder commented 5 months ago

In the following case, the expected result should be

A as "A is a service 1"
A.method

https://github.com/mermaid-js/zenuml-core/assets/169417/a9461ce6-0c38-425f-bed2-6587c43d11b5

dontry commented 5 months ago

It seems that it does not handle participant alias correctly. The syntax is ParticipantA as ParticipantA_Alias.

Fixed

MrCoder commented 5 months ago

First part is on the main branch where new E works as expected. The second part is the PR branch participant is not displayed with new E.

https://github.com/mermaid-js/zenuml-core/assets/169417/969b8bda-7153-4591-9b90-783bb2f012dd

dontry commented 5 months ago

Address the issue of calling a method after creating a new instance and assigning to a new variable

https://github.com/mermaid-js/zenuml-core/assets/3481791/940ecf3e-6791-455b-a271-611df4195228