From d58b6a077930454cd7b1f6b9c24aa3ac58c0683d Mon Sep 17 00:00:00 2001 From: Geireann <60007097+geireann@users.noreply.github.com> Date: Tue, 15 Feb 2022 13:28:13 -0500 Subject: fixed some syntax errors --- src/client/documents/Documents.ts | 3 ++- src/client/views/PropertiesView.tsx | 9 ++++----- src/client/views/collections/CollectionSubView.tsx | 1 + src/client/views/nodes/MapBox/MapBox.tsx | 16 ++++++++-------- src/fields/Doc.ts | 2 +- 5 files changed, 16 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts index 80c3f9168..ff9ac4c8c 100644 --- a/src/client/documents/Documents.ts +++ b/src/client/documents/Documents.ts @@ -14,7 +14,8 @@ import { Cast, NumCast, StrCast } from "../../fields/Types"; import { AudioField, ImageField, MapField, PdfField, VideoField, WebField, YoutubeField } from "../../fields/URLField"; import { SharingPermissions } from "../../fields/util"; import { Upload } from "../../server/SharedMediaTypes"; -import { OmitKeys, Utils } from "../../Utils"; +import { OmitKeys, Utils } fr +om "../../Utils"; import { YoutubeBox } from "../apis/youtube/YoutubeBox"; import { DocServer } from "../DocServer"; import { Networking } from "../Network"; diff --git a/src/client/views/PropertiesView.tsx b/src/client/views/PropertiesView.tsx index f38341603..25b1381fe 100644 --- a/src/client/views/PropertiesView.tsx +++ b/src/client/views/PropertiesView.tsx @@ -1,6 +1,6 @@ import React = require("react"); +import { faAnchor, faArrowRight } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { faAnchor, faArrowRight } from '@fortawesome/free-solid-svg-icons' import { Checkbox, Tooltip } from "@material-ui/core"; import { intersection } from "lodash"; import { action, autorun, computed, Lambda, observable } from "mobx"; @@ -17,6 +17,7 @@ import { emptyFunction, returnEmptyDoclist, returnEmptyFilter, returnFalse, retu import { DocumentType } from "../documents/DocumentTypes"; import { CurrentUserUtils } from "../util/CurrentUserUtils"; import { DocumentManager } from "../util/DocumentManager"; +import { LinkManager } from "../util/LinkManager"; import { SelectionManager } from "../util/SelectionManager"; import { SharingManager } from "../util/SharingManager"; import { Transform } from "../util/Transform"; @@ -27,12 +28,10 @@ import { EditableView } from "./EditableView"; import { InkStrokeProperties } from "./InkStrokeProperties"; import { DocumentView, StyleProviderFunc } from "./nodes/DocumentView"; import { KeyValueBox } from "./nodes/KeyValueBox"; -import { PresBox } from "./nodes/trails/PresBox"; import { PropertiesButtons } from "./PropertiesButtons"; import { PropertiesDocContextSelector } from "./PropertiesDocContextSelector"; import "./PropertiesView.scss"; import { DefaultStyleProvider } from "./StyleProvider"; -import { LinkManager } from "../util/LinkManager"; const higflyout = require("@hig/flyout"); export const { anchorPoints } = higflyout; export const Flyout = higflyout.default; @@ -1218,7 +1217,7 @@ export class PropertiesView extends React.Component { onChange={e => this.handleLinkRelationshipChange(e.currentTarget.value)} className="text" type="text" - /> + />; } @computed @@ -1232,7 +1231,7 @@ export class PropertiesView extends React.Component { onChange={e => this.handleDescriptionChange(e.currentTarget.value)} className="text" type="text" - /> + />; } /** diff --git a/src/client/views/collections/CollectionSubView.tsx b/src/client/views/collections/CollectionSubView.tsx index fc1bcb8b9..34209ebc9 100644 --- a/src/client/views/collections/CollectionSubView.tsx +++ b/src/client/views/collections/CollectionSubView.tsx @@ -446,6 +446,7 @@ export function CollectionSubView(schemaCtor: (doc: Doc) => T, moreProps?: generatedDocuments.push(...await DocUtils.uploadFilesToDocs(files, options)); } if (generatedDocuments.length) { + // Creating a dash document const isFreeformView = this.props.Document._viewType === CollectionViewType.Freeform; const set = !isFreeformView ? generatedDocuments : generatedDocuments.length > 1 ? generatedDocuments.map(d => { DocUtils.iconify(d); return d; }) : []; diff --git a/src/client/views/nodes/MapBox/MapBox.tsx b/src/client/views/nodes/MapBox/MapBox.tsx index e80ad8acd..a506a5fcd 100644 --- a/src/client/views/nodes/MapBox/MapBox.tsx +++ b/src/client/views/nodes/MapBox/MapBox.tsx @@ -271,10 +271,10 @@ export class MapBox extends ViewBoxAnnotatableComponent { - if (this.toggleAddMarker == true) { + if (this.toggleAddMarker === true) { this.placeMarker((e as any).latLng, map); } - }) + }); } @action @@ -328,7 +328,7 @@ export class MapBox extends ViewBoxAnnotatableComponent { if (doc.lat !== undefined && doc.lng !== undefined) { const existingMarker = this.allMapMarkers.find(marker => marker.lat === doc.lat && marker.lng == doc.lng); @@ -340,7 +340,7 @@ export class MapBox extends ViewBoxAnnotatableComponent { console.log(this.allMapMarkers); console.log(this.allSidebarDocs); - }) + }); return this.removeDocument(doc, sidebarKey); } @@ -432,7 +432,7 @@ export class MapBox extends ViewBoxAnnotatableComponent { const anchor = AnchorMenu.Instance?.GetAnchor(this._savedAnnotations) ?? - this.rootDoc + this.rootDoc; return anchor; } @@ -525,7 +525,7 @@ export class MapBox extends ViewBoxAnnotatableComponent this.markerLoadHandler(marker, place)} onClick={(e: google.maps.MapMouseEvent) => this.markerClickHandler(e, place)} /> - )) + )); } // TODO: auto center on select a document in the sidebar diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts index 328385fda..8a5491b4b 100644 --- a/src/fields/Doc.ts +++ b/src/fields/Doc.ts @@ -1241,7 +1241,7 @@ export namespace Doc { case DocumentType.INK: return "pen-nib"; case DocumentType.PDF: return "file-pdf"; case DocumentType.LINK: return "link"; - case DocumentType.MAP: return "map-marker-alt" + case DocumentType.MAP: return "map-marker-alt"; default: return "question"; } } -- cgit v1.2.3-70-g09d2 From 7d5974c871fd50ed521ff8edd624c2c252553444 Mon Sep 17 00:00:00 2001 From: Geireann <60007097+geireann@users.noreply.github.com> Date: Tue, 15 Feb 2022 13:41:48 -0500 Subject: fixed broken import --- src/client/documents/Documents.ts | 3 +-- src/client/views/collections/CollectionStackingView.tsx | 2 ++ src/client/views/nodes/trails/PresElementBox.tsx | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts index f026d0005..df573a377 100644 --- a/src/client/documents/Documents.ts +++ b/src/client/documents/Documents.ts @@ -14,8 +14,7 @@ import { Cast, NumCast, StrCast } from "../../fields/Types"; import { AudioField, ImageField, MapField, PdfField, VideoField, WebField, YoutubeField } from "../../fields/URLField"; import { SharingPermissions } from "../../fields/util"; import { Upload } from "../../server/SharedMediaTypes"; -import { OmitKeys, Utils } fr -om "../../Utils"; +import { OmitKeys, Utils } from "../../Utils"; import { YoutubeBox } from "../apis/youtube/YoutubeBox"; import { DocServer } from "../DocServer"; import { Networking } from "../Network"; diff --git a/src/client/views/collections/CollectionStackingView.tsx b/src/client/views/collections/CollectionStackingView.tsx index cdc680a08..46cea5f78 100644 --- a/src/client/views/collections/CollectionStackingView.tsx +++ b/src/client/views/collections/CollectionStackingView.tsx @@ -82,12 +82,14 @@ export class CollectionStackingView extends CollectionSubView { TraceMobx(); this._docXfs.length = 0; + // Go through each of the documents that are contained return docs.map((d, i) => { const height = () => this.getDocHeight(d); const width = () => this.getDocWidth(d); const rowSpan = Math.ceil((height() + this.gridGap) / this.gridGap); const style = this.isStackingView ? { width: width(), marginTop: i ? this.gridGap : 0, height: height() } : { gridRowEnd: `span ${rowSpan}` }; return
+
OOPS
{this.getDisplayDoc(d, width)}
; }); diff --git a/src/client/views/nodes/trails/PresElementBox.tsx b/src/client/views/nodes/trails/PresElementBox.tsx index 238d025dc..04162dd91 100644 --- a/src/client/views/nodes/trails/PresElementBox.tsx +++ b/src/client/views/nodes/trails/PresElementBox.tsx @@ -167,6 +167,7 @@ export class PresElementBox extends ViewBoxBaseComponent { -- cgit v1.2.3-70-g09d2 From bdccc7c147dbb985bff5286e318718e48fd7cc62 Mon Sep 17 00:00:00 2001 From: Geireann <60007097+geireann@users.noreply.github.com> Date: Tue, 15 Feb 2022 16:06:18 -0500 Subject: updates --- .../views/collections/CollectionStackingView.scss | 32 ++++++++++++++++++-- .../views/collections/CollectionStackingView.tsx | 34 ++++++++++++++++++++-- .../CollectionStackingViewFieldColumn.tsx | 8 +++-- 3 files changed, 67 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/client/views/collections/CollectionStackingView.scss b/src/client/views/collections/CollectionStackingView.scss index 2f002736d..a77eb6b8a 100644 --- a/src/client/views/collections/CollectionStackingView.scss +++ b/src/client/views/collections/CollectionStackingView.scss @@ -131,9 +131,37 @@ margin-left: -5; } + // Documents in stacking view .collectionStackingView-columnDoc { - display: inline-block; - margin: auto; + display: flex; + // margin: auto; // Removed auto so that it is no longer center aligned - this could be something we change + position: relative; + + &:hover { + .hoverButtons{ + opacity: 1; + } + } + + .hoverButtons { + display: flex; + opacity: 0; + position: absolute; + height: 100%; + left: -35px; + justify-content: center; + align-items: center; + padding: 0px 10px; + + .buttonWrapper { + padding: 3px; + border-radius: 3px; + + &:hover { + background: rgba(0, 0, 0, 0.26); + } + } + } } .collectionStackingView-masonryDoc { diff --git a/src/client/views/collections/CollectionStackingView.tsx b/src/client/views/collections/CollectionStackingView.tsx index cdc680a08..ad3f3b217 100644 --- a/src/client/views/collections/CollectionStackingView.tsx +++ b/src/client/views/collections/CollectionStackingView.tsx @@ -65,6 +65,7 @@ export class CollectionStackingView extends CollectionSubView +
+ {/* We'll want to add an onPointerDown that uses DragManager.DocumentDragData + -- we also want to remember to preventDefault (so other drag events are not recognized over this one) + -- Design discussion as to whether we want dragging to be on the document itself or with a drag button + -- Do we want clicking on this button to do anything as well? + -- Design Question: Schema view also has the notion of a drag manager (different from this one), do we want + the same functionality? + -- Problem: This only shows when the outer container is selected... + */} +
+ e.stopPropagation()} /> +
+
{this.getDisplayDoc(d, width)} - ; + }); } @action @@ -275,7 +289,13 @@ export class CollectionStackingView extends CollectionSubView; } + @action + onPointerOver = (e: React.PointerEvent) => { + if (DragManager.docsBeingDragged.length){ + console.log(DragManager.docsBeingDragged[0].title) + } + } + @undoBatch @action onInternalDrop = (e: Event, de: DragManager.DropEvent) => { + console.log('drop') const where = [de.x, de.y]; let dropInd = -1; let dropAfter = 0; @@ -371,6 +399,7 @@ export class CollectionStackingView extends CollectionSubView => { + console.log('external drop') const where = [e.clientX, e.clientY]; let targInd = -1; this._docXfs.map((cd, i) => { @@ -600,6 +629,7 @@ export class CollectionStackingView extends CollectionSubView this._scroll = e.currentTarget.scrollTop)} + onPointerOver={this.onPointerOver} onDrop={this.onExternalDrop.bind(this)} onContextMenu={this.onContextMenu} onWheel={e => this.props.isContentActive(true) && e.stopPropagation()} > diff --git a/src/client/views/collections/CollectionStackingViewFieldColumn.tsx b/src/client/views/collections/CollectionStackingViewFieldColumn.tsx index 58289a161..3e4e5bdcb 100644 --- a/src/client/views/collections/CollectionStackingViewFieldColumn.tsx +++ b/src/client/views/collections/CollectionStackingViewFieldColumn.tsx @@ -309,14 +309,16 @@ export class CollectionStackingViewFieldColumn extends React.Component {!this.props.chromeHidden && type !== DocumentType.PRES ?
+ style={{ width: this.props.columnWidth / this.props.numGroupColumns, marginBottom: 10, marginLeft: 25 }}> } toggle={this.toggleVisibility} - menuCallback={this.menuCallback} /> + menuCallback={this.menuCallback} + />
: null} } -- cgit v1.2.3-70-g09d2 From a0365450297aa96bcc514114413fb983a34226f9 Mon Sep 17 00:00:00 2001 From: Geireann <60007097+geireann@users.noreply.github.com> Date: Tue, 15 Feb 2022 16:31:35 -0500 Subject: more comments --- src/client/views/collections/CollectionStackingView.tsx | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/client/views/collections/CollectionStackingView.tsx b/src/client/views/collections/CollectionStackingView.tsx index 70471d0d8..419b9a943 100644 --- a/src/client/views/collections/CollectionStackingView.tsx +++ b/src/client/views/collections/CollectionStackingView.tsx @@ -80,6 +80,7 @@ export class CollectionStackingView extends CollectionSubView { TraceMobx(); this._docXfs.length = 0; @@ -338,6 +339,7 @@ export class CollectionStackingView extends CollectionSubView; } + // TODO: plj @action onPointerOver = (e: React.PointerEvent) => { if (DragManager.docsBeingDragged.length){ @@ -345,6 +347,7 @@ export class CollectionStackingView extends CollectionSubView { -- cgit v1.2.3-70-g09d2