833 Commits

Author SHA1 Message Date
Dan
dec63839f3 Merge remote-tracking branch 'origin/dev' into chore/log-changes-661 2022-03-12 16:19:23 -05:00
Dan
2fc4b44ef3 Create a path to directly download the spreadsheet file (and avoid the weird dance on the front end of making an API call to get file data.)
Fixing pagination.  Seems the front end uses a page_index that is 0 based, and sqlAlchemy prefers to start at 1.
2022-03-12 16:19:07 -05:00
Dan
4ab314c7b8 Be sure to delete the data store items when you delete a study. 2022-03-12 13:38:09 -05:00
Dan
52b5e1d34a Fixing tests. 2022-03-11 18:02:37 -05:00
mike cullerton
b753f06394 Changes to remove pagination for the get_logs scripts.
We only use pagination for the get_logs_for_study API endpoint. (Used on the study page)
2022-03-11 14:03:09 -05:00
mike cullerton
d57d741c10 Added TODO 2022-03-10 12:17:32 -05:00
mike cullerton
423426c2c8 Removed some unused imports
Finished up get_all_logs_for_download
2022-03-10 12:14:14 -05:00
mike cullerton
9efb4c4fb3 New spreadsheet_service.
Accepts list of dictionaries, and optional headers and title
Creates spreadsheet from list of dictionaries
Returns the spreadsheet as a binary stream
2022-03-10 12:13:10 -05:00
mike cullerton
bf31364b1f *** WIP ***
Committing to fix logging so we can use a level of 'metrics'
2022-03-09 13:07:56 -05:00
Dan
1e9c9919c2 hot fix, missed a critical part of the jinja include syntax when identifying included templates 2022-03-09 11:03:42 -05:00
Dan
ce57a3753a fixing some comments and error messages for clarity 2022-03-09 10:28:22 -05:00
Dan
e3c1a908fe A better comment around a tricky part of the code. 2022-03-09 09:43:08 -05:00
Dan
41b5106a28 patching up the tests.
Looks like we want to use default values, if they are provided, for validation. So good test, and I didn't have to create a new bug.  Also added skipping the test about requiring a default for hidden+required fields.  Maybe we don't need to after all.
2022-03-08 18:38:05 -05:00
Dan
26eeb2912a Only run the form validation stuff if we have a form.
If there is a default value, use it, regardless of whether the form is hidden (this is how the front end works)
  (accomplished by moving the hide_epxression check -> continue stuff below the set default_value code)
