feat(runtime): 'Set Variable' node, add editor getInspectInfo (#80)

It is very nice to be able to inspect the value inside the variable even via the "Set Variable" node. Most of the time I see an additional variable node placed above the "Set Variable" node to just inspect the current value.
This commit is contained in:
Eric Tuvesson
2024-11-13 13:35:03 +01:00
committed by GitHub
parent 016837f466
commit e25155556f

View File

@@ -1,11 +1,9 @@
'use strict';
const { Node } = require('@noodl/runtime');
const Model = require('@noodl/runtime/src/model');
const Collection = require('@noodl/runtime/src/collection');
var SetVariableNodeDefinition = {
const SetVariableNodeDefinition = {
name: 'Set Variable',
docs: 'https://docs.noodl.net/nodes/data/variable/set-variable',
category: 'Data',
@@ -16,6 +14,13 @@ var SetVariableNodeDefinition = {
internal.variablesModel = Model.get('--ndl--global-variables');
},
getInspectInfo() {
if (this._internal.name) {
return this._internal.variablesModel.get(this._internal.name);
}
return '[No value set]';
},
outputs: {
done: {
type: 'signal',