mermaid-js / mermaid

Generation of diagrams like flowcharts or sequence diagrams from text in a similar manner as markdown
https://mermaid.js.org
MIT License
71.91k stars 6.53k forks source link

C4-PlantUML syntax shows [ENTERPRISE] stereotype for System_Boundary #3186

Open NJ-Brad opened 2 years ago

NJ-Brad commented 2 years ago

Describe the bug When displaying a SYSTEM_BOUNDARY, the stereotype that is displayed reads [ENTERPRISE] instead of [SYSTEM]

To Reproduce Steps to reproduce the behavior:

  1. Create a markdown document, including a PlantUML flavored C4 diagram.
  2. Include a SYSTEM_BOUNDARY, with items inside
  3. Generate the diagram
  4. See error

Expected behavior Underneath title of the system boundary, I expect to see [SYSTEM]

Desktop (please complete the following information):

NJ-Brad commented 2 years ago

I believe I have located the source of the error, but am not familiar enough with the code to create a pull request. The error is in \src\diagrams\c4\parser\c4Diagram.jison Line:289

Current: | SYSTEM_BOUNDARY attributes {console.log($1,JSON.stringify($2)); $2.splice(2, 0, 'ENTERPRISE'); yy.addPersonOrSystemBoundary(...$2); $$=$2;}

Proposed: | SYSTEM_BOUNDARY attributes {console.log($1,JSON.stringify($2)); $2.splice(2, 0, 'SYSTEM'); yy.addPersonOrSystemBoundary(...$2); $$=$2;}

knsv commented 2 years ago

Could you supply an example of the broken diagram?

-Thanks

NJ-Brad commented 2 years ago

When I enter this at mermaid.live (and in my own web pages) I get the condition I mentioned C4Context title System Context diagram for Internet Banking System System_Boundary(b2, "BankBoundary2") {
System(SystemA, "Banking System A")
System(SystemB, "Banking System B", "A system of the bank, with personal bank accounts. next line.")
} SystemBoundaryExample