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

bug/#3251_linkStyle-can't-specify-ids Fixed #4934

Conversation

RounakJoshi09
Copy link
Contributor

@RounakJoshi09 RounakJoshi09 commented Oct 9, 2023

📑 Summary

In my fix, I've added a condition to handle the case where the index provided in linkStyle is greater than or equal to the length of the edges array. This provides a clear error message to the user and prevents a TypeError from occurring.

Resolves #3251

📏 Design Decisions

The implementation ensures that if the user attempts to apply a style to an index that exceeds the number of available edges, an error message will be displayed.

📋 Tasks

Make sure you

@netlify
Copy link

netlify bot commented Oct 9, 2023

Deploy Preview for mermaid-js ready!

Name Link
🔨 Latest commit 995449c
🔍 Latest deploy log https://app.netlify.com/sites/mermaid-js/deploys/6526bbee6c6d7d0008c98d4f
😎 Deploy Preview https://deploy-preview-4934--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.

@codecov
Copy link

codecov bot commented Oct 9, 2023

Codecov Report

Merging #4934 (995449c) into develop (12a4707) will decrease coverage by 0.01%.
Report is 7 commits behind head on develop.
The diff coverage is 50.00%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #4934      +/-   ##
===========================================
- Coverage    79.97%   79.97%   -0.01%     
===========================================
  Files          164      164              
  Lines        13623    13625       +2     
  Branches       693      693              
===========================================
+ Hits         10895    10896       +1     
- Misses        2579     2580       +1     
  Partials       149      149              
Flag Coverage Δ
e2e 85.26% <50.00%> (-0.01%) ⬇️
unit 43.29% <ø> (ø)

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

Files Coverage Δ
packages/mermaid/src/diagrams/flowchart/flowDb.js 81.86% <50.00%> (-0.18%) ⬇️

@RounakJoshi09
Copy link
Contributor Author

Hi @Yash-Singh1 , Could you please check my approach to fix this bug. Pardon for mistakes if any . Grateful for Your Suggestion.

Copy link
Member

@Yash-Singh1 Yash-Singh1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I left a few comments down below.

@Yash-Singh1 Yash-Singh1 requested a review from a team October 10, 2023 01:41
Copy link
Member

@sidharthv96 sidharthv96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Love the tests, just needs some minor fixes :)

packages/mermaid/src/diagrams/flowchart/flowDb.js Outdated Show resolved Hide resolved
@sidharthv96 sidharthv96 added this pull request to the merge queue Nov 14, 2023
Merged via the queue into mermaid-js:develop with commit 0c0f7a7 Nov 14, 2023
16 of 17 checks passed
Copy link

mermaid-bot bot commented Nov 14, 2023

@RounakJoshi09, Thank you for the contribution!
You are now eligible for a year of Premium account on MermaidChart.
Sign up with your GitHub account to activate.

@aloisklink aloisklink added Type: Bug / Error Something isn't working or is incorrect Graph: Flow labels Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Graph: Flow Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: linkStyle can't specify IDs that don't exist at the point in the diagram
5 participants