Skip to content

Commit 2d195aa

Browse files
committed
Bug Fix: For new workflows, make sure to populate the sample plugin params, in case the user saves without editing it.
1 parent 86e99b7 commit 2d195aa

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

htdocs/js/pages/Workflows.class.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,12 @@ Page.Workflows = class Workflows extends Page.Events {
9292
else if (!app.plugins.length) return this.doFullPageError(config.ui.errors.new_wf_no_plugins);
9393
else plug_id = app.plugins[0].id;
9494

95+
var plug_params = {};
96+
var plugin = find_object(app.plugins, { id: plug_id }) || {};
97+
(plugin.params || []).forEach( function(param) {
98+
plug_params[ param.id ] = (typeof(param.value) == 'object') ? deep_copy_object(param.value) : param.value;
99+
} );
100+
95101
var target_ids = [];
96102
if (app.config.new_event_template.targets && app.config.new_event_template.targets.length) target_ids = [ ...app.config.new_event_template.targets ];
97103
else if (find_object(app.groups, { id: 'main' })) target_ids = ['main'];
@@ -102,7 +108,7 @@ Page.Workflows = class Workflows extends Page.Events {
102108
"id": job_node_id,
103109
"type": "job",
104110
"data": {
105-
"params": {},
111+
"params": plug_params,
106112
"targets": target_ids,
107113
"algo": app.config.new_event_template.algo || "random",
108114
"label": "",

0 commit comments

Comments
 (0)