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

Implement splitLevel of Tree.Edit #705

Merged
merged 2 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/converter/converter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func TestConverter(t *testing.T) {
Type: "text",
Value: "Hello world",
}},
})
}, 0)

return nil
})
Expand Down
3 changes: 2 additions & 1 deletion api/converter/from_pb.go
Original file line number Diff line number Diff line change
Expand Up @@ -519,8 +519,9 @@ func fromTreeEdit(pbTreeEdit *api.Operation_TreeEdit) (*operations.TreeEdit, err
parentCreatedAt,
from,
to,
createdAtMapByActor,
nodes,
int(pbTreeEdit.SplitLevel),
createdAtMapByActor,
executedAt,
), nil
}
Expand Down
2 changes: 1 addition & 1 deletion api/converter/to_bytes.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ func ToTreeNodes(treeNode *crdt.TreeNode) []*api.TreeNode {
return pbTreeNodes
}

index.TraverseNode(treeNode.IndexTreeNode, func(node *index.Node[*crdt.TreeNode], depth int) {
index.TraverseNode(treeNode.Index, func(node *index.Node[*crdt.TreeNode], depth int) {
pbTreeNodes = append(pbTreeNodes, toTreeNode(node.Value, depth))
})
return pbTreeNodes
Expand Down
3 changes: 2 additions & 1 deletion api/converter/to_pb.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,9 @@ func toTreeEdit(e *operations.TreeEdit) (*api.Operation_TreeEdit_, error) {
ParentCreatedAt: ToTimeTicket(e.ParentCreatedAt()),
From: toTreePos(e.FromPos()),
To: toTreePos(e.ToPos()),
CreatedAtMapByActor: toCreatedAtMapByActor(e.CreatedAtMapByActor()),
Contents: ToTreeNodesWhenEdit(e.Contents()),
SplitLevel: int32(e.SplitLevel()),
CreatedAtMapByActor: toCreatedAtMapByActor(e.CreatedAtMapByActor()),
ExecutedAt: ToTimeTicket(e.ExecutedAt()),
},
}, nil
Expand Down
316 changes: 176 additions & 140 deletions api/yorkie/v1/resources.pb.go

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions api/yorkie/v1/resources.proto
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ message Operation {
TreePos to = 3;
map<string, TimeTicket> created_at_map_by_actor = 4;
repeated TreeNodes contents = 5;
int32 split_level = 7;
TimeTicket executed_at = 6;
}
message TreeStyle {
Expand Down
Loading
Loading