Commit Graph

266 Commits

Author SHA1 Message Date
mike cullerton 682b010f6f Added mocked study_details with an invalid REVIEW_TYPE
This is used to test StudyService.get_studies_for_user
StudyService.get_studies_for_user should now filter on REVIEW_TYPE
2021-07-09 11:38:45 -04:00
mike cullerton 841bbe73ef Added REVIEW_TYPE to the mocked PB data 2021-07-09 10:38:41 -04:00
Dan Funk 3c52453c26
Merge branch 'dev' into add-name-error-hint-8 2021-07-07 11:35:24 -04:00
Dan Funk 2ed436327f
Merge pull request #333 from sartography/check-study-script-273
Check study script #273
2021-07-07 11:28:32 -04:00
Dan 2a45f2fcda Merge branch 'dev' into add-name-error-hint-8 2021-07-07 11:24:00 -04:00
Dan fb54edac1c Adding additional details to error messages, and cleaning up the cruft around these messages to keep them clear and succinct.
Most noteable is the addition of the line on which the error occurs for script tasks.  It will report the line number and pass back the content of
the line that failed.
The validator only returns the first error it encounters, as it's clear that all we ever get right now is two of the same error.
Did a lot of work between this and spiffworkflow to remove all the places where we obfuscate or drop details as we converted between workflowExceptions and APIExceptions.
Dropped the python levenshtein dependency, in favor of just rolling a simple one ourselves in Spiffworkflow.
2021-07-07 00:53:49 -04:00
Dan 1b1a994360 Refactoring Reference files to use the lookup table, rather than parsing the results directly out of the spreadsheet, or attempting to cache them.
Adding a DocumentService to clean up the FileService, and get Documents well seperated, as it seems likely be pulled out or seperated in the future, there is now a Documents api file as well, for the same reason.
Some other minor changes are just fixing white space to assure our code is linting correctly.
I removed _create_study_workflow_approvals from the base test, as we don't use approvals like this anymore.
2021-07-06 13:10:20 -04:00
mike cullerton 8145ff9025 Tests for calling the script 2021-07-02 16:14:19 -04:00
mike cullerton 2cb2874a49 Added test and json data for new check_study pb mock api endpoint 2021-07-02 15:26:39 -04:00
mike cullerton 2a43230121 Test and workflow for the new name error hint code 2021-07-01 15:39:25 -04:00
Dan 9a32fadc2f Merge branch 'dev' into 346-waiting-task-schedule
# Conflicts:
#	Pipfile.lock
#	crc/services/workflow_service.py
2021-06-30 10:14:37 -04:00
Dan Funk 48bf721b23
Merge pull request #331 from sartography/bug/356_duplicate_workflow
Bug/356 duplicate workflow
2021-06-22 17:42:24 -04:00
Dan 1f3febe2df Fix the panda warnings, which means we only support xlsx files now.
Include the document details when reutnring a file from the file model.
Improve the validation of file form elements.
2021-06-22 14:58:52 -04:00
Dan 0722a4bf13 Moving metrics into SpiffWorkflow so we can run the performance metrics deeply across both systems simultaniously.
Upgrading libraries.
Fixing deprication issue with Pandas and numpy.
We can only process xlsx files now, plain oldschool xls is fully removed.
2021-06-18 17:00:10 -04:00
Dan 07eb3f9ca8 Moving metrics into SpiffWorkflow so we can run the performance metrics deeply across both systems simultaniously.
Upgrading libraries.
Fixing deprication issue with Pandas and numpy.
We can only process xlsx files now, plain oldschool xls is fully removed.
2021-06-18 16:41:55 -04:00
mike cullerton 8db4199d73 Separate workflows for `using` the script and `validating` the script. 2021-06-15 11:15:04 -04:00
mike cullerton 9e20025f33 Test and workflow for reset_workflow 2021-06-15 08:37:42 -04:00
Kelly McDonald 5f722d675f Add a function that gets runs via a background scheduler to look for any workflows that are in a 'waiting' state - it runs the update waiting tasks and does do_engine_steps
We have a test for the function that runs, but an assumption was made that the scheduler module has its own unit tests and we do not need to test that.

