@gregoriusrippenstein/erlang-red-unittest 0.12.1 → 0.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,10 +10,14 @@
10
10
  name: {
11
11
  value:"",
12
12
  },
13
+
14
+ scope: { value: null, type: "*[]", required: true },
15
+
13
16
  nodeid: {
14
17
  value: "",
15
18
  required: true
16
- },
19
+ },
20
+
17
21
  msgtype: {
18
22
  value: "normal",
19
23
  required: true
@@ -29,9 +33,14 @@
29
33
  outputs: 1,
30
34
 
31
35
  label: function() {
32
- if (this.nodeid && !this.name ) {
33
- let nodeLabel = `[${this.nodeid}]`;
34
- let node = RED.nodes.node(this.nodeid)
36
+
37
+ if (this.nodeid && (!this.scope || !this.scope[0])) {
38
+ this.scope = [this.nodeid]
39
+ }
40
+
41
+ if (this.scope && this.scope[0] && !this.name ) {
42
+ let nodeLabel = `[${this.scope[0]}]`;
43
+ let node = RED.nodes.node(this.scope[0])
35
44
  if (node) {
36
45
  nodeLabel = RED.utils.getNodeLabel(node)
37
46
  }
@@ -45,7 +54,11 @@
45
54
  },
46
55
 
47
56
  labelStyle: function() {
48
- return (this.name || this.nodeid) ? "node_label_italic" : "";
57
+ if (this.nodeid && (!this.scope || !this.scope[0])) {
58
+ this.scope = [this.nodeid]
59
+ }
60
+
61
+ return (this.name || (this.scope && this.scope[0])) ? "node_label_italic" : "";
49
62
  },
50
63
 
51
64
  onpaletteadd: function() {
@@ -55,6 +68,10 @@
55
68
  },
56
69
 
57
70
  oneditprepare: function() {
71
+ if (this.nodeid && (!this.scope || !this.scope[0])) {
72
+ this.scope = [this.nodeid]
73
+ }
74
+
58
75
  $('#node-input-inverse').on('change', () => {
59
76
  if ($('#node-input-inverse').is(":checked")) {
60
77
  $('#ut-assert-debug-opts-to-hide-on-inverse').fadeOut(300);
@@ -65,10 +82,11 @@
65
82
 
66
83
  var dirList = $("#node-input-assert-debug-target-container-div").css({
67
84
  width: "100%",
68
- height: "calc(100%)"
85
+ height: "100%"
69
86
  }).treeList(
70
87
  {
71
- multi: false
88
+ multi: false,
89
+ sortable: false
72
90
  }
73
91
  ).on('treelistselect', function (event, item) {
74
92
  if (item && item.nodeid) {
@@ -110,7 +128,7 @@
110
128
  nodeid: nde.id,
111
129
  node: nde,
112
130
  sublabel: nde.type,
113
- selected: nde.id == this.nodeid,
131
+ selected: this.scope && (this.scope[0] == nde.id),
114
132
  checkbox: false,
115
133
  radio: true,
116
134
  children: undefined
@@ -124,7 +142,11 @@
124
142
  },
125
143
 
126
144
  oneditsave: function() {
127
- this.nodeid = $("#node-input-assert-debug-target-container-div").treeList('selected').nodeid
145
+ if ($("#node-input-assert-debug-target-container-div").treeList('selected').nodeid) {
146
+ this.scope = [$("#node-input-assert-debug-target-container-div").treeList('selected').nodeid]
147
+ } else {
148
+ this.scope = []
149
+ }
128
150
  },
129
151
 
130
152
  oneditresize: function(size) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gregoriusrippenstein/erlang-red-unittest",
3
- "version": "0.12.1",
3
+ "version": "0.12.2",
4
4
  "dependencies": {
5
5
  },
6
6