aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionSchemaCells.tsx
diff options
context:
space:
mode:
authorStanley Yip <33562077+yipstanley@users.noreply.github.com>2019-07-30 19:40:00 -0400
committerGitHub <noreply@github.com>2019-07-30 19:40:00 -0400
commitb26a257e09b9f4d8375806acb7ad143802b93603 (patch)
tree230fe76c093084c45105ec4c3b7a53f80b3eba86 /src/client/views/collections/CollectionSchemaCells.tsx
parent36ac0409b2a7a752727eaf2fc289d8cc72487619 (diff)
parent53b8bd7ff75ee500c999a4cbc87ed75e59ef1c21 (diff)
Merge branch 'master' into toggle_claire
Diffstat (limited to 'src/client/views/collections/CollectionSchemaCells.tsx')
-rw-r--r--src/client/views/collections/CollectionSchemaCells.tsx24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/client/views/collections/CollectionSchemaCells.tsx b/src/client/views/collections/CollectionSchemaCells.tsx
index fdf0896ac..61f21006e 100644
--- a/src/client/views/collections/CollectionSchemaCells.tsx
+++ b/src/client/views/collections/CollectionSchemaCells.tsx
@@ -71,6 +71,7 @@ export class CollectionSchemaCell extends React.Component<CellProps> {
document.removeEventListener("keydown", this.onKeyDown);
this._isEditing = true;
this.props.setIsEditing(true);
+
}
}
@@ -87,6 +88,9 @@ export class CollectionSchemaCell extends React.Component<CellProps> {
this.props.changeFocusedCellByIndex(this.props.row, this.props.col);
this.props.setPreviewDoc(this.props.rowProps.original);
+ // this._isEditing = true;
+ // this.props.setIsEditing(true);
+
let field = this.props.rowProps.original[this.props.rowProps.column.id!];
let doc = FieldValue(Cast(field, Doc));
if (typeof field === "object" && doc) this.props.setPreviewDoc(doc);
@@ -108,7 +112,7 @@ export class CollectionSchemaCell extends React.Component<CellProps> {
this._document[fieldKey] = de.data.draggedDocuments[0];
}
else {
- let coll = Docs.Create.SchemaDocument([new SchemaHeaderField("title")], de.data.draggedDocuments, {});
+ let coll = Docs.Create.SchemaDocument([new SchemaHeaderField("title", "#f1efeb")], de.data.draggedDocuments, {});
this._document[fieldKey] = coll;
}
e.stopPropagation();
@@ -122,17 +126,17 @@ export class CollectionSchemaCell extends React.Component<CellProps> {
}
}
- expandDoc = (e: React.PointerEvent) => {
- let field = this.props.rowProps.original[this.props.rowProps.column.id as string];
- let doc = FieldValue(Cast(field, Doc));
+ // expandDoc = (e: React.PointerEvent) => {
+ // let field = this.props.rowProps.original[this.props.rowProps.column.id as string];
+ // let doc = FieldValue(Cast(field, Doc));
- console.log("Expanding doc", StrCast(doc!.title));
- this.props.setPreviewDoc(doc!);
+ // console.log("Expanding doc", StrCast(doc!.title));
+ // this.props.setPreviewDoc(doc!);
- // this.props.changeFocusedCellByIndex(this.props.row, this.props.col);
+ // // this.props.changeFocusedCellByIndex(this.props.row, this.props.col);
- e.stopPropagation();
- }
+ // e.stopPropagation();
+ // }
renderCellWithType(type: string | undefined) {
let dragRef: React.RefObject<HTMLDivElement> = React.createRef();
@@ -285,7 +289,7 @@ export class CollectionSchemaCheckboxCell extends CollectionSchemaCell {
this._isChecked = e.target.checked;
let script = CompileScript(e.target.checked.toString(), { requiredType: "boolean", addReturn: true, params: { this: Doc.name } });
if (script.compiled) {
- this.applyToDoc(this._document, script.run);
+ this.applyToDoc(this._document, this.props.row, this.props.col, script.run);
}
}