116 Commits

Author SHA1 Message Date
c1e449f48e
Implements StoredObjectManager for local storage 2025-01-09 15:25:41 +01:00
1f6de3cb11
Implement TempUrlLocalStorageGenerator and its tests
Added the full implementation for TempUrlLocalStorageGenerator, including methods to generate signed URLs and POST requests with expiration and signature logic. Introduced corresponding unit tests to validate functionality using mocked dependencies.
2025-01-09 15:25:40 +01:00
e25c1e1816
Refactor object storage to separate local storage and openstack storage 2025-01-09 15:25:38 +01:00
4933d2251c
fix tests about PdfSignedMessageHandler.php 2024-12-16 16:50:07 +01:00
03fe9a6d86
Update Signature App.vue to use a converted pdf
Introduced a new helper ts function to download documents as PDFs and integrated with the existing workflow. Enhanced `PDFSignatureZoneAvailable` to implement `LocaleAwareInterface` for better locale management and added PDF conversion handling for non-PDF documents. Updated App.vue to use the new PDF download method.
2024-11-15 14:27:36 +01:00
a312b45777
Remove ConvertToPdfBeforeSignatureStepEventSubscriber
This commit deletes the ConvertToPdfBeforeSignatureStepEventSubscriber.php file from the workflow directory. .
2024-11-15 14:27:35 +01:00
829fb669fe
Update Workflow Permission Handling
Refactor the `WorkflowRelatedEntityPermissionHelper` to enhance permission checks for workflow-related entities. This includes updating methods, improving test coverage, and incorporating `MockClock` for date-sensitive operations.
2024-11-14 12:07:21 +01:00
c99dda0126
Rename WorkflowStoredObjectPermissionHelper to WorkflowRelatedEntityPermissionHelper and create method isAllowedByWorkflow
Refactored class names and namespaces from WorkflowStoredObjectPermissionHelper to WorkflowRelatedEntityPermissionHelper across various modules. Updated associated tests and voter classes to reflect the changes, ensuring consistency and clarity in the codebase.
2024-11-13 22:41:23 +01:00
64d91e2afe
Allow users to edit a document if they were added to the previous step of a workflow.
OP#826 Workflow - les utilisateurs des étapes précédentes sur un workflow doivent aussi avoir la main sur les étapes en cours du workflow (Vendee/accent-suivi-developpement/1289)

