2683 Commits

Author SHA1 Message Date
83121c2a83
Implement signature cancellation feature
Added functionality to cancel signatures in workflow, including controller, view, and tests. Updated translations and adjusted templates to support and display cancellation actions.
2024-09-25 10:58:53 +02:00
5a467ae38d
Add ChillUrlGenerator and ChillUrlGeneratorInterface
Introduced a new interface ChillUrlGeneratorInterface for URL generation with return path handling. Implemented this interface in the ChillUrlGenerator class, which uses Symfony components to manage URL generation and request information.
2024-09-25 10:58:15 +02:00
90c5b0341a
Handle null transitionPreviousBy in ListWorkflow.vue
Previously, the getPopContent method assumed transitionPreviousBy would always have a value, which led to errors when it was null. This update adds a conditional check to handle cases where transitionPreviousBy is null, ensuring the component renders correctly.
2024-09-24 14:36:01 +02:00
5a5d259d18
Add duplicate workflow prevention in MetadataExtractor
Integrate DuplicateEntityWorkflowFinder to prevent creating workflows for entities with existing opened or positive final workflows. Updated EntityWorkflowVoter to implement the same check before allowing creation. Removed unnecessary blank workflow parameter from Twig template.
2024-09-24 14:25:00 +02:00
758a14366e
Add OpenedEntityWorkflowHelper and tests
Implemented OpenedEntityWorkflowHelper to handle final state checks for EntityWorkflow. This includes methods to determine if a workflow has reached positive or negative final steps. Added corresponding unit tests to ensure proper functionality.
2024-09-24 14:25:00 +02:00
e91fce524e
Append workflow name in twig calls to workflow_metadata
Ensuring that the twig template works if there are more than one workflow available
2024-09-24 14:25:00 +02:00
7b06c80c2a Merge branch 'signature-app/wp-706-no-forward-unless-signed' into 'signature-app-master'
Block transition if there is a pending signature for the entityWorkflow

See merge request Chill-Projet/chill-bundles!736
2024-09-24 09:13:45 +00:00
cf2fe1bba7
Add guards and tests for entity workflow transitions
Introduced EntityWorkflowGuardUnsignedTransition to block transitions with pending signatures. Implemented a new center resolver and added comprehensive unit tests for verifying transition rules and permissions.
2024-09-24 11:08:22 +02:00
27df3b2c9b
Add support for ManagerAwareCenterResolverInterface
Introduce ManagerAwareCenterResolverInterface to ensure resolvers can reference their manager. Added a trait for implementing the interface and updated the CenterResolverManager to initialize resolvers correctly.
2024-09-24 10:58:01 +02:00
20e8b03588
Rewrite the Component PickWorkflow.vue into typescript 2024-09-23 14:32:59 +02:00
a8c5d1f660
Remove unused constructor parameter 2024-09-19 17:48:34 +02:00
d9b36533a2
Fix the query to find staled entity workflows
Add a test to check that the query still works
2024-09-19 12:31:46 +02:00
4d8de46ac9
Apply the voter to allow all transition on EntityWorkflowGuardTransition
This allow to effectively check that a user is allowed to apply all transitions on a workflow and, if yes, enable the given transition.
2024-09-16 14:47:00 +02:00
4696332a46
Create a voter for applying all transitions on all workflow's steps
This voter checks that the related entity's centers is reachable by the user.
2024-09-16 14:42:37 +02:00
0d54637d35
Add missing constructor argument in SignatureStepStateChangerTest 2024-09-16 13:19:14 +02:00
45323e9136
Merge remote-tracking branch 'origin/upgrade-sf5' into signature-app-master 2024-09-16 11:51:33 +02:00
9f1afb8423
Add access controls and permissions for signature steps
Implemented a Voter to enforce permissions on signature steps, ensuring only authorized users can sign steps. Updated relevant controllers and templates to reflect these permissions, and added corresponding tests to validate the changes.
2024-09-13 17:04:57 +02:00
911dfc2878
fix rector errors 2024-09-13 16:22:09 +02:00
8e984f2006
do not allow to sign if the signature is already applyied 2024-09-13 16:16:42 +02:00
nobohan
ae1459cf77 Signature: topbar UI 2024-09-12 14:22:58 +02:00
bc34d84d63
Merge remote-tracking branch 'origin/master' into upgrade-sf5 2024-09-12 13:36:50 +02:00
f0f651edea
update cs after php-cs-fixer upgrade 2024-09-12 12:02:33 +02:00
09563979a2
Refactor entity rendering with manager pattern
Introduce ChillEntityRenderManager to centralize entity rendering logic, reducing redundancy and improving code organization. Update dependencies and service configuration to support the new manager pattern, enhancing maintainability and flexibility of entity rendering in templates.
2024-09-12 11:18:35 +02:00
nobohan
d08212df46
Signature: add and process returnPath in the signature app 2024-09-12 09:46:14 +02:00
nobohan
4933238f3f
Signature - improve UI signature app 2024-09-12 09:46:14 +02:00
18af2ca70b
Handle null transitionBy and improve display logic
Added checks for null transitionBy cases in workflow templates to display "Automated transition" when applicable. Also improved conditional rendering for 'destUser' and 'ccUser' fields to avoid empty elements.
2024-09-11 21:52:34 +02:00
f1505a9d15
Add locale to workflow URLs in notification templates
This is required to send notification within a console command
2024-09-11 21:16:54 +02:00
4e588ed0e0
Add logging to SignatureStepStateChanger
Enhanced the SignatureStepStateChanger by integrating a LoggerInterface to provide detailed logging at key points in the state transition process. This includes informational messages when marking signatures or skipping transitions, as well as debug messages when determining the next steps.
2024-09-11 21:14:07 +02:00
70671dadac
Refactor workflow guard logic and add internal methods
Removed guard logic from EntityWorkflowTransitionEventSubscriber and created a new EntityWorkflowGuardTransition class for separation of concerns. Marked several setter methods in EntityWorkflowStepSignature as internal to guide proper usage. Added comprehensive tests to ensure the new guard logic functions correctly.
2024-09-11 21:13:58 +02:00
01c2848a83
Fix deprecated method in redis 2024-09-11 14:23:23 +02:00
d0ee381627
Upgrade of php-cs-fixer 2024-09-11 14:21:32 +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
1ddd283f26
Add signer type differentiation for workflows
Added a method to determine if the signer is a 'person' or 'user'. Updated the signature template to handle both types accordingly, ensuring the correct entity type is displayed in workflow signatures.
2024-09-10 17:48:32 +02:00
2fb46c65c2
Refactor CancelStaleWorkflowCronJobTest to simplify setup
Replaced KernelTestCase with TestCase to simplify test setup and removed dependency on the database connection. Added NullLogger to replace mocked LoggerInterface during testing. Updated method call in tests to correctly reference CancelStaleWorkflowMessage class.
2024-09-09 15:16:10 +02:00
f4356ac249
Add test for detecting stale workflows and enhance handler
Added a new test to check if workflows are stale in EntityWorkflowTest. Enhanced CancelStaleWorkflowHandler to handle stale workflows more accurately, including checking if workflows have transitioned recently. Updated EntityWorkflow entity to cascade remove workflow steps.

Refactor tests for handler, to avoid using $kernel during tests
2024-09-09 15:08:39 +02:00
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
ee9530d03f
More conditions to find staled workflows 2024-09-09 10:46:35 +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
6001bb6447
Add logger messages for possible debugging purposes 2024-09-09 10:40:41 +02:00
29fec50515
Add cronjob and repository method to find and cancel stale workflows every other day 2024-09-09 10:40:41 +02:00
34edb02cd0
Create message and handler for canceling stale workflows 2024-09-09 10:40:41 +02:00
860ae5cedf
Create CancelStaleWorkflow message and handler 2024-09-09 10:40:40 +02:00
bf056046ab
Fix cs 2024-09-06 14:40:25 +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
ad94310981
Refactor workflow hold functionality to avoid relying on database to perform some checks on "user holds entityworkflow"
Simplify the logic in handling workflow on hold status by moving related checks and operations to `EntityWorkflowStep` and `EntityWorkflow` entities. This includes implementing new methods to check if a step or workflow is held by a specific user and refactoring the controller actions to use these methods.
2024-09-05 20:46:29 +02:00