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

Allow users to pass multi nodes when calling Tree.edit #579

Merged
merged 11 commits into from
Jul 13, 2023

Conversation

JOOHOJANG
Copy link
Contributor

@JOOHOJANG JOOHOJANG commented Jul 12, 2023

What this PR does / why we need it:

  • allow users to pass multi tree nodes when edit
    • change parameter type *TreeNode => []*TreeNode
      • modify json/tree, crdt/tree and converter
  • remove duplicate code
  • update TC

FYI

  • most of the lines that have changed are tc,
  • please review
    Which issue(s) this PR fixes:

Fixes #561

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


Additional documentation:


Checklist:

  • Added relevant tests or not required
  • Didn't break anything

@codecov
Copy link

codecov bot commented Jul 12, 2023

Codecov Report

Merging #579 (d1f5991) into main (2b15ac5) will decrease coverage by 0.10%.
The diff coverage is 35.13%.

@@            Coverage Diff             @@
##             main     #579      +/-   ##
==========================================
- Coverage   51.50%   51.40%   -0.10%     
==========================================
  Files          67       67              
  Lines        6932     6951      +19     
==========================================
+ Hits         3570     3573       +3     
- Misses       2891     2907      +16     
  Partials      471      471              
Impacted Files Coverage Δ
api/converter/from_pb.go 48.20% <0.00%> (-0.75%) ⬇️
api/converter/to_bytes.go 68.58% <0.00%> (-3.71%) ⬇️
api/converter/to_pb.go 57.27% <0.00%> (ø)
pkg/document/crdt/tree.go 53.68% <72.22%> (+0.43%) ⬆️

@hackerwins hackerwins added the protocol changed 📝 Whether the protocol has changed label Jul 12, 2023
@JOOHOJANG JOOHOJANG requested a review from hackerwins July 12, 2023 04:36
Copy link
Member

@hackerwins hackerwins left a comment

Choose a reason for hiding this comment

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

Overall looks good.
I left a comment about style.

pkg/document/json/tree.go Outdated Show resolved Hide resolved
@JOOHOJANG JOOHOJANG requested a review from hackerwins July 13, 2023 07:49
Copy link
Member

@hackerwins hackerwins left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution.

@hackerwins hackerwins changed the title Allow users to pass multi tree nodes when edit Allow users to pass multi nodes when calling Tree.edit Jul 13, 2023
@hackerwins hackerwins merged commit 12d410f into main Jul 13, 2023
@hackerwins hackerwins deleted the feat/allow-multi-tree-nodes branch July 13, 2023 10:22
hackerwins pushed a commit that referenced this pull request Jul 14, 2023
* Allow users to pass multi nodes when calling Tree.edit

* Add nodes validation to Tree.edit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
protocol changed 📝 Whether the protocol has changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Tree.edit to allow insertion of multiple contents at once
2 participants