From 78c99446f284f7ac8e5443f77227ae5edbfd2aaf Mon Sep 17 00:00:00 2001 From: bobzel Date: Mon, 3 Aug 2020 18:41:18 -0400 Subject: made always show link end a contextMenu option --- src/fields/util.ts | 1 - 1 file changed, 1 deletion(-) (limited to 'src/fields/util.ts') diff --git a/src/fields/util.ts b/src/fields/util.ts index 957b2c8cd..44a3317db 100644 --- a/src/fields/util.ts +++ b/src/fields/util.ts @@ -10,7 +10,6 @@ import { DocServer } from "../client/DocServer"; import { ComputedField } from "./ScriptField"; import { ScriptCast, StrCast } from "./Types"; import { returnZero } from "../Utils"; -import { addSyntheticLeadingComment } from "typescript"; function _readOnlySetter(): never { -- cgit v1.2.3-70-g09d2 From 3e4329b81d96f139f38eeb182afcbd8359dcd171 Mon Sep 17 00:00:00 2001 From: usodhi <61431818+usodhi@users.noreply.github.com> Date: Thu, 6 Aug 2020 19:51:25 +0530 Subject: alias and acl related fixes --- src/client/documents/Documents.ts | 1 + src/client/views/collections/CollectionView.tsx | 3 ++- .../collectionFreeForm/PropertiesView.tsx | 20 +++++++++++--------- src/fields/Doc.ts | 4 ++-- src/fields/util.ts | 2 +- 5 files changed, 17 insertions(+), 13 deletions(-) (limited to 'src/fields/util.ts') diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts index 7719b3eef..61a44a39d 100644 --- a/src/client/documents/Documents.ts +++ b/src/client/documents/Documents.ts @@ -565,6 +565,7 @@ export namespace Docs { // without this, if a doc has no annotations but the user has AddOnly privileges, they won't be able to add an annotation because they would have needed to create the field's list which they don't have permissions to do. dataDoc[fieldKey + "-annotations"] = new List(); + dataDoc.aliases = new List(); proto.links = ComputedField.MakeFunction("links(self)"); diff --git a/src/client/views/collections/CollectionView.tsx b/src/client/views/collections/CollectionView.tsx index dcd5a31f6..4d1cb670c 100644 --- a/src/client/views/collections/CollectionView.tsx +++ b/src/client/views/collections/CollectionView.tsx @@ -151,7 +151,8 @@ export class CollectionView extends Touchable { for (const [key, value] of Object.entries(this.props.Document[AclSym])) { - distributeAcls(key, this.AclMap.get(value) as SharingPermissions, d, true); + if (d.author === Doc.CurrentUserEmail && !d.aliasOf) distributeAcls(key, SharingPermissions.Admin, d, true); + else distributeAcls(key, this.AclMap.get(value) as SharingPermissions, d, true); } }); } diff --git a/src/client/views/collections/collectionFreeForm/PropertiesView.tsx b/src/client/views/collections/collectionFreeForm/PropertiesView.tsx index d22c00b1f..5634a438a 100644 --- a/src/client/views/collections/collectionFreeForm/PropertiesView.tsx +++ b/src/client/views/collections/collectionFreeForm/PropertiesView.tsx @@ -25,6 +25,7 @@ import "./FormatShapePane.scss"; import { discovery_v1 } from "googleapis"; import { PresBox } from "../../nodes/PresBox"; import { DocumentManager } from "../../../util/DocumentManager"; +import FormatShapePane from "./FormatShapePane"; const higflyout = require("@hig/flyout"); export const { anchorPoints } = higflyout; export const Flyout = higflyout.default; @@ -51,8 +52,8 @@ export class PropertiesView extends React.Component { @computed get selectedDocumentView() { if (SelectionManager.SelectedDocuments().length) { return SelectionManager.SelectedDocuments()[0]; - } else if (PresBox.Instance._selectedArray.length >= 1) { - return DocumentManager.Instance.getDocumentView(PresBox.Instance.rootDoc); + } else if (PresBox.Instance?._selectedArray.length >= 1) { + return DocumentManager.Instance.getDocumentView(PresBox.Instance?.rootDoc); } else { return undefined; } } @computed get isPres(): boolean { @@ -72,6 +73,7 @@ export class PropertiesView extends React.Component { @observable openTransform: boolean = true; // @observable selectedUser: string = ""; // @observable addButtonPressed: boolean = false; + //Pres Trails booleans: @observable openAddSlide: boolean = true; @observable openPresentationTools: boolean = true; @@ -957,9 +959,9 @@ export class PropertiesView extends React.Component {
{this.editableTitle}
- {PresBox.Instance._selectedArray.length} selected + {PresBox.Instance?._selectedArray.length} selected
- {PresBox.Instance.listOfSelected} + {PresBox.Instance?.listOfSelected}
@@ -973,7 +975,7 @@ export class PropertiesView extends React.Component { {this.openAddSlide ?
- {PresBox.Instance.newDocumentDropdown} + {PresBox.Instance?.newDocumentDropdown}
: null}
@@ -986,7 +988,7 @@ export class PropertiesView extends React.Component {
{this.openPresTransitions ?
- {PresBox.Instance.transitionDropdown} + {PresBox.Instance?.transitionDropdown}
: null}
@@ -999,20 +1001,20 @@ export class PropertiesView extends React.Component {
{this.openPresProgressivize ?
- {PresBox.Instance.progressivizeDropdown} + {PresBox.Instance?.progressivizeDropdown}
: null}
runInAction(() => { this.openSlideOptions = !this.openSlideOptions; })} style={{ backgroundColor: this.openSlideOptions ? "black" : "" }}> -     {PresBox.Instance.stringType} options +     {PresBox.Instance?.stringType} options
{this.openSlideOptions ?
- {PresBox.Instance.optionsDropdown} + {PresBox.Instance?.optionsDropdown}
: null}
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts index 6163fedbb..6bfe91378 100644 --- a/src/fields/Doc.ts +++ b/src/fields/Doc.ts @@ -508,9 +508,9 @@ export namespace Doc { alias.aliasOf = doc; alias.title = ComputedField.MakeFunction(`renameAlias(this, ${Doc.GetProto(doc).aliasNumber = NumCast(Doc.GetProto(doc).aliasNumber) + 1})`); alias.author = Doc.CurrentUserEmail; + alias[AclSym] = doc[AclSym]; - if (!doc.aliases) doc.aliases = new List([alias]); - else Doc.AddDocToList(doc, "aliases", alias); + Doc.AddDocToList(doc[DataSym], "aliases", alias); return alias; } diff --git a/src/fields/util.ts b/src/fields/util.ts index 44a3317db..4c71572db 100644 --- a/src/fields/util.ts +++ b/src/fields/util.ts @@ -220,7 +220,7 @@ export function distributeAcls(key: string, acl: SharingPermissions, target: Doc // maps over the aliases of the document if (target.aliases) { DocListCast(target.aliases).map(alias => { - distributeAcls(key, acl, alias); + distributeAcls(key, acl, alias, inheritingFromCollection); }); } -- cgit v1.2.3-70-g09d2