Commit fd42eebf authored by Frédéric Escudié's avatar Frédéric Escudié
Browse files

Fix bug in GUI with param group order.

parent 34b06302
...@@ -227,10 +227,10 @@ class JFlowServer (object): ...@@ -227,10 +227,10 @@ class JFlowServer (object):
select = False select = False
if 'filter_groups' in kwargs : filter_groups = kwargs['filter_groups'].split(',') if 'filter_groups' in kwargs : filter_groups = kwargs['filter_groups'].split(',')
if 'select' in kwargs : select = kwargs['select'] in ['True', 'true', '1', 1] if 'select' in kwargs : select = kwargs['select'] in ['True', 'true', '1', 1]
wf_instances, wf_methodes = self.wfmanager.get_available_workflows(filter_groups = filter_groups , select = select) wf_instances, wf_methodes = self.wfmanager.get_available_workflows(filter_groups = filter_groups , select = select)
for instance in wf_instances: for instance in wf_instances:
parameters, parameters_per_groups, groups = [], {}, ["default"] parameters, parameters_per_groups, ordered_groups = [], {}, ["default"]
for param in instance.get_parameters(): for param in instance.get_parameters():
# if it's a multiple action change the action by the name # if it's a multiple action change the action by the name
if param.action == MiltipleAction: if param.action == MiltipleAction:
...@@ -289,13 +289,14 @@ class JFlowServer (object): ...@@ -289,13 +289,14 @@ class JFlowServer (object):
if param.group in parameters_per_groups: if param.group in parameters_per_groups:
parameters_per_groups[param.group].append(hash_param) parameters_per_groups[param.group].append(hash_param)
else: parameters_per_groups[param.group] = [hash_param] else: parameters_per_groups[param.group] = [hash_param]
groups.append(param.group) if param.group not in ordered_groups:
ordered_groups.append(param.group)
workflows.append({"name": instance.name, workflows.append({"name": instance.name,
"help": instance.description, "help": instance.description,
"class": instance.__class__.__name__, "class": instance.__class__.__name__,
"parameters": parameters, "parameters": parameters,
"parameters_per_groups": parameters_per_groups, "parameters_per_groups": parameters_per_groups,
"groups": list(set(groups))}) "groups": ordered_groups})
return workflows return workflows
@cherrypy.expose @cherrypy.expose
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment