263 Commits

Author SHA1 Message Date
d152efe084
Refactor imports and remove redundant type strings
This commit refactors the usage of \DateTimeImmutable to ensure consistent namespacing and removes unnecessary string type declarations from constants in CancelStaleWorkflowCronJob. These changes improve code readability and maintainability.
2024-09-09 14:58:19 +02:00
b97eabf0d2
Get workflowComponent directly from registry 2024-09-09 10:46:35 +02:00
2e69d2df90
Adjust test to work with actual workflow + minor fix of handler logic 2024-09-09 10:46:33 +02:00
cb446edd18
Suffix message class with 'Message' and add check on workflow to assert no transitions were applied since message placed in queue 2024-09-09 10:40:42 +02:00
5d84e997c1
Php cs fixes 2024-09-09 10:40:42 +02:00
35199b6993
Create test for CancelStaleWorkflowHandler: wip state 2024-09-09 10:40:42 +02:00
dab68fb409
Add CancelStaleWorkflowCronJobTest 2024-09-09 10:40:41 +02:00
49ad25b4c8
Refactor WorkflowOnHoldController and improve tests
Refactored WorkflowOnHoldController to remove dependencies and improve redirect handling. Updated test cases to use PHPUnit instead of KernelTestCase and mock proper dependencies. Added relationship handling in EntityWorkflowStep to manage EntityWorkflowStepHold instances accurately.
2024-09-06 14:02:11 +02:00
e8f09b507f
Fix cs after php-cs-fixer upgrade, fix phpstan and rector errors 2024-09-05 18:00:37 +02:00
8c4f342ca1
Correct instantiation of controller within test 2024-09-05 17:19:28 +02:00
745a29f742
Adjust logic for removing the hold on a workflow only by user who owns the hold and when a transition is applied on the workflow 2024-09-05 17:19:27 +02:00
41ffc470a0
Adjust test to check creation of onHold if user is allowed to apply a transition 2024-09-05 17:19:27 +02:00
8c5e94e295
Work on test for workflowOnHold controller 2024-09-05 17:19:25 +02:00
9c8a84cdbd
Add test for WorkflowOnHoldControllerTest 2024-09-05 17:19:24 +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
bb848746d5
Merge branch 'upgrade-sf5' into signature-app-master 2024-08-28 13:23:12 +02:00
3738c110f8
Add missing import 2024-08-28 12:38:11 +02:00
6b4e1ed2d3
PHP CS Fixer updated (3.59.3 -> v3.63.1) 2024-08-28 12:06:08 +02:00
db94af0958
Add support for user signatures in workflow transitions
This update introduces the ability to specify user signatures in workflow transitions. It allows a nullable user to be declared that may be requested to apply a signature. The code now handles the use-case of signing a transition by a user in addition to previous functionality of having it signed by a "Person" entity. Corresponding tests are also updated to validate this new feature.
2024-07-10 12:47:02 +02:00
7f3de62b2c
Move the metadata on each workflow transition from the event subscriber to the entity EntityWorkflow::setStep method
The main update is in the setStep method of EntityWorkflow, where parameters are added to capture the transition details. These include the exact transition, the user who made the transition and the time of transition.

The WorkflowController extracts this information and put it into the transition's context. The MarkingStore transfer it to the EntityWorkflow::setStep method, and all metadata are recorded within the entities themselve.
2024-07-10 10:40:17 +02:00
a309cc0774
Refactor workflow classes and forms
- the workflow controller add a context to each transition;
- the state of the entity workflow is applyied using a dedicated marking store
- the method EntityWorkflow::step use the context to associate the new step with the future destination user, cc users and email. This makes the step consistent at every step.
- this allow to remove some logic which was processed in eventSubscribers,
- as counterpart, each workflow must specify a dedicated marking_store:

