aboutsummaryrefslogtreecommitdiff
path: root/src/client/documents/Gitlike.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-05-14 12:03:40 -0400
committerbobzel <zzzman@gmail.com>2023-05-14 12:03:40 -0400
commit42afc0250de658fc3e924864bfae5afb4edec335 (patch)
treed61bbc43d95cb6e1d6fa5c997102d505adc09af5 /src/client/documents/Gitlike.ts
parent0849fbd97c61688d51e5fea6cf8edc47989df5de (diff)
major overhaul of field naming conventions.
Diffstat (limited to 'src/client/documents/Gitlike.ts')
-rw-r--r--src/client/documents/Gitlike.ts26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/client/documents/Gitlike.ts b/src/client/documents/Gitlike.ts
index 5e2baf924..f35f33f65 100644
--- a/src/client/documents/Gitlike.ts
+++ b/src/client/documents/Gitlike.ts
@@ -9,24 +9,24 @@
// // we don't have individual timestamps for all fields -- this is a problematic design issue.
// function GitlikeSynchDocs(bd: Doc, md: Doc) {
// const fieldKey = Doc.LayoutFieldKey(md);
-// const bdate = DateCast(bd[`${fieldKey}-lastModified`])?.date;
-// const mdate = DateCast(md[`${fieldKey}-lastModified`])?.date;
+// const bdate = DateCast(bd[`${fieldKey}_modificationDate`])?.date;
+// const mdate = DateCast(md[`${fieldKey}_modificationDate`])?.date;
// const bdproto = bd && Doc.GetProto(bd);
// if (bdate !== mdate && bdate <= mdate) {
// if (bdproto && md) {
// bdproto[fieldKey] = Field.Copy(md[fieldKey]);
-// bdproto[`${fieldKey}-lastModified`] = new DateField();
+// bdproto[`${fieldKey}_modificationDate`] = new DateField();
// }
// }
-// const bldate = DateCast(bd._lastModified)?.date;
-// const mldate = DateCast(md._lastModified)?.date;
+// const bldate = DateCast(bd._layout_modificationDate)?.date;
+// const mldate = DateCast(md._layout_modificationDate)?.date;
// if (bldate === mldate || bldate > mldate) return;
// if (bdproto && md) {
// bd.x = Field.Copy(md.x);
// bd.y = Field.Copy(md.y);
// bd.width = Field.Copy(md.width);
// bd.height = Field.Copy(md.height);
-// bdproto._lastModified = new DateField();
+// bdproto._layout_modificationDate = new DateField();
// }
// }
@@ -53,10 +53,10 @@
// const newlyBranchedDocs = await Promise.all(newDocsFromMaster?.map(async md => (await Doc.MakeClone(md, false, true, cloneMap)).clone) || []);
// newlyBranchedDocs.forEach(nd => {
// Doc.AddDocToList(branch, Doc.LayoutFieldKey(branch) + suffix, nd);
-// nd.context = branch;
+// nd.embedContainer = branch;
// });
-// // if a branch doc's corresponding main branch doc doesn't have a context, then it was deleted.
-// const remDocsFromMaster = branchMainDocs?.filter(bd => Cast(bd.branchOf, Doc, null) && !Cast(bd.branchOf, Doc, null)?.context);
+// // if a branch doc's corresponding main branch doc doesn't have a embedContainer, then it was deleted.
+// const remDocsFromMaster = branchMainDocs?.filter(bd => Cast(bd.branchOf, Doc, null) && !Cast(bd.branchOf, Doc, null)?.embedContainer);
// // so then remove all the deleted main docs from this branch.
// remDocsFromMaster?.forEach(rd => Doc.RemoveDocFromList(branch, Doc.LayoutFieldKey(branch) + suffix, rd));
// }
@@ -87,14 +87,14 @@
// branchDocProto.branchOf = masterChild; // the branch child is now a branch of the master child
// }
// Doc.AddDocToList(master, Doc.LayoutFieldKey(master) + suffix, masterChild); // add the masterChild to master (if it's already there, this is a no-op)
-// masterChild.context = master;
+// masterChild.embedContainer = master;
// GitlikeSynchDocs(masterChild, bd);//Doc.GetProto(masterChild), bd);
// }));
// const masterChildren = await DocListCastAsync(master[Doc.LayoutFieldKey(master) + suffix]);
// masterChildren?.forEach(mc => { // see if any master children
// if (!branchChildren?.find(bc => bc.branchOf === mc)) { // are not in the list of children for this branch.
// Doc.RemoveDocFromList(master, Doc.LayoutFieldKey(master) + suffix, mc); // if so, delete the master child since the branch has deleted it.
-// mc.context = undefined; // NOTE if we merge a branch that didn't do a pull, it will look like the branch deleted documents -- need edit timestamps that prevent merging if branch isn't up-to-date with last edit timestamp
+// mc.embedContainer = undefined; // NOTE if we merge a branch that didn't do a pull, it will look like the branch deleted documents -- need edit timestamps that prevent merging if branch isn't up-to-date with last edit timestamp
// }
// });
// });
@@ -109,8 +109,8 @@
// export async function BranchTask(target: Doc, action: "pull" | "merge") {
// const func = action === "pull" ? GitlikePullFromMaster : GitlikeMergeWithMaster;
// await func(target, "");
-// await DocListCast(target[Doc.LayoutFieldKey(target)]).forEach(async targetChild => func(targetChild, "-annotations"));
-// await DocListCast(target[Doc.LayoutFieldKey(target)]).forEach(async targetChild => func(targetChild, "-sidebar"));
+// await DocListCast(target[Doc.LayoutFieldKey(target)]).forEach(async targetChild => func(targetChild, "_annotations"));
+// await DocListCast(target[Doc.LayoutFieldKey(target)]).forEach(async targetChild => func(targetChild, "_sidebar"));
// }
// export async function BranchCreate(target: Doc) {