aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-06-15 12:00:12 -0400
committerbobzel <zzzman@gmail.com>2023-06-15 12:00:12 -0400
commitd92775bffab6470dc6142e02092b7cae2c30b5ff (patch)
tree4ddd16288616b4003af511b76d8a3f06b264884f
parentd6bb0b41e064fbe56672ebce7871d8c42dab38a6 (diff)
fixes post-merge
-rw-r--r--src/client/documents/tempCodeRunnerFile.ts1
-rw-r--r--src/client/util/SharingManager.tsx13
-rw-r--r--src/client/views/DocComponent.tsx4
-rw-r--r--src/client/views/DocumentDecorations.tsx34
-rw-r--r--src/client/views/MarqueeAnnotator.tsx2
-rw-r--r--src/client/views/PropertiesView.tsx20
-rw-r--r--src/fields/Doc.ts4
-rw-r--r--src/fields/util.ts31
8 files changed, 45 insertions, 64 deletions
diff --git a/src/client/documents/tempCodeRunnerFile.ts b/src/client/documents/tempCodeRunnerFile.ts
deleted file mode 100644
index 76ea17be0..000000000
--- a/src/client/documents/tempCodeRunnerFile.ts
+++ /dev/null
@@ -1 +0,0 @@
-Initializing \ No newline at end of file
diff --git a/src/client/util/SharingManager.tsx b/src/client/util/SharingManager.tsx
index 78e502e6e..bea870f21 100644
--- a/src/client/util/SharingManager.tsx
+++ b/src/client/util/SharingManager.tsx
@@ -1,4 +1,5 @@
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
+import { IconButton, Size } from 'browndash-components';
import { intersection } from 'lodash';
import { action, computed, observable, runInAction } from 'mobx';
import { observer } from 'mobx-react';
@@ -6,7 +7,7 @@ import * as React from 'react';
import Select from 'react-select';
import * as RequestPromise from 'request-promise';
import { Doc, DocListCast, DocListCastAsync, HierarchyMapping } from '../../fields/Doc';
-import { AclAdmin, AclPrivate, DocAcl, AclUnset, DocData } from '../../fields/DocSymbols';
+import { AclAdmin, AclPrivate, AclUnset, DocAcl, DocData } from '../../fields/DocSymbols';
import { Id } from '../../fields/FieldSymbols';
import { List } from '../../fields/List';
import { NumCast, StrCast } from '../../fields/Types';
@@ -23,7 +24,6 @@ import { GroupManager, UserOptions } from './GroupManager';
import { GroupMemberView } from './GroupMemberView';
import { SelectionManager } from './SelectionManager';
import './SharingManager.scss';
-import { IconButton, Size } from 'browndash-components';
export interface User {
email: string;
@@ -652,7 +652,7 @@ export class SharingManager extends React.Component<{}> {
</div>
</div>
) : (
- <br></br>
+ <br />
)}
<div className="main-container">
<div className={'individual-container'}>
@@ -671,9 +671,8 @@ export class SharingManager extends React.Component<{}> {
<div className={'group-container'}>
<div className="user-sort" onClick={action(() => (this.groupSort = this.groupSort === 'ascending' ? 'descending' : this.groupSort === 'descending' ? 'none' : 'ascending'))}>
<div className="container">
- Groups
- &nbsp;
- <div className="group-info" onClick={action(() => (GroupManager.Instance?.open()))}>
+ Groups &nbsp;
+ <div className="group-info" onClick={action(() => GroupManager.Instance?.open())}>
<FontAwesomeIcon icon={'info-circle'} color={'#e8e8e8'} size={'sm'} style={{ backgroundColor: '#1e89d7', borderRadius: '100%', border: '1px solid #1e89d7' }} />
</div>
&nbsp;
@@ -697,4 +696,4 @@ export class SharingManager extends React.Component<{}> {
render() {
return <MainViewModal contents={this.sharingInterface} isDisplayed={this.isOpen} interactive={true} dialogueBoxDisplayedOpacity={this.dialogueBoxOpacity} overlayDisplayedOpacity={this.overlayOpacity} closeOnExternalClick={this.close} />;
}
-} \ No newline at end of file
+}
diff --git a/src/client/views/DocComponent.tsx b/src/client/views/DocComponent.tsx
index dc9c8a0ce..db24229dc 100644
--- a/src/client/views/DocComponent.tsx
+++ b/src/client/views/DocComponent.tsx
@@ -214,7 +214,7 @@ export function ViewBoxAnnotatableComponent<P extends ViewBoxAnnotatableProps>()
// only make a pushpin if we have acl's to edit the document
//DocUtils.LeavePushpin(doc);
doc._stayInCollection = undefined;
- doc.context = this.props.Document;
+ doc.embedContainer = this.props.Document;
if (annotationKey ?? this._annotationKeySuffix()) Doc.GetProto(doc).annotationOn = this.rootDoc;
Doc.ActiveDashboard && inheritParentAcls(Doc.ActiveDashboard, doc);
@@ -222,7 +222,7 @@ export function ViewBoxAnnotatableComponent<P extends ViewBoxAnnotatableProps>()
const annoDocs = targetDataDoc[annotationKey ?? this.annotationKey] as List<Doc>;
if (annoDocs instanceof List) annoDocs.push(...added);
else targetDataDoc[annotationKey ?? this.annotationKey] = new List<Doc>(added);
- targetDataDoc[(annotationKey ?? this.annotationKey) + '-lastModified'] = new DateField(new Date(Date.now()));
+ targetDataDoc[(annotationKey ?? this.annotationKey) + '_modificationDate'] = new DateField(new Date(Date.now()));
}
}
return true;
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx
index 9bc4cb48f..744d04370 100644
--- a/src/client/views/DocumentDecorations.tsx
+++ b/src/client/views/DocumentDecorations.tsx
@@ -13,7 +13,7 @@ import { InkField } from '../../fields/InkField';
import { RichTextField } from '../../fields/RichTextField';
import { ScriptField } from '../../fields/ScriptField';
import { Cast, DocCast, NumCast, StrCast } from '../../fields/Types';
-import { GetEffectiveAcl, normalizeEmail } from '../../fields/util';
+import { GetEffectiveAcl, normalizeEmail, SharingPermissions } from '../../fields/util';
import { DocumentType } from '../documents/DocumentTypes';
import { Docs } from '../documents/Documents';
import { DocumentManager } from '../util/DocumentManager';
@@ -655,7 +655,7 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number; P
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();
+ 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);
dH && (doc._layout_autoHeight = false);
@@ -760,23 +760,23 @@ 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 docShareMode = Doc.GetProto(seldocview.rootDoc)['acl-' + normalizeEmail(Doc.CurrentUserEmail)];
const shareMode = StrCast(docShareMode);
var shareSymbolIcon = null;
switch (shareMode) {
- case 'Admin':
+ case SharingPermissions.Admin:
shareSymbolIcon = '⬢ ';
break;
- case 'Edit':
+ case SharingPermissions.Edit:
shareSymbolIcon = '⬢ ';
break;
- case 'Augment':
+ case SharingPermissions.Augment:
shareSymbolIcon = '⬟ ';
break;
- case 'View':
+ case SharingPermissions.View:
shareSymbolIcon = '♦ ';
break;
- case 'Not-Shared':
+ case SharingPermissions.None:
shareSymbolIcon = '▲ ';
break;
default:
@@ -805,7 +805,7 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number; P
seldocview.rootDoc.hideDeleteButton ||
SelectionManager.Views().some(docView => {
const collectionAcl = docView.props.docViewPath()?.lastElement() ? GetEffectiveAcl(docView.props.docViewPath().lastElement().rootDoc[DocData]) : AclEdit;
- return docView.rootDoc.stayInCollection || (collectionAcl !== AclAdmin && collectionAcl !== AclEdit && GetEffectiveAcl(docView.rootDoc) !== AclAdmin);
+ return (docView.rootDoc.stayInCollection && !docView.rootDoc._isTimelineLabel) || (collectionAcl !== AclAdmin && collectionAcl !== AclEdit && GetEffectiveAcl(docView.rootDoc) !== AclAdmin);
});
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">
@@ -833,7 +833,7 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number; P
// Radius constants
const useRounding = seldocview.ComponentView instanceof ImageBox || seldocview.ComponentView instanceof FormattedTextBox || seldocview.ComponentView instanceof CollectionFreeFormView;
- const borderRadius = numberValue(StrCast(seldocview.rootDoc.borderRounding));
+ const borderRadius = numberValue(StrCast(seldocview.rootDoc.layout_borderRounding));
const docMax = Math.min(NumCast(seldocview.rootDoc.width) / 2, NumCast(seldocview.rootDoc.height) / 2);
const maxDist = Math.min((this.Bounds.r - this.Bounds.x) / 2, (this.Bounds.b - this.Bounds.y) / 2);
const radiusHandle = (borderRadius / docMax) * maxDist;
@@ -858,7 +858,17 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number; P
</div>
);
const sharingMenu = docShareMode ? (
- <div className='documentDecorations-share' onPointerDown={e => setupMoveUpEvents(this, e, returnFalse, returnFalse, action(() => SettingsManager.propertiesWidth =250))}>
+ <div
+ className="documentDecorations-share"
+ onPointerDown={e =>
+ setupMoveUpEvents(
+ this,
+ e,
+ returnFalse,
+ returnFalse,
+ action(() => (SettingsManager.propertiesWidth = 250))
+ )
+ }>
<div className={`documentDecorations-share${shareMode}`}>
<span>{shareSymbolIcon + ' ' + shareMode}</span>
</div>
@@ -899,7 +909,7 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number; P
{hideDeleteButton ? null : topBtn('close', 'times', undefined, e => this.onCloseClick(true), 'Close')}
{hideResizers || hideDeleteButton ? null : topBtn('minimize', 'window-maximize', undefined, e => this.onCloseClick(undefined), 'Minimize')}
{hideTitle ? null : titleArea}
- {hideOpenButton ? <div /> : topBtn('open', 'external-link-alt', this.onMaximizeDown, undefined, 'Open in Lightbox (ctrl: as alias, shift: in new collection)')}
+ {hideOpenButton ? null : topBtn('open', 'external-link-alt', this.onMaximizeDown, undefined, 'Open in Lightbox (ctrl: as new embedding, shift: in new collection)')}
</div>
{hideResizers ? null : (
<>
diff --git a/src/client/views/MarqueeAnnotator.tsx b/src/client/views/MarqueeAnnotator.tsx
index 7edc1494b..a4a2c1df9 100644
--- a/src/client/views/MarqueeAnnotator.tsx
+++ b/src/client/views/MarqueeAnnotator.tsx
@@ -1,7 +1,7 @@
import { action, observable, ObservableMap, runInAction } from 'mobx';
import { observer } from 'mobx-react';
import { Doc, Opt } from '../../fields/Doc';
-import { AclAdmin, AclAugment, AclEdit, AclSelfEdit, DocData, } from '../../fields/DocSymbols';
+import { AclAdmin, AclAugment, AclEdit, AclSelfEdit, DocData } from '../../fields/DocSymbols';
import { Id } from '../../fields/FieldSymbols';
import { List } from '../../fields/List';
import { NumCast } from '../../fields/Types';
diff --git a/src/client/views/PropertiesView.tsx b/src/client/views/PropertiesView.tsx
index abbf9a22e..43ac2aa88 100644
--- a/src/client/views/PropertiesView.tsx
+++ b/src/client/views/PropertiesView.tsx
@@ -393,19 +393,19 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
colorACLDropDown(name: string, admin: boolean, permission: string, showExpansionIcon?: boolean) {
var dropDownText = '';
switch (StrCast(permission)) {
- case 'Admin':
+ case SharingPermissions.Admin:
dropDownText = '⬢ ';
break;
- case 'Edit':
+ case SharingPermissions.Edit:
dropDownText = '⬢ ';
break;
- case 'Augment':
+ case SharingPermissions.Augment:
dropDownText = '⬟ ';
break;
- case 'View':
+ case SharingPermissions.View:
dropDownText = '♦ ';
break;
- case 'Not-Shared':
+ case SharingPermissions.None:
dropDownText = '▲ ';
break;
}
@@ -454,9 +454,9 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
// const effectiveAcls = GetEffectiveAcl(target);
// const showAdmin = effectiveAcls == AclAdmin || docToUse!['acl-' + normalizeEmail(Doc.CurrentUserEmail)] == 'Owner';
- const curUserAcl = docToUse!['acl-' + normalizeEmail(Doc.CurrentUserEmail)]
- const showAdmin = curUserAcl == 'Admin' || curUserAcl == 'Owner'
-
+ const curUserAcl = docToUse!['acl-' + normalizeEmail(Doc.CurrentUserEmail)];
+ const showAdmin = curUserAcl == 'Admin' || curUserAcl == 'Owner';
+
const tableEntries = [];
const usersAdded: string[] = []; // all shared users being added - organized by denormalized email
@@ -496,11 +496,11 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
const commonKeys = intersection(...docs.map(doc => (this.layoutDocAcls ? doc : doc[DocData])).map(doc => doc?.[DocAcl] && Object.keys(doc[DocAcl])));
const groupListMap: (Doc | { title: string })[] = groups.filter(({ title }) => (docs.length > 1 ? commonKeys.includes(`acl-${normalizeEmail(StrCast(title))}`) : true));
groupListMap.map(group => {
- if (group.title != 'Public'){
+ if (group.title != 'Public') {
const permission = StrCast(target[`acl-${StrCast(group.title)}`]);
tableEntries.unshift(this.sharingItem(StrCast(group.title), showAdmin, permission, false));
}
- })
+ });
// shift owner to top
tableEntries.unshift(this.sharingItem(StrCast(target.author), showAdmin, 'Owner'), false);
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts
index 555e768c1..3116fd70b 100644
--- a/src/fields/Doc.ts
+++ b/src/fields/Doc.ts
@@ -1267,9 +1267,7 @@ export namespace Doc {
}
// don't bother memoizing (caching) the result if called from a non-reactive context. (plus this avoids a warning message)
export function IsBrushedDegreeUnmemoized(doc: Doc) {
- if (!doc || GetEffectiveAcl(doc) === AclPrivate || GetEffectiveAcl(Doc.GetProto(doc)) === AclPrivate || doc.opacity === 0) {
- return DocBrushStatus.unbrushed;
- }
+ if (!doc || GetEffectiveAcl(doc) === AclPrivate || GetEffectiveAcl(Doc.GetProto(doc)) === AclPrivate || doc.opacity === 0) return DocBrushStatus.unbrushed;
const status = brushManager.BrushedDoc.has(doc) ? DocBrushStatus.selfBrushed : brushManager.BrushedDoc.has(Doc.GetProto(doc)) ? DocBrushStatus.protoBrushed : DocBrushStatus.unbrushed;
if (status === DocBrushStatus.unbrushed) {
const lastBrushed = Array.from(brushManager.BrushedDoc.keys()).lastElement();
diff --git a/src/fields/util.ts b/src/fields/util.ts
index e0f87f805..9c0f4ba1f 100644
--- a/src/fields/util.ts
+++ b/src/fields/util.ts
@@ -7,41 +7,16 @@ import { SerializationHelper } from '../client/util/SerializationHelper';
import { UndoManager } from '../client/util/UndoManager';
import { returnZero } from '../Utils';
import CursorField from './CursorField';
-import {
- Doc,
- aclLevel,
- DocListCast,
- DocListCastAsync,
- HierarchyMapping,
- ReverseHierarchyMap,
- updateCachedAcls,
-} from './Doc';
-import {
- AclAdmin,
- AclEdit,
- AclPrivate,
- AclAugment,
- FieldKeys,
- DocAcl,
- DocData,
- ForceServerWrite,
- Height,
- Initializing,
- DocLayout,
- UpdatingFromServer,
- Width,
- SelfProxy,
- Update
-} from './DocSymbols';
+import { aclLevel, Doc, DocListCast, DocListCastAsync, HierarchyMapping, ReverseHierarchyMap, updateCachedAcls } from './Doc';
+import { AclAdmin, AclAugment, AclEdit, AclPrivate, DocAcl, DocData, DocLayout, FieldKeys, ForceServerWrite, Height, Initializing, SelfProxy, Update, UpdatingFromServer, Width } from './DocSymbols';
import { Id, OnUpdate, Parent, ToValue } from './FieldSymbols';
import { List } from './List';
import { ObjectField } from './ObjectField';
import { PrefetchProxy, ProxyField } from './Proxy';
import { RefField } from './RefField';
import { SchemaHeaderField } from './SchemaHeaderField';
-import { ComputedField, ScriptField } from './ScriptField';
+import { ComputedField } from './ScriptField';
import { ScriptCast, StrCast } from './Types';
-import { convertCompilerOptionsFromJson } from 'typescript';
function _readOnlySetter(): never {
throw new Error("Documents can't be modified in read-only mode");