aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJude <julie_wang1@brown.edu>2019-02-24 15:27:27 -0500
committerJude <julie_wang1@brown.edu>2019-02-24 15:27:27 -0500
commit3213d828b4386eabc2ee19b47279d0053958ea2a (patch)
treea0cdc8d392d041cf2edb083152ea6f05a9df985f
parent2eec7d883511107136d27683a309287c350f79b4 (diff)
why doesn't this work
-rw-r--r--src/client/views/collections/CollectionFreeFormView.tsx1
-rw-r--r--src/client/views/collections/CollectionTreeView.tsx7
-rw-r--r--src/client/views/collections/CollectionView.tsx6
3 files changed, 11 insertions, 3 deletions
diff --git a/src/client/views/collections/CollectionFreeFormView.tsx b/src/client/views/collections/CollectionFreeFormView.tsx
index cb6668634..a6296ba3e 100644
--- a/src/client/views/collections/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/CollectionFreeFormView.tsx
@@ -10,6 +10,7 @@ import { Transform } from "../../util/Transform";
import { undoBatch } from "../../util/UndoManager";
import { CollectionDockingView } from "../collections/CollectionDockingView";
import { CollectionSchemaView } from "../collections/CollectionSchemaView";
+import { CollectionTreeView } from "../collections/CollectionTreeView";
import { CollectionView } from "../collections/CollectionView";
import { CollectionFreeFormDocumentView } from "../nodes/CollectionFreeFormDocumentView";
import { DocumentView } from "../nodes/DocumentView";
diff --git a/src/client/views/collections/CollectionTreeView.tsx b/src/client/views/collections/CollectionTreeView.tsx
index adc2e032d..90cd5a4c0 100644
--- a/src/client/views/collections/CollectionTreeView.tsx
+++ b/src/client/views/collections/CollectionTreeView.tsx
@@ -7,14 +7,15 @@ import { ListField } from "../../../fields/ListField";
@observer
export class CollectionTreeView extends CollectionViewBase {
- public static makeTreeView(document: Document) {
- var children = document.GetT<ListField<Document>>(KeyStore.Data, ListField);
+ test = () => {
+ var children = this.props.Document.GetT<ListField<Document>>(KeyStore.Data, ListField);
if (children != null) {
console.log("\nNumber of Children: " + children);
}
+ return "HELLO WORLD";
}
render() {
- return "HELLO WORLD";
+ return { test };
}
} \ No newline at end of file
diff --git a/src/client/views/collections/CollectionView.tsx b/src/client/views/collections/CollectionView.tsx
index 90080ab43..35ebb5687 100644
--- a/src/client/views/collections/CollectionView.tsx
+++ b/src/client/views/collections/CollectionView.tsx
@@ -11,6 +11,7 @@ import { CollectionFreeFormView } from "./CollectionFreeFormView";
import { CollectionDockingView } from "./CollectionDockingView";
import { CollectionSchemaView } from "./CollectionSchemaView";
import { CollectionViewProps } from "./CollectionViewBase";
+import { CollectionTreeView } from "./CollectionTreeView";
@@ -19,6 +20,7 @@ export enum CollectionViewType {
Freeform,
Schema,
Docking,
+ Tree
}
export const COLLECTION_BORDER_WIDTH = 2;
@@ -91,6 +93,10 @@ export class CollectionView extends React.Component<CollectionViewProps> {
return (<CollectionDockingView {...this.props}
addDocument={this.addDocument} removeDocument={this.removeDocument} active={this.active}
CollectionView={this} />)
+ case CollectionViewType.Tree:
+ return (<CollectionTreeView {...this.props}
+ addDocument={this.addDocument} removeDocument={this.removeDocument} active={this.active}
+ CollectionView={this} />)
default:
return <div></div>
}