mermaid icon indicating copy to clipboard operation
mermaid copied to clipboard

Allow static/abstract classifier also for official UML syntax

Open skogsbaer opened this issue 2 years ago • 3 comments

: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

skogsbaer avatar Nov 26 '22 11:11 skogsbaer

I'm happy to fix the conflicts, but I suggest a review first.

skogsbaer avatar Dec 05 '22 07:12 skogsbaer

@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.

skogsbaer avatar Dec 05 '22 20:12 skogsbaer

@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:

screenshot

skogsbaer avatar Dec 14 '22 16:12 skogsbaer

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

jgreywolf avatar May 03 '23 23:05 jgreywolf