Commit Graph

68 Commits

Author SHA1 Message Date
Sidharth Vinod d22ee8d1d5
fix: Check if parentCommit is provided 2023-12-04 11:13:52 +05:30
RounakJoshi09 31a1de1566
Condition of Parent Id Without Merge Commit Added 2023-12-04 00:28:01 +05:30
RounakJoshi09 c19fa122af
Merge branch 'develop' into bug/#4497_unable-to-cherrypick-merge-commit 2023-11-17 11:28:20 +05:30
RounakJoshi09 aadf5339a4 Error Hash Removed 2023-11-17 09:51:03 +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 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 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 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 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 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 9469f759a9 GitGraph: Moved overlapping commit arrow colour inside conditional 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 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
RounakJoshi09 827808dca3
Merge Conflict Resolved 2023-10-19 10:33:32 +05:30
RounakJoshi09 d65191f6c1
Merge branch 'develop' into bug/#4497_unable-to-cherrypick-merge-commit 2023-10-19 10:26:25 +05:30
RounakJoshi09 d8500f9e08 Suggested Changes FOR PR DONE 2023-10-18 20:59:55 +05:30
Sidharth Vinod 7eac75c15c
Merge pull request #4928 from mribeirodantas/fix-minor-typos
fix(typos): Fix minor typos in the source code
2023-10-16 14:00:27 +00:00
RounakJoshi09 4051b42b5a documentation added, Tests Fixed 2023-10-14 07:26:23 +05:30
RounakJoshi09 6e5cd2b3c2 All Unit Tests Passing 2023-10-14 05:49:51 +05:30
RounakJoshi09 3118c7c532 Unit Test Cases Added 2023-10-13 23:49:01 +05:30
RounakJoshi09 13d85b6ee5 Parser and Logic For Parent Commit Added 2023-10-12 02:35:43 +05:30
Hans Blankenhaus 846fb3f8f8 making consitent config imports from diagramAPI 2023-10-08 14:17:45 +02:00
Marcel Ribeiro-Dantas 30b3e6213f
fix(typos): Fix minor typos in the source code
Signed-off-by: Marcel Ribeiro-Dantas <mribeirodantas@seqera.io>
2023-10-07 22:16:11 -03:00
Sidharth Vinod 32729f82b9
Merge branch 'develop' into sidv/removeDirectiveGrammar
* develop: (26 commits)
  chore: Fix unit tests
  chore(deps): update all patch dependencies
  Update docs
  chore: remove unneeded `CommomDB`
  fix: Add support for `~test Array~string~`
  chore: Add JSDoc to apply in sequenceDB
  refactor: Tidy up direction handling
  chore: Fix flowchart arrow
  chore: Add test to verify activate
  chore: Update tests snapshot
  fix: #4691 Align arrowheads properly in sequenceDiagram
  chore: move `commonDb` into `diagrams/common/commonDb`
  Update docs
  run prettier fix
  Apply suggestions from code review
  chore: Add comments in edge handling
  chore: Make aggregation arrow transparent
  chore: Remove structuredClone
  chore: Make extension arrow transparent
  chore: Align edge markers properly in class
  ...
2023-09-06 18:36:02 +05:30
Sidharth Vinod a0e33bee71
chore: Cleanup gitGraph tests 2023-09-05 21:57:05 +05:30
Reda Al Sulais a61887f5a2 chore: move `commonDb` into `diagrams/common/commonDb` 2023-09-02 17:51:33 +03:00
Sidharth Vinod 1e0918c2ff
refactor: Remove directives from grammar 2023-08-25 12:55:58 +05:30
Sidharth Vinod f0883be0e3
refactor: Update DBs to remove directive handling 2023-08-25 12:55:35 +05:30
Sidharth Vinod 11b599d77c
chore: Fix type imports 2023-08-22 13:44:11 +05:30
Brian Graham 4cdb43f791 ts-ignore comment was misleading, JISON doesn't support types 2023-08-01 14:30:58 +02:00
Sibin Thomas cba5b5a7e3 ran preetier 2023-07-19 21:55:24 +05:30
Sibin Thomas d81e4fabd5 positioned tags, tilted commit labels and fixed some bugs 2023-07-19 20:22:29 +05:30
Sibin Thomas 863d1bfd4d removed BT and added TB 2023-07-19 20:21:15 +05:30
Sibin Thomas 383bbefa9e Added code for Vertical branches for GitGraph and Added TB option in the parser file. 2023-07-15 18:27:42 +05:30
Nikolay Rozhkov d5021cab1d Remove double parsing 2023-07-03 18:57:26 +03:00
Yokozuna59 9573f336c3 standardize detectors loeader function definition with `DiagramLoader` type 2023-06-12 15:28:45 +03:00
Yokozuna59 e688138167 pref: change detectors from `.match` into `.test`
there is no need for matching, capturing results, and validating nullablity
just using `.test` would be enough and significantly faster

for more info, see https://stackoverflow.com/10940138/16476610
2023-06-12 14:45:08 +03:00
Alois Klink 32538b5b03 Merge branch 'develop' into lishid/patch-2
The E2E tests are failing, but will probably be fixed by commit
9bb0cef8 (fix: wait for image rendering in nodes, 2023-03-30)
on the `develop` branch.
2023-04-14 02:09:22 +01:00
Lishid 5693f63603
Fix git graph css bracket leak 2023-04-04 11:22:19 -04:00
Remco Haszing fc80ba66d2
Fix import extensions 2023-03-11 15:27:16 +01:00
Remco Haszing b7d31adda4
Support node16 module resolution
The `node16` module resolution requires imports to use the `.js` file
extension in type definitions.

`@rollup/plugin-typescript` is needed to make this work with the Vite
setup used by Mermaid.

The module option for Mermaid internally is set to `nodenext`. This is
needed to support `.json` imports. Note that setting `module` to
`node16` or `nodenext` implies a matching `moduleResolution` value.
2023-03-11 14:54:21 +01:00
Sidharth Vinod 638362baea
Merge branch 'release/10.0.0' into sidv/splitDiagrams
* release/10.0.0: (333 commits)
  10.0.0-rc.3
  Export more types
  no side effects
  10.0.0-rc.2
  skip failing elk test
  Cleanup
  Update docs
  fix(#3406, #3394): Remove init & initThrowsErrors
  chore: Rename lazy loaded diagram definitions
  Skip flowchart-elk failing test
  Fix docs
  fix Server
  Fix lint
  Remove Readme
  Fix E2E Tests
  Fix tests
  feat: Break render and parse types
  chore: Remove all non async render/parse/init
  Remove CJS builds from docs
  chore: Remove cjs from build
  ...
2023-02-19 20:18:26 +05:30