From b0fc6546a4a0461611e8daac2f6dae31618f24e5 Mon Sep 17 00:00:00 2001
From: Hannah Chow <hannah_chow@brown.edu>
Date: Thu, 7 Mar 2019 01:24:06 -0500
Subject: added source or destination document labelling

---
 src/client/views/nodes/LinkMenu.tsx | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

(limited to 'src/client/views/nodes/LinkMenu.tsx')

diff --git a/src/client/views/nodes/LinkMenu.tsx b/src/client/views/nodes/LinkMenu.tsx
index d0909e266..c01e26b62 100644
--- a/src/client/views/nodes/LinkMenu.tsx
+++ b/src/client/views/nodes/LinkMenu.tsx
@@ -10,6 +10,7 @@ import { LinkBox } from "./LinkBox"
 import { Document } from "../../../fields/Document";
 import { ListField } from "../../../fields/ListField";
 import { TextField } from "../../../fields/TextField";
+import { FieldWaiting } from "../../../fields/Field";
 
 interface Props {
     docView: DocumentView;
@@ -30,12 +31,23 @@ export class LinkMenu extends React.Component<Props> {
 
                     {linkTo.map(link => {
                         let name = link.GetData(KeyStore.Title, TextField, new String);
-                        return <LinkBox linkDoc={link} linkName={name} />
+                        let doc = link.GetT(KeyStore.LinkedToDocs, Document);
+                        if (doc && doc != FieldWaiting) {
+                            return <LinkBox linkDoc={link} linkName={name} pairedDoc={doc} type={"Destination: "} />
+                        } else {
+                            return <div></div>
+                        }
+
                     })}
 
                     {linkFrom.map(link => {
                         let name = link.GetData(KeyStore.Title, TextField, new String);
-                        return <LinkBox linkDoc={link} linkName={name} />
+                        let doc = link.GetT(KeyStore.LinkedFromDocs, Document);
+                        if (doc && doc != FieldWaiting) {
+                            return <LinkBox linkDoc={link} linkName={name} pairedDoc={doc} type={"Source: "} />
+                        } else {
+                            return <div></div>
+                        }
                     })}
                 </div>
 
-- 
cgit v1.2.3-70-g09d2

