diff --git a/crc/models/api_models.py b/crc/models/api_models.py index 361b9183..bb99eebb 100644 --- a/crc/models/api_models.py +++ b/crc/models/api_models.py @@ -61,7 +61,7 @@ class Task(object): class OptionSchema(ma.Schema): class Meta: - fields = ["id", "name"] + fields = ["id", "name", "data"] class ValidationSchema(ma.Schema): @@ -71,15 +71,11 @@ class ValidationSchema(ma.Schema): class FormFieldPropertySchema(ma.Schema): class Meta: - fields = [ - "id", "value" - ] + fields = ["id", "value"] class FormFieldSchema(ma.Schema): class Meta: - fields = [ - "id", "type", "label", "default_value", "options", "validation", "properties", "value" - ] + fields = ["id", "type", "label", "default_value", "options", "validation", "properties", "value"] default_value = marshmallow.fields.String(required=False, allow_none=True) options = marshmallow.fields.List(marshmallow.fields.Nested(OptionSchema)) diff --git a/crc/services/workflow_service.py b/crc/services/workflow_service.py index 0faf3b76..e81b9e3c 100644 --- a/crc/services/workflow_service.py +++ b/crc/services/workflow_service.py @@ -1,4 +1,5 @@ import copy +import json import string from datetime import datetime import random @@ -319,8 +320,8 @@ class WorkflowService(object): task.data = spiff_task.data if hasattr(spiff_task.task_spec, "form"): task.form = spiff_task.task_spec.form - for field in task.form.fields: - WorkflowService.process_options(spiff_task, field) + for i, field in enumerate(task.form.fields): + task.form.fields[i] = WorkflowService.process_options(spiff_task, field) task.documentation = WorkflowService._process_documentation(spiff_task) # All ready tasks should have a valid name, and this can be computed for @@ -391,7 +392,9 @@ class WorkflowService(object): if not hasattr(field, 'options'): field.options = [] for d in data: - field.options.append({"id": d.value, "name": d.label}) + field.options.append({"id": d.value, "name": d.label, "data": d.data}) + + return field @staticmethod def log_task_action(user_uid, workflow_model, spiff_task, action, version): diff --git a/crc/static/bpmn/group_test/group_test.bpmn b/crc/static/bpmn/group_test/group_test.bpmn new file mode 100644 index 00000000..aed16ffd --- /dev/null +++ b/crc/static/bpmn/group_test/group_test.bpmn @@ -0,0 +1,82 @@ + + + + + Flow_1gnws9u + + + + Flow_1xria19 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Flow_1gnws9u + Flow_0zud2rb + + + + lookup_dropdown: {{ lookup_dropdown }} +lookup_checkbox: {{ lookup_checkbox }} +lookup_radio: {{ lookup_radio }} + + + Flow_0zud2rb + Flow_1xria19 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/crc/static/bpmn/group_test/lookup.xlsx b/crc/static/bpmn/group_test/lookup.xlsx new file mode 100644 index 00000000..2861a655 Binary files /dev/null and b/crc/static/bpmn/group_test/lookup.xlsx differ diff --git a/crc/static/bpmn/sponsor_funding_source/sponsors.xls b/crc/static/bpmn/sponsor_funding_source/sponsors.xls index 7bb3882c..92c6cf66 100644 Binary files a/crc/static/bpmn/sponsor_funding_source/sponsors.xls and b/crc/static/bpmn/sponsor_funding_source/sponsors.xls differ diff --git a/example_data.py b/example_data.py index 98746c50..80df124d 100644 --- a/example_data.py +++ b/example_data.py @@ -69,6 +69,12 @@ class ExampleDataLoader: db.session.commit() # Pass IRB Review + self.create_spec(id="group_test", + name="group_test", + display_name="Group Test", + description="TBD", + category_id=0, + display_order=0) self.create_spec(id="irb_api_personnel", name="irb_api_personnel", display_name="Personnel",