aboutsummaryrefslogtreecommitdiff
path: root/src/fields/util.ts
diff options
context:
space:
mode:
authorusodhi <61431818+usodhi@users.noreply.github.com>2020-07-06 15:33:45 +0530
committerusodhi <61431818+usodhi@users.noreply.github.com>2020-07-06 15:33:45 +0530
commitb442fc347abc267697575c517949ca0ee0dad2f1 (patch)
treefe5e0aca9dbf155196b0e8514cdcadbfc26dc36d /src/fields/util.ts
parent94137cb3a771ec6afd803f3cff97da86a14dd54f (diff)
parent6b24899bcf2c099163c1ca872d65b6318c11a53b (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into grid_view_secondary
Diffstat (limited to 'src/fields/util.ts')
-rw-r--r--src/fields/util.ts10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/fields/util.ts b/src/fields/util.ts
index ad7b6ea7a..2dc21c987 100644
--- a/src/fields/util.ts
+++ b/src/fields/util.ts
@@ -10,6 +10,7 @@ import { DocServer } from "../client/DocServer";
import { ComputedField } from "./ScriptField";
import { ScriptCast } from "./Types";
+
function _readOnlySetter(): never {
throw new Error("Documents can't be modified in read-only mode");
}
@@ -77,7 +78,7 @@ const _setterImpl = action(function (target: any, prop: string | symbol | number
} else {
target.__fields[prop] = value;
}
- if (typeof value === "object" && !(value instanceof ObjectField)) debugger;
+ //if (typeof value === "object" && !(value instanceof ObjectField)) debugger;
if (writeToServer) {
if (value === undefined) target[Update]({ '$unset': { ["fields." + prop]: "" } });
else target[Update]({ '$set': { ["fields." + prop]: value instanceof ObjectField ? SerializationHelper.Serialize(value) : (value === undefined ? null : value) } });
@@ -107,10 +108,10 @@ export function OVERRIDE_ACL(val: boolean) {
}
const layoutProps = ["panX", "panY", "width", "height", "nativeWidth", "nativeHeight", "fitWidth", "fitToBox",
- "LODdisable", "chromeStatus", "viewType", "gridGap", "xMargin", "yMargin", "autoHeight"];
+ "chromeStatus", "viewType", "gridGap", "xMargin", "yMargin", "autoHeight"];
export function setter(target: any, in_prop: string | symbol | number, value: any, receiver: any): boolean {
let prop = in_prop;
- if (target[AclSym] && !_overrideAcl) return true;
+ if (target[AclSym] && !_overrideAcl && !DocServer.PlaygroundFields.includes(in_prop.toString())) return true;
if (typeof prop === "string" && prop !== "__id" && prop !== "__fields" && (prop.startsWith("_") || layoutProps.includes(prop))) {
if (!prop.startsWith("_")) {
console.log(prop + " is deprecated - switch to _" + prop);
@@ -155,9 +156,6 @@ export function getter(target: any, in_prop: string | symbol | number, receiver:
function getFieldImpl(target: any, prop: string | number, receiver: any, ignoreProto: boolean = false): any {
receiver = receiver || target[SelfProxy];
- if (target === undefined) {
- console.log("");
- }
let field = target.__fields[prop];
for (const plugin of getterPlugins) {
const res = plugin(receiver, prop, field);