diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/models/task.py b/spiffworkflow-backend/src/spiffworkflow_backend/models/task.py index 60a3aa795..637585f27 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/models/task.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/models/task.py @@ -84,6 +84,7 @@ class TaskModel(SpiffworkflowBaseDBModel): process_model_identifier: Optional[str] = None type: Optional[str] = None can_complete: Optional[bool] = None + extensions: Optional[dict] = None def get_data(self) -> dict: return {**self.python_env_data(), **self.json_data()} diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/routes/tasks_controller.py b/spiffworkflow-backend/src/spiffworkflow_backend/routes/tasks_controller.py index 8a7c0a29d..5600146a7 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/routes/tasks_controller.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/routes/tasks_controller.py @@ -280,8 +280,6 @@ def task_show(process_instance_id: int, task_guid: str = "next") -> flask.wrappe process_instance.process_model_identifier, ) - # _find_human_task_or_raise(process_instance_id, task_guid) - form_schema_file_name = "" form_ui_schema_file_name = "" @@ -363,6 +361,7 @@ def task_show(process_instance_id: int, task_guid: str = "next") -> flask.wrappe _munge_form_ui_schema_based_on_hidden_fields_in_task_data(task_model) _render_instructions_for_end_user(task_model, extensions) + task_model.extensions = extensions return make_response(jsonify(task_model), 200) @@ -382,30 +381,6 @@ def _render_instructions_for_end_user(task_model: TaskModel, extensions: Optiona return "" -def process_data_show( - process_instance_id: int, - process_data_identifier: str, - modified_process_model_identifier: str, -) -> flask.wrappers.Response: - """Process_data_show.""" - process_instance = _find_process_instance_by_id_or_raise(process_instance_id) - processor = ProcessInstanceProcessor(process_instance) - all_process_data = processor.get_data() - process_data_value = None - if process_data_identifier in all_process_data: - process_data_value = all_process_data[process_data_identifier] - - return make_response( - jsonify( - { - "process_data_identifier": process_data_identifier, - "process_data_value": process_data_value, - } - ), - 200, - ) - - def _interstitial_stream(process_instance_id: int) -> Generator[str, Optional[str], None]: process_instance = _find_process_instance_by_id_or_raise(process_instance_id) processor = ProcessInstanceProcessor(process_instance) diff --git a/spiffworkflow-frontend/src/components/InstructionsForEndUser.tsx b/spiffworkflow-frontend/src/components/InstructionsForEndUser.tsx index 8a5a41d45..c9d955782 100644 --- a/spiffworkflow-frontend/src/components/InstructionsForEndUser.tsx +++ b/spiffworkflow-frontend/src/components/InstructionsForEndUser.tsx @@ -10,7 +10,7 @@ export default function InstructionsForEndUser({ task }: any) { 'There is no additional instructions or information for this task.'; let { properties } = task; if (!properties) { - properties = task.properties_json; + properties = task.extensions; } const { instructionsForEndUser } = properties; if (instructionsForEndUser) { diff --git a/spiffworkflow-frontend/src/routes/TaskShow.tsx b/spiffworkflow-frontend/src/routes/TaskShow.tsx index b8d3d10f1..bb59c47d2 100644 --- a/spiffworkflow-frontend/src/routes/TaskShow.tsx +++ b/spiffworkflow-frontend/src/routes/TaskShow.tsx @@ -297,7 +297,7 @@ export default function TaskShow() { let taskData = task.data; let jsonSchema = task.form_schema; let reactFragmentToHideSubmitButton = null; - if (task.type === 'Manual Task') { + if (task.type === 'ManualTask') { taskData = {}; jsonSchema = { type: 'object', @@ -333,9 +333,9 @@ export default function TaskShow() { if (task.state === 'READY') { let submitButtonText = 'Submit'; let saveAsDraftButton = null; - if (task.type === 'Manual Task') { + if (task.type === 'ManualTask') { submitButtonText = 'Continue'; - } else if (task.type === 'User Task') { + } else if (task.type === 'UserTask') { saveAsDraftButton = (