Commit Graph

9227 Commits

Author SHA1 Message Date
Sidharth Vinod f5bd1e0809
Merge pull request #4997 from mermaid-js/renovate/all-minor
chore(deps): update all minor dependencies (minor)
2023-11-02 11:05:01 +00:00
renovate[bot] 0d4faef758
chore(deps): update all minor dependencies 2023-11-01 19:42:28 +00:00
Sidharth Vinod 0c5cf72235
chore: Point to correct changelog 2023-11-01 20:18:49 +05:30
Guy Pursey 57a9d7356c GitGraph: made reroute fn more readable
Pre-commit lint hook had made the use of ternaries harder to read
than I'd originally intended so I introduced an additional
variable which explains what is being checked and keeps ternaries
from becoming obscured.
2023-10-31 17:24:13 +00:00
Guy Pursey a9c5d903c5 GitGraph: simplified branch check in arrow rerouting fn
Wanted to avoid repetition given that the originally nested
ternaries had the same structure
2023-10-31 17:24:13 +00:00
Guy Pursey d80e1a2662 GitGraph: added commit IDs to e2e test to remove false positives
Should stop randomised commit IDs from showing arbitrary
differences between test runs.
2023-10-31 17:24:13 +00:00
Guy Pursey bf52e76a39 GitGraph: Moved branch curve check to within reroute check fn
Based on review by @nirname. I had originally been trying
to minimise number of new arguments being passed to
rerouting check but as the branch curve check is not used
elsewhere and is part of the same rerouting check it makes
sense for them to be together.

Position information now passed to rerouting fn instead.
2023-10-31 17:24:13 +00:00
Guy Pursey 31a8e040fa GitGraph: corrected minor typo in comment. 2023-10-31 17:24:13 +00:00
Guy Pursey f7d83e2cda GitGraph: added 2x e2e tests for branches not used immediately
My focus earlier on had been on relationship to `main` branch
so this is to ensure that we have some tests that cover
relationship between a pair of branches that doesn't
include `main`.
2023-10-31 17:24:13 +00:00
Guy Pursey 0555368e1c GitGraph: added branch checking to rerouting
Hypothesised that working out which branch needed checking for
overlapping commits might be missing, so added that as a
nested ternary and passed result as new argument to rerouting
check.

If commits are found on the branch which will be getting the
curve (whichever branch is lower or more to the right of main
than the other, for now), then the arrow will be rerouted.

I may refactor in a follow-up commit and I think there's scope
to simplify the logic but this is a test for now.
2023-10-31 17:24:13 +00:00
Guy Pursey adfe1728ae GitGraph: Added e2e tests for deferred branch use.
In these tests, a new branch is created but then a commit is made
on the main branch before the new branch gets a commit. This
important to see what happens with rerouting of arrows.

Suggested by @nirname in PR review of #4927.
2023-10-31 17:24:13 +00:00
Guy Pursey 2acad550da GitGraph: e2e tests, added commit IDs to test graphs
Followed practice of other tests so that commit IDs are
stabilised (i.e., not randomly generated) and therefore
don't show repeatedly in Cypress diff output screenshots
2023-10-31 17:24:13 +00:00
Guy Pursey b0b276898a GitGraph: fixed an e2e branch for vertical branch
Fix for error spotted by @mathbraga
2023-10-31 17:24:13 +00:00
Guy Pursey 25a678caec GitGraph: added e2e tests for multiple branches from one commit 2023-10-31 17:24:13 +00:00
Guy Pursey 3e18e76d31 GitGraph: removed check of branch with main from arrow reroute fn
Checking if branch was same as main turned out to be redundant
for now, since there don't seem to be any cases where routing
curves into main.

This fixes issue found in review by @nirname and avoids a
situation where branching from the same commit results in
unnecessary rerouting.
2023-10-31 17:24:13 +00:00
Guy Pursey 3ba33c8b75 GitGraph: added more to demos 2023-10-31 17:24:13 +00:00
Guy Pursey 7c87df7cf6 GitGraph: rename overlap check to shouldRerouteArrow
The function also now does an additional check to see
if source branch in overlap check is on main.