https://champs-libres.openproject.com/work_packages/826
2024-11-08 20:34:45 +01:00
261bc88b5e
Add suggested persons and third parties methods
Introduced getSuggestedPersons and getSuggestedThirdParties methods across various WorkflowHandlers. These methods integrate with ProvidePersonsAssociated and ProvideThirdPartiesAssociated services to fetch related entities, enhancing the workflow handling capabilities.
2024-10-23 11:41:19 +02:00
c877076429
Add and update test handlers for suggested users retrieval
Introduced new test files for workflow handlers and adjusted existing `getSuggestedUsers` methods to handle related entity checks and duplicates removal. Also, modified repos to align with test dependencies.
2024-10-22 23:24:10 +02:00
fde74b190d
Add mock for TempUrlGeneratorInterface in StoredObjectTypeTest
Updated the StoredObjectNormalizer initialization to include a mock for TempUrlGeneratorInterface. This ensures tests handle all dependencies of StoredObjectNormalizer correctly.
2024-10-21 17:45:12 +02:00
ff5640e193
Allow to edit storedObject associated with workflow which are canceled
OP#753
2024-10-21 17:41:59 +02:00
9d722110a6
fixup! Add direct download link feature with new button implementation 2024-10-09 21:39:55 +02:00
118ae291e2
Add direct download link feature with new button implementation
Introduce a new feature that allows for direct download links by integrating TempUrlGeneratorInterface. Added new DOWNLOAD_LINK_ONLY group and corresponding logic to generate download links in StoredObjectNormalizer. Implement a new Twig filter and Vue component for rendering the download button. Updated tests to cover the new functionality.
2024-10-08 15:15:38 +02:00
9a9d14eb5a
Enhance behaviour of duplicating storedObject to keep only the last "kept before conversion" version if any
Enhance the duplication service to selectively handle versions tagged with "KEEP_BEFORE_CONVERSION". Modify StoredObject to support retrieval and checking of such versions. Add relevant test cases to validate this behavior.
2024-10-04 13:41:18 +02:00
611a968162
Duplicate and accompanying course evaluation document
- create a service which duplicate the accompanying course work evaluation document
- create a controller to duplicate this document
- update the vuejs component to use this duplicate action
2024-09-23 16:32:47 +02:00
4b65ec9b54
Create a duplicator service for accompanying course document 2024-09-23 14:32:40 +02:00
5f67a7aadc
Create a service to duplicate a storedObject into another one 2024-09-19 17:48:03 +02:00
77d06d756a
Block document editing if any signature associated to a workflow is signed
Add a check in `WorkflowStoredObjectPermissionHelper` to block document editing once any signature is signed. Accompanied by new tests to verify this behavior.
2024-09-19 16:18:16 +02:00
5906171041
Add restoration functionality for stored object versions
Introduce a service to restore stored object versions along with relevant tests and an API endpoint. This includes database migrations for version relationships, enhancing stored object version tracking.
2024-09-19 13:42:23 +02:00
6a0e26ec31
Add point-in-time normalization to stored object versions
Introduced a new normalizer for StoredObjectPointInTime and updated the StoredObjectVersionNormalizer to include point-in-time data when specified in the context. Added corresponding test cases to ensure the new normalization logic works correctly.
2024-09-19 13:42:19 +02:00
943a42cd38
Add StoredObjectVersionApiController and corresponding test
Added a new class StoredObjectVersionApiController in ChillDocGeneratorBundle which lists versions of a specified stored object. Corresponding unit test has been added as well. Made modifications in `StoredObject.php` to make the versions selectable. Also updated the API specifications to include a new GET route for retrieving versions.
2024-09-19 13:42:18 +02:00
nobohan
1197a46f5f
Refactor PDF signature handling and add signature state changer
Simplified PdfSignedMessageHandler by delegating signature state changes to a new SignatureStepStateChanger class. Added utility method to EntityWorkflowStepSignature for checking pending signatures and created new test cases for the SignatureStepStateChanger.
2024-09-10 21:27:55 +02:00
941444b7d5
Add event subscriber to convert docs to PDF before signature
Introduce ConvertToPdfBeforeSignatureStepEventSubscriber to convert documents to PDF when reaching a signature step in the workflow. Includes tests to ensure the conversion process only triggers when necessary.
2024-09-10 17:48:32 +02:00
a60ea0e066
Add StoredObjectToPdfConverter service and unit tests
Introduced the StoredObjectToPdfConverter service to handle conversion of stored objects to PDF format. Added unit tests to ensure proper functionality, including versioning and exception handling.
2024-09-10 17:48:32 +02:00
669b967899
Enhance object version removal to exclude point-in-time versions
Add a check to exclude versions associated with points in time before deleting old object versions. This ensures that such versions are not mistakenly removed, providing greater data integrity. Updated tests and repository methods accordingly.
2024-09-10 17:48:31 +02:00
8ea87053f0
fix some tests 2024-09-05 16:47:45 +02:00
3c9ee41b3b
fix some tests 2024-09-04 18:30:18 +02:00
3e5a558cdf
Add exists method to RemoveOldVersionMessageHandlerTest
Introduce the exists method to handle checks for StoredObject or StoredObjectVersion in test cases. This modification ensures consistency and proper exception handling in the testing framework.
2024-09-04 15:18:07 +02:00
0e6b7d76a4
Add exists method to WebdavControllerTest
Included a new method `exists` to handle existence checks for StoredObject or StoredObjectVersion within WebdavControllerTest. This method currently always returns true, ensuring initial compatibility and providing a foundation for future logic refinements.
2024-09-04 15:10:18 +02:00
313fb9ffdf
PHP CS Fixer updated (3.63.1 -> v3.64.0) 2024-09-04 14:38:56 +02:00
e17203ca3a
Add PDF signature zone availability checks
Introduce `PDFSignatureZoneAvailable` service to check available PDF signature zones. Updated `WorkflowAddSignatureController` to use the new service. Added unit tests to verify the correctness of the functionality.
2024-09-04 13:55:08 +02:00
c6a6d76790
Add signatureZoneIndex to PdfSignedMessage and related classes
Included signatureZoneIndex for PdfSignedMessage in class definitions, handlers, and serializers to support signature zones. Updated test cases to reflect this new property, ensuring robust validation for handling and serialization.
2024-09-03 15:44:25 +02:00
3d49c959e0
Update DropFile to handle object versioning 2024-09-03 15:42:04 +02:00
b6edbb3eed
Refactor StoredObject normalization handling
Deprecate and remove specific context constants from StoredObjectNormalizer. Update object properties for better clarity and add permissions handling. Introduce related tests and adjust other files relying on the old context constants.
2024-08-28 23:19:24 +02:00
00cc3b7806
Refactor backend for getting signed url 2024-08-28 18:00:20 +02:00
7ab52ff09e
Add stored object creation endpoint
Introduced a new API endpoint to create stored objects with access control for roles 'ROLE_ADMIN' and 'ROLE_USER'. Updated corresponding routes, removed unused dependencies, and added unit tests to ensure functionality.
2024-08-28 15:34:42 +02:00
2d82c1e105
rector fixes after rector's upgrade 2024-08-28 15:34:13 +02:00
0db2652f08
Add cron job for removing expired stored objects
Introduced `RemoveExpiredStoredObjectCronJob` to automate the deletion of expired stored objects every 7 days. Enhanced associated tests and updated relevant interfaces and classes to support the new cron job functionality.
2024-08-28 14:06:11 +02:00
c38f7c1179
Add functionality to delete old versions of documents
This commit introduces a feature that automatically deletes old versions of StoredObjects in the Chill application. A cron job, "RemoveOldVersionCronJob", has been implemented to delete versions older than 90 days. A message handler, "RemoveOldVersionMessageHandler", has been added to handle deletion requests. Furthermore, unit tests for the new functionality have been provided.
2024-08-28 14:06:10 +02:00
67d24cb951
Use "createdAt" from database to compute the last modified datetime in StoredObjectManager
The code has been updated to use 'createdAt' from StoredObjectVersion entity in StoredObjectManager. Specifically, if a 'createdAt' datetime is set, we return that datetime. This change also includes corresponding test cases to validate the functionality. The situation helps deal with files created before July 2024.
2024-08-28 14:06:09 +02:00
1b16d4fe3b
Flush entities when storing document using webdav / put operation
The WebdavController has been updated to flush the EntityManager after writing a document, while its tests have been adjusted correspondingly. A new test for the document PUT operation has also been added, which ensures the EntityManager flushes and the StoredObjectManager writes to this document.
2024-08-28 14:06:08 +02:00
ce5659219a
Fix test 2024-08-28 14:06:07 +02:00
5fefe09a39
Fix test 2024-08-28 14:06:07 +02:00
3978ea9a47
Update StoredObjectManager to handle versioned StoredObjects
The StoredObjectManager and related test cases have been updated to handle versioned StoredObjects, allowing the same methods to work with either a StoredObject or its versions. The changes also involve return information for the write method and enhancements to the write test procedure. This provides more functionality and flexibility for handling StoredObjects in different versions.
2024-08-28 14:06:06 +02:00
2b7ea4178b
Add versioning to stored objects
This update introduces a versioning system to the stored objects in the ChillDocStoreBundle. The 'StoredObject' entity now includes several new methods, and maintains a collection of 'StoredObjectVersion' instances. Each time a 'StoredObject' is modified, a new version instance is created and added to the collection, ensuring a history of changes. Migration file for the addition of new database column included. Corresponding tests are also updated.
2024-08-28 14:06:06 +02:00
8a374864fa
update code style after upgrade rector and phpstan 2024-08-28 14:03:26 +02:00
564813ef3d
Change attribute in test and add new test method
Updated an existing test to use the 'EDIT' attribute instead of 'SEE' in AbstractStoredObjectVoterTest.php. Added a new test method to check the 'SEE' attribute when the workflow is allowed, ensuring proper access validation.
2024-07-26 00:34:11 +02:00
5fed42a623
Fix decision logic in AbstractStoredObjectVoter
Amend the condition to ensure proper attribute validation before checking workflow association. This prevents unintended execution paths and potential exceptions when the workflow document service is not provided.
2024-07-25 23:34:36 +02:00