diff options
| author | Sam Wilkins <abdullah_ahmed@brown.edu> | 2019-04-30 16:21:53 -0400 |
|---|---|---|
| committer | Sam Wilkins <abdullah_ahmed@brown.edu> | 2019-04-30 16:21:53 -0400 |
| commit | 43ed4e7fd2d6120598733e537a301a8f87379239 (patch) | |
| tree | 2dc0b21a0da4e25b899ab46a8ca512131cb23ccb /src/client/views/collections/collectionFreeForm/CollectionFreeFormLinksView.tsx | |
| parent | d99b1be8e44ed2dc65714ea192debf5529e353de (diff) | |
| parent | c95e1789da41fb63e27f1086e30c0ebd151009df (diff) | |
Merge branch 'newDocs' of https://github.com/browngraphicslab/Dash-Web into newDocs
Diffstat (limited to 'src/client/views/collections/collectionFreeForm/CollectionFreeFormLinksView.tsx')
| -rw-r--r-- | src/client/views/collections/collectionFreeForm/CollectionFreeFormLinksView.tsx | 11 |
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..4a75fccff 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() { |
