aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/DocumentDecorations.tsx
diff options
context:
space:
mode:
authorsrichman333 <sarah_n_richman@brown.edu>2023-06-14 15:02:39 -0400
committersrichman333 <sarah_n_richman@brown.edu>2023-06-14 15:02:39 -0400
commit20d217d825891cf29a432a048d1f8e7bc04d062a (patch)
treeb1e2a44dc8a3a3210b9f88b1abac18186bf3c6bb /src/client/views/DocumentDecorations.tsx
parent0d5cf9f0d269b38894bb79cc187e8f0d50797f59 (diff)
PropertiesView changes - colors on all permissions and fixed bug with when the drop down arrow is displayed
Diffstat (limited to 'src/client/views/DocumentDecorations.tsx')
-rw-r--r--src/client/views/DocumentDecorations.tsx9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx
index 9aca8c339..a6b2db8f3 100644
--- a/src/client/views/DocumentDecorations.tsx
+++ b/src/client/views/DocumentDecorations.tsx
@@ -11,7 +11,7 @@ import { InkField } from '../../fields/InkField';
import { RichTextField } from '../../fields/RichTextField';
import { ScriptField } from '../../fields/ScriptField';
import { Cast, NumCast, StrCast } from '../../fields/Types';
-import { GetEffectiveAcl } from '../../fields/util';
+import { GetEffectiveAcl, normalizeEmail } from '../../fields/util';
import { aggregateBounds, emptyFunction, numberValue, returnFalse, setupMoveUpEvents, Utils } from '../../Utils';
import { Docs } from '../documents/Documents';
import { DocumentType } from '../documents/DocumentTypes';
@@ -650,7 +650,6 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number; P
} else {
const rotCtr = [docwidth / 2, docheight / 2];
const tlRotated = Utils.rotPt(-rotCtr[0], -rotCtr[1], (NumCast(doc._rotation) / 180) * Math.PI);
-
const maxHeight = doc.nativeHeightUnfrozen || !nheight ? 0 : Math.max(nheight, NumCast(doc.scrollHeight, NumCast(doc[docView.LayoutFieldKey + '-scrollHeight']))) * docView.NativeDimScaling();
dH && (doc._height = actualdH > maxHeight && maxHeight ? maxHeight : actualdH);
dW && (doc._width = actualdW);
@@ -756,9 +755,13 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number; P
// sharing
const docShareMode = Doc.GetProto(seldocview.rootDoc)['acl-Public'];
+ // const docShareMode = Doc.GetProto(seldocview.rootDoc)['acl-'+normalizeEmail(Doc.CurrentUserEmail)];
const shareMode = StrCast(docShareMode);
var shareSymbolIcon = null;
switch (shareMode) {
+ case 'Admin':
+ shareSymbolIcon = '⬢ ';
+ break;
case 'Edit':
shareSymbolIcon = '⬢ ';
break;
@@ -799,7 +802,7 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number; P
// const collectionAcl = docView.props.docViewPath()?.lastElement() ? GetEffectiveAcl(docView.props.docViewPath().lastElement().rootDoc[DataSym]) : AclEdit;
// return docView.rootDoc.stayInCollection || (collectionAcl !== AclAdmin && collectionAcl !== AclEdit && GetEffectiveAcl(docView.rootDoc) !== AclAdmin);
const effectiveAcl = GetEffectiveAcl(Doc.GetProto(seldocview.rootDoc));
- return docView.rootDoc.stayInCollection || (effectiveAcl !== AclAdmin && GetEffectiveAcl(docView.rootDoc) !== AclAdmin);
+ return docView.rootDoc.stayInCollection || (effectiveAcl !== AclAdmin && GetEffectiveAcl(docView.rootDoc) !== AclAdmin && effectiveAcl !== AclEdit && GetEffectiveAcl(docView.rootDoc) !== AclEdit);
});
const topBtn = (key: string, icon: string, pointerDown: undefined | ((e: React.PointerEvent) => void), click: undefined | ((e: any) => void), title: string) => (
<Tooltip key={key} title={<div className="dash-tooltip">{title}</div>} placement="top">