@5minds/node-red-dashboard-2-processcube-dynamic-form 2.1.1 → 2.2.0-feature-e06da4-me6x8r85
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.
- package/nodes/ui-dynamic-form.html +23 -13
- package/nodes/ui-dynamic-form.js +1 -4
- package/package.json +1 -1
- package/resources/ui-dynamic-form.umd.js +10 -10
- package/ui/components/FooterActions.vue +113 -31
- package/ui/components/UIDynamicForm.vue +76 -50
- package/ui/stylesheets/ui-dynamic-form.css +18 -0
|
@@ -79,13 +79,16 @@
|
|
|
79
79
|
const labels = [...this.options.map((i) => i.label)];
|
|
80
80
|
|
|
81
81
|
if (this.handle_confirmation_dialogs) {
|
|
82
|
-
labels.push('
|
|
82
|
+
labels.push('Ablehnen', 'Bestätigen');
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
if (this.trigger_on_change) {
|
|
86
86
|
labels.push('Triggered on change');
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
labels.push('Suspend');
|
|
90
|
+
labels.push('Terminate');
|
|
91
|
+
|
|
89
92
|
return labels[index];
|
|
90
93
|
},
|
|
91
94
|
icon: 'ui_dynamic_form.svg',
|
|
@@ -122,7 +125,6 @@
|
|
|
122
125
|
style: 'background: var(--red-ui-secondary-background, #fff); margin:0; padding:8px 0px 0px;',
|
|
123
126
|
});
|
|
124
127
|
|
|
125
|
-
// Create input fields for value and label
|
|
126
128
|
const row = $('<div/>').appendTo(container);
|
|
127
129
|
$('<input/>', {
|
|
128
130
|
class: 'node-input-option-label',
|
|
@@ -188,7 +190,6 @@
|
|
|
188
190
|
],
|
|
189
191
|
});
|
|
190
192
|
|
|
191
|
-
// Create delete button for the option
|
|
192
193
|
const finalSpan = $('<span/>', {
|
|
193
194
|
style: 'float:right; margin-right:8px;',
|
|
194
195
|
}).appendTo(row);
|
|
@@ -251,8 +252,13 @@
|
|
|
251
252
|
}
|
|
252
253
|
|
|
253
254
|
if ($('#node-input-handle_confirmation_dialogs').is(':checked')) {
|
|
254
|
-
|
|
255
|
+
const confirmationOutputs = 2;
|
|
256
|
+
this.outputs += confirmationOutputs;
|
|
255
257
|
}
|
|
258
|
+
|
|
259
|
+
const suspendOutput = 1;
|
|
260
|
+
const terminateOutput = 1;
|
|
261
|
+
this.outputs += suspendOutput + terminateOutput;
|
|
256
262
|
},
|
|
257
263
|
});
|
|
258
264
|
</script>
|
|
@@ -280,15 +286,7 @@
|
|
|
280
286
|
<span id="valWarning" style="color: var(--red-ui-text-color-error, #910000)"><b>All Values must be unique.</b></span>
|
|
281
287
|
<ol id="node-input-option-container" style="list-style-type:none; margin:0;"></ol>
|
|
282
288
|
</div>
|
|
283
|
-
<!-- <a
|
|
284
|
-
data-html="true"
|
|
285
|
-
title="Dynamic Property: Send 'msg.options' in order to override this property."
|
|
286
|
-
class="red-ui-button ui-node-popover-title"
|
|
287
|
-
style="margin-left: 4px; cursor: help; font-size: 0.625rem; border-radius: 50%; width: 24px; height: 24px; display: inline-flex; justify-content: center; align-items: center;">
|
|
288
|
-
<i style="font-family: ui-serif;">fx</i>
|
|
289
|
-
</a> -->
|
|
290
289
|
</div>
|
|
291
|
-
<!-- Add Option Button -->
|
|
292
290
|
<div class="form-row">
|
|
293
291
|
<a href="#" class="editor-button editor-button-small" id="node-input-add-option" style="margin-top:4px; margin-left:103px;"><i class="fa fa-plus"></i> <span>action</span></a>
|
|
294
292
|
</div>
|
|
@@ -411,12 +409,24 @@
|
|
|
411
409
|
### Handles confirmation dialogs
|
|
412
410
|
|
|
413
411
|
When checked, this node will gain two additional outputs 'Accept' and 'Decline'. These are required, when handling confirmation dialogs, that may be defined in the Studio by settings a Form Fields type to 'Confirm'.
|
|
414
|
-
|
|
412
|
+
When a 'Confirm'-FormField is present and this option is enabled, only the confirmation buttons (Accept/Decline) will be displayed. The actions configured in the 'Actions' section will be hidden.
|
|
415
413
|
|
|
416
414
|
### Inside of card
|
|
417
415
|
|
|
418
416
|
This property controls the positioning of the action buttons. They can be palced inside of the card, right below the FormFields, or below the whole Card containing the Form.
|
|
419
417
|
|
|
418
|
+
## Built-in Actions
|
|
419
|
+
|
|
420
|
+
The dynamic form includes two built-in actions that are always available:
|
|
421
|
+
|
|
422
|
+
### Suspend Action
|
|
423
|
+
|
|
424
|
+
A secondary-styled button that allows users to suspend the current UserTask. This action has its own dedicated output and will send a message with `isSuspend: true` in the payload.
|
|
425
|
+
|
|
426
|
+
### Terminate Action
|
|
427
|
+
|
|
428
|
+
A red link-styled button that allows users to terminate the current UserTask. This action has its own dedicated output and will send a message with `isTerminate: true` in the payload.
|
|
429
|
+
|
|
420
430
|
## Title Configuration
|
|
421
431
|
|
|
422
432
|
### Title
|
package/nodes/ui-dynamic-form.js
CHANGED
|
@@ -8,14 +8,11 @@ module.exports = function (RED) {
|
|
|
8
8
|
|
|
9
9
|
const evts = {
|
|
10
10
|
onAction: true,
|
|
11
|
-
|
|
11
|
+
onInput: function (msg, send, done) {
|
|
12
12
|
if (config.title_text_type && config.title_text_type !== 'str') {
|
|
13
13
|
msg.dynamicTitle = RED.util.evaluateNodeProperty(config.title_text, config.title_text_type, node, msg);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
return msg;
|
|
17
|
-
},
|
|
18
|
-
onInput: function (msg, send, done) {
|
|
19
16
|
base.stores.data.save(base, node, msg);
|
|
20
17
|
|
|
21
18
|
if (done) done();
|
package/package.json
CHANGED