From 6a96ccffa27a5851116b665a3b5a9bc0afee87c1 Mon Sep 17 00:00:00 2001 From: Aaron Louie Date: Fri, 1 May 2020 21:54:01 -0400 Subject: [PATCH 1/2] Updates pipenv hashes. Fixes typo in SpiffWorkflow file name --- Pipfile.lock | 8 ++++---- crc/services/workflow_service.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 82b1d9a5..e6f000db 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -478,11 +478,11 @@ }, "marshmallow": { "hashes": [ - "sha256:90854221bbb1498d003a0c3cc9d8390259137551917961c8b5258c64026b2f85", - "sha256:ac2e13b30165501b7d41fc0371b8df35944f5849769d136f20e2c5f6cdc6e665" + "sha256:56663fa1d5385c14c6a1236badd166d6dee987a5f64d2b6cc099dadf96eb4f09", + "sha256:f12203bf8d94c410ab4b8d66edfde4f8a364892bde1f6747179765559f93d62a" ], "index": "pypi", - "version": "==3.5.1" + "version": "==3.5.2" }, "marshmallow-enum": { "hashes": [ @@ -783,7 +783,7 @@ "spiffworkflow": { "editable": true, "git": "https://github.com/sartography/SpiffWorkflow.git", - "ref": "c3dc94deba2890a10d3b2b05d4a0dee54c83ed69" + "ref": "e14b376cfe06441dac6d6154c9a5d908324aeea7" }, "sqlalchemy": { "hashes": [ diff --git a/crc/services/workflow_service.py b/crc/services/workflow_service.py index ca7bfb74..4c8e9bf4 100644 --- a/crc/services/workflow_service.py +++ b/crc/services/workflow_service.py @@ -2,7 +2,7 @@ from SpiffWorkflow.bpmn.specs.ManualTask import ManualTask from SpiffWorkflow.bpmn.specs.ScriptTask import ScriptTask from SpiffWorkflow.bpmn.specs.UserTask import UserTask from SpiffWorkflow.bpmn.workflow import BpmnWorkflow -from SpiffWorkflow.dmn.specs.BuisnessRuleTask import BusinessRuleTask +from SpiffWorkflow.dmn.specs.BusinessRuleTask import BusinessRuleTask from SpiffWorkflow.specs import CancelTask, StartTask from pandas import ExcelFile from sqlalchemy import func @@ -227,4 +227,4 @@ class WorkflowService(object): # db_query = db_query.filter(text("lookup_data.label @@ to_tsquery('simple', '%s')" % query)) - return db_query.limit(limit).all() \ No newline at end of file + return db_query.limit(limit).all() From 098cf109263398f440c8c7ddbb9c374886839a97 Mon Sep 17 00:00:00 2001 From: Aaron Louie Date: Fri, 1 May 2020 22:49:52 -0400 Subject: [PATCH 2/2] Fixes Jinja code to match new structure of StudyInfo documents --- .../documents_approvals.bpmn | 40 ++++++++----------- 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/crc/static/bpmn/documents_approvals/documents_approvals.bpmn b/crc/static/bpmn/documents_approvals/documents_approvals.bpmn index 6ffd7ded..bf39615b 100644 --- a/crc/static/bpmn/documents_approvals/documents_approvals.bpmn +++ b/crc/static/bpmn/documents_approvals/documents_approvals.bpmn @@ -13,10 +13,14 @@ # Documents & Approvals > ## Protocol Document Management -{% if StudyInfo.protocol is defined -%} -{%- set p = StudyInfo.protocol -%} - -> [{{p.name}}](/study/{{p.study_id}}/workflow/{{p.workflow_id}}/task/{{p.task_id}}) +{% if StudyInfo.documents.Study_Protocol_Document is defined -%} +{%- set p = StudyInfo.documents.Study_Protocol_Document -%} +{% if p.files|length -%} +{%- set f = p.files[0] -%} +> [{{p.display_name}}](/study/{{p.study_id}}/workflow/{{f.workflow_id}}/task/{{f.task_id}}) +{%- else -%} +> No protocol uploaded yet. +{% endif %} {%- else -%} > No protocol uploaded yet. {% endif %} @@ -31,13 +35,14 @@ > ## Documents > | Name | Status | Help | Download | |:---- |:------ |:---- |:-------- | -{% for doc in StudyInfo.documents_status -%} - {% if doc.file_id is defined -%} +{% for key, doc in StudyInfo.documents.items() %}{% if doc.required -%} + {% if doc.files|length -%} | [{{doc.display_name}}](/study/{{doc.study_id}}/workflow/{{doc.workflow_id}}/task/{{doc.task_id}}) | {{doc.status}} | [Context here](/help/documents/{{doc.code}}) | [Download](/file/{{doc.file_id}}/data) | {%- else -%} | {{doc.display_name}} | Not started | [?](/help/documents/{{doc.code}}) | No file yet | {%- endif %} -{% endfor %} +{% endif %}{% endfor %} + @@ -52,25 +57,19 @@ StudyInfo approvals - Flow_0w20w9j + Flow_1k3su2q Flow_0c7ryff - StudyInfo documents_status + StudyInfo documents - - - Flow_1k3su2q - Flow_0w20w9j - StudyInfo protocol - - + - + @@ -99,13 +98,6 @@ - - - - - - -