aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections
diff options
context:
space:
mode:
authorAndy Rickert <andrew_rickert@brown.edu>2020-08-05 00:07:59 -0400
committerAndy Rickert <andrew_rickert@brown.edu>2020-08-05 00:07:59 -0400
commit8c7196ca1eda1f89bbac3e2f24219df739978776 (patch)
treea50197ff35955d3bca3e8aa527027ec703449963 /src/client/views/collections
parent02f3d218aa084f00211ffa9e632ea0cdc4d2a531 (diff)
lint
Diffstat (limited to 'src/client/views/collections')
-rw-r--r--src/client/views/collections/CollectionSchemaCells.tsx25
-rw-r--r--src/client/views/collections/CollectionSchemaView.tsx4
-rw-r--r--src/client/views/collections/CollectionSubView.tsx2
3 files changed, 8 insertions, 23 deletions
diff --git a/src/client/views/collections/CollectionSchemaCells.tsx b/src/client/views/collections/CollectionSchemaCells.tsx
index b02b4c86a..7a80f4484 100644
--- a/src/client/views/collections/CollectionSchemaCells.tsx
+++ b/src/client/views/collections/CollectionSchemaCells.tsx
@@ -241,7 +241,7 @@ export class CollectionSchemaCell extends React.Component<CellProps> {
// <FontAwesomeIcon icon="expand" size="sm" />
// </div>
// );
- let positions = [];
+ const positions = [];
if (StrCast(this.props.Document._searchString) !== "") {
const cfield = ComputedField.WithoutComputed(() => FieldValue(props.Document[props.fieldKey]));
let term = "";
@@ -256,8 +256,8 @@ export class CollectionSchemaCell extends React.Component<CellProps> {
term = String(NumCast(cfield));
}
}
- let search = StrCast(this.props.Document._searchString);
- let start = term.indexOf(search) as number;
+ const search = StrCast(this.props.Document._searchString);
+ let start = term.indexOf(search);
let tally = 0;
if (start !== -1) {
positions.push(start);
@@ -883,36 +883,27 @@ export class CollectionSchemaButtons extends CollectionSchemaCell {
// (!this.props.CollectionView || !this.props.CollectionView.props.isSelected() ? undefined :
// SetupDrag(reference, () => this._document, this.props.moveDocument, this.props.Document.schemaDoc ? "copy" : undefined)(e));
// };
- let doc = this.props.rowProps.original;
+ const doc = this.props.rowProps.original;
let buttons = <div style={{
paddingTop: 8,
paddingLeft: 3,
}}><button onClick={() => {
- console.log(doc);
- console.log(doc.searchMatch);
doc.searchMatch = false;
- console.log(doc.searchMatch);
setTimeout(() => doc.searchMatch = true, 0);
- console.log(doc.searchMatch);
doc.searchIndex = NumCast(doc.searchIndex);
}} style={{ padding: 2, left: 77 }}>
<FontAwesomeIcon icon="arrow-up" size="sm" />
</button>
<button onClick={() => {
{
- console.log(doc);
- console.log(doc.searchMatch2);
doc.searchMatch2 = false;
- console.log(doc.searchMatch2);
setTimeout(() => doc.searchMatch2 = true, 0);
- console.log(doc.searchMatch2);
doc.searchIndex = NumCast(doc.searchIndex);
}
}} style={{ padding: 2 }}>
<FontAwesomeIcon icon="arrow-down" size="sm" />
</button></div>;
const type = StrCast(doc.type);
- console.log(StrCast(doc.type));
if (type === "pdf") {
buttons = <div><button
style={{
@@ -923,19 +914,14 @@ export class CollectionSchemaButtons extends CollectionSchemaCell {
}}
onClick={() => {
- console.log(doc);
- console.log(doc.searchMatch);
doc.searchMatch = false;
- console.log(doc.searchMatch);
setTimeout(() => doc.searchMatch = true, 0);
- console.log(doc.searchMatch);
doc.searchIndex = NumCast(doc.searchIndex);
}}>
<FontAwesomeIcon icon="arrow-down" size="sm" />
- </button></div >
+ </button></div >;
}
else if (type !== "rtf") {
- console.log("sad");
buttons = undefined;
}
@@ -945,7 +931,6 @@ export class CollectionSchemaButtons extends CollectionSchemaCell {
else {
buttons = undefined;
}
-
return (
<div> {buttons}</div>
);
diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx
index d47d41a1e..a003de0d3 100644
--- a/src/client/views/collections/CollectionSchemaView.tsx
+++ b/src/client/views/collections/CollectionSchemaView.tsx
@@ -329,14 +329,14 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
if (filter) {
Doc.setDocFilter(this.props.Document, newKey, filter, "match");
if (this.props.Document.selectedDoc !== undefined) {
- let doc = Cast(this.props.Document.selectedDoc, Doc) as Doc;
+ const doc = Cast(this.props.Document.selectedDoc, Doc) as Doc;
Doc.setDocFilter(doc, newKey, filter, "match");
}
}
else {
this.props.Document._docFilters = undefined;
if (this.props.Document.selectedDoc !== undefined) {
- let doc = Cast(this.props.Document.selectedDoc, Doc) as Doc;
+ const doc = Cast(this.props.Document.selectedDoc, Doc) as Doc;
doc._docFilters = undefined;
}
}
diff --git a/src/client/views/collections/CollectionSubView.tsx b/src/client/views/collections/CollectionSubView.tsx
index 888f0b9e9..b896518ed 100644
--- a/src/client/views/collections/CollectionSubView.tsx
+++ b/src/client/views/collections/CollectionSubView.tsx
@@ -159,7 +159,7 @@ export function CollectionSubView<T, X>(schemaCtor: (doc: Doc) => T, moreProps?:
newarray = [];
newdocs.forEach((t) => {
if (d.data !== undefined) {
- let newdocs = DocListCast(t.data);
+ const newdocs = DocListCast(t.data);
newdocs.forEach((newdoc) => {
newarray.push(newdoc);
});