Commit Graph

150 Commits

Author SHA1 Message Date
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 187221537b fixing a corner case around file_data attributes. 2021-06-25 16:18:28 -04:00
Dan 628a587d97 We weren't committing to the database in the correct spot, so the delete wasn't sticking, and we were ending up with test workflows showing up in the main interface. 2021-06-23 16:39:58 -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 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
Dan a4caae8d64 when validating, we need to take every step to remove the workflows we create during the validation. 2021-06-16 14:40:20 -04:00
Dan acae6030f5 The API for evaluating python expressions should not raise an error, it can simply return a result of false, and provide an error to explain the problem. In this way the front end doesn't error out when it's running the script tasks but doesn't have enough information to get a valid response back.
The validation should take into account that repeating sections must be evaluated in the context of the data within the repeating section, not outside of it.
2021-06-15 16:17:15 -04:00
Dan 738a984dcd Merge branch 'dev' of github.com:sartography/cr-connect-workflow into dev 2021-06-11 17:21:47 -04:00
Dan 879d6e1df3 missed a critical change on the backend with the recent file updates, this assures that we properly handle repeating sections during the post process,
and we update the file doc code in those repeating sections.
2021-06-11 17:20:25 -04:00
Dan 7282419174 modified the tools api to return the expression and data with the result, making it easier to cash results on the front end, This should help drastically reduce the calls to the python_eval from the front end.
The post processors for form submissions needs to take repeating sections into account, or it won't find the files it is looking for.
2021-06-11 08:27:50 -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
Kelly McDonald 0d8d251e8e Temp save to test dev 2021-06-09 09:24:37 -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 8d79fe9d94 Fixing failing tests, and now asserting that we only perform the post_process_form if we actually have a form. 2021-06-08 11:16:10 -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 c41657301a Modify `test_spec` and `make_test_workflow` to accept new optional `validate_study_id` parameter.
Modify `make_test_workflow` to use study_id when creating test workflow for validation.
2021-06-03 14:22:26 -04:00
Dan Funk ade7812540
Merge pull request #310 from sartography/get-primary-workflow-301
Get primary workflow #301
2021-05-14 12:41:48 -04:00
mike cullerton 8a6bef5af4 New service to get the `primary workflow` for a workflow_spec, using a workflow_spec_id.
This is necessary because `primary` is a file parameter, not a workflow_spec parameter.

- you can ask a workflow file whether it is primary, but
- you cannot ask a workflow_spec for its primary workflow file

Now, you can use `workflow_service.get_primary_workflow(workflow_spec_id)`
2021-05-12 13:51:51 -04:00
mike cullerton 07f3d2c2ee Allow data from read-only fields to persist in task_data 2021-05-07 14:06:53 -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 d6054a9846
Merge branch 'dev' into 310-task-event-timezone 2021-05-04 11:21:36 -04:00
mike cullerton 804926dbac Fixed problem where WorkflowService.make_test_workflow did not add a study to the workflow_model 2021-05-01 15:55:20 -04:00
mike cullerton 24c818bf31 Added study_id to workflow_api 2021-04-29 14:29:21 -04:00
Kelly McDonald 2b9cee6b89 Update database to include timezone and change all points where we set the time on an event to be utc time. If we get something in the database with a timezone, it will display properly on the front end, but by default everything will be put in the database in UTC 2021-04-29 10:25:28 -04:00
mike cullerton f17a9dc0f4 Modified `get_users_assigned_to_task`.
If we are running a standalone workflow, only return the current user.
2021-04-26 08:45:08 -04:00
mike cullerton b6f5001687 Added methods for the 2 new api endpoints 2021-04-26 08:43:14 -04:00
Dan 6427a54d74 Set the correct default value on enumerations - if it is a multi-select enum (checkbox is set) then it should return a default value of an empty array, and not a dictionary. 2021-04-09 08:40:58 -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
mike cullerton 938079cf59 Lowered count ceiling to 100, from 1000. This significantly increased validation time, from about 3 minutes to about 10 seconds.
Changed ApiError call to from_task, instead of from_workflow_exception.
2021-03-17 14:52:19 -04:00
mike cullerton 529bfc34b3 We now check for an infinite loop during validation.
This happened when testing for a Department Chair in a workflow.
Our mocked data for study_info script did not have a Department Chair
2021-03-16 13:35:51 -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
Dan 15c64c862e Adding an argument to update task that will allow it to complete all remaining tasks through an "update_all" flag,
this will allow us to remove some fairly complex logic from the front end that isn't behaving properly.
2021-03-12 20:41:07 -05:00
Dan 1000b22a3b Don't raise errors on non-ready tasks that calculate a title, the information may not be avaiable yet.
Also Allow autocomplete-num as a valid field property.
2021-03-12 15:40:23 -05:00
Dan 576aebab19 Sometimes a workflow can be completely broken and unloadable. For instance, it starts off with a engine step / script task that will not execute. So the failure happens the second it is processed. When calling reset on a workflow, we should catch the failure, and reset the workflow, so we aren't trapped in an unrecoverable state.
To do so, I changed the WorkflowProcessor's reset method to be static, it will try to instantiate the current workflow and execute a cancel_notify event, but if that fails, it will continue and always return a new workflow processor using the latest spec.
2021-03-09 11:52:55 -05:00
Dan 36dcc58705 Merge branch 'dev' of github.com:sartography/cr-connect-workflow into dev 2021-03-08 14:00:14 -05:00
Dan 291216e081 Fixing a bug that prevented proper evaluation of a enum field where the default value was null or empty. 2021-03-08 14:00:03 -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
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 f3414e22c1 use the associated table to grant access to users who have been designated to have access to the study, not just the study owner. 2021-02-25 11:08:06 -05:00
Dan Funk 349c3d657a
Merge branch 'dev' into 201-changes-to-in-progress 2021-02-22 18:17:59 -05:00
Dan Funk f0a921d46d
Merge pull request #242 from sartography/allow-period-in-field-id-199
Allow period in field id 199
2021-02-17 15:08:53 -05:00
Kelly McDonald 93f29e86d8 Merge branch 'dev' into STG-181_frontend-ux-model-changes 2021-02-17 07:49:05 -05:00
Dan ff8a44a7b1 Make sure we always have a current user, even if the very first task is a script task. 2021-02-16 12:42:59 -05:00
Kelly McDonald 118cf62172 Merge remote-tracking branch 'origin/dev' into STG-181_frontend-ux-model-changes 2021-02-16 10:07:34 -05:00
mike cullerton ed6218028c We now allow periods in field ids.
Also, added task_id and task_name to the ApiError for missing default value on hidden and required fields
2021-02-15 16:27:56 -05:00
Dan Funk 35773ebc29
Merge pull request #240 from sartography/weird-email-error
The email script was failing validation because of missing parameters…
2021-02-12 09:31:52 -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
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