From ba9d2324b4f2249bd8bc03ca81979577f4641d83 Mon Sep 17 00:00:00 2001
From: anika-ahluwalia <anika.ahluwalia@gmail.com>
Date: Sun, 17 May 2020 12:17:23 -0500
Subject: adjusting parameters

---
 src/client/views/nodes/ScriptingBox.tsx | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

(limited to 'src/client/views/nodes/ScriptingBox.tsx')

diff --git a/src/client/views/nodes/ScriptingBox.tsx b/src/client/views/nodes/ScriptingBox.tsx
index 9de072062..ec11ad346 100644
--- a/src/client/views/nodes/ScriptingBox.tsx
+++ b/src/client/views/nodes/ScriptingBox.tsx
@@ -15,7 +15,6 @@ import { OverlayView } from "../OverlayView";
 import { DocumentIconContainer, DocumentIcon } from "./DocumentIcon";
 import { List } from "../../../fields/List";
 import { DragManager } from "../../util/DragManager";
-import { Id } from "../../../fields/FieldSymbols";
 
 const ScriptingSchema = createSchema({});
 type ScriptingDocument = makeInterface<[typeof ScriptingSchema, typeof documentSchema]>;
@@ -41,8 +40,6 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent<FieldViewProps, Sc
 
     set compileParams(value) { this.dataDoc[this.props.fieldKey + "-params"] = value; }
 
-    @observable private _parameters: any = this.compileParams;
-
     @action
     componentDidMount() {
         this.rawScript = ScriptCast(this.dataDoc[this.props.fieldKey])?.script?.originalScript || this.rawScript;
@@ -70,14 +67,18 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent<FieldViewProps, Sc
     onCompile = () => {
         // const params = this.compileParams.reduce((o: ScriptParam, p: string) => { o[p] = "any"; return o; }, {} as ScriptParam);
         // const result = CompileScript(this.rawScript, {
-        //     editable: true,
+        //     editable: true
         //     transformer: DocumentIconContainer.getTransformer(),
         //     params,
         //     typecheck: false
         // });
         // this._errorMessage = isCompileError(result) ? result.errors.map(e => e.messageText).join("\n") : "";
         // return this.dataDoc[this.props.fieldKey] = result.compiled ? new ScriptField(result) : undefined;
+
         const params = this.compileParams.reduce((o: ScriptParam, p: string) => { o[p] = "any"; return o; }, {} as ScriptParam);
+
+        console.log(this.compileParams);
+
         const result = CompileScript(this.rawScript, {
             editable: true,
             transformer: DocumentIconContainer.getTransformer(),
@@ -134,14 +135,12 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent<FieldViewProps, Sc
         if (droppedDocs?.length) {
             const dropped = droppedDocs[0];
             this.compileParams[index] = firstParam[0] + " = " + dropped.title;
-            //this._parameters[index] = dropped;
         }
     }
 
     @action
     onDelete = (num: number) => {
         this.compileParams.splice(num, 1);
-        //this._parameters.splice(num, 1);
     }
 
     render() {
-- 
cgit v1.2.3-70-g09d2

