aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes
diff options
context:
space:
mode:
authorab <abdullah_ahmed@brown.edu>2019-09-16 15:26:36 -0400
committerab <abdullah_ahmed@brown.edu>2019-09-16 15:26:36 -0400
commit19375927c677ad6c99c77d0c7dac17fe7a2712a9 (patch)
tree147dd5d3263f8f050d6cda4bd4986f779a391621 /src/client/views/nodes
parentd3b4f8991aefcc939768cfa82617e42862693bc6 (diff)
beginning to handle external interactions
Diffstat (limited to 'src/client/views/nodes')
-rw-r--r--src/client/views/nodes/DocumentView.tsx7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx
index 2ae71f1da..a034bc1f4 100644
--- a/src/client/views/nodes/DocumentView.tsx
+++ b/src/client/views/nodes/DocumentView.tsx
@@ -45,6 +45,7 @@ import { RecommendationsBox } from '../Recommendations';
import { SearchUtil } from '../../util/SearchUtil';
import { ClientRecommender } from '../../ClientRecommender';
import { DocumentType } from '../../documents/DocumentTypes';
+import { SchemaHeaderField } from '../../../new_fields/SchemaHeaderField';
const JsxParser = require('react-jsx-parser').default; //TODO Why does this need to be imported like this?
library.add(fa.faBrain);
@@ -774,7 +775,11 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu
ClientRecommender.Instance.reset_docs();
const doc = Doc.GetDataDoc(this.props.Document);
const extdoc = doc.data_ext as Doc;
- return ClientRecommender.Instance.extractText(doc, extdoc ? extdoc : doc, false);
+ const values = await ClientRecommender.Instance.extractText(doc, extdoc ? extdoc : doc, false);
+ const headers = [new SchemaHeaderField("title"), new SchemaHeaderField("href")];
+ const body = Docs.Create.FreeformDocument([], { title: values.title });
+ body.href = values.url;
+ CollectionDockingView.Instance.AddRightSplit(Docs.Create.SchemaDocument(headers, [body], { title: `Showing External Recommendations for "${StrCast(doc.title)}"` }), undefined);
}
onPointerEnter = (e: React.PointerEvent): void => { Doc.BrushDoc(this.props.Document); };