Merge branch 'dev' into 263-optimize-dashboard

This commit is contained in:
Dan 2021-04-02 17:12:02 -04:00
commit 3ad3a086ba
4 changed files with 365 additions and 440 deletions

769
Pipfile.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -65,6 +65,7 @@ paths:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/User"
# /v1.0/study
/study:
@ -80,6 +81,7 @@ paths:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Study"
post:
operationId: crc.api.study.add_study
@ -159,6 +161,7 @@ paths:
/workflow_sync/{workflow_spec_id}/spec:
parameters:
- name: workflow_spec_id
required: true
in: path
description: The unique id of an existing workflow specification to modify.
schema:
@ -392,7 +395,7 @@ paths:
parameters:
- name: spec_id
in: path
required: false
required: true
description: The unique id of an existing workflow specification to modify.
schema:
type: string
@ -441,7 +444,7 @@ paths:
parameters:
- name: spec_id
in: path
required: false
required: true
description: The unique id of an existing workflow specification to validate.
schema:
type: string
@ -497,7 +500,7 @@ paths:
parameters:
- name: cat_id
in: path
required: false
required: true
description: The unique id of an existing workflow spec category to modify.
schema:
type: string
@ -1513,8 +1516,7 @@ components:
example: "random_fact"
x-nullable: true
file:
type: file
format: binary
type: string
Workflow:
properties:
id:
@ -1522,7 +1524,7 @@ components:
type: integer
format: int64
status:
type: enum
type: string
enum: ['new','user_input_required','waiting','complete']
navigation:
type: array
@ -1576,7 +1578,7 @@ components:
data:
type: object
multi_instance_type:
type: enum
type: string
enum: ['none', 'looping', 'parallel', 'sequential']
multi_instance_count:
type: number
@ -1709,7 +1711,7 @@ components:
type: string
readOnly: true
type:
type: enum
type: string
enum: ['string', 'long', 'boolean', 'date', 'enum']
readOnly: true
label:
@ -1785,7 +1787,7 @@ components:
type: string
example: "Chuck Norris"
data:
type: any
type: string
NavigationItem:
properties:
id:
@ -1815,7 +1817,7 @@ components:
type: integer
example: 4
state:
type: enum
type: string
enum: ['FUTURE', 'WAITING', 'READY', 'CANCELLED', 'COMPLETED','LIKELY','MAYBE']
readOnly: true
is_decision:

View File

@ -166,8 +166,10 @@ class BaseTest(unittest.TestCase):
study_model = StudyModel(**study_json)
session.add(study_model)
StudyService._add_all_workflow_specs_to_study(study_model)
session.execute(Sequence(StudyModel.__tablename__ + '_id_seq'))
session.commit()
update_seq = f"ALTER SEQUENCE %s RESTART WITH %s" % (StudyModel.__tablename__ + '_id_seq', study_model.id + 1)
print("Update Sequence." + update_seq)
session.execute(update_seq)
session.flush()
specs = session.query(WorkflowSpecModel).all()

View File

@ -253,10 +253,8 @@ class TestWorkflowProcessor(BaseTest):
processor = self.get_processor(study, workflow_spec_model)
self.assertTrue(processor.get_version_string().startswith('v2.1.1'))
def test_hard_reset(self):
self.load_example_data()
# Start the two_forms workflow, and enter some data in the first form.
study = session.query(StudyModel).first()
workflow_spec_model = self.load_test_spec("two_forms")
@ -275,6 +273,8 @@ class TestWorkflowProcessor(BaseTest):
# Assure that creating a new processor doesn't cause any issues, and maintains the spec version.
processor.workflow_model.bpmn_workflow_json = processor.serialize()
db.session.add(processor.workflow_model) ## Assure this isn't transient, which was causing some errors.
self.assertIsNotNone(processor.workflow_model.bpmn_workflow_json)
processor2 = WorkflowProcessor(processor.workflow_model)
self.assertFalse(processor2.is_latest_spec) # Still at version 1.