fixes #346
2021-06-09 10:42:34 -04:00
Dan Funk 586a0f2f1a
Merge pull request #325 from sartography/feature/file_refactor
Prefer tasks that share a parent over just the the next available tas…
2021-06-08 11:28:23 -04:00
Dan Funk e10b210302
Merge pull request #323 from sartography/shield-test-issue-344
Shield test issue #344
2021-06-08 08:59:58 -04:00
Dan 59f605c3df Prefer tasks that share a parent over just the the next available task when returning the next_task in the workflow processor. 2021-06-08 08:03:14 -04:00
mike cullerton 70651e2a6a Test and BPMN files for testing 2021-06-04 11:45:51 -04:00
Kelly McDonald 8c04e228e9 Add test and fix to make sure that an empty study associates list (or a blank list) will effectively clear the extra study associates 2021-06-01 11:46:43 -04:00
Dan ef7ee284b2 Prefer tasks that share a parent over just the the next available task when returning the next_task in the workflow processor. 2021-05-19 16:26:16 -04:00
Dan Funk 4d7ce5eda9
Merge pull request #311 from sartography/deprecate-study-info-protocol-261
Deprecate study info protocol #261
2021-05-14 14:14:18 -04:00
Dan Funk 6a34fc0cde
Merge pull request #309 from sartography/persist-read-only-data-324
Persist read only data #324
2021-05-14 12:38:48 -04:00
Dan Funk 1d28d602d5
Merge pull request #308 from sartography/get-dashboard-url-230
Get dashboard url #230
2021-05-14 12:36:40 -04:00
Dan Funk 99da502912
Merge branch 'dev' into 321-Markdown-Macro 2021-05-14 12:32:41 -04:00
mike cullerton 1509bf23f8 Added some detail to the study_details mock data 2021-05-14 12:26:54 -04:00
mike cullerton 885c4c9a20 Started writing tests for the study_info script.
Need to add some mock data for a couple more
2021-05-13 16:30:17 -04:00
mike cullerton 67321ecd97 Test and workflow for persisting read-only data 2021-05-07 14:07:19 -04:00
mike cullerton 375089e5df test and bpmn file for new get_dashboard_url script 2021-05-06 15:32:28 -04:00
Kelly McDonald cbd1d01203 Add URL to the study_info('documents') script
fixes #321 - I merged in branches that fix #320 and #297

