aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionSchemaView.tsx
diff options
context:
space:
mode:
authorTyler Schicke <tyler_schicke@brown.edu>2019-04-01 19:54:05 -0400
committerTyler Schicke <tyler_schicke@brown.edu>2019-04-01 19:54:05 -0400
commit1cdb04707301bc51b3ed6dd1c15c79a7b989b7f7 (patch)
treef7f3e73f83156b49b17f1611eb1e9467a6640397 /src/client/views/collections/CollectionSchemaView.tsx
parenta687a9962c8952074177e52366b69dcce231a18e (diff)
Started refactoring props and collections
Diffstat (limited to 'src/client/views/collections/CollectionSchemaView.tsx')
-rw-r--r--src/client/views/collections/CollectionSchemaView.tsx13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx
index 0ff6c3b40..0c7e28691 100644
--- a/src/client/views/collections/CollectionSchemaView.tsx
+++ b/src/client/views/collections/CollectionSchemaView.tsx
@@ -73,19 +73,18 @@ export class CollectionSchemaView extends CollectionViewBase {
renderCell = (rowProps: CellInfo) => {
let props: FieldViewProps = {
- doc: rowProps.value[0],
+ Document: rowProps.value[0],
fieldKey: rowProps.value[1],
isSelected: () => false,
select: () => { },
isTopMost: false,
- bindings: {},
selectOnLoad: false,
}
let contents = (
<FieldView {...props} />
)
let reference = React.createRef<HTMLDivElement>();
- let onItemDown = setupDrag(reference, () => props.doc, (containingCollection: CollectionView) => this.props.removeDocument(props.doc));
+ let onItemDown = setupDrag(reference, () => props.Document, (containingCollection: CollectionView) => this.props.removeDocument(props.Document));
let applyToDoc = (doc: Document, value: string) => {
let script = CompileScript(value, { this: doc }, true);
if (!script.compiled) {
@@ -105,20 +104,20 @@ export class CollectionSchemaView extends CollectionViewBase {
return false;
}
return (
- <div className="collectionSchemaView-cellContents" onPointerDown={onItemDown} style={{ height: "56px" }} key={props.doc.Id} ref={reference}>
+ <div className="collectionSchemaView-cellContents" onPointerDown={onItemDown} style={{ height: "56px" }} key={props.Document.Id} ref={reference}>
<EditableView
display={"inline"}
contents={contents}
height={56}
GetValue={() => {
- let field = props.doc.Get(props.fieldKey);
+ let field = props.Document.Get(props.fieldKey);
if (field && field instanceof Field) {
return field.ToScriptString();
}
return field || "";
}}
SetValue={(value: string) => {
- return applyToDoc(props.doc, value);
+ return applyToDoc(props.Document, value);
}}
OnFillDown={(value: string) => {
this.props.Document.GetTAsync<ListField<Document>>(this.props.fieldKey, ListField).then((val) => {
@@ -298,7 +297,7 @@ export class CollectionSchemaView extends CollectionViewBase {
{doc instanceof Document ? <DocumentView Document={doc}
AddDocument={this.props.addDocument} RemoveDocument={this.props.removeDocument}
isTopMost={false}
- SelectOnLoad={false}
+ selectOnLoad={false}
ScreenToLocalTransform={this.getPreviewTransform}
ContentScaling={this.getContentScaling}
PanelWidth={this.getPanelWidth}