Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow to put notes in namespaces on classDiagram #5814

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

kairi003
Copy link
Contributor

@kairi003 kairi003 commented Sep 2, 2024

📑 Summary

It improve its support for notes inside namespaces.

Resolves #4706

image

📏 Design Decisions

It allows NoteNode to be added in the namespace.

  • classStatements parses not only classStatement but also noteStatement and returns an array of their IDs.
  • addClassesToNamespace() takes a new param noteNames and associates the namespace with the note.
  • In classRender-v2.ts addNotes() implements the process of adding to namespace like addClasses().
  • Changed notes from Array to ClassNoteMap.
  • Add fields to ClassNote.
    • parent: keeps the ID of the namespace.
    • index: holds the number of the note. index: holds the number of the note (used as a reference when generating the edge ID)

📋 Tasks

Make sure you

  • 📖 have read the contribution guidelines
  • 💻 have added necessary unit/e2e tests.
  • 📓 have added documentation. Make sure MERMAID_RELEASE_VERSION is used for all new features.
  • 🦋 If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

Copy link

changeset-bot bot commented Sep 2, 2024

🦋 Changeset detected

Latest commit: 2dd29be

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
mermaid Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the Type: Enhancement New feature or request label Sep 2, 2024
Copy link

netlify bot commented Sep 2, 2024

Deploy Preview for mermaid-js ready!

Name Link
🔨 Latest commit 2dd29be
🔍 Latest deploy log https://app.netlify.com/sites/mermaid-js/deploys/66dc8afe1b08ab00088d06c6
😎 Deploy Preview https://deploy-preview-5814--mermaid-js.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Sep 2, 2024

Codecov Report

Attention: Patch coverage is 0% with 94 lines in your changes missing coverage. Please review.

Project coverage is 5.01%. Comparing base (58524ac) to head (2dd29be).

Files with missing lines Patch % Lines
...ges/mermaid/src/diagrams/class/classRenderer-v2.ts 0.00% 62 Missing ⚠️
packages/mermaid/src/diagrams/class/classDb.ts 0.00% 27 Missing ⚠️
packages/mermaid/src/diagrams/class/classTypes.ts 0.00% 4 Missing ⚠️
...ckages/mermaid/src/diagrams/class/classRenderer.js 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           develop   #5814      +/-   ##
==========================================
- Coverage     5.01%   5.01%   -0.01%     
==========================================
  Files          336     336              
  Lines        48073   48105      +32     
  Branches       575     575              
==========================================
  Hits          2413    2413              
- Misses       45660   45692      +32     
Flag Coverage Δ
unit 5.01% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ckages/mermaid/src/diagrams/class/classRenderer.js 0.00% <0.00%> (ø)
packages/mermaid/src/diagrams/class/classTypes.ts 0.00% <0.00%> (ø)
packages/mermaid/src/diagrams/class/classDb.ts 0.00% <0.00%> (ø)
...ges/mermaid/src/diagrams/class/classRenderer-v2.ts 0.00% <0.00%> (ø)

Copy link

argos-ci bot commented Sep 2, 2024

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ⚠️ Changes detected (Review) 1 added Sep 7, 2024, 5:30 PM

@kairi003 kairi003 force-pushed the feature/4706_allow_notes_in_namespace branch from c8a41d6 to fc0c793 Compare September 3, 2024 06:28
@kairi003 kairi003 changed the title Feature/4706 allow notes in namespace feat: allow notes in namespace Sep 7, 2024
Copy link

pkg-pr-new bot commented Sep 7, 2024

Open in Stackblitz

pnpm add https://pkg.pr.new/mermaid-js/mermaid@5814
pnpm add https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/mermaid-zenuml@5814
pnpm add https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/layout-elk@5814
pnpm add https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/parser@5814

commit: 2dd29be

@kairi003 kairi003 changed the title feat: allow notes in namespace feat: allow to put notes in namespace on classDiagram Sep 7, 2024
@kairi003 kairi003 changed the title feat: allow to put notes in namespace on classDiagram feat: allow to put notes in namespaces on classDiagram Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

class diagrams: allow notes for namespace'd classes
1 participant