aboutsummaryrefslogtreecommitdiff
path: root/src/client/views
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views')
-rw-r--r--src/client/views/MainView.tsx70
-rw-r--r--src/client/views/collections/CollectionSchemaCells.tsx9
-rw-r--r--src/client/views/collections/CollectionSchemaHeaders.tsx10
-rw-r--r--src/client/views/collections/CollectionSchemaView.tsx24
-rw-r--r--src/client/views/collections/CollectionSubView.tsx3
-rw-r--r--src/client/views/nodes/LabelBox.tsx1
-rw-r--r--src/client/views/nodes/WebBox.tsx2
-rw-r--r--src/client/views/pdf/PDFViewer.tsx3
8 files changed, 10 insertions, 112 deletions
diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx
index 03f624038..923036eae 100644
--- a/src/client/views/MainView.tsx
+++ b/src/client/views/MainView.tsx
@@ -80,7 +80,6 @@ export class MainView extends React.Component {
@computed private get userDoc() { return Doc.UserDoc(); }
@computed private get mainContainer() { return this.userDoc ? FieldValue(Cast(this.userDoc.activeWorkspace, Doc)) : CurrentUserUtils.GuestWorkspace; }
@computed public get mainFreeform(): Opt<Doc> { return (docs => (docs && docs.length > 1) ? docs[1] : undefined)(DocListCast(this.mainContainer!.data)); }
- @computed public get sidebarButtonsDoc() { return Cast(this.userDoc["tabs-buttons"], Doc) as Doc; }
@computed public get searchDoc() { return Cast(this.userDoc["search-panel"], Doc) as Doc; }
@@ -356,38 +355,6 @@ export class MainView extends React.Component {
}
}
- // @computed get search() {
- // return <DocumentView Document={this.searchDoc!}
- // DataDoc={undefined}
- // LibraryPath={emptyPath}
- // addDocument={undefined}
- // addDocTab={this.addDocTabFunc}
- // pinToPres={emptyFunction}
- // rootSelected={returnTrue}
- // onClick={undefined}
- // backgroundColor={this.defaultBackgroundColors}
- // removeDocument={undefined}
- // ScreenToLocalTransform={Transform.Identity}
- // ContentScaling={returnOne}
- // NativeHeight={returnZero}
- // NativeWidth={returnZero}
- // PanelWidth={this.getPWidth}
- // PanelHeight={this.getPHeight}
- // renderDepth={0}
- // focus={emptyFunction}
- // parentActive={returnTrue}
- // whenActiveChanged={emptyFunction}
- // bringToFront={emptyFunction}
- // docFilters={returnEmptyFilter}
- // ContainingCollectionView={undefined}
- // ContainingCollectionDoc={undefined}
- // />;
- // }
-
-
-
-
-
@computed get mainDocView() {
return <DocumentView
Document={this.mainContainer!}
@@ -640,45 +607,8 @@ export class MainView extends React.Component {
}
@computed get mainContent() {
- //const n = (RichTextMenu.Instance?.Pinned ? 1 : 0) + (CollectionMenu.Instance?.Pinned ? 1 : 0);
const n = (CollectionMenu.Instance?.Pinned ? 1 : 0);
const height = `calc(100% - ${n * Number(ANTIMODEMENU_HEIGHT.replace("px", ""))}px)`;
- // return !this.userDoc || !(sidebar instanceof Doc) ? (null) : (
- // <div>
- // <div style={{ height: "32px", width: "100%", backgroundColor: "black" }}>
- // {this.search}
- // </div>
- // <div className="mainView-mainContent" style={{
- // color: this.darkScheme ? "rgb(205,205,205)" : "black",
- // //change to times 2 for both pinned
- // height,
- // width: (FormatShapePane.Instance?.Pinned) ? `calc(100% - 200px)` : "100%"
- // }} >
- // <div style={{ display: "contents", flexDirection: "row", position: "relative" }}>
- // <div className="mainView-flyoutContainer" onPointerLeave={this.pointerLeaveDragger} style={{ width: this.flyoutWidth }}>
- // <div className="mainView-libraryHandle" onPointerDown={this.onPointerDown}
- // style={{ backgroundColor: this.defaultBackgroundColors(sidebar) }}>
- // <span title="library View Dragger" style={{
- // width: (this.flyoutWidth !== 0 && this._flyoutTranslate) ? "100%" : "3vw",
- // //height: (this.flyoutWidth !== 0 && this._flyoutTranslate) ? "100%" : "100vh",
- // position: (this.flyoutWidth !== 0 && this._flyoutTranslate) ? "absolute" : "fixed",
- // top: (this.flyoutWidth !== 0 && this._flyoutTranslate) ? "" : "0"
- // }} />
- // </div>
- // <div className="mainView-libraryFlyout" style={{
- // //transformOrigin: this._flyoutTranslate ? "" : "left center",
- // transition: this._flyoutTranslate ? "" : "width .5s",
- // //transform: `scale(${this._flyoutTranslate ? 1 : 0.8})`,
- // boxShadow: this._flyoutTranslate ? "" : "rgb(156, 147, 150) 0.2vw 0.2vw 0.8vw"
- // }}>
- // {this.flyout}
- // {this.expandButton}
- // </div>
- // </div>
- // {this.dockingContent}
- // </div>
- // </div>
- // </div>);
const pinned = FormatShapePane.Instance?.Pinned;
const innerContent = this.mainInnerContent;
return !this.userDoc ? (null) : (
diff --git a/src/client/views/collections/CollectionSchemaCells.tsx b/src/client/views/collections/CollectionSchemaCells.tsx
index e50f95dca..ecd20eb06 100644
--- a/src/client/views/collections/CollectionSchemaCells.tsx
+++ b/src/client/views/collections/CollectionSchemaCells.tsx
@@ -32,7 +32,6 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import DatePicker from "react-datepicker";
import "react-datepicker/dist/react-datepicker.css";
import { DateField } from "../../../fields/DateField";
-import { indexOf } from "lodash";
const path = require('path');
library.add(faExpand);
@@ -292,9 +291,6 @@ export class CollectionSchemaCell extends React.Component<CellProps> {
maxHeight={Number(MAX_ROW_HEIGHT)}
placeholder={"enter value"}
bing={() => {
- // 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) {
@@ -307,11 +303,6 @@ export class CollectionSchemaCell extends React.Component<CellProps> {
return String(NumCast(cfield));
}
}
- // console.log(cfield.Text);
- // console.log(StrCast(cfield));
- // return StrCast(cfield);
- // }
-
}}
GetValue={() => {
if (type === "number" && (contents === 0 || contents === "0")) {
diff --git a/src/client/views/collections/CollectionSchemaHeaders.tsx b/src/client/views/collections/CollectionSchemaHeaders.tsx
index a979f9838..5d7ab2c61 100644
--- a/src/client/views/collections/CollectionSchemaHeaders.tsx
+++ b/src/client/views/collections/CollectionSchemaHeaders.tsx
@@ -78,14 +78,6 @@ export class CollectionSchemaAddColumnHeader extends React.Component<AddColumnHe
-
-
-
-
-
-
-
-
export interface ColumnMenuProps {
columnField: SchemaHeaderField;
// keyValue: string;
@@ -330,8 +322,6 @@ export class KeysDropdown extends React.Component<KeysDropdownProps> {
@undoBatch
onKeyDown = (e: React.KeyboardEvent): void => {
- //if (this._key !==)
-
if (e.key === "Enter") {
const keyOptions = this._searchTerm === "" ? this.props.possibleKeys : this.props.possibleKeys.filter(key => key.toUpperCase().indexOf(this._searchTerm.toUpperCase()) > -1);
if (keyOptions.length) {
diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx
index b93a7f7b8..869be2b03 100644
--- a/src/client/views/collections/CollectionSchemaView.tsx
+++ b/src/client/views/collections/CollectionSchemaView.tsx
@@ -4,27 +4,26 @@ import { faCog, faPlus, faSortDown, faSortUp, faTable } from '@fortawesome/free-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { action, computed, observable, untracked } from "mobx";
import { observer } from "mobx-react";
+import Measure from "react-measure";
import { Resize } from "react-table";
import "react-table/react-table.css";
-import { Doc, DocCastAsync } from "../../../fields/Doc";
+import { Doc } from "../../../fields/Doc";
import { List } from "../../../fields/List";
import { listSpec } from "../../../fields/Schema";
-import { SchemaHeaderField, PastelSchemaPalette } from "../../../fields/SchemaHeaderField";
-import { Cast, NumCast, StrCast } from "../../../fields/Types";
-import { Docs, DocumentOptions } from "../../documents/Documents";
+import { PastelSchemaPalette, SchemaHeaderField } from "../../../fields/SchemaHeaderField";
+import { Cast, NumCast } from "../../../fields/Types";
+import { TraceMobx } from "../../../fields/util";
+import { emptyFunction, returnFalse, returnOne, returnZero, setupMoveUpEvents } from "../../../Utils";
+import { SnappingManager } from "../../util/SnappingManager";
import { Transform } from "../../util/Transform";
import { undoBatch } from "../../util/UndoManager";
import { COLLECTION_BORDER_WIDTH } from '../../views/globalCssVariables.scss';
import '../DocumentDecorations.scss';
+import { ContentFittingDocumentView } from "../nodes/ContentFittingDocumentView";
import { KeysDropdown } from "./CollectionSchemaHeaders";
import "./CollectionSchemaView.scss";
import { CollectionSubView } from "./CollectionSubView";
-import { ContentFittingDocumentView } from "../nodes/ContentFittingDocumentView";
-import { setupMoveUpEvents, emptyFunction, returnZero, returnOne, returnFalse } from "../../../Utils";
-import { SnappingManager } from "../../util/SnappingManager";
-import Measure from "react-measure";
import { SchemaTable } from "./SchemaTable";
-import { TraceMobx } from "../../../fields/util";
library.add(faCog, faPlus, faSortUp, faSortDown);
library.add(faTable);
@@ -170,9 +169,7 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
@action
setColumnSort = (columnField: SchemaHeaderField, descending: boolean | undefined) => {
const columns = this.columns;
- columns.forEach(col => {
- col.setDesc(undefined);
- })
+ columns.forEach(col => col.setDesc(undefined));
const index = columns.findIndex(c => c.heading === columnField.heading);
const column = columns[index];
@@ -330,8 +327,6 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
columns[index] = column;
this.columns = columns;
if (filter) {
- console.log(newKey);
- console.log(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;
@@ -462,7 +457,6 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
this.props.select(false);
}
}
- console.log("yeeeet");
}
@computed
diff --git a/src/client/views/collections/CollectionSubView.tsx b/src/client/views/collections/CollectionSubView.tsx
index ab28e1904..88241f519 100644
--- a/src/client/views/collections/CollectionSubView.tsx
+++ b/src/client/views/collections/CollectionSubView.tsx
@@ -130,10 +130,7 @@ 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();
diff --git a/src/client/views/nodes/LabelBox.tsx b/src/client/views/nodes/LabelBox.tsx
index 983470f9d..302d66cc5 100644
--- a/src/client/views/nodes/LabelBox.tsx
+++ b/src/client/views/nodes/LabelBox.tsx
@@ -69,7 +69,6 @@ export class LabelBox extends ViewBoxBaseComponent<FieldViewProps, LabelDocument
const params = Cast(this.paramsDoc["onClick-paramFieldKeys"], listSpec("string"), []);
const missingParams = params?.filter(p => !this.paramsDoc[p]);
params?.map(p => DocListCast(this.paramsDoc[p])); // bcz: really hacky form of prefetching ...
- console.log(this.backColor);
return (
<div className="labelBox-outerDiv" onClick={() => runInAction(() => { this.clicked = !this.clicked; this.clicked ? this.backColor = StrCast(this.layoutDoc.hovercolor) : this.backColor = "unset" })} onMouseLeave={() => runInAction(() => { !this.clicked ? this.backColor = "unset" : null })}
onMouseOver={() => runInAction(() => { this.backColor = StrCast(this.layoutDoc.hovercolor); })} ref={this.createDropTarget} onContextMenu={this.specificContextMenu}
diff --git a/src/client/views/nodes/WebBox.tsx b/src/client/views/nodes/WebBox.tsx
index 1313bded7..646a94aa7 100644
--- a/src/client/views/nodes/WebBox.tsx
+++ b/src/client/views/nodes/WebBox.tsx
@@ -139,7 +139,7 @@ export class WebBox extends ViewBoxAnnotatableComponent<FieldViewProps, WebDocum
} else if (field?.url) {
const result = await WebRequest.get(Utils.CorsProxy(field.url.href));
if (result) {
- this.props.Document.text = htmlToText.fromString(result.content);
+ this.dataDoc.text = htmlToText.fromString(result.content);
}
}
}
diff --git a/src/client/views/pdf/PDFViewer.tsx b/src/client/views/pdf/PDFViewer.tsx
index 7ab2876da..7f31931a9 100644
--- a/src/client/views/pdf/PDFViewer.tsx
+++ b/src/client/views/pdf/PDFViewer.tsx
@@ -329,10 +329,7 @@ export class PDFViewer extends ViewBoxAnnotatableComponent<IViewerProps, PdfDocu
}
@action
prevAnnotation = () => {
- console.log(this.Index);
this.Index = Math.max(this.Index - 1, 0);
- console.log(this.Index);
- console.log(this.allAnnotations);
this.scrollToAnnotation(this.allAnnotations.sort((a, b) => NumCast(a.y) - NumCast(b.y))[this.Index]);
}