aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/collections')
-rw-r--r--src/client/views/collections/CollectionSchemaCells.tsx31
-rw-r--r--src/client/views/collections/CollectionSchemaHeaders.tsx1
-rw-r--r--src/client/views/collections/CollectionSubView.tsx5
3 files changed, 20 insertions, 17 deletions
diff --git a/src/client/views/collections/CollectionSchemaCells.tsx b/src/client/views/collections/CollectionSchemaCells.tsx
index bf826857e..e50f95dca 100644
--- a/src/client/views/collections/CollectionSchemaCells.tsx
+++ b/src/client/views/collections/CollectionSchemaCells.tsx
@@ -247,12 +247,12 @@ export class CollectionSchemaCell extends React.Component<CellProps> {
if (StrCast(this.props.Document._searchString) !== "") {
const cfield = ComputedField.WithoutComputed(() => FieldValue(props.Document[props.fieldKey]));
let term = "";
- if (cfield!==undefined){
- if (cfield.Text!==undefined){
+ if (cfield !== undefined) {
+ if (cfield.Text !== undefined) {
term = cfield.Text;
}
- else if (StrCast(cfield)){
- term= StrCast(cfield);
+ else if (StrCast(cfield)) {
+ term = StrCast(cfield);
}
else {
term = String(NumCast(cfield));
@@ -261,8 +261,8 @@ export class CollectionSchemaCell extends React.Component<CellProps> {
let search = StrCast(this.props.Document._searchString)
let start = term.indexOf(search) as number;
let tally = 0;
- if (start!==-1){
- positions.push(start);
+ if (start !== -1) {
+ positions.push(start);
}
while (start < contents.length && start !== -1) {
term = term.slice(start + search.length + 1);
@@ -275,7 +275,8 @@ export class CollectionSchemaCell extends React.Component<CellProps> {
}
}
return (
- <div className="collectionSchemaView-cellContainer" style={{ cursor: fieldIsDoc ? "grab" : "auto" }} ref={dragRef} onPointerDown={this.onPointerDown} onPointerEnter={onPointerEnter} onPointerLeave={onPointerLeave}>
+ <div className="collectionSchemaView-cellContainer" style={{ cursor: fieldIsDoc ? "grab" : "auto" }}
+ ref={dragRef} onPointerDown={this.onPointerDown} onPointerEnter={onPointerEnter} onPointerLeave={onPointerLeave}>
<div className={className} ref={this._focusRef} onPointerDown={onItemDown} tabIndex={-1}>
<div className="collectionSchemaView-cellContents" ref={type === undefined || type === "document" ? this.dropRef : null} key={props.Document[Id]}>
<EditableView
@@ -294,21 +295,21 @@ export class CollectionSchemaCell extends React.Component<CellProps> {
// if (type === "number" && (contents === 0 || contents === "0")) {
// return "0";
// } else {
- const cfield = ComputedField.WithoutComputed(() => FieldValue(props.Document[props.fieldKey]));
- if (cfield!==undefined){
- if (cfield.Text!==undefined){
- return(cfield.Text);
+ const cfield = ComputedField.WithoutComputed(() => FieldValue(props.Document[props.fieldKey]));
+ if (cfield !== undefined) {
+ if (cfield.Text !== undefined) {
+ return (cfield.Text);
}
- else if (StrCast(cfield)){
+ else if (StrCast(cfield)) {
return StrCast(cfield);
}
else {
return String(NumCast(cfield));
}
}
- // console.log(cfield.Text);
- // console.log(StrCast(cfield));
- // return StrCast(cfield);
+ // console.log(cfield.Text);
+ // console.log(StrCast(cfield));
+ // return StrCast(cfield);
// }
}}
diff --git a/src/client/views/collections/CollectionSchemaHeaders.tsx b/src/client/views/collections/CollectionSchemaHeaders.tsx
index 0ee225407..a979f9838 100644
--- a/src/client/views/collections/CollectionSchemaHeaders.tsx
+++ b/src/client/views/collections/CollectionSchemaHeaders.tsx
@@ -430,7 +430,6 @@ export class KeysDropdown extends React.Component<KeysDropdownProps> {
render() {
- console.log(this.props.docs);
return (
<div className="keys-dropdown" style={{ zIndex: 10, width: this.props.width, maxWidth: this.props.width }}>
{this._key === this._searchTerm.slice(0, this._key.length) ?
diff --git a/src/client/views/collections/CollectionSubView.tsx b/src/client/views/collections/CollectionSubView.tsx
index dacb06e5b..4463eef3e 100644
--- a/src/client/views/collections/CollectionSubView.tsx
+++ b/src/client/views/collections/CollectionSubView.tsx
@@ -130,13 +130,16 @@ export function CollectionSubView<T, X>(schemaCtor: (doc: Doc) => T, moreProps?:
let childDocs = viewSpecScript ? docs.filter(d => viewSpecScript.script.run({ doc: d }, console.log).result) : docs;
const searchDocs = DocListCast(this.props.Document._searchDocs);
+ console.log(this.props.Document);
+ console.log(searchDocs);
if (searchDocs !== undefined && searchDocs.length > 0) {
+ console.log("yes");
childDocs = searchDocs;
}
const docFilters = this.docFilters();
const docRangeFilters = this.props.ignoreFields?.includes("_docRangeFilters") ? [] : Cast(this.props.Document._docRangeFilters, listSpec("string"), []);
- return this.props.Document.dontRegisterView ? docs : DocUtils.FilterDocs(docs, docFilters, docRangeFilters, viewSpecScript);
+ return this.props.Document.dontRegisterView ? childDocs : DocUtils.FilterDocs(childDocs, docFilters, docRangeFilters, viewSpecScript);
}
@action