As we're no longer purely checking for an overlap and
the only use of this function is to reroute the arrows
to avoid running over commits, this more literal name
should be clearer.
2023-10-31 17:24:13 +00:00
Guy Pursey dba7197fc6 GitGraph: simplified overlapping check fn 2023-10-31 17:24:13 +00:00
Guy Pursey 902a9dd42b GitGraph: added and updated demos to align with some of e2e testing 2023-10-31 17:24:13 +00:00
Guy Pursey 461a293d71 GitGraph: refactored overlapping fn for efficiency/performance
On previous rewrite, I had created new functions within the
overlapping functions but these were being recreated on each
iteration of Object.some(). I moved them outside this for
clarity and so they're not recreated each iteration.
2023-10-31 17:24:13 +00:00
Guy Pursey 9f8457d249 GitGraph: Rewrote overlap fn to make main branch exception to rule. 2023-10-31 17:24:13 +00:00
Guy Pursey 8c43d2273f GitGraph: added destination branch check into overlapping fn. 2023-10-31 17:24:13 +00:00
Guy Pursey 69ec4a0359 GitGraph: Added cherry-pick and merge demos for to GitGraph. 2023-10-31 17:24:13 +00:00
Guy Pursey 9469f759a9 GitGraph: Moved overlapping commit arrow colour inside conditional 2023-10-31 17:24:13 +00:00
Guy Pursey 60bb7b5b6c GitGraph: updated demo page to include top-to-bottom examples. 2023-10-31 17:24:13 +00:00
Guy Pursey 4787bb07df GitGraph: corrected object method in hasOverlappingCommits 2023-10-31 17:24:13 +00:00
Guy Pursey 33050e1812 GitGraph: Update variable names in drawArrow fn 2023-10-31 17:24:13 +00:00
Guy Pursey 6dc8e58b47 GitGraph: Refactor hasOverlappingCommits function
Changed argument names from commit1 and commit2 to
commitA and commitB respectively to prevent confusion
with seq number values.

Replaced Array filter method with array some method
so that as soon as one overlap is found, function is
finished.

Used Object.entries instead of Object.keys to reduce
number of variables needed and make function easier
to read.
2023-10-31 17:24:13 +00:00
Guy Pursey 839645f161 GitGraph: Add more example diagrams to test with. 2023-10-31 17:24:13 +00:00
Guy Pursey d9daf19055 GitGraph: Correct commit variable in overlap check.
Originally, the function was checking if any commits were on the
same branch as `commit2`, the destination commit.

However, in order to avoid a conflict, we should only need to
check whether any commits are on the same branch as `commit 1`.

Updated and moved commenting as well.
2023-10-31 17:24:13 +00:00
Guy Pursey f42cec282a GitGraph: Add check for direction of merge arrow to determine colour. 2023-10-31 17:24:13 +00:00
Aakansha Doshi fff25e7e2c add spec 2023-10-31 19:39:43 +05:30
Aakansha Doshi 2a8323f951
Merge branch 'develop' into bug/4983-fix-getMessageAPI 2023-10-31 18:35:25 +05:30
Aakansha Doshi 390e22cc0b fix: getMessageAPI so it considers entity codes 2023-10-31 18:28:45 +05:30
Sebastian Holmqvist a3ee21d7fc fix(tooltip): change position of tooltip to not cover node
Position the tooltip centered, just below the node being hovered.

Update packages/mermaid/src/diagrams/flowchart/flowDb.js

Co-authored-by: Sidharth Vinod <sidharthv96@gmail.com>
2023-10-31 12:51:47 +01:00
Sebastian Holmqvist 8f2a5064cb fix(tooltip): remove redundant scroll offset
window.scrollY is already account for which means document.body.scrollTop incorrectly offsets the tooltip vertically.
The same is not true for horizontal position.
2023-10-31 08:38:19 +01:00
Sidharth Vinod 77667b94d3
Merge pull request #4975 from mermaid-js/add-docusaurus
Docs: add Docusaurus to "Integrations - Community" page
2023-10-31 06:42:09 +00:00
Sidharth Vinod b85a48f7f7
Merge pull request #4976 from mermaid-js/renovate/patch-all-patch
chore(deps): update all patch dependencies (patch)
2023-10-31 06:40:19 +00:00
Sidharth Vinod 34f1db399f
Merge pull request #4979 from karthxk07/develop
Update README.md
2023-10-31 06:40:05 +00:00
renovate[bot] e8a04faa36
chore(deps): update all patch dependencies 2023-10-31 06:13:41 +00:00
Sidharth Vinod d714ecb4d7
Merge pull request #4994 from alex-titarenko/docs/add-noteshub-tool
docs: Add NotesHub to integrations-community page
2023-10-31 06:06:59 +00:00
Sidharth Vinod 54ca3e789f
Merge pull request #4991 from sadikkuzu/patch-1
Fix typo in build-docs.yml
2023-10-31 06:03:26 +00:00
Alex Titarenko cb06962c85 Update integrations-community.md 2023-10-27 20:27:16 -07:00
Alex Titarenko e98aa55577 docs: upate the list of tools with native support of mermaid 2023-10-27 18:58:30 -07:00
SADIK KUZU 672a0edc59
Fix typo in build-docs.yml 2023-10-27 12:22:14 +03:00
Harshit Anand | Frontend Developer | ReactJS 3394541b41
Merge branch 'develop' into bug/4716_fix_target_blank_getting_sanitized 2023-10-26 14:57:15 +05:30
Harshit Anand 54ab3fc3b2 fix: added an e2e test case for classdiagram with anchor tag 2023-10-26 14:55:04 +05:30
Sahil Nagpure 36a727d44e
Merge branch 'develop' into patch-1 2023-10-26 11:44:46 +05:30
Harshit Anand 06d2ba8398 fix: added two unit tests to check for the secured anchor tag 2023-10-25 21:17:53 +05:30
Knut Sveidqvist 5f117fc2b2 Merge branch 'master' into develop 2023-10-25 13:36:10 +02:00