320-add-default-for-file-data-get
297-filename-in-documents
2021-05-05 11:30:08 -04:00
Dan Funk 8b0afa4437
Merge pull request #304 from sartography/irb-info-script-307
Irb info script #307
2021-05-04 11:40:52 -04:00
Dan Funk 4780240103
Merge pull request #302 from sartography/320-add-default-for-file-data-get
Add default capability to file_data_get script
2021-05-04 11:28:40 -04:00
Dan Funk 77d9bfca43
Merge pull request #296 from sartography/launch-workflow-outside-study-204
Launch workflow outside study 204
2021-05-04 11:16:08 -04:00
mike cullerton 9465b6408d Test and workflow for new `get_irb_info` script 2021-05-01 15:53:43 -04:00
mike cullerton 1bcf4ea02e Test and mock data for new `get_irb_info` service in ProtocolBuilderService 2021-05-01 15:23:07 -04:00
Kelly McDonald 7608a889fb Add default capability to file_data_get
script
2021-04-30 10:11:50 -04:00
Kelly McDonald d3d7eeb309 Add file_data_get and file_data_set functions that can be accessed in a bpmn script function
Fixes #299
2021-04-26 09:41:14 -04:00
mike cullerton 54ab7bd2f6 Test and workflow for launching a standalone workflow 2021-04-26 08:53:25 -04:00
Dan 069de83bd5 forgot to include a bpmn for the tests. 2021-04-09 09:02:43 -04:00
Dan 41310b6879 Allow both a keyword argument, a single argument when calling delete_file. And call it "delete_file" to be more conssitent with existing scripts. 2021-04-08 13:42:17 -04:00
mike cullerton 70fbd49aab Modified my test workflow so it works better for testing multiple file deletions 2021-04-05 15:12:14 -04:00
mike cullerton c6b1fd4e52 Fix for failing tests. Q_COMPLETE is no longer a column in the PB Mock study table. 2021-04-05 13:18:56 -04:00
mike cullerton d81497f8cb Test and workflow for new script to delete IRB documents 2021-04-05 08:55:41 -04:00
Dan Funk b5d4df595f
Merge pull request #271 from sartography/master-workflow-status-messages-222
Master workflow status messages 222
2021-03-26 20:52:24 -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 ac4877fecf Merge remote-tracking branch 'origin/dev' into master-workflow-status-messages-222 2021-03-26 17:47:57 -04:00
mike cullerton 47ff29e3ab Added a test for dictionary output from a decision table.
Will need dictionary output for master workflow status messages.
2021-03-18 12:25:27 -04:00
mike cullerton c4b52f85af Test and workflow for testing infinite loop code. 2021-03-17 14:52:50 -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
Dan Funk 14386b8ba9
Merge pull request #264 from sartography/bug/243_complete_all
Bug/243 complete all
2021-03-14 12:34:55 -04:00
Dan 6f80d816cd My privous efforts didn't take into account the fact that we use dot notation in field names.
I've re-worked the workflow form endpoint, so that it only accepts the data that should be in the form, and ignores any other values that come back from the front end.  It seems Formly has some bugs that were introducing confusing information, and I want everything to behave consistently.
I had to re-work some of the tests, which were relying on an ability to set data through a form post without having a corresponding form to do so.
2021-03-14 12:20:39 -04:00
Mike Cullerton e7c78c8d0e
Merge branch 'dev' into study-associated-email-207-223 2021-03-11 12:38:47 -05:00
mike cullerton fa028dd517 Modified the email_script workflow to accommodate the changes to the email script.
Workflow now uses keyword arguments; subject, recipients, and cc.
If cc is not passed in, we set it to None.
2021-03-11 11:37:54 -05:00
mike cullerton 7749f3aeaf Fixed existing workflows to work with keyword arguments 2021-03-09 06:50:58 -05:00
mike cullerton 8c75217042 Test and workflow for associated user emails 2021-03-09 06:50:20 -05:00
mike cullerton f883eb2bbe We now include field.id in the ApiError message for hidden and default validation. (The field must have a default value or value expression)
While working on this ticket I found a logic error in the test. I expected both default_value and value_expression. It turns out the default_value is always there, it's just null if we don't set it.

Modified the existing test for hidden and required, and added tests to make sure my passing logic is now correct.
2021-03-04 10:42:13 -05:00
Dan 9e758c57d3 Merge branch 'dev' into bug/225_enum_lookup_same_field_name 2021-03-02 14:15:58 -05:00
Dan Funk 572eb3457a
Merge pull request #252 from sartography/customer-error-messages-192
Customer error messages 192
2021-03-02 13:45:38 -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 aac3d5c16e Bug #255, this requires the front end to pass in the name of the task, when doing a lookup. This will prevent a bug where we have multiple user tasks, with enum fields that set the same variable, but use different lookup tables to populate the dropbown or search feature. 2021-03-01 14:54:04 -05:00
mike cullerton 9d804c36d5 Merge branch 'dev' into customer-error-messages-192.
Needed some sql changes from dev
2021-03-01 10:29:10 -05:00
Kelly McDonald 0b08a95e25 Add test and make sure that the API endpoint does the right thing when we switch users - checks both associated with access and associated with no access 2021-02-25 12:20:43 -05:00
Kelly McDonald 1504779bba Make sure we have all test files 2021-02-25 11:40:45 -05:00
Kelly McDonald 55f8825b3c Make sure we are testing both versions of the setting functions as well as the getting functions 2021-02-25 09:14:24 -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
mike cullerton f937ac3ce9 Getting some thoughts down for the extension property error. This might force us to use regexes for the error service.
Committing so I can work on another branch.
2021-02-24 10:56:25 -05:00
mike cullerton c40af1d7df Modified workflow to add form field with period in the id. 2021-02-15 16:36:36 -05:00
Dan Funk fe4e737596
Merge pull request #238 from sartography/value-expression-failing-shield-test-194
We now allow value_expression to evaluate to an empty string ("") so …
2021-02-11 11:25:09 -05:00
Dan Funk df25b83958
Merge pull request #235 from sartography/index-error-for-enums-186
Index error for enums 186
2021-02-11 11:21:50 -05:00
mike cullerton 39e874504f We now allow value_expression to evaluate to an empty string ("") so that we *do not* set a default value for enums in some cases.
This was causing an error because "" was not an option for the enum.
2021-02-10 14:35:58 -05:00
mike cullerton 11177b4296 Test, workflow, and empty spreadsheet for the new code. The workflow references the spreadsheet, which has no rows. 2021-02-08 15:12:11 -05:00
mike cullerton eb504465f6 Test and workflow for new code.
We test 2 things.
 - If a field can be hidden and required, it must have a default value or value_expression
 - If a field is hidden and required, make sure we use the default value
