mermaid
mermaid copied to clipboard
Allow static/abstract classifier also for official UML syntax
:bookmark_tabs: Summary
Previously, the static classifier was only supported for attributes using the syntax String name$
. Now you can also write name: String$
Further, it was confusing that static/abstract classifiers for methods had to be written after the closing parenthesis of the method signature, even if the method has a return type. So you had to write foo(name: String)* int
.
This commit also adds the possibility of writing the classifier at the
very end, as in foo(name: String) int*
.
See PR #2269 and issue #3001 and my old issue #1953
:straight_ruler: Design Decisions
No real design desicions had to be made. I added new unit tests and made sure that all old tests are running.
:clipboard: Tasks
Make sure you
- [ x] :book: have read the contribution guidelines
- [x ] :computer: have added unit/e2e tests (if appropriate)
- [x ] :bookmark: targeted
develop
branch
I'm happy to fix the conflicts, but I suggest a review first.
@ashishjain0512 Any hints how to add new rendering test cases? The developer documentation (https://mermaid-js.github.io/mermaid/#/development, section "Add E2E tests") explain how to run cypress and how to add test cases but does not explain how to provide the expected images.
@ashishjain0512 I tried adding the tests but it seems that some of them are broken. For example, test 19 in cypress/integration/rendering/classDiagram.spec.js
has a syntax error, although I did not change anything:

I am closing this since the changes were included in PR #4303