diff options
| author | bob <bcz@cs.brown.edu> | 2019-09-16 10:36:16 -0400 |
|---|---|---|
| committer | bob <bcz@cs.brown.edu> | 2019-09-16 10:36:16 -0400 |
| commit | 5e3c12128f4d15d621b323e0f1d78bfff2452b92 (patch) | |
| tree | 209fef8663ee2ac55687ba7dc2be4d0b57ae2a3d /src/client/views/collections/CollectionSubView.tsx | |
| parent | f428ac2621f123661a937405764058f27a9feefd (diff) | |
fixed templates to allow aliasing, clustering and other things.
Diffstat (limited to 'src/client/views/collections/CollectionSubView.tsx')
| -rw-r--r-- | src/client/views/collections/CollectionSubView.tsx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/client/views/collections/CollectionSubView.tsx b/src/client/views/collections/CollectionSubView.tsx index bc994cffd..d13c69ecf 100644 --- a/src/client/views/collections/CollectionSubView.tsx +++ b/src/client/views/collections/CollectionSubView.tsx @@ -53,8 +53,10 @@ export function CollectionSubView<T>(schemaCtor: (doc: Doc) => T) { @computed get extensionDoc() { return Doc.resolvedFieldDataDoc(BoolCast(this.props.Document.isTemplate) && this.props.DataDoc ? this.props.DataDoc : this.props.Document, this.props.fieldKey, this.props.fieldExt); } + get childLayoutPairs() { + return this.childDocs.map(cd => Doc.GetLayoutDataDocPair(this.props.Document, this.props.DataDoc, this.props.fieldKey, cd)).filter(pair => pair.layout).map(pair => ({ layout: pair.layout!, data: pair.data! })); + } get childDocs() { - let self = this; //TODO tfs: This might not be what we want? //This linter error can't be fixed because of how js arguments work, so don't switch this to filter(FieldValue) let docs = DocListCast(this.extensionDoc[this.props.fieldExt ? this.props.fieldExt : this.props.fieldKey]); |