2021-02-08 10:20:05 -05:00
mike cullerton fa34bee18a First commit for cleaning up error messages for customers.
This is *not* in a working state.
Committing this so I can work on another ticket.
2021-02-04 11:23:05 -05:00
Dan Funk 329146237e
Merge pull request #232 from sartography/boolean-default-values-175
Boolean default values 175
2021-02-03 16:34:54 -05:00
mike cullerton 1247744463 Test and workflow for new code. 2021-02-03 09:50:37 -05:00
mike cullerton f9e4b6a972 Test and workflow for the new code. We test the correct cancel notify is called, and only when appropriate. 2021-01-29 14:09:42 -05:00
Dan Funk cccb722e07
Merge pull request #226 from sartography/enum_default_value_expression_162
Enum default value expression 162
2021-01-27 10:43:46 -05:00
mike cullerton 420ef0b2b0 Test and data for cleaning up my smell. We now test explicitly whether a task has both a default_value and value_expression. If so, we raise an error. 2021-01-27 10:22:43 -05:00
Dan Funk 98f946c119
Merge pull request #227 from sartography/missing_form_key_163
Missing form key 163
2021-01-27 09:42:46 -05:00
mike cullerton d01f8e1018 This workflow had a form with a missing form key, so it's associated test failed after my changes in this ticket. I added a form key to the form. Test now passes. 2021-01-22 12:16:02 -05:00
mike cullerton 2438779470 Test and workflow file for missing form key. Ticket 163 2021-01-22 12:14:59 -05:00
mike cullerton 1ee6a11d46 Test and associated data files for setting enum default values from value_expression. Ticket 162 2021-01-22 10:01:20 -05:00
Dan 5921ce9f10 Merge branch 'dev' into 152-workflow-spec-pull 2021-01-21 12:30:43 -05:00
Kelly McDonald 442a4524c4 Test for new functionality and code coverage 2021-01-12 10:18:35 -05:00
mike cullerton d274813ae5 We now check form field IDs so they play well with Python and Javascript. 2021-01-07 11:10:31 -05:00
Dan 96739d99c4 Fixing a failing test because new logic was catching a different error. 2020-12-29 11:14:40 -05:00
mike cullerton 06318c87b1 Test and workflow for changes to workflow_service. The workflow does not have a field type. We look for evidence of raised exception in data of response. 2020-12-28 18:03:59 -05:00
Dan Funk 4268d0f482
Merge pull request #208 from sartography/152-workflow-spec-pull
152 workflow spec pull
2020-12-14 11:35:06 -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
Dan 38a6fa782d Fixing the email script test. 2020-12-14 10:29:53 -05:00
Kelly McDonald ee3ee9fd4a Added tests to cover most of the use cases and code, and a bunch of stuff to make the mocks happy 2020-12-14 10:27:40 -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
Sartography 750a202e99 Test and BPMN files for testing email script 2020-12-06 10:22:32 -05:00
Dan Funk e15130e09c
Merge pull request #203 from sartography/151-data-store-exclusive-branch-expression
Added the ability to use the custom functions within a decision/flow …
2020-12-01 14:44:27 -05:00
Kelly McDonald 94662c560e Added the ability to use the custom functions within a decision/flow coming off of an exclusive join
Altered previous test to test this feature
2020-12-01 09:13:12 -05:00