From 44d669b46616e561aef874471d2740a4f205d9f0 Mon Sep 17 00:00:00 2001 From: Fawn Date: Mon, 11 Mar 2019 21:25:13 -0400 Subject: column adding works, but render doesn't get called on add --- src/fields/Document.ts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/fields/Document.ts') diff --git a/src/fields/Document.ts b/src/fields/Document.ts index 25e239417..6cf9c194e 100644 --- a/src/fields/Document.ts +++ b/src/fields/Document.ts @@ -38,6 +38,11 @@ export class Document extends Field { return this.GetText(KeyStore.Title, ""); } + @computed + public get Fields() { + return this.fields; + } + /** * Get the field in the document associated with the given key. If the * associated field has not yet been filled in from the server, a request -- cgit v1.2.3-70-g09d2 From 1ae0ba5addbcf3d527f1e75cc895aaf023063a7d Mon Sep 17 00:00:00 2001 From: Tyler Schicke Date: Mon, 18 Mar 2019 14:05:37 -0400 Subject: Cleaned up field view --- src/client/views/nodes/FieldView.tsx | 19 ++++++++++++++----- src/fields/Document.ts | 1 + 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'src/fields/Document.ts') diff --git a/src/client/views/nodes/FieldView.tsx b/src/client/views/nodes/FieldView.tsx index 49f4cefce..e84c5f933 100644 --- a/src/client/views/nodes/FieldView.tsx +++ b/src/client/views/nodes/FieldView.tsx @@ -16,6 +16,7 @@ import { WebBox } from "./WebBox"; import { VideoBox } from "./VideoBox"; import { AudioBox } from "./AudioBox"; import { AudioField } from "../../../fields/AudioField"; +import { ListField } from "../../../fields/ListField"; // @@ -60,12 +61,20 @@ export class FieldView extends React.Component { } else if (field instanceof WebField) { return - } - else if (field instanceof VideoField){ - return } - else if (field instanceof AudioField){ - return + else if (field instanceof VideoField) { + return + } + else if (field instanceof AudioField) { + return + } else if (field instanceof Document) { + return
{field.Title}
+ } else if (field instanceof ListField) { + return (
+ {(field as ListField).Data.map(f => { + return f instanceof Document ? f.Title : f.GetValue().toString(); + }).join(", ")} +
) } // bcz: this belongs here, but it doesn't render well so taking it out for now // else if (field instanceof HtmlField) { diff --git a/src/fields/Document.ts b/src/fields/Document.ts index 5f0889786..be0137128 100644 --- a/src/fields/Document.ts +++ b/src/fields/Document.ts @@ -310,6 +310,7 @@ export class Document extends Field { throw new Error("Method not implemented."); } GetValue() { + return this.Title; var title = (this._proxies.has(KeyStore.Title.Id) ? "???" : this.Title) + "(" + this.Id + ")"; return title; //throw new Error("Method not implemented."); -- cgit v1.2.3-70-g09d2