aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/views/nodes/ScriptingBox.tsx19
-rw-r--r--src/server/index.ts9
2 files changed, 14 insertions, 14 deletions
diff --git a/src/client/views/nodes/ScriptingBox.tsx b/src/client/views/nodes/ScriptingBox.tsx
index ec11ad346..b507d250b 100644
--- a/src/client/views/nodes/ScriptingBox.tsx
+++ b/src/client/views/nodes/ScriptingBox.tsx
@@ -75,7 +75,12 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent<FieldViewProps, Sc
// 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);
+ const params = this.compileParams.reduce((o: ScriptParam, p: string) => {
+ const param = p.split("=");
+ o[param[0]] = param[1];
+ return o;
+ },
+ {} as ScriptParam);
console.log(this.compileParams);
@@ -98,7 +103,13 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent<FieldViewProps, Sc
@action
onRun = () => {
- const params = this.compileParams.reduce((o: ScriptParam, p: string) => { o[p] = "any"; return o; }, {} as ScriptParam);
+ const params = this.compileParams.reduce((o: ScriptParam, p: string) => {
+ const param = p.split("=");
+ o[param[0]] = param[1];
+ return o;
+ },
+ {} as ScriptParam);
+
const result = CompileScript(this.rawScript, {
editable: true,
transformer: DocumentIconContainer.getTransformer(),
@@ -134,7 +145,7 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent<FieldViewProps, Sc
const droppedDocs = de.complete.docDragData?.droppedDocuments;
if (droppedDocs?.length) {
const dropped = droppedDocs[0];
- this.compileParams[index] = firstParam[0] + " = " + dropped.title;
+ this.compileParams[index] = firstParam[0] + " = " + dropped;
}
}
@@ -157,7 +168,6 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent<FieldViewProps, Sc
this._paramNum++;
const par = this.compileParams;
this.compileParams = new List<string>(value.split(";").filter(s => s !== " "));
- //this._parameters.push(this.compileParams);
this.compileParams.push.apply(this.compileParams, par);
console.log(this.compileParams);
return true;
@@ -188,7 +198,6 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent<FieldViewProps, Sc
SetValue={value => {
if (value !== "" && value !== " ") {
this.compileParams[i] = value;
- //this._parameters[i] = value;
parameter = value;
return true;
} else {
diff --git a/src/server/index.ts b/src/server/index.ts
index fd5552d12..7ac032ed3 100644
--- a/src/server/index.ts
+++ b/src/server/index.ts
@@ -149,18 +149,9 @@ export async function launchServer() {
* log the output of the server process, so it's not ideal for development.
* So, the 'else' clause is exactly what we've always run when executing npm start.
*/
-<<<<<<< HEAD
-if (process.env.RELEASE) {
- (sessionAgent = new DashSessionAgent()).launch();
-} else {
- setTimeout(() => (Database.Instance as Database.Database).doConnect(), 30000);
- launchServer();
-}
-=======
// if (process.env.RELEASE) {
// (sessionAgent = new DashSessionAgent()).launch();
// } else {
(Database.Instance as Database.Database).doConnect();
launchServer();
// }
->>>>>>> 9c3d461a9642a4596c55f642af2b55e186b0fe20