diff options
author | bob <bcz@cs.brown.edu> | 2019-04-16 12:46:06 -0400 |
---|---|---|
committer | bob <bcz@cs.brown.edu> | 2019-04-16 12:46:06 -0400 |
commit | a4122573367ef36a9725e09b8447f3edfaa5c6a1 (patch) | |
tree | 76fec7e0f5f964efc0af0957681d63fde309e5cc /src/client/views/nodes/DocumentContentsView.tsx | |
parent | c6360fb4aed348f6f6a3c7412b6acc0d1990c239 (diff) | |
parent | feae8f4d314ef389cc544fd3ad0792a6bb04832c (diff) |
Merge branch 'master' into presentation_view
Diffstat (limited to 'src/client/views/nodes/DocumentContentsView.tsx')
-rw-r--r-- | src/client/views/nodes/DocumentContentsView.tsx | 33 |
1 files changed, 3 insertions, 30 deletions
diff --git a/src/client/views/nodes/DocumentContentsView.tsx b/src/client/views/nodes/DocumentContentsView.tsx index 88900c4b1..76f852601 100644 --- a/src/client/views/nodes/DocumentContentsView.tsx +++ b/src/client/views/nodes/DocumentContentsView.tsx @@ -23,7 +23,7 @@ import { HistogramBox } from "../../northstar/dash-nodes/HistogramBox"; import React = require("react"); import { Document } from "../../../fields/Document"; import { FieldViewProps } from "./FieldView"; -import { Without } from "../../../Utils"; +import { Without, OmitKeys } from "../../../Utils"; const JsxParser = require('react-jsx-parser').default; //TODO Why does this need to be imported like this? type BindingProps = Without<FieldViewProps, 'fieldKey'>; @@ -44,35 +44,8 @@ export class DocumentContentsView extends React.Component<DocumentViewProps & { CreateBindings(): JsxBindings { - let { - Document, - isSelected, - select, - isTopMost, - selectOnLoad, - ScreenToLocalTransform, - ContainingCollectionView, - addDocument, - removeDocument, - onActiveChanged, - parentActive: active, - } = this.props; - let bindings: JsxBindings = { - props: { - Document, - isSelected, - select, - isTopMost, - selectOnLoad, - ScreenToLocalTransform, - ContainingCollectionView, - active, - onActiveChanged, - addDocument, - removeDocument, - focus, - } - }; + let bindings: JsxBindings = { props: OmitKeys(this.props, ['parentActive'], (obj: any) => obj.active = this.props.parentActive) }; + for (const key of this.layoutKeys) { bindings[key.Name + "Key"] = key; // this maps string values of the form <keyname>Key to an actual key Kestore.keyname e.g, "DataKey" => KeyStore.Data } |