diff options
| author | bobzel <zzzman@gmail.com> | 2020-08-12 16:10:39 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2020-08-12 16:10:39 -0400 |
| commit | 57bbb175bfed6388f63566230eb7f1a591107855 (patch) | |
| tree | ced1e6aaecc997af176808117b02f5ce7a3c30e3 /src/client/views/collections | |
| parent | f7b6e64c5c60f7221d80d16460d0a85d0f17b35a (diff) | |
fixed run-time warnings & remove print statements
Diffstat (limited to 'src/client/views/collections')
| -rw-r--r-- | src/client/views/collections/CollectionSchemaCells.tsx | 8 | ||||
| -rw-r--r-- | src/client/views/collections/CollectionSchemaHeaders.tsx | 1 |
2 files changed, 4 insertions, 5 deletions
diff --git a/src/client/views/collections/CollectionSchemaCells.tsx b/src/client/views/collections/CollectionSchemaCells.tsx index c9dccd23b..49d75e6de 100644 --- a/src/client/views/collections/CollectionSchemaCells.tsx +++ b/src/client/views/collections/CollectionSchemaCells.tsx @@ -168,13 +168,14 @@ export class CollectionSchemaCell extends React.Component<CellProps> { if (positions !== undefined) { StrCast(this.props.Document._searchString); const length = StrCast(this.props.Document._searchString).length; + const color = contents ? "black" : "grey"; - results.push(<span style={{ color: contents ? "black" : "grey" }}>{contents ? contents.slice(0, positions[0]) : "undefined"}</span>); + results.push(<span key="-1" style={{ color }}>{contents?.slice(0, positions[0])}</span>); positions.forEach((num, cur) => { - results.push(<span style={{ backgroundColor: "#FFFF00", color: contents ? "black" : "grey" }}>{contents ? contents.slice(num, num + length) : "undefined"}</span>); + results.push(<span key={"start" + cur} style={{ backgroundColor: "#FFFF00", color }}>{contents?.slice(num, num + length)}</span>); let end = 0; cur === positions.length - 1 ? end = contents.length : end = positions[cur + 1]; - results.push(<span style={{ color: contents ? "black" : "grey" }}>{contents ? contents.slice(num + length, end) : "undefined"}</span>); + results.push(<span key={"end" + cur} style={{ color }}>{contents?.slice(num + length, end)}</span>); } ); return results; @@ -233,7 +234,6 @@ export class CollectionSchemaCell extends React.Component<CellProps> { if (aliasdoc.length > 0) { targetContext = Cast(aliasdoc[0].context, Doc) as Doc; } - console.log(targetContext); DocumentManager.Instance.jumpToDocument(this.props.rowProps.original, false, undefined, targetContext); } else { diff --git a/src/client/views/collections/CollectionSchemaHeaders.tsx b/src/client/views/collections/CollectionSchemaHeaders.tsx index 12fb5a874..c2bc7c77c 100644 --- a/src/client/views/collections/CollectionSchemaHeaders.tsx +++ b/src/client/views/collections/CollectionSchemaHeaders.tsx @@ -483,7 +483,6 @@ export class KeysDropdown extends React.Component<KeysDropdownProps> { @observable filterOpen: boolean | undefined = undefined; render() { - console.log(this._isOpen, this._key, this._searchTerm); return ( <div style={{ display: "flex" }}> <FontAwesomeIcon onClick={e => { this.props.Document._searchDoc ? runInAction(() => { this._isOpen === undefined ? this._isOpen = true : this._isOpen = !this._isOpen; }) : this.props.openHeader(this.props.col, e.clientX, e.clientY); }} icon={this.props.icon} size="lg" style={{ display: "inline", paddingBottom: "1px", paddingTop: "4px", cursor: "hand" }} /> |
