Commit Graph

136 Commits

Author SHA1 Message Date
mike cullerton f0f5cff8d7 Added some checks to do_task to look for valid irb_doc_code and whether or not we found a file
Added code for do_task_validate
2021-04-05 13:15:09 -04:00
mike cullerton 9317e49e65 Merge branch 'dev' into delete-uploaded-file-script-283 2021-04-05 10:40:33 -04:00
mike cullerton 0eb6291740 Script to delete an IRB document. Takes an `irb_document` argument.
Deletes all files associated with the workflow with that IRB document code
2021-04-05 08:55:02 -04:00
Kelly McDonald 116bf5e7aa Merge branch 'dev' into 263-optimize-dashboard
# Conflicts:
#	crc/services/study_service.py
2021-03-31 10:20:33 -04:00
Kelly McDonald 60f5be1aef Check in - pending change from @cullerton 2021-03-30 12:10:49 -04:00
Dan Funk 123ec50912
Merge pull request #272 from sartography/infinite-validations-262
Infinite validations 262
2021-03-26 19:49:42 -04:00
Dan Funk 6ab98c1dee
Merge pull request #267 from sartography/get-study-associates-validation-242
The `do_task_validate_only` method in the `get_study_associates` scri…
2021-03-19 15:41:46 -04:00
mike cullerton e2ba19748d Added department chair to the mocked data for study_info script.
The missing department chair caused an infinite loop in a workflow that checked for a department chair.
2021-03-16 13:36:55 -04:00
mike cullerton 70efdb4788 The `do_task_validate_only` method in the `get_study_associates` script now returns a mocked list of associates.
It used to return `True`, and this caused shield validation to fail when looping over the results of `get_study_associates`.
(You can't loop over a boolean)

Added a for loop in `study_sponsors_associate.bpmn` to test for this.
Moved `BaseTest` import to the top of `test_study_associate_script` because debug was failing.
2021-03-16 08:57:30 -04:00
mike cullerton dfa65ac276 We now perform an LDAP lookup for the associated user email addresses, instead of looking in the DB user table. 2021-03-15 10:30:23 -04:00
mike cullerton 67697b5076 Lots of changes!
Email Script:
- The email script now accepts 3 keyword arguments; subject, recipients, and cc.
- Subject and recipients are required.
- Recipients (and cc) can be an email address or list of addresses.
- You can use the string 'associated' in place of an email address, in which case we look up the users associated with a study that have send_email set to True.
- Moved some helper methods to email_service.

Email Service:
- Added cc argument
- Added helper methods previously in email script.
- Modified get_rendered_content to accept message and data directly. Previously, we passed in the task and grabbed them from there. Now we can use the method outside a task.
2021-03-11 11:32:21 -05:00
mike cullerton 7171219e8b removed unused import 2021-03-09 07:00:20 -05:00
mike cullerton 44ac55bc32 We can now send emails to users associated with a study, by using 'associated' as the recipient
We now use keyword arguments in the email script; subject and recipients
2021-03-09 06:49:39 -05:00
Kelly McDonald 06dedd8a32 Add short_title to study, change update_study task to use kw arguments and add the short_title to the update_study script 2021-03-02 10:03:53 -05:00
Dan Funk 3e0541fa15
Merge pull request #250 from sartography/206-extend-study-access
206 extend study access
2021-03-01 14:55:38 -05:00
mike cullerton 5c3d791bf3 UVA asked us to remove the extra whitespace in emails.
We removed the string replacement of '\n' -> '<br>' to solve this.
This means you can't purposely add blank lines any more.
Trade offs.
2021-02-25 11:08:08 -05:00
Kelly McDonald f592a8a0b0 Added a few more tests - I think I need to test one more script endpoint 2021-02-25 09:07:46 -05:00
Kelly McDonald 9bd3aa8dcb service and scripts with working test - still needs a few more tests to try out, but should work to get Mike going 2021-02-24 12:55:23 -05:00
Kelly McDonald c795dd7aea Merge branch 'dev' into 206-extend-study-access 2021-02-24 12:16:35 -05:00
Kelly McDonald 3dbe39c6fe initial checkin of changes for branch 2021-02-24 12:05:06 -05:00
Dan Funk 53fa49e668
Merge pull request #243 from sartography/183-remove-study-approval-code
Remove Approvals per ticket 183
2021-02-22 18:12:02 -05:00
Kelly McDonald 003bf2f9b9 Remove Approvals per ticket 183 2021-02-16 09:05:29 -05:00
mike cullerton d8bd203139 The email script was failing validation because of missing parameters in scripts.email.do_task_validate_only.
I added a test in tests.test_email_script to make sure we get the default email_address.
I also found and fixed a bug in workflow_service.populate_form_with_random_data where we would overwrite default_values with random text because of a missing continue.
(We don't want to continue if we have repeating fields though.)
2021-02-11 15:36:12 -05:00
mike cullerton d7a3afe8f4 changed the template to use the responsive html email template at https://github.com/leemunroe/responsive-html-email-template
added method get_cr_connect_wrapper to render our new html email template. This takes the email text generated from the task element documentation as the email_body.
2021-01-27 17:12:03 -05:00
mike cullerton 909af9b8d6 Change HTML emails so they look like the CR-Connect website. Add logo, color, style, etc.
Cleaned up email script a little.
Also, email script no longer uses services.mails. It uses email_service directly now.
2021-01-26 09:19:28 -05:00
mike cullerton 0c47d09972 Ticket 143. Test whether file is uploaded. 2021-01-04 10:53:21 -05:00
Dan Funk 386feddeed
Merge pull request #214 from sartography/validate-hide-expression-103
Modified study_info do_task_validate_only so that we take the default…
2020-12-31 10:53:27 -05:00
Dan efdbbcbc72 StudyInfo sometimes returns arrays of items, each item in the array should be coverted to a Box dictionary if possible. 2020-12-30 14:51:51 -05:00
mike cullerton f29429f0d0 Modified study_info do_task_validate_only so that we take the default path in ind_update workflow. 2020-12-30 10:04:10 -05:00
Dan e5a38874f6 A hard or soft reset should also cause a 'cancel_notify' which will kick off any CANCEL events. If this happens during
a hard or soft reset, and an error is thrown trying to fulfil a cancel event, the reset should still fire.
Sending emails still had a number of issues correctly parsing it's arguments.  This is corrected.
2020-12-29 18:05:13 -05:00
Dan Funk e54404e424
Merge pull request #205 from sartography/test-email-script
Test email script
2020-12-14 11:28:14 -05:00
mike cullerton 7defc2b02f Tests for uid in logs. Currently we test for uid in a response. This covers ApiError.
Currently, we don't have a test for Sentry. Unsure how to do this.
Also added a script, service and test workflow to help. (Also to learn about adding a script and service.)
2020-12-11 17:47:53 -05:00
mike cullerton 32c5060a31 No longer use eval on the email address. It is already parsed.
Tests for single and multiple emails, and email error checking.
Still need to figure out how to implement multiple emails.
2020-12-09 12:11:46 -05:00
mike cullerton 730d0ca18f Email script now uses an email address instead of a UVA LDAP user_id. 2020-12-07 16:23:41 -05:00
Dan b83ab1bcd1 Move data store base into its own file. 2020-11-18 15:34:50 -05:00
Kelly McDonald 70425eee0d Add last_updated field - change the api signature to be closer to what we need going forward, but retain the old methods for testing the script get/set through the API 2020-11-13 12:03:29 -05:00
Kelly McDonald 7c2c725840 save before changing how API works 2020-11-13 09:58:21 -05:00
Kelly McDonald 9a4d167dcd Add in api changes 2020-11-11 09:44:58 -05:00
Kelly McDonald cef221be32 Refactor to reuse code 2020-11-10 11:32:59 -05:00
Kelly McDonald 3ba11f5e6b add user_data_get/set and alter test so that it ensures that we don't grab study_data stuff from the user_data calls
change the test to mock up the user.
2020-11-10 10:32:37 -05:00
Kelly McDonald 245124779e Add mostly-working elements of the data-store, compare with dev to see why db is not working after running tests 2020-11-10 08:21:46 -05:00
Kelly McDonald e598994d34 Change the study_sponsors script so that we can actually call it :
var = study_info('sponsors')

to keep it more in line with other scripts that we have
2020-11-05 10:31:47 -05:00
Kelly McDonald 2931f45187 Add 'sponsors' to study_info call 2020-11-04 14:34:10 -05:00
Dan Funk b544334f45 1. Updating Personnel BPMN diagram to debug some issues.
2. Disabling the token timeout for now, to see if this corrects the issues Alex is having with lost work.
3. Raising more thoughtful error messages for unknown lookup options.
4. Providing better validation of default values and injecting the correct value for defaults related to enum lists of all types.
5. Bumping Spiffworkflow library which contains some better error messages and checks.
2020-09-01 15:58:50 -04:00
Dan Funk 5be35e8bab Adding a study sponsors script to return details about study sponsors 2020-08-25 10:30:46 -04:00
Dan Funk 8f5488d910 Don't raise an error when validating workflows that use the ldap script. 2020-08-17 15:45:37 -04:00
Dan Funk c12e2b97f3 calling ldap with no argument will return information about the current user. 2020-08-13 21:09:52 -04:00
Dan Funk e8067fe34e adding additional data to the study details returned during validation/shield testing. 2020-08-12 17:04:59 -04:00
Aaron Louie c25536dcca Makes Sonar happy. 2020-08-04 16:42:35 -04:00
Aaron Louie 2846bf9451 Fleshes out fake PB response, so workflows that pull from PB actually trigger validation errors 2020-08-04 15:50:29 -04:00