From 1d3a18b53942d21ab5ceb5c5c5dc836e45f1c5b6 Mon Sep 17 00:00:00 2001 From: anika-ahluwalia Date: Tue, 9 Jun 2020 11:44:01 -0500 Subject: typing bug bix --- src/client/views/nodes/ScriptingBox.tsx | 46 ++++++++++++++++----------------- 1 file changed, 22 insertions(+), 24 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 07c156742..e07704c19 100644 --- a/src/client/views/nodes/ScriptingBox.tsx +++ b/src/client/views/nodes/ScriptingBox.tsx @@ -60,15 +60,18 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent p.split(":")[0].trim()); } @computed({ keepAlive: true }) get paramsTypes() { return this.compileParams.map(p => p.split(":")[1].trim()); } @computed({ keepAlive: true }) get rawScript() { return StrCast(this.dataDoc[this.props.fieldKey + "-rawScript"], ""); } + @computed({ keepAlive: true }) get functionName() { return StrCast(this.dataDoc[this.props.fieldKey + "-functionName"], ""); } + @computed({ keepAlive: true }) get functionDescription() { return StrCast(this.dataDoc[this.props.fieldKey + "-functionDescription"], ""); } @computed({ keepAlive: true }) get compileParams() { return Cast(this.dataDoc[this.props.fieldKey + "-params"], listSpec("string"), []); } + set rawScript(value) { this.dataDoc[this.props.fieldKey + "-rawScript"] = value; } + set functionName(value) { this.dataDoc[this.props.fieldKey + "-functionName"] = value; } + set functionDescription(value) { this.dataDoc[this.props.fieldKey + "-functionDescription"] = value; } + set compileParams(value) { this.dataDoc[this.props.fieldKey + "-params"] = new List(value); } // WORK ON THIS @@ -236,24 +239,20 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent { - if (this._functionName.length === 0) { + if (this.functionName.length === 0) { this._errorMessage = "Must enter a function name"; return false; } - if (this._functionName.indexOf(" ") > 0) { + if (this.functionName.indexOf(" ") > 0) { this._errorMessage = "Name can not include spaces"; return false; } - this.dataDoc.funcName = this._functionName; - this.dataDoc.descripition = this._functionDescription; + this.dataDoc.funcName = this.functionName; + this.dataDoc.descripition = this.functionDescription; ScriptingBox.DeleteScript?.(this.dataDoc); - - this.dataDoc.funcName = "testingTitle"; - this.dataDoc.descripition = "description test"; - ScriptingBox.AddScript?.(this.dataDoc); console.log("created"); @@ -302,32 +301,31 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent this._functionDescription = e.target.value} + className="scriptingBox-textarea" + onChange={e => this.functionDescription = e.target.value} placeholder="enter description here" - value={this._functionDescription} - style={{ height: "40%", width: "100%" }} + value={this.functionDescription} + style={{ maxWidth: "100%", height: "40%", width: "100%", resize: "none" }} />; - const nameInput =