aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/documents/Documents.ts4
-rw-r--r--src/client/util/SharingManager.scss2
-rw-r--r--src/client/util/SharingManager.tsx2
-rw-r--r--src/client/views/PropertiesView.tsx6
-rw-r--r--src/fields/Doc.ts4
-rw-r--r--src/fields/util.ts2
6 files changed, 10 insertions, 10 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index 2de1090a2..7c420fb90 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -603,7 +603,7 @@ export namespace Docs {
viewDoc.type !== DocumentType.LINK && DocUtils.MakeLinkToActiveAudio(viewDoc);
viewDoc["acl-Public"] = dataDoc["acl-Public"] = Doc.UserDoc()?.defaultAclPrivate ? SharingPermissions.None : SharingPermissions.Add;
- viewDoc["acl-Override"] = dataDoc["acl-Override"] = "unset";
+ viewDoc["acl-Override"] = dataDoc["acl-Override"] = "None";
return Doc.assign(viewDoc, delegateProps, true);
}
@@ -749,7 +749,7 @@ export namespace Docs {
I.rotation = 0;
I.data = new InkField(points);
I["acl-Public"] = Doc.UserDoc()?.defaultAclPrivate ? SharingPermissions.None : SharingPermissions.Add;
- I["acl-Override"] = "unset";
+ I["acl-Override"] = "None";
return I;
}
diff --git a/src/client/util/SharingManager.scss b/src/client/util/SharingManager.scss
index 06458827a..54e3f45bc 100644
--- a/src/client/util/SharingManager.scss
+++ b/src/client/util/SharingManager.scss
@@ -40,7 +40,7 @@
.permissions-select {
z-index: 1;
- margin-left: -100;
+ margin-left: -115;
border: none;
outline: none;
text-align: justify; // for Edge
diff --git a/src/client/util/SharingManager.tsx b/src/client/util/SharingManager.tsx
index 4f2676728..2c9620b02 100644
--- a/src/client/util/SharingManager.tsx
+++ b/src/client/util/SharingManager.tsx
@@ -289,7 +289,7 @@ export class SharingManager extends React.Component<{}> {
private sharingOptions(uniform: boolean, override?: boolean) {
const dropdownValues: string[] = Object.values(SharingPermissions);
if (!uniform) dropdownValues.unshift("-multiple-");
- if (override) dropdownValues.unshift("unset");
+ if (override) dropdownValues.unshift("None");
return dropdownValues.filter(permission => permission !== SharingPermissions.View).map(permission =>
(
<option key={permission} value={permission}>
diff --git a/src/client/views/PropertiesView.tsx b/src/client/views/PropertiesView.tsx
index 6aad94131..59358ce40 100644
--- a/src/client/views/PropertiesView.tsx
+++ b/src/client/views/PropertiesView.tsx
@@ -320,7 +320,7 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
getPermissionsSelect(user: string, permission: string) {
const dropdownValues: string[] = Object.values(SharingPermissions);
if (permission === "-multiple-") dropdownValues.unshift(permission);
- if (name === "Override") dropdownValues.unshift("Unset");
+ if (user === "Override") dropdownValues.unshift("None");
return <select className="permissions-select"
value={permission}
onChange={e => this.changePermissions(e, user)}>
@@ -381,7 +381,7 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
*/
@computed get sharingTable() {
const AclMap = new Map<symbol, string>([
- [AclUnset, "unset"],
+ [AclUnset, "None"],
[AclPrivate, SharingPermissions.None],
[AclReadonly, SharingPermissions.View],
[AclAddonly, SharingPermissions.Add],
@@ -425,7 +425,7 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
const ownerSame = Doc.CurrentUserEmail !== target.author && docs.filter(doc => doc).every(doc => doc.author === docs[0].author);
// shifts the current user, owner, public to the top of the doc.
- tableEntries.unshift(this.sharingItem("Override", showAdmin, docs.filter(doc => doc).every(doc => doc["acl-Override"] === docs[0]["acl-Override"]) ? (AclMap.get(target[AclSym]?.["acl-Override"]) || "unset") : "-multiple-"));
+ tableEntries.unshift(this.sharingItem("Override", showAdmin, docs.filter(doc => doc).every(doc => doc["acl-Override"] === docs[0]["acl-Override"]) ? (AclMap.get(target[AclSym]?.["acl-Override"]) || "None") : "-multiple-"));
tableEntries.unshift(this.sharingItem("Public", showAdmin, docs.filter(doc => doc).every(doc => doc["acl-Public"] === docs[0]["acl-Public"]) ? (AclMap.get(target[AclSym]?.["acl-Public"]) || SharingPermissions.None) : "-multiple-"));
tableEntries.unshift(this.sharingItem("Me", showAdmin, docs.filter(doc => doc).every(doc => doc.author === Doc.CurrentUserEmail) ? "Owner" : effectiveAcls.every(acl => acl === effectiveAcls[0]) ? AclMap.get(effectiveAcls[0])! : "-multiple-", !ownerSame));
if (ownerSame) tableEntries.unshift(this.sharingItem(StrCast(target.author), showAdmin, "Owner"));
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts
index 205831153..a4cf0a826 100644
--- a/src/fields/Doc.ts
+++ b/src/fields/Doc.ts
@@ -113,7 +113,7 @@ export const UpdatingFromServer = Symbol("UpdatingFromServer");
export const CachedUpdates = Symbol("Cached updates");
const AclMap = new Map<string, symbol>([
- ["unset", AclUnset],
+ ["None", AclUnset],
[SharingPermissions.None, AclPrivate],
[SharingPermissions.View, AclReadonly],
[SharingPermissions.Add, AclAddonly],
@@ -124,7 +124,7 @@ const AclMap = new Map<string, symbol>([
export function fetchProto(doc: Doc) {
const permissions: { [key: string]: symbol } = {};
- Object.keys(doc).filter(key => key.startsWith("acl")).forEach(key => permissions[key] = AclMap.get(StrCast(doc[key]))!);
+ Object.keys(doc).filter(key => key.startsWith("acl") && (permissions[key] = AclMap.get(StrCast(doc[key]))!));
if (Object.keys(permissions).length) doc[AclSym] = permissions;
diff --git a/src/fields/util.ts b/src/fields/util.ts
index 20ba1ca39..989166bf8 100644
--- a/src/fields/util.ts
+++ b/src/fields/util.ts
@@ -280,7 +280,7 @@ export function setter(target: any, in_prop: string | symbol | number, value: an
if (effectiveAcl !== AclEdit && effectiveAcl !== AclAdmin) return true;
// if you're trying to change an acl but don't have Admin access / you're trying to change it to something that isn't an acceptable acl, you can't
- if (typeof prop === "string" && prop.startsWith("acl") && (effectiveAcl !== AclAdmin || ![...Object.values(SharingPermissions), undefined, "unset"].includes(value))) return true;
+ if (typeof prop === "string" && prop.startsWith("acl") && (effectiveAcl !== AclAdmin || ![...Object.values(SharingPermissions), undefined, "None"].includes(value))) return true;
// if (typeof prop === "string" && prop.startsWith("acl") && !["Can Edit", "Can Add", "Can View", "Not Shared", undefined].includes(value)) return true;
if (typeof prop === "string" && prop !== "__id" && prop !== "__fields" && (prop.startsWith("_") || layoutProps.includes(prop))) {