From 9d9e7593a0ece66d3538ea5986de3388a0759ad7 Mon Sep 17 00:00:00 2001 From: bobzel Date: Mon, 28 Sep 2020 13:00:55 -0400 Subject: fixed filtering annotation anchors on PDFs. added tooltip for identifying who made an annotation. --- src/client/views/DocComponent.tsx | 3 ++- src/client/views/nodes/PDFBox.tsx | 1 + src/client/views/pdf/Annotation.scss | 10 ++++++++++ src/client/views/pdf/Annotation.tsx | 13 +++++++++---- src/client/views/pdf/PDFViewer.tsx | 7 +++++-- 5 files changed, 27 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/client/views/DocComponent.tsx b/src/client/views/DocComponent.tsx index dad48d002..b3c90a68f 100644 --- a/src/client/views/DocComponent.tsx +++ b/src/client/views/DocComponent.tsx @@ -166,7 +166,8 @@ export function ViewBoxAnnotatableComponent

{ for (const [key, value] of Object.entries(this.props.Document[AclSym])) { if (d.author === key.substring(4).replace("_", ".") && !d.aliasOf) distributeAcls(key, SharingPermissions.Admin, d, true); - else distributeAcls(key, this.AclMap.get(value) as SharingPermissions, d, true); + //else if (this.props.Document[key] === SharingPermissions.Admin) distributeAcls(key, SharingPermissions.Add, d, true); + // else distributeAcls(key, this.AclMap.get(value) as SharingPermissions, d, true); } }); } diff --git a/src/client/views/nodes/PDFBox.tsx b/src/client/views/nodes/PDFBox.tsx index 6db95e842..74b431bea 100644 --- a/src/client/views/nodes/PDFBox.tsx +++ b/src/client/views/nodes/PDFBox.tsx @@ -254,6 +254,7 @@ export class PDFBox extends ViewBoxAnnotatableComponent { return false; } + @observable _showInfo = false; render() { - return (

this._showInfo = true)} onPointerLeave={action(() => this._showInfo = false)} onPointerDown={this.onPointerDown} ref={this._mainCont} style={{ top: this.props.y, left: this.props.x, @@ -137,7 +139,10 @@ class RegionAnnotation extends React.Component { height: this.props.height, opacity: this._brushed ? 0.5 : undefined, backgroundColor: this._brushed ? "orange" : StrCast(this.props.document.backgroundColor), - transition: "opacity 0.5s", - }} />); + }} > + {!this._showInfo ? (null) :
+ {this.props.dataDoc.author + " " + Field.toString(this.props.dataDoc.creationDate as Field)} +
} +
); } } \ No newline at end of file diff --git a/src/client/views/pdf/PDFViewer.tsx b/src/client/views/pdf/PDFViewer.tsx index caa22b58a..6784540cd 100644 --- a/src/client/views/pdf/PDFViewer.tsx +++ b/src/client/views/pdf/PDFViewer.tsx @@ -61,6 +61,8 @@ interface IViewerProps { DataDoc?: Doc; searchFilterDocs: () => Doc[]; ContainingCollectionView: Opt; + docFilters: () => string[]; + docRangeFilters: () => string[]; PanelWidth: () => number; PanelHeight: () => number; ContentScaling: () => number; @@ -118,8 +120,7 @@ export class PDFViewer extends ViewBoxAnnotatableComponent this._script.run({ this: anno }, console.log, true).result); + return DocUtils.FilterDocs(DocListCast(this.dataDoc[this.props.fieldKey + "-annotations"]), this.props.docFilters(), this.props.docRangeFilters(), undefined); } @computed get nonDocAnnotations() { return this.allAnnotations.filter(a => a.annotations); } @@ -718,6 +719,8 @@ export class PDFViewer extends ViewBoxAnnotatableComponent