2022-03-08 18:13:54 -05:00
Dan
b03e24bbf4 Properly handle forms where a field is required, based on a later field.
Do an aboutface on saying that if a field is required but hidden, it has to have a default value.  I'm just commenting this out for now, as it made getting these workflows to validate bloody impossible.
Clean up the replication of code for identifying required fields (as it wasn't consistently applied)
Removing some very broken and apparently unused methods.
2022-03-08 17:36:13 -05:00
Dan
0a906a4b3c Cleaning up Print Statements (it was making it hard to see what was happening)
The Jinja2 service was treating all the task data as a possible template, modified it to only include the referenced templates.
(This turned out not to be the problem, but it seems like a good idea to keep it in place)
There is a terrible bug with the wordwrap pipe that will die without any details if you pass it a value of None.  We now cature the terrible error, and replace it with a sensible one.
Removed an unused Jinja_extensions file.
2022-03-08 15:46:36 -05:00
Dan Funk
0b3fa781c5
Merge pull request #484 from sartography/bug/bleeding_data
Loading latest chages from Spiff whic refactored the way the PythonEx…
2022-03-07 10:22:36 -05:00
Dan
0455506e2b Loading latest chages from Spiff whic refactored the way the PythonExpressionEngine works.
This cleans up the _evaluate method which previously accepted arbitrary args and kwargs, and now requires an expression, a context to which exectute it, and, optionally, the current task being executed if the DMN is being executed as a part of a BusinessRuleTask in a BPMN diagram.

This also cleans up several bits of duplicated code.

There is also a bit of code here to assure that the current user is included when running the master workflow.
2022-03-04 15:34:36 -05:00
mike cullerton
2cfe1b331c Merge branch 'dev' into git-integration-596 2022-03-02 15:29:27 -05:00
mike cullerton
83e2370778 The frontend passes '' instead of None
Also, tests for the new button display variables
2022-03-02 13:33:22 -05:00
Dan Funk
84c420346d
Merge pull request #481 from sartography/feature/add-jinja-to-help-576
Feature/add jinja to help #576
2022-03-02 12:33:21 -05:00
mike cullerton
cb65a7dc41 Add booleans for displaying push/merge buttons
*** WIP ***
Still need to add some tests for this.
Committing so we can work on the frontend
2022-03-02 12:03:08 -05:00
Dan Funk
07e13584e7
Merge pull request #479 from sartography/nonetype-displayname-error-632
Clean up error message in test_spec
2022-03-01 16:20:20 -05:00
Dan Funk
cf77480803
Merge pull request #480 from sartography/bug/no-assignment-tasks-639
Fixes #650 - Approvals not Clearing When Completed
2022-03-01 16:19:51 -05:00
mike cullerton
5ef2905d3c Add Jinja templating to form field help 2022-03-01 16:17:02 -05:00
mike cullerton
6da23dc854 Clean up error message in else clause in test_spec 2022-03-01 14:58:53 -05:00
alicia pritchett
e416873916 Fixes #650 - Approvals not Clearing When Completed 2022-03-01 14:45:18 -05:00
Dan Funk
896ce8934b
Merge pull request #477 from sartography/bug/645_document_updated
An optimization prevented us from picking up a change to the document…
2022-02-28 15:57:13 -05:00
mike cullerton
ef4334b1c8 Added a catch for generic exceptions, so the finally clause always executes.
Also, raise if there is an ApiError, because some tests depend on it.
2022-02-28 14:01:19 -05:00
Dan
51a14311eb An optimization prevented us from picking up a change to the documents associated with a study. This assures that even if scripts run side by side, the document list will get updated, but only on a change. So it's still performant. Also added a sligthly better error message to the workflow service. 2022-02-28 12:17:21 -05:00
alicia pritchett
5dfb3153d1 Fixes #639 - Pending Approvals Panel No longer displaying 2022-02-27 12:21:38 -05:00
Dan
ebbb04a1af Fixing failing validation. 2022-02-27 10:00:44 -05:00
mike cullerton
f2c97f80d5 Merge branch 'dev' into feature/delete-variable-script-584
# Conflicts:
#	Pipfile.lock
2022-02-25 15:54:34 -05:00
Dan
3944d00e88 Removing an unused / rogue variable.
Adding a logger warning for very large workflow json data.
2022-02-25 09:59:41 -05:00
Dan
e61ca471db remove all the @timeit from method calls. 2022-02-24 21:06:22 -05:00
Dan
dde8873c9e 1. defer the loading of the bpmn_json when loading the workflow model. It can be stupidly larger. (see models/workflow.py)
2. Shave a little more time off the reset by not re-creating the whole WorkflowProcessor

cleaning up all the firsttime/sincetime statements.
2022-02-24 20:56:57 -05:00
Dan
3442655bd1 Performance Improvements:
1. Avoid ever re-generating the list of scripts that can be used in a script task.  Terribly expensive as we call eval constantly, and it never ever changes once the app starts. (see script.py changes, and comments)
2. Cache the DocumentStatus list in the flask session, so we calculate it at most once per API Call.  It's at least .25 seconds per call.  (see study_sevice)
3. We called UserFileService.get_files_for_study (which runs a db query EVERY time) for every possible document type.  Now we run the query once (study service line 321)
4. When returning a workflow, we looped through every single task in that workflow's navigation, and called the expensive spiff_task_to_api_task just to figure out it's proper display name. We run a much faster and more efficient method to calculate the display name naow (see workflow_service on lie 680, and 799)
5. A hellton of @timeit and sincetime() calls, that I want to leave in, to help debug any slowness on production.
2022-02-24 14:25:42 -05:00
Dan Funk
33dc1f0868
Merge pull request #465 from sartography/bug/628_jinja_template_errors
fix to assure we produce a usable error message
2022-02-24 08:50:41 -05:00
Dan Funk
e8617038ab
Merge pull request #461 from sartography/bug/missing-executabe-option-601
Bug/missing executabe option #601
2022-02-24 08:46:46 -05:00
Dan
23a43c0472 fix to assure we produce a usable error message 2022-02-23 11:53:24 -05:00
alicia pritchett
095856d3c7 Fixes a bug so that you can reference later fields (and they'll validate 2022-02-22 10:18:09 -05:00
Dan
65ffc37787 fixing a bug in Spiff that was preventing our tests from passing. 2022-02-21 14:30:36 -05:00
mike cullerton
a830657ebd raise ApiError when isExecutable tag is missing.
Unsure how this would actually happen, since it should get set to False if box is unchecked.
2022-02-21 10:17:01 -05:00
Dan
24f33ec9c9 Merge branch 'chore/variables-in-forms-550' of github.com:sartography/cr-connect-workflow into chore/variables-in-forms-550 2022-02-21 09:57:19 -05:00
alicia pritchett
bb3d3a5907 Merge remote-tracking branch 'origin/chore/variables-in-forms-550' into chore/variables-in-forms-550 2022-02-21 08:56:11 -05:00
Dan
06b9b653b2 don't overwrite the field.label during an eval. It should remain as it is, just assure that it /can/ be evaluated. 2022-02-19 17:43:12 -05:00
Dan
4f32cf753c Merge branch 'chore/variables-in-forms-550' of github.com:sartography/cr-connect-workflow into chore/variables-in-forms-550 2022-02-18 17:20:10 -05:00
Dan
c3e52f960b Minor stuff to help digging into validation of current workflows. 2022-02-18 17:20:04 -05:00
Dan
a7f591d2ac Merge branch 'dev' into chore/variables-in-forms-550 2022-02-18 17:19:01 -05:00
alicia pritchett
3b48435411 Merge branch 'master' into chore/variables-in-forms-550 2022-02-18 13:23:33 -05:00