Commit Graph

607 Commits

Author SHA1 Message Date
Dan Funk be057e8758 Adding an "UpdateStudy" task that is able to update the data on the study model, useful for setting core data points on the model, such as setting the Primary Investigator, or altering the Study Title.
Fixing a bug where the validation of forms did not correctly process auto-complete fields.
Fixing a bug where the approvals script and the update study script could not process dot notation correctly.

Moved populate_random_data into the WorkflowService where it makes more sense.
2020-05-25 15:30:06 -04:00
Dan Funk d80a6af754 Disabling the Protocol Builder, and getting the rrt data correct. 2020-05-25 12:53:56 -04:00
Dan Funk 6cd4ef64d1 Fixing add_study api endpoint, so you can actually add a new "Study" with just some basic information.
Using the LDAP service for checking user details in development mode - even if you are using the back door.
Added a new Flask fucntion load-example-rrt-data that loads the rrt workflow, and not the CRC wrokflows.
Modified the "load-example-data" in the tests to use some test data, rather than loading up all the workflows[
in CRC each time, with a parameter to load crc data if that is required - which is enabled for just a handful of tests.
(Tests run in 1/4 the time now)
2020-05-25 12:29:05 -04:00
Dan Funk 971d9a58e9 As we now have an approval_service.py, I moved all the business logic into this service and out of the request_approval.py script. And moved all tests for these features into a test file for the service. Will make it easier to cross reference what is happening, as everything all happens in one file.
As many of the scripts need to know the workflow, and it's down in a weird parameter, moved this so it is passed in each time.
2020-05-24 16:13:15 -04:00
Carlos Lopez e9bd19b112 Fixing broken test 2020-05-24 01:22:14 -06:00
Carlos Lopez 49eb4b3f98 Making working endpoints for approvals 2020-05-23 23:53:48 -06:00
Carlos Lopez e5e7eb3dd3 Fixing broken tests by making version parameter optional in get file data endpoint 2020-05-23 15:37:03 -06:00
Dan Funk d5c91e575f stuff that might be broken. 2020-05-23 15:21:30 -04:00
Dan Funk d39ef658a2 Made some modifications to the Approval so that it knows exactly what versions of every file are being sent for approval
Added the following columns:
  * date_created - so we know when the file was created
  * renamed workflow_version to just "version", because everything has a version,  this is the version of the request.
  * workflow_hash - this is just a quick way to see what files and versions are associated with the request, it could be factored out.
  * study - a quick relationship link to the study, so that this model is easier to use.
  * workflow - ditto
  * approval_files - these is a list from a new link table that links an approval to specific files and versions.

The RequestApproval is logically sound, but still needs some additional pieces in place to be callable from a BPMN workflow diagram.

Altered the file service to pick up on changes to files vs adding new files, so that versions are picked up correctly as
users modify their submission - adding new files or replacing existing ones.  Deleting files worries me, and I will need to revisit this.

The damn base test keeps giving me a headache, so I made changes there to see if clearing and dropping the database each time won't allow the tests to pass more consistently.

Lots more tests around the file service to make sure it is versioning user uploaded files correctly.

The "Test Request Approval Script" tries to find to assure the correct behavior as this is likely to be called many times repeatedly and with little knowledge of the internal system.  So it should just "do the right thing".
2020-05-23 15:08:17 -04:00
Dan Funk 49c322177b
Merge pull request #76 from sartography/feature/rrp-endpoints
Feature/rrp endpoints
2020-05-22 19:38:26 -04:00
Carlos López 833f65fe8c
Merge pull request #75 from sartography/feature/add_review_model
Feature/add review model
2020-05-22 17:30:01 -06:00
Dan Funk 148e86bb42 Building out the boilerplate code to make pushing forward on this a little friendlier.
There is an approval api file, and approval model file and an approval test file.
2020-05-22 18:25:00 -04:00
Dan Funk 571c1d7d24 Merge branch 'feature/rrp-endpoints' into feature/disable_protocol_builder 2020-05-22 16:18:33 -04:00
Dan Funk d1606ffb1a forgot to include the new empty master workflow, which allows the tests to all pass. 2020-05-22 15:31:38 -04:00
Dan Funk 1017bb1897 On the tools/render_docx api, allow sending the json data in the body, rather than as a ludicrous long get parameter. Silly Dan. 2020-05-22 15:30:22 -04:00
Dan Funk 503c1c8f18 Allow disabling the Protocol Builder
PB_ENABLED can be set to false in the configuration (either in a file called instance/config.py, or as an environment variable)

Added a check in the base_test, to assure that we are always running tests with the test configuration, and bail out otherwise.  Setting TESTING=true as an environment variable will get this, but so well the correct ordering of imports. Just be dead certain the first file every test file imports is base_test.py.

Aaron was right, and we call the Protocol Builder in all kinds of awful places.  But we don't do this now.  So Carlos, you should have the ability to reuse a lot of the logic in the study_service now.

I dropped the poorly named "study-update" endpoint completely.  We weren't using it. POST and PUT to Study still work just fine for doing exactly that.

All the tests now run and pass with the Protocol builder disabled. Tests that specifically check PB behavior turn it back on for the test, or mock it out.
2020-05-22 14:37:49 -04:00
Dan Funk 992a85e9a5 Rough idea of what the Approvals model will look like. 2020-05-22 11:56:43 -04:00
Carlos Lopez a0c884499e Merge branch 'feature/rrp-endpoints' of github.com:sartography/cr-connect-workflow into feature/rrp-endpoints 2020-05-22 09:46:25 -06:00
Carlos Lopez 1ed7930aab Endpoint for studies with files 2020-05-22 09:46:03 -06:00
Dan Funk 8b3dc8e0ca Merge branch 'dev' into feature/rrp-endpoints 2020-05-22 11:41:11 -04:00
Dan Funk b490005af7 dropping the remaining config stuff for flask_sso.
updaing the user 'sso' endpoint to provide additional information for debugging.
Pulling information from ldap to stay super consistent on where we get our information.
2020-05-22 09:50:18 -04:00
Dan Funk 1cc9a60bfe clearing out the remaining references to the flask_sso library. 2020-05-22 08:01:33 -04:00
Dan Funk 4627318818 Dropping flask_sso library in favor of reading from the headers directly. Updating login to read from ldap once it has the user_id. Adding more information to the sso endpoint. 2020-05-22 07:55:58 -04:00
Dan Funk b3ae9ee770 changing the mapping, because 'Uid' not 'uid' 2020-05-21 16:28:34 -04:00
Dan Funk 0265db7146 adding an /sso endpoint for testing. 2020-05-21 16:02:45 -04:00
Dan Funk 4628834106 just a few more logging details. 2020-05-21 12:11:35 -04:00
Aaron Louie d76c18d329 Installs curl 2020-05-20 20:13:09 -04:00
Carlos Lopez abc90cdcb1 Adding serialiazer for study files 2020-05-20 15:10:22 -06:00
Aaron Louie d0f380e224 Uses Python 3.6.9 2020-05-20 16:49:55 -04:00
Aaron Louie 595364b415 Merge branch 'ec2/dev' into dev 2020-05-20 16:34:53 -04:00
Aaron Louie b915794000 Fixes more paths. 2020-05-20 15:57:54 -04:00
Dan Funk de7cebbd7d o 2020-05-20 15:32:40 -04:00
Aaron Louie 616a47bd10 Fixes file paths 2020-05-20 15:17:03 -04:00
Dan Funk 5f793db606 It is critical that the Pipfile python version matches the python version on the server. 2020-05-20 15:07:16 -04:00
Aaron Louie 865188795f Adds git. Purges apt cache after 2020-05-20 15:04:41 -04:00
Aaron Louie 97130e504a Adds git 2020-05-20 14:57:03 -04:00
Aaron Louie 91a228d3f4 Trying to slim down the size of the image 2020-05-20 14:33:39 -04:00
Dan Funk 2c407ae607 adding requirements.txt and a way to regenerate it. 2020-05-20 14:21:39 -04:00
Dan Funk 57615edde3 adding wsgi configuration. 2020-05-20 14:01:09 -04:00
Dan Funk 8647ebee42 Moving spiff back to master branch, with fixes for parallel, and performance improvements. 2020-05-20 10:57:20 -04:00
Aaron Louie 51ece390f3
Merge branch 'testing' into dev 2020-05-20 10:03:41 -04:00
Aaron Louie 3808786f11 Merge branch 'rrt/dev' into dev 2020-05-20 10:02:44 -04:00
Aaron Louie 48f9873548 Adding yet another flush, because Travis builds keep failing due to database race condition issues in this method. 2020-05-20 10:02:30 -04:00
Aaron Louie 6f60b04b98
Merge pull request #68 from sartography/dev
Dev
2020-05-20 08:45:16 -04:00
Aaron Louie e454993f6e
Merge branch 'testing' into dev 2020-05-20 00:14:51 -04:00
Aaron Louie 9fd3e8f1a5
Merge pull request #67 from sartography/rrt/dev
Rrt/dev
2020-05-20 00:14:21 -04:00
Aaron Louie fc63d26322
Merge pull request #66 from sartography/feature/docx_images
Feature/docx images
2020-05-20 00:13:50 -04:00
Aaron Louie 58189285ad Cleans up 2020-05-20 00:12:48 -04:00
Aaron Louie 2b5687c3a3 Fixes pernicious bug where template document versions were not being updated properly, and template completion script was not honoring version numbers 2020-05-20 00:10:32 -04:00
Aaron Louie 481a9ed04c Gets image ids from task data and Injects images into jinja docx 2020-05-19 21:51:54 -04:00