Commit Graph

74 Commits

Author SHA1 Message Date
mike cullerton ce1af73d6e Remove unused import 2021-09-07 15:44:15 -04:00
mike cullerton 21987cf1f1 Remove old root definition.
We now use the 2019 spec
2021-09-07 15:38:53 -04:00
mike cullerton e630aeb94e Add DMNDI section.
Without it, the configurator could not parse the XML
2021-09-07 14:27:15 -04:00
mike cullerton 6e7b549136 Change root element to use 2019 spec 2021-09-07 12:11:27 -04:00
mike cullerton 93e8015ddd Read the spreadsheet data sent from the front end. This allows pandas to see it as a file type object.
Fixed bug where column_count wouldn't get set if there isn't an Annotation column
2021-09-03 10:37:06 -04:00
mike cullerton 4fa68bd4c0 Move business logic to FileService 2021-09-02 09:52:58 -04:00
mike cullerton 506157d58a Add task_spec_name to FileService.add_workflow_file, and script that calls it. 2021-08-26 10:40:47 -04:00
Leashys 032aad9bc4 Fixes #383 - Timestamp on files is UTC?
also this includes the shield test thing for the boolean_type property whoopsie
2021-08-17 13:04:24 -04:00
Kelly McDonald 960d302c03 Finish #367 - Make sure that we only use a primary_id if it is in the workflow that we are currently working on - otherwise it is a library and might have its own primary id. 2021-08-10 09:15:38 -04:00
mike cullerton b0cf74fa3d Merge branch 'dev' into add-by-user-61
# Conflicts:
#	tests/files/test_files_api.py
2021-07-07 10:46:50 -04:00
mike cullerton 894377a607 Add user_uid to FileDataModel calls 2021-07-06 17:09:00 -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
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 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 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
Kelly McDonald a5d67bb245 337 partial fix
if the user calls the file_data_set function for a valid file with the key 'irb_code' and a value of a valid IRB document code, then we should set the irb code on the file.
2021-05-27 12:24:30 -04:00
Dan 5a79b80f32 fixes #322, do not error out deleting files that have assocaited data stores, just remove the data store. 2021-05-05 20:21:33 -04:00
Dan Funk 34759a2f3d
Merge branch 'dev' into feature/performance-refactor 2021-05-04 11:30:13 -04:00
Dan a719cf4bf9 When retrieving the study, only update the status of underlying workflows if specifically requested.
Record the size of a file in the database for quick access (this helps with a frontend refactor, so it isn't downloading the file just to see it's size)
Cleaning up the timing/performance metric reporting to make it easier to read.
Fixing a bug that prevented non-admins for getting the document-directory
2021-04-30 11:55:12 -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
Kelly McDonald e2197ddab9 Changes to support the frontend data pane
fixes #277 and requires frontend branch 277-document-pane
2021-04-20 08:12:27 -04:00
Kelly McDonald f1ca44a0e1 Add primitive cache on the fileservice is_review, halves the time of loading the list on the primary dashboard 2021-03-23 10:17:48 -04:00
Kelly McDonald da0af14724 Changes to enable front-end changes
Added a human readable name to created user

added last updated task time and name,

added is_review on the workflow which is triggered by a swimlane with a name present.

Notably - it does NOT update or change any of the performance concerns that we were having with this.
2021-02-10 11:58:19 -05:00
mike cullerton c9a4a9685f Users cannot upload a workflow_spec_file that already exists. We raise an error that is displayed on the fron end. 2021-01-04 15:47:45 -05:00
Dan 6cfce839c1 Validation now assures that we won't encounter errors when generating navigation lists.
Fixing workflow sync paths that were incorrect.
Repairing a suddenly failing test in files, that just don't make no sense.
Bumping spiffworkflow that contains a fix for issue #155
2020-12-28 17:33:38 -05:00
Dan fd4b881416 upgrading the pip libraries. 2020-12-14 10:30:10 -05:00
Kelly McDonald 8b23cdc05c commit changes before switching branches 2020-10-09 08:46:14 -04:00
Carlos Lopez 2bd906e96d Update github routines to use branches 2020-08-14 11:04:22 -06:00
Aaron Louie c8881cbf91 Merge branch 'dev' into feature/approvals_dashboard_prototype 2020-07-31 12:17:22 -04:00
Dan Funk 300026cbc8 Expanding the task events endpoint to accept workflow and study ids as additional filters.
Removing events from the study endpoint, too noisy.
2020-07-28 10:16:48 -04:00
Carlos Lopez 73400ed6c7 Adding proper tests for files publishing 2020-07-17 16:59:25 -06:00
Dan Funk 150117587e Merge branch 'dev' into feature/parallel_multiinstance_tasks 2020-06-25 23:20:38 -04:00
Aaron Louie c3ceda4c2f Replaces xml.etree with lxml.etree 2020-06-25 14:02:16 -04:00
Carlos Lopez e9e805b2c9 Storing emails in database 2020-06-09 22:57:56 -06:00
Dan Funk fed6e86f92 Trying to fix LDAP issues on production. Changing LDAP to static only methods, caching the connection and calling bind before all connection requests.
Also assuring we don't load the documents.xls file over and over again.
2020-06-04 14:59:36 -04:00
Dan Funk bbcbfef1ba Fixing the migrations so I don't break the universe. 2020-06-04 10:09:36 -04:00
Dan Funk 1324533865 Some additional cleanup - when a file is "archived" it is no longer returned for any endpoints about files, but it
is directly accessible via id, in the event some request is made for it at a later date.
2020-06-04 09:49:42 -04:00
Dan Funk 217ecfc911 When you can't delete a file, mark it as archived. Don't include archived files in new approval requests. 2020-06-03 17:34:27 -04:00
Dan Funk e102214809 minor cleanup of error codes. 2020-06-03 15:03:22 -04:00
Dan Funk 9c7de39b09 This adds additional file data details to the study model as well. 2020-05-31 21:15:40 -04:00
Dan Funk 860c475b29 Fill out repeating sections during validation process.
Also, when returning error messages, attempt to include the task data for the task that caused the error.
Also, when attempting to delete any file, respond with an API error explaining the issue, and log the details.
2020-05-30 15:37:04 -04:00
Dan Funk 11413838a7 Faster lookup fields. We were parsing the spec each time to get details about how to search. We're just grabbing the workflow id and task id now and building that straight into the full text search index for faster lookups. Should be peppy.
Another speed improvement - data in the FileDataModel is deferred, and not queried until it is specifically used, as the new data structures need to use this model frequently.
2020-05-29 01:39:39 -04:00
Dan Funk aea78de066 Merge remote-tracking branch 'origin/dev' into feature/file_refactor_part2 2020-05-28 20:06:32 -04:00
Dan Funk dba41f4759 Ludicrously stupid launch in a refactor of the way all files work in the system at a time where I crave sleep and peace above all other things.
Added a File class, that we wrap around the FileModel so the api endpoints don't change, but File no longer holds refences to versions or dates of the file_data model, we
figure this out based on a clean database structure.

The ApprovalFile is directly related to the file_data_model - so no chance that a reviewer would review the incorrect version of a file.py

Noticed that our FileType enum called "bpmn" "bpmm", hope this doesn't screw someone up.

Workflows are directly related to the data_models that create the workflow spec it needs.  So the files should always be there.  There are no more hashes, and thus no more hash errors where it can't find the files to rebuild the workflow.py

Not much to report here, other than I broke every single test in the system at one point.  So I'm super concerned about this, and will be testing it a lot before creating the pull request.
2020-05-28 20:03:50 -04:00
Dan Funk cd7f67ab48 A major refactor of how we search and store files, as there was a lot of confusing bits in here.
From an API point of view you can do the following (and only the following)

/files?workflow_spec_id=x
* You can find all files associated with a workflow_spec_id, and add a file with a workflow_spec_id
/files?workflow_id=x
* You can find all files associated with a workflow_id, and add a file that is directly associated with the workflow
/files?workflow_id=x&form_field_key=y
* You can find all files associated with a form element on a running workflow, and add a new file.
   Note: you can add multiple files to the same form_field_key, IF they have different file names. If the same name, the original file is archived,
   and the new file takes its place.

The study endpoints always return a list of the file metadata associated with the study.  Removed /studies-files, but there is an
endpoint called

/studies/all  - that returns all the studies in the system, and does include their files.

On a deeper level:
 The File model no longer contains:
  - study_id,
  - task_id,
  - form_field_key

Instead, if the file is associated with workflow - then that is the one way it is connected to the study, and we use this relationship to find files for a study.
A file is never associated with a task_id, as these change when the workflow is reloaded.
The form_field_key must match the irb_doc_code, so when requesting files for a form field, we just look up the irb_doc_code.
2020-05-28 08:27:26 -04:00
Aaron Louie 97cdbfce94 Deletes extra line break 2020-05-27 23:48:48 -04: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
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 58189285ad Cleans up 2020-05-20 00:12:48 -04:00