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

reactflow v11 migration and fixes for GitGraph #1080

Merged
merged 9 commits into from
Jan 3, 2023

Conversation

nelsonni
Copy link
Member

@nelsonni nelsonni commented Jan 3, 2023

The GitGraph component relies on dagre for calculating layout for acyclic digraphs, and react-flow-renderer (renamed to reactflow for v11) for rendering the nodes and edges. The state of these graphs are managed outside of Redux using a custom React Hook called useGitGraph.

However, no graph is generated when selecting a branch from the Repository Map drop-down menu, with the root cause being a two-fold issue. The Branch models stored in Redux contained no commits due to a Regex pattern mismatch, and invalid Node objects were being created when a processed Edge contains an undefined endpoint.

This PR introduces validation checks for edges before they are added to the graph, and updates the Regex patterns for parsing git-log, git-rev-parse, and git-rev-list output to properly capture commits.

This PR resolves #988.

Changes:

This PR makes the following changes:

  • Migrate react-flow-renderer v10 to reactflow v11
  • Validate parent commit oid values prior to adding edges in a GitGraph
  • Capture commit messages when processing git-log output
    *revParse return type expanded to Promise<string | undefined> to properly model when the git-rev-parse command returns { stdout: undefined, stderr: undefined }
  • Remove redundant .git-flow CSS class since reactflow Theming allows for style props
  • Mitigate warnings from the Serializability Middleware in Redux Toolkit by storing timestamps as string instead of DateTime objects in the store
  • Apply border-radius CSS attributes to scrollbars in Card component content to fix display issues when a square scrollbar appears on a rounded corner of a card

@nelsonni nelsonni added bug Bug reports or bug fixes dependencies Issues or updates to dependency files labels Jan 3, 2023
@nelsonni nelsonni self-assigned this Jan 3, 2023
@nelsonni nelsonni merged commit 3c4eeff into main Jan 3, 2023
@nelsonni nelsonni deleted the fix/reactflow-v11-migration branch January 3, 2023 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug reports or bug fixes dependencies Issues or updates to dependency files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No GitGraph appears when selecting a repository from Repository Map drop-down menu
1 participant