aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionSubView.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2025-03-24 16:29:32 -0400
committerbobzel <zzzman@gmail.com>2025-03-24 16:29:32 -0400
commit858f5d2f1621695a703b0e3f8297521c3ebe692d (patch)
tree3180f91ee18bf8accef98cbbb6db6688666e8340 /src/client/views/collections/CollectionSubView.tsx
parent9c5d14fdd562dc1bcc8aa0f73ce7ad189c9fbf23 (diff)
parentb6cf21b5a52184f89909898d292a79c57c043d7e (diff)
Merge branch 'fieldSyntaxUpdate' into aarav_edit
Diffstat (limited to 'src/client/views/collections/CollectionSubView.tsx')
-rw-r--r--src/client/views/collections/CollectionSubView.tsx10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/client/views/collections/CollectionSubView.tsx b/src/client/views/collections/CollectionSubView.tsx
index 655894e40..a43cf0755 100644
--- a/src/client/views/collections/CollectionSubView.tsx
+++ b/src/client/views/collections/CollectionSubView.tsx
@@ -108,7 +108,11 @@ export function CollectionSubView<X>() {
}
get dataDoc() {
- return this._props.TemplateDataDocument instanceof Doc && this.Document.isTemplateForField ? Doc.GetProto(this._props.TemplateDataDocument) : this.Document.resolvedDataDoc ? this.Document : this.Document[DocData]; // if the layout document has a resolvedDataDoc, then we don't want to get its parent which would be the unexpanded template
+ return this._props.TemplateDataDocument instanceof Doc && this.layoutDoc.isTemplateForField //
+ ? this._props.TemplateDataDocument[DocData]
+ : this.layoutDoc.resolvedDataDoc
+ ? this._props.Document
+ : this.Document[DocData]; // if the layout document has a resolvedDataDoc, then we don't want to get its parent which would be the unexpanded template
}
get childContainerViewPath() {
@@ -127,7 +131,7 @@ export function CollectionSubView<X>() {
hasChildDocs = () => this.childLayoutPairs.map(pair => pair.layout);
@computed get childLayoutPairs(): { layout: Doc; data: Doc }[] {
- const { Document, TemplateDataDocument } = this._props;
+ const { Document: Document, TemplateDataDocument } = this._props;
const validPairs = this.childDocs
.map(doc => Doc.GetLayoutDataDocPair(Document, !this._props.isAnnotationOverlay ? TemplateDataDocument : undefined, doc))
.filter(
@@ -295,7 +299,7 @@ export function CollectionSubView<X>() {
const dragData = de.complete.docDragData;
if (dragData) {
const sourceDragAction = dragData.dropAction;
- const sameCollection = !dragData.draggedDocuments.some(d => d.embedContainer !== this._props.Document);
+ const sameCollection = !dragData.draggedDocuments.some(d => d.embedContainer !== this._renderDoc);
dragData.dropAction = !sameCollection // if doc from another tree
? sourceDragAction || targetDropAction // then use the source's dragAction otherwise the target's
: sourceDragAction === dropActionType.inPlace // if source drag is inPlace