```yaml
framework:
    workflows:
        vendee_internal:
            # ...
            marking_store:
                service: Chill\MainBundle\Workflow\EntityWorkflowMarkingStore
```
2024-07-02 08:30:28 +02:00
3db4fff80d
Add signature functionality to workflow entities
Created new files to add signature functionality to the workflow entities, including signature state enums and signature metadata. Added these changes to the migration script as well. Updated EntityWorkflowStep to include a collection for signatures.
2024-07-01 14:50:03 +02:00
916724c0c5
Merge branch 'master' into upgrade-sf5 2024-06-24 10:46:21 +02:00
0bfb3de465
fix cs 2024-06-11 16:58:33 +02:00
61877e0157
Refactor UserRenderTest and remove unused methods
The UserRenderTest class has been refactored significantly. Redundant methods related to the booting kernel of Symfony have been removed. The approach of mocking objects has been changed, swapping from traditional mocking to prophecy mocking.
2024-06-07 13:06:11 +02:00
c9e13be736 pipeline fixes for phpstan, cs-fixer, rector 2024-04-16 20:16:45 +02:00
b9b342fe44 Set isActive property for userjob 2024-04-16 20:09:00 +02:00
0bc9fff825 test still failing with error saying column phonenumber of relation users does not exist 2024-04-16 12:01:40 +02:00
4e0d8e4def fix userNormalizerTest by adding clock in the construct of UserNormalizer 2024-04-16 12:01:40 +02:00
addc623add php style fixer 2024-04-16 12:01:37 +02:00
1b96deb4ee try to fix userRenderTest: mock not working 2024-04-16 11:55:54 +02:00
835409cb94 work on userRenderTest 2024-04-16 11:55:54 +02:00
8d58805abd work on user render test 2024-04-16 11:55:54 +02:00
c3a799cb7d work on test logic 2024-04-16 11:55:54 +02:00
d91b1a70bf work on userRender test 2024-04-16 11:52:58 +02:00
29d53c53a4
fixup! Fix configuration and usage of password hasher 2024-04-08 13:45:37 +02:00
8700352cf8
Fix configuration and usage of password hasher 2024-04-08 13:21:34 +02:00
5be85a4fc6
Refactored code to use PHP8 attributes instead of annotations
In this change, Doctrine and validation annotations have been replaced with PHP8 Attributes. The Rector tool has been configured with a list of annotations to convert to attributes. As a consequence, the PHPStan's rules have been updated to reflect these changes. The PHP8's nullable operator (?) has been added where required, and comments in field declaration have been replaced with #[Attribute] syntax.
2024-04-08 12:11:29 +02:00
72016e1a21
Apply rector rules: add annotation for doctrine mapping 2024-04-05 00:01:30 +02:00
579bd829f8
Apply rector rules: symfony up to 54 2024-04-04 23:30:25 +02:00
553fb271e4
fix container operations within tests 2024-04-04 22:26:42 +02:00
931c69eee4
Merge remote-tracking branch 'origin/master' into upgrade-sf5 2024-04-04 18:45:01 +02:00
d29415317b Allow users to display news on homepage (+ configuring a dashboard homepage) 2024-03-07 21:08:00 +00:00
1d636f5e9e
Fix deprecations and code style issues 2024-03-07 15:26:58 +01:00
0081146a78
Change non-static class-level variables and methods to static in tests's data providers
The update modifies several test classes within the "chill-project" to change non-static class-level variables and methods to static ones. This change has been made to improve readability, performance, and to eliminate unnecessary instantiation of class objects in test scenarios. Also, flush and clear actions on the entity manager are moved to individual data providers.
2024-02-19 15:38:28 +01:00
f251e6f100
upgrade phpunit: make data provider static 2024-02-14 12:28:14 +01:00
510023d630
fix cs 2024-02-13 21:04:09 +01:00
2ddfd56401
fix phpstan and rector errors, fix path for rector rules 2024-02-13 19:12:14 +01:00
f889d67e94
fixes after merge of master into upgrade-sf4 2024-02-12 22:31:16 +01:00