aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinksView.tsx
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2019-04-30 13:34:30 -0400
committerbob <bcz@cs.brown.edu>2019-04-30 13:34:30 -0400
commitf59503c26b165b71cf3fa6fe4c1b7a14cef2d441 (patch)
treee079e726759f5f0e8d08783829860bd05b5f6e99 /src/client/views/collections/collectionFreeForm/CollectionFreeFormLinksView.tsx
parente013b7b146f91b0ffbc26e3770f5f90f417da60b (diff)
parent86e89178628a27a91665ad835046e536bdb89729 (diff)
Merge branch 'master' into newDocs
Diffstat (limited to 'src/client/views/collections/collectionFreeForm/CollectionFreeFormLinksView.tsx')
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormLinksView.tsx11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinksView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinksView.tsx
index f693d55e8..e5dcf8c29 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinksView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinksView.tsx
@@ -84,6 +84,14 @@ export class CollectionFreeFormLinksView extends React.Component<CollectionViewP
if (containerDoc) {
equalViews = DocumentManager.Instance.getDocumentViews(containerDoc.proto!);
}
+ if (view.props.ContainingCollectionView) {
+ let collid = view.props.ContainingCollectionView.props.Document.Id;
+ Cast(this.props.Document[this.props.fieldKey], listSpec(Doc), []).
+ filter(child =>
+ child.Id === collid).map(view =>
+ DocumentManager.Instance.getDocumentViews(view).map(view =>
+ equalViews.push(view)));
+ }
return equalViews.filter(sv => sv.props.ContainingCollectionView && sv.props.ContainingCollectionView.props.Document === this.props.Document);
}
@@ -107,7 +115,8 @@ export class CollectionFreeFormLinksView extends React.Component<CollectionViewP
);
return drawnPairs;
}, [] as { a: Doc, b: Doc, l: Doc[] }[]);
- return connections.map(c => <CollectionFreeFormLinkView key={Utils.GenerateGuid()} A={c.a} B={c.b} LinkDocs={c.l} />);
+ return connections.map(c => <CollectionFreeFormLinkView key={Utils.GenerateGuid()} A={c.a} B={c.b} LinkDocs={c.l}
+ removeDocument={this.props.removeDocument} addDocument={this.props.addDocument} />);
}
render() {