From 20a4159484c75396857290779814b948abf49734 Mon Sep 17 00:00:00 2001 From: anika-ahluwalia Date: Wed, 29 Apr 2020 23:43:31 -0500 Subject: fixed parts of drag and drop and finalized deleting params --- src/client/views/nodes/ScriptingBox.tsx | 13 ++++++++----- src/server/database.ts | 8 ++++++++ src/server/index.ts | 2 +- 3 files changed, 17 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/client/views/nodes/ScriptingBox.tsx b/src/client/views/nodes/ScriptingBox.tsx index f810d178c..8e8340042 100644 --- a/src/client/views/nodes/ScriptingBox.tsx +++ b/src/client/views/nodes/ScriptingBox.tsx @@ -122,14 +122,17 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent, { x: 0, y: 0 }); } + @action onDrop = (e: Event, de: DragManager.DropEvent, index: any) => { this._dropped = true; + console.log("drop"); const firstParam = this.compileParams[index].split("="); - this.compileParams[index] = firstParam[0] + " = " + de.complete.docDragData?.droppedDocuments[0]; + this.compileParams[index] = firstParam[0] + " = " + de.complete.docDragData?.droppedDocuments[0].id; } - onDelete = (parameter: any) => { - this.compileParams.filter(s => s !== parameter); + @action + onDelete = (num: number) => { + this.compileParams.splice(num, 1); } render() { @@ -154,7 +157,7 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent; const listParams = this.compileParams.map((parameter, i) => -
+
void)[] = []; + doConnect() { console.error(`\nConnecting to Mongo with URL : ${url}\n`); this.MongoClient.connect(url, { connectTimeoutMS: 30000, socketTimeoutMS: 30000, useUnifiedTopology: true }, (_err, client) => { @@ -67,6 +69,12 @@ export namespace Database { }); } + + + + + + public async update(id: string, value: any, callback: (err: mongodb.MongoError, res: mongodb.UpdateWriteOpResult) => void, upsert = true, collectionName = Database.DocumentsCollection) { if (this.db) { diff --git a/src/server/index.ts b/src/server/index.ts index f26c8a6ab..005ecb1be 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -153,6 +153,6 @@ export async function launchServer() { if (process.env.RELEASE) { (sessionAgent = new DashSessionAgent()).launch(); } else { - (Database.Instance as Database.Database).doConnect(); + setTimeout(() => (Database.Instance as Database.Database).doConnect(), 30000); launchServer(); } -- cgit v1.2.3-70-g09d2