Adjusted `localizeString` method to accept a `label` parameter, ensuring proper localization of `user_job.label` and `main_scope.name`. Also made minor syntax adjustments to improve readability.
Updated French translations for "Participants" and improved pluralization handling in accompanying_period keys. Modified list_with_period.html.twig to dynamically translate "Participants" based on the count of current participations.
Expanded the installation guide to include required dependencies such as `jq`, `php`, `composer`, and `symfony-cli`, among others. Updated setup commands to include `-W` flag for better dependency handling and added a cache clear step to ensure proper asset compilation. These changes enhance clarity and streamline the installation process.
The @symfony/ux-translator package was removed from package.json as it is no longer required. This helps streamline the dependency list and reduce unnecessary maintenance overhead.
Resolve "Finish handling of internationalization in vuejs: handling translation of "translatable string""
Closes#379
See merge request Chill-Projet/chill-bundles!822
Updated the note display logic to use the `chill_markdown_to_html` filter for better formatting and presentation. This change ensures that Markdown syntax in notes is properly rendered as HTML.
Imported Bootstrap variables and updated styling to use responsive media breakpoints. Adjusted positioning of toggle buttons to ensure proper alignment on different screen sizes.
Replaces the deprecated `@input` event with the `@update:modelValue` event to ensure compatibility with Vue 3. This improves handling of two-way binding for the `v-model` directive.
Text editor: Add a toggle button to switch to simple text editor and add emoji and fullscreen to ckeditor toolbar
Closes#321
See merge request Chill-Projet/chill-bundles!827
Replaced CKEditor initialization with a Vue-based editor component. Introduced a toggle to switch between rich and simple editing modes, persisting the state in local storage. Updated CKEditor dependency to version 45.1.0.
Integrated Emoji, Mention (required for Emoji), and Fullscreen plugins into the CKEditor setup. Updated the toolbar to include respective buttons, enhancing functionality and user interaction.
Replaced multi-line template string with a cleaner single-line backtick template. This improves readability and maintains consistent formatting in the code.
This change removes the "not null" constraint on specific properties in the HouseholdComposition entity to allow null values. The adjustment addresses Issue #380 and ensures better flexibility without impacting the schema.
Introduced a consistent LOG_PREFIX to all log messages in CancelStaleWorkflowHandler. This ensures clearer contextual identification in logs and improves traceability when debugging or monitoring workflow actions.
Prevent the `RemoveOldVersionMessageHandler` from throwing errors when the stored object version is missing on disk. Introduced a check to log a notice instead of attempting deletion in such cases and added corresponding test coverage.
Fix graphical bug in document list with title overflowing the frame, and add new classes to display title and aside in flex-table (DX + Fix)
Closes#102 and #22
See merge request Chill-Projet/chill-bundles!815
Replaced the old 'item-col' structure with a 'item-two-col-grid' layout across multiple templates, improving consistency and responsiveness. Introduced CSS grid styles ensuring proper alignment and wrapping of titles and aside elements in different viewport sizes. This enhances the overall readability and maintainability of the views.
The interval for `AccompanyingPeriodStepChangeCronjob` was reduced from 24 hours to 23 hours and 45 minutes. This change guarantees at least one execution per day, addressing potential issues with timing overlaps.
Adjusted the parameter order and ensured consistent use of LOWER and UNACCENT functions in the LIKE clause. This resolves potential mismatches and improves query reliability for pattern matching.
Consolidated variable declarations into a single statement using const. This improves code readability and aligns with modern JavaScript best practices.
Replaced incorrect service definitions in AbstractCRUDController to ensure proper dependency injection. Specifically, fixed retrieval of the ManagerRegistry and Validator services to resolve CalendarRange save errors (Issue #362). No schema changes were introduced.
Resolve "Permettre de télécharger la liste des problématiques et la liste des actions en CSV"
Closes#343
See merge request Chill-Projet/chill-bundles!785
Resolve "Proposer en plus du référent de parcours les agents traitants saisis dans toutes les cations d'accompagnement du parcours"
Closes#349
See merge request Chill-Projet/chill-bundles!787
Implement an event subscriber to restore documents to their last kept version when a workflow transition ends in a non-positive final state. Includes corresponding unit tests and an unreleased feature change log entry.
Replaced array_map with a foreach loop for clarity and maintainability when extracting usernames from work referrers. This ensures better readability and aligns with coding standards.
The "filter" button was unnecessary in the document list within the "add attachment" modal and has been removed for simplicity. This change does not involve any schema modifications and resolves issue #358.
Resolve "Erreur 500 lorsqu'un utilisateur fusionne deux dossiers d'usagers, et que les deux dossiers usagers sélectionnés sont les mêmes"
Closes#350
See merge request Chill-Projet/chill-bundles!788
Resolve "Afficher les noms des usagers et l'entité concerné par l'entité notifiée dans la liste des notifications"
Closes#319
See merge request Chill-Projet/chill-bundles!767
Added detailed instructions to configure the Symfony Notifier component correctly, emphasizing proper setup for SMS providers like OVHcloud. Clarified removal of legacy configurations and included examples for both utilizing and replacing the added configuration.
Check existing framework configurations for `texter_transports` before applying default settings. This avoids overwriting or conflicting with pre-defined notifier configurations.
Added a condition to log an info message when the sent SMS lacks a message ID. Ensures clearer distinction between successful and incomplete SMS message logging.
Introduce the Symfony Notifier component for SMS messaging, supporting more providers. Fix referrer's scope and job aggregation issue (#348). Update numerous dependencies, including Babel and ESLint, for improved stability and functionality.
Included the Rector command in composer.json to streamline running Rector tasks. This addition ensures consistency and improves developer efficiency by integrating the tool directly into the project workflow.
Replaced outdated ShortMessage functionalities with Symfony's Notifier component for handling SMS messages. Deprecated legacy `ShortMessage` components and introduced a transition layer for existing OVH configurations. Updated dependencies and environment setup to support the new implementation.
Introduced a new event subscriber to log SMS sent events with details such as recipient and message IDs. This enhances monitoring and debugging of SMS delivery.
Switched the entire short message notification system to leverage Symfony's Notifier component and its TexterInterface with SmsMessage. This update simplifies the implementation, removes custom short message handling, and aligns with Symfony's standardized approach.
Integrated Symfony Notifier into the project by adding it to `composer.json` and creating a configuration file `notifier.yaml`. Updated `symfony.lock` to include the recipe configuration for Notifier. Minor documentation formatting issues were also fixed in `index.rst`.
Changed the cache path in `.php-cs-fixer.dist.php` to improve organization by moving it to the `var` directory. Added a new Composer script for running PHPStan to streamline static analysis workflows.
Updated attachment logic to use in-memory file contents and apply a `.gz` suffix to filenames. This ensures better file handling and resolves potential issues with attaching files directly from a path.
Introduce a service to handle the import of French addresses from the Base Adresse Nationale (BAN) dataset. Add a new console command `chill:main:address-ref-from-ban` to trigger the import by department numbers, with an option to send a report email for unmatched addresses.
Introduce a new guide detailing document storage options, including on-disk storage and cloud-based OpenStack integration. This document explains configuration steps, benefits, and limitations for both methods, and is now linked in the production installation index.
Introduces a new `use_driver` configuration option to specify the desired storage driver (`local_storage` or `openstack`). Ensures proper validation to handle multiple drivers and throws appropriate errors when configurations are inconsistent or missing. Refactors related logic to improve clarity and maintainability.
Changed the key size from 128 bytes to 32 bytes in the KeyGenerator service. This aligns with the expected algorithm requirements and ensures proper cryptographic behavior.
Implemented local storage-based file handling with TempUrl signature validation for upload and retrieval. Added validation checks for parameters like max file size/count, expiration, and signature integrity. Included unit tests for TempUrl signature validation and adjusted configuration for local storage.
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.
Allow addresses without postal code to be imported without failure, and add email reporting for unimported addresses in import commands
See merge request Chill-Projet/chill-bundles!780
Enhanced address import commands to optionally send a recap of unimported addresses via email. Updated import logic to handle cases where postal codes are missing, log issues, and generate compressed CSV reports with failed entries.
Replaced InvalidArgumentException with InvalidConfigurationException for widget service alias conflicts. This ensures the exception better reflects the configuration-related nature of the error.
Ensure atomicity when writing stored objects and marking signatures as signed by wrapping these operations in a database transaction. This reduces the risk of partial updates and improves data consistency.
Wrap signature state changes in transactions to prevent race conditions and ensure data integrity. Update controller and test class names to reflect broader state change capabilities. Enhance documentation with comments to clarify transaction requirements and procedure details for signature operations.
Resolve "[App de signature] Pouvoir voir le document en continu (toutes les pages ensemble)"
Closes#318
See merge request Chill-Projet/chill-bundles!761
Resolve "Lorsqu'on place manuellement une zone de signature avec le zoom actif, la zone n'est pas placée correctement sur la page"
Closes#317
See merge request Chill-Projet/chill-bundles!757
The custom join table setup for the 'documents' relation has been removed. This change relies on the default naming and configuration provided by Doctrine, simplifying the code and reducing potential configuration errors.
Removed the "not null" constraint from the person phone number field to allow for better flexibility in data storage, such as storing notes. This change rectifies issues in certain instances where the migration had incorrectly set the field to "not null". Adjustments include updating the database schema and modifying the entity definition to reflect this change.
Integrate Symfony Web Profiler Bundle for improved debugging and profiling in development environment. Updated composer configuration, created necessary configuration files for both packages and routes, and locked the bundle version in symfony.lock file.
Renamed the folder 'resource' to 'resources' to better reflect its contents. Updated the file path in the PHP CS Fixer configuration accordingly to ensure continued functionality.
Update admin client authentication method
Modified `getClientAuthenticatedAsAdmin` to accept an optional firewall parameter and updated dependency to use `chill_in_memory` user provider. This allows more flexible and configurable testing of client authentication against different firewalls.
[WIP] first import of automated recipes
[WIP] fix configuration file to be able to compile kernel and serve route
[WIP] first build of assets
[WIP] Continue working on configuration to load a page
[WIP] Reset the bin directory
[WIP] remove default migrations files
[WIP] fix configuration for running tests
[WIP] Installation instructions
Fix the default firewall in test login
[WIP] fix cs
[WIP] update gitlab-ci
[WIP] update gitlab-ci
[WIP] update gitlab ci
[WIP] fix config for running tests
[WIP] fix gitlab ci
[WIP] try tests/bootstrap php file from symfony bridge instead of phpunit recipe
remove kernel.php file
fix loading of entrypoint.json in test
[wip] increase memory limit for phpstan in test/ci
[WIP]: set the correct timezone directly within the phpunit.xml.dist file
[WIP]: fix security configuration
WIP: fix config for testing
Updated the French template for workflow transition notifications to include the workflow title. This ensures users have more context in the notification email.
Updated the French template for workflow transition notifications to include the workflow title. This ensures users have more context in the notification email.
Updated the breadcrumb macro's parameters to accept `entity_workflow` directly instead of a context object. This change affects the index, list, and macro_breadcrumb templates, ensuring consistent parameter usage and improving readability.
This avoid exploiting a bug which was solved in twig 3.15.0
Introduced `EntityWorkflowManager` to `NotificationOnTransition` to fetch and include the entity workflow title in notifications. Updated relevant tests to support the new functionality and verify the entity title retrieval process.
Add unique constraints to prevent person_document and accompanying_course document with the same object_id
Closes#326
See merge request Chill-Projet/chill-bundles!759
This change ensures `object_id` uniqueness within `person_document` and `accompanyingcourse_document` tables. It includes migration scripts and entity annotations to enforce these constraints. This helps maintain data integrity and consistency across the database.
Incorporated the workflow title into notification emails to provide more context to users. Updated the NotificationToUserGroupsOnTransition class and its tests to include the title from EntityWorkflowManager. Adjusted the French email templates to display the workflow title correctly.
This change removes the `Assert\Date` validation on the `deathDate` property in the `Person` entity. The adjustment allows for more flexible input by not strictly enforcing the date format, which can resolve issues where the date string validation was previously causing errors.
Lors de la procédure de signature, le document ne doit être converti qu'à partir du moment où la première signature est apposée
Closes#324
See merge request Chill-Projet/chill-bundles!758
Enhanced the `addConvertedVersion` method in `StoredObjectToPdfConverter` to optionally include converted content in the response. Updated `SignatureRequestController` to handle non-PDF documents by converting them to PDF before processing the signature request.
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.
The 'btn-sm' class was added to the download button in HistoryButtonListItem.vue to adjust its size. Additionally, a bug was fixed in DownloadButton.vue to correctly reference the 'type' property from 'atVersion'.
Permettre aux utilisateurs concerné par un workflow de modifier un document, même si, en dehors du workflow, ils ne possèdent pas de droits d'édition et de lecture sur ce document
Closes#323
See merge request Chill-Projet/chill-bundles!756
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.
This commit introduces logic to grant permissions based on workflow conditions in the `AbstractStoredObjectVoter`. It also includes a new test case to ensure the workflow-based permission check functions correctly.
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.
Integrated a new UserRender option 'SPLIT_LINE_BEFORE_CHARACTER' with a value of 30 in the SignatureRequestController. This enhances the rendering format for user details.
Introduce a new option to split lines in user job and scope render strings based on a specified character limit. Implement a corresponding test to verify the correct behavior of this feature.
Integrated a new UserRender option 'SPLIT_LINE_BEFORE_CHARACTER' with a value of 30 in the SignatureRequestController. This enhances the rendering format for user details.
Introduce a new option to split lines in user job and scope render strings based on a specified character limit. Implement a corresponding test to verify the correct behavior of this feature.
Refactored NotificationToUserGroupsOnTransition to utilize EntityManager for persisting EntityWorkflowStep. This ensures entities have generated IDs, leading to proper email notifications during workflow transitions.
Implemented a guard to prevent signatures on related entities that lack a stored object. It also includes corresponding tests and added translation for the error message in French.
The absolute url in the French version of the workflow notification content to user group has been updated. It now points to 'chill_main_workflow_grant_access_by_key' instead of 'chill_main_workflow_show'. This update improves the user experience by taking the user directly to the desired page.
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
- do not show the button if a zone is selected (to avoid to create two selected zones on the document);
- change the button while waiting for the user to create a new zone: this make visible the fact that the app is waiting for a user action
Added a check in the workflow-show page script to stop the execution if a transition is marked as finalized (`toFinal`). This ensures that transitions leading to final states are not processed further.
Modified the canvas element to conditionally apply a CSS class when adding a zone. This change ensures the cursor changes to 'copy' for visual feedback during the add operation.
Introduced a new validator `TransitionHasSignerIfSignature` to enforce that a signature transition must have a designated signer. Included related tests, updated DTO annotations, and added translations for new validation messages.
Replaced `const` with `let` for `zoomLevel` in `App.vue` to allow reassignment. This change ensures proper handling of dynamic zoom levels during document signature operations.
Introduced a new method to duplicate evaluation documents and forward return path URLs. Updated templates to include duplication buttons and adjusted routing for handling the duplication process.
Changed the type of the zoomLevel parameter from number to string and updated the assignment to parse the zoomLevel as a float. This ensures that the zoom functionality properly handles string inputs by converting them to numerical values.
Updated the translation key from 'workflow.signature_required_title' to 'workflow.signatures_title' in the workflow history view. This change ensures consistency and proper usage of the translation key across different parts of the application.
Ensure the canRun method in CancelStaleWorkflowCronJob returns true when the cron job execution is null. This change includes updating the corresponding test case to cover the new behavior.
Implemented a new Twig function `chill_path_force_return_path` to enforce a specific return path within the URL. Updated relevant template to utilize this new function for better control over URL routing and return path management.
OP#787
https://champs-libres.openproject.com/work_packages/787
Changed the Email field's 'required' option to false, allowing it to be optional. This adjustment aims to improve the usability and flexibility of the UserGroupType form.
Changed mountPdf function to accept an ArrayBuffer instead of a URL. This improves handling of documents by simplifying the data flow and eliminates the need for URL object creation.
Introduce `EntityWorkflowGuardSendExternalIfNoPublicView` class to prevent workflows from transitioning to an external send state if the entity lacks a public view. Included unit tests to verify functionality for entities both with and without public views.
Fix the triggering of the vent goToGenerateWorkflow when relatedentityId is not know in PickWorkflow vue component
See merge request Chill-Projet/chill-bundles!747
The component PickWorkflow emitted the event "goToGenerateWorkflow" when the normal behaviour is intercepted. But that event generated the link to create the workflow to pass it in the payload's event. That generation failed, causing the whole event to fail.
Now, if the link could not been generated, the link is a blank string. There is a supplementary parameter `isLinkValid`, boolean, inform if the link is valid or not.
Integrated suggested persons and third parties into the WorkflowStepType form. This enhancement auto-populates suggestion fields for better user experience. It ensures that the suggestion data for persons and third parties is readily available in the form configuration.
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.
Implemented services to provide associated persons and third parties for accompanying periods and their works. Included comprehensive tests to ensure proper functionality and associations.
Removed duplicate user suggestion handling from `WorkflowController` and centralized it in `WorkflowStepType`. This change simplifies the controller and makes user suggestion logic more maintainable.
Implemented the method to retrieve a list of suggested users for an entity workflow, filtering out duplicates. Added corresponding unit tests to verify the method's functionality and ensure its correctness in various scenarios.
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.
Updated the StoredObjectNormalizer initialization to include a mock for TempUrlGeneratorInterface. This ensures tests handle all dependencies of StoredObjectNormalizer correctly.
Refactor workflow cancellation logic to encapsulate transition checks in a dedicated method, and update CronJob handling to use entity workflows instead of IDs. Enhance test coverage to ensure proper handling and instantiate mocks for EntityManagerInterface.
Standardized template names in WorkflowController and WorkflowAddSignatureController for better consistency. Updated references and renamed template files accordingly.
Implemented NotificationToUserGroupsOnTransition to send group emails upon workflow completion. Also updated NotificationOnTransition to prevent double notifications and created a unit test for the new functionality.
Implemented the `EntityWorkflowWithPublicViewInterface` in `AccompanyingPeriodWorkEvaluationDocumentWorkflowHandler`. Included the `renderPublicView` method using `WorkflowWithPublicViewDocumentHelper` for enhanced document handling.
The getTargets method now explicitly returns an array, enhancing type safety and readability. This change ensures that the return type is clear to any developers interacting with this method.
Introduce `PostPublicViewMessage` and `PostPublicViewMessageHandler` to handle external user views on public links by applying workflow transitions. Integrate with `WorkflowViewSendPublicController` and add relevant tests.
Introduced the ability to render public views for workflows, including new templates, handlers, and metadata support. Updated entity interfaces and translations to enhance the public sharing of workflow documents.
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.
- create an event subscriber to catch the workflow which arrive to a "sentExternal" step;
- add a messenger's message to handle the generation of the email;
- add a simple message, and a simple controller for viewing the document
- add dedicated tests
- Create a dedicated constraint to check if the destUsers are required by the applied transition.
- Apply on WorkflowTransitionContextDTO and, if required, use the built-in constraints
- create tests
This commit introduces a new validator to ensure that transitions marked as 'sent' have a designated external recipient. It includes related tests for scenarios with and without recipients and covers integration with the workflow context.
Introduce a new validator that ensures a third party has an email address, including the corresponding translation for error messaging and unit tests to verify its functionality.
Introduced EntityWorkflowSend and EntityWorkflowSendView entities to enable tracking of workflow content sent to external parties. Updated EntityWorkflowStep to associate with these entities and added a corresponding database migration script.
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.
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.
Added new event 'addNewEntityProcessEnded' to PickEntity component. This event triggers form submission when 'submit_on_adding_new_entity' is enabled, ensuring proper flow control.
Added a new table `chill_main_user_group_user_admin` for admin users and modified the UserGroup entity to include an `active` status column. Included methods for managing the admin users and the active status in the UserGroup entity.
Enhanced the WorkflowTransitionContextDTO to include user groups alongside individual users for future steps. Updated the relevant entity and form classes to accommodate this change and included the necessary database migration script.
- add necessary vue component to render usergroup within the component AddPersons;
- add necessary normalization and denormalization process for matching the selected usergroup with entities in database
Implemented `SearchUserGroupApiProvider` to handle user group search requests. Added `UserGroupRepository` and its interface to support search queries. Updated API specs to include user group as a searchable type.
Import the UserGrou feature from ticket-app-master branch. This includes:
- import all the entities and migrations, modification of typescript types, templating, and so on;
- apply some verification and formatting rules, like:
- reformat file on chill.api.specs.yaml (MainBundle)
- reformat file on types.ts (Main Bundle)
Migrations kept the same filename.
Introduce MessageBus to handle post-signature operations asynchronously. This ensures that further steps are executed through dispatched messages, improving system scalability and performance. Implement new handlers and messages for the workflow state transitions.
Implemented the ability to reject workflow signatures by adding necessary templates, routes, and authorization checks. Updated the `WorkflowSignatureCancelController` to handle rejection and modified existing templates and translations to support the new feature.
Added functionality to cancel signatures in workflow, including controller, view, and tests. Updated translations and adjusted templates to support and display cancellation actions.
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.
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.
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.
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.
Introduced EntityWorkflowGuardUnsignedTransition to block transitions with pending signatures. Implemented a new center resolver and added comprehensive unit tests for verifying transition rules and permissions.
Introduce ManagerAwareCenterResolverInterface to ensure resolvers can reference their manager. Added a trait for implementing the interface and updated the CenterResolverManager to initialize resolvers correctly.
Make stored object read-only if a signature was added to the document and allow to duplicate the related entity in workflow
See merge request Chill-Projet/chill-bundles!731
- 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
Added functionality to specify key namespaces that should be exluded from duplicate detection
Added functionality to check the accidental creation of duplicates based on an md5 hash of translation duplicates.
Add a check in `WorkflowStoredObjectPermissionHelper` to block document editing once any signature is signed. Accompanied by new tests to verify this behavior.
Introduce a version restoration button and logic to track restored versions throughout the UI. Update download buttons to display action strings conditionally and implement toast notifications for version restoration.
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.
This commit introduces a History button to the DocumentActionButtonsGroup component to view document versions. It includes new components for the modal dialog and API integrations to fetch and display version histories. This feature allows users to view and restore previous versions of stored objects.
Add UserNormalizer dependency and pass createdAt context for createdBy normalization, ensuring compatibility with nullable context groups. This improves the accuracy and completeness of the normalized data.
Introduced `FileIcon.vue` to handle file type icons centrally. Refactored `DropFile.vue` to utilize the new `FileIcon` component, improving code clarity and maintainability.
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.
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.
Format the output using a table.
Use existing translator.default service to fetch translation files and extract keys and translations from the translation catalogue for a certain locale.
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.
Updated the SignatureRequest metadata to include the requester's IP address and currently authenticated user details. Also improved the rendering of signer information by leveraging the `ChillEntityRenderManagerInterface`.
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.
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.
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.
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.
Lorsque tous les usagers ont signé un workflow, le workflow retourne à l’envoyeur avec une étape « workflow signé »
See merge request Chill-Projet/chill-bundles!726
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.
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.
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.
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.
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.
Implemented a new StoredObjectPointInTime entity to manage snapshots of stored objects. This includes related migrations, enum for reasons, repository, and integration with StoredObjectVersion.
Introduce the WopiConverter service to handle document-to-PDF conversion using Collabora Online. Extend and update related tests in WopiConvertToPdfTest and ConvertControllerTest for better coverage and reliability. Enhance the GitLab CI configuration to exclude new test category "collabora-integration".
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.
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
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.
Renamed Convert class and relevant references to ConvertController to improve clarity and maintain consistency. Updated corresponding test files and route configurations to reflect the new name.
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.
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.
Refactor the query to include checks for user membership via both 'destUser' and 'destUserByAccessKey'. This ensures that workflows correctly account for user access by multiple criteria.
Introduced a new SCSS file to handle hover effects on rows and added the ability to remove bottom margins with a "slim" class. Updated various twig templates to utilize these new styles for better visual feedback and alignment.
Updated the signature view template to include person details using the '_insert_vue_onthefly.html.twig' template. This change adds more contextual information about the signer, such as their name and status, improving the user experience.
Reorganized the signature rendering loop for better readability. Moved the row alignment inside the loop and added text alignment for signed statements. Simplified the conditional checks within the loop to enhance code maintainability.
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.
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.
Correct syntax errors involving constant definitions in the RemoveExpiredStoredObjectCronJob class. This change ensures compliance with PHP's constant declaration standards.
Deleted the deprecated constants `ADD_DAV_SEE_LINK_CONTEXT` and `ADD_DAV_EDIT_LINK_CONTEXT` from the `StoredObjectNormalizer` class. These constants are no longer in use and their removal cleans up the codebase.
Removed the resetStoredObject() method call from StoredObject, adjusted the storedObjectId column in the stored_object_version table to be NOT NULL, and moved the association setup of the StoredObject entity directly into the constructor in StoredObjectVersion. This ensures that every StoredObjectVersion has a valid StoredObject and maintains database integrity.
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.
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.
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.
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.
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.
Added a customized SwaggerUI HTML template under Dev directory. Removed outdated swagger-ui dependency from package.json to streamline dependency management.
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.
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.
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.
The size of the random byte string used in the generateFilename method of StoredObjectVersion has been reduced from 16 to 8. Conversely, the size of the random byte string used in the generatePrefix method of StoredObject has been increased from 8 to 32.
The naming generation fit better with the usage, as 16bytes are generated for each file (more version), and less for the version.
A new document detailing the configuration steps for enabling Collabora in development has been added. This includes setting up ngrok and configuring both the Collabora and Symfony servers. Furthermore, a new class, NullProofValidator, has been created for validation during the development process. This class always returns true, making it useful for debugging purposes.
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.
This commit includes several updates to the document management functionality within ChillWopiBundle and ChillDocGeneratorBundle, refactoring for simplicity and improved readability.
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.
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.
Updated entity properties to use Collection&Selectable for better type safety and interoperability. This change affects User, Household, Calendar, Person, AccompanyingPeriod, and EntityWorkflow classes.
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.
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.
The processSignature method in SignatureRequestController has been cleaned up and unneeded comments were removed. The process now involves retrieving the EntityWorkflow and StoredObject from the Signature, and reading the content from the StoredObjectManager. Debugging dump functions and commented code were also removed for a cleaner look.
Additional dependencies have been added to the PdfSignedMessageHandler to handle the state of the signature. After writing the signed message content, the state is set to 'signed' and the state date is updated with the current time. Also, modifications are flushed in the EntityManager to save these changes to the database. Corresponding updates and tests have been made in the PdfSignedMessageHandlerTest file.
The logic for checking 'see' and 'edit' permissions within the StoredObjectNormalizer has been updated. It now correctly refers to the value of the StoredObjectRoleEnum to check access rights.
The previous name, WorkflowDocumentService, was misleading as its functionality extends to all stored objects and not limited to documents. Therefore, it was renamed to WorkflowStoredObjectPermissionHelper. Consequently, all references to this service were updated throughout the codebase.
Introduces a locale requirement to the search route in the ChillMainBundle. This update specifies that a valid locale should consist of 1 to 3 lowercase alphabetic characters. This change will help constrain acceptable locale values.
The AccompanyingPeriodWorkEvaluationStoredObjectVoter has been updated to use the AccompanyingPeriodWorkEvaluationDocument-related classes instead of the AccompanyingPeriodWork classes. Additionally, a new voters class, AccompanyingPeriodWorkEvaluationDocumentVoter has been created. Changes are also made in the repository to find the associated entity in the AccompanyingPeriodWorkEvaluationDocument repository instead of the AccompanyingPeriodWork repository.
The existing StoredObjectVoter test logic was reworked to utilize UsernamePasswordToken and Security mock objects instead of defining its own token. This change improves the testing for different scenarios such as unsupported attributes and cases where role voters cannot see the stored object. Also, the redundancy in the test case provider was removed, which leads to cleaner and more maintainable code.
This commit eliminates antiquated security checks in the StoredObjectVoter class. Specifically, it removes a chunk of commented out code that checked for certain attributes on the token and also the import for DavTokenAuthenticationEventSubscriber class which is no longer needed. This results in code cleanup and prevents future confusion.
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.
Allow to retrieve an eventual stored object associated with an EntityWorkflow + handle more effectively transition
See merge request Chill-Projet/chill-bundles!711
The PdfSignedMessageHandler has been updated to handle pdf signed messages: the content is now stored within the object. Also, a PdfSignedMessageHandlerTest has been created to ensure the correct functionality of the updated handler.
Changes include class refactoring for Workflow handlers, using `readonly` and better indentation in constructors for better readability. In addition, outdated comments are removed. Also, entity workflow handlers now implement the EntityWorkflowHandlerInterface type for better type safety.
Added new interface, EntityWorkflowWithStoredObjectHandlerInterface, which provides methods to handle workflows associated with stored objects. Two classes, AccompanyingPeriodWorkEvaluationDocumentWorkflowHandler and AccompanyingCourseDocumentWorkflowHandler, have been updated to implement this new interface. The EntityWorkflowManager class has also been updated to handle workflows associated with stored objects.
A new property named futurePersonSignatures has been added to the WorkflowTransitionContextDTO class. This will hold a list of Person objects expected to sign the next step, improving the scope of information available within the workflow context.
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.
When downloaded the title of the document was\ always set to 'Document', which gave little\ indication as to what the document was about.\
Now documents are titled with the name of the\ person and the type of document (CV, permis,...)
- 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
```
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.
Using the workflow handlers we return the workflow that is attached to an object
so that within the workflowDocumentService we can then check whether this workflow blocks
the edition of a document.
Added a new class, PdfSignedMessage, to handle received signed PDF messages. Also, added a serializer for this class, PdfSignedMessageSerializer, for use with messaging. Furthermore, comment documentation has been added to RequestPdfSignMessage and its serializer for better clarity. Updated unit tests are also included.
This update introduces a new serializer class for request messages (from messenger component). New features-includes encoding and decoding of request messages and handling unexpected value exceptions. A new test class for the serializer and it also adds functionality to process signature requests in the controller.
The voter was not checking the correct permissions to\ establish whether a user can see/edit a storedObject\
The right to see/edit an AccompanyingPeriodWork has to\
be checked.
Although a many-to-many relationship exists between these entities and stored object,
only one activity or event will ever be linked to a single stored object.
For extra safety measure we return a single result in the repository to ensure our voters
will keep working.
For reusability an AbstractStoredObjectVoter was created and a StoredObjectVoterInterface.
A WorkflowDocumentService checks whether the StoredObject is involved in a workflow.
A WorkflowDocumentService was created that can be injected\
in context-specific StoredObject voters that need to check whether\
the document in question is attached to a workflow.
A separate AccompanyingCourseDocumentStoredObjectVoter was\
created to handle the specific access to a Stored object\
related to an Accompanying Course Document.
Instead of manually injecting services into StoredObjectVoter\
config is added to automatically tag each service that implements\
StoredObjectVoterInterface.php
The StoredObjectVoter.php has been refactorized to handle context-specific voters.\
This way we can check if the context-specific voter should handle the authorization or not.\
If not, there is a simple fallback to check on the USER_ROLE.
Although a many-to-many relationship exists between these entities and stored object,
only one activity or event will ever be linked to a single stored object.
For extra safety measure we return a single result in the repository to ensure our voters
will keep working.
For reusability an AbstractStoredObjectVoter was created and a StoredObjectVoterInterface.
A WorkflowDocumentService checks whether the StoredObject is involved in a workflow.
This method was requiring a person_id to be set, which was\
not the case here so it threw an error. Using the method\
already available in CRUDController works fine, seems to be\
no need to override it.
At first another download button was used, but not working.\ Elsewhere in Chill the chill_document_button_group seems to\
be used so more coherent to use it here too.
The Symfony Serializer groups annotation has been added to all properties of the PDFPage and PDFSignatureZone classes. This change allows the serialization and deserialization process to be group-specific, ensuring only relevant data is processed during these operations.
This update changes how we handle values in PDFSignatureZoneParser class. Specifically, we've modified the 'MediaBox' and 'PDFSignatureZone' variables to use float values. The helps ensure greater precision, minimize errors, and maintain data consistency across the application.
An extra "?" was erroneously appended to the download report URL in ChillMainBundle's export feature. This update removes the extraneous character to ensure the function works as expected with the correct URL format.
Updated the versions of PHPUnit and Symfony's PHPUnit-Bridge in composer.json to more recent, stable versions. The bootstrap.php code has been modified to now load the regular .env file instead of the .env.test file, the change is made to enable the application fetch the actual environment variables during execution.
The code changes eliminate the minimum length assertions for 'acronym' and 'nameCompany' in the ThirdParty entity. This modification increases flexibility, accommodating acronyms and company names of any length.
The parameter type for the 'rebuildRawData' function in the ExportController class has been changed to accept null values. This change is introduced to handle cases where a null key might be passed, preventing potential errors in the application.
A WorkflowDocumentService was created that can be injected\
in context-specific StoredObject voters that need to check whether\
the document in question is attached to a workflow.
A separate AccompanyingCourseDocumentStoredObjectVoter was\
created to handle the specific access to a Stored object\
related to an Accompanying Course Document.
This update introduces new services into the ChillDocStoreBundle for signature zone parsing within PDFs. The PDFSignatureZoneParser service identifies signature zones within PDF content while the additional classes, PDFPage and PDFSignatureZone, help define these zones and pages. Corresponding tests have also been
Instead of manually injecting services into StoredObjectVoter\
config is added to automatically tag each service that implements\
StoredObjectVoterInterface.php
The StoredObjectVoter.php has been refactorized to handle context-specific voters.\
This way we can check if the context-specific voter should handle the authorization or not.\
If not, there is a simple fallback to check on the USER_ROLE.
This commit involves the deletion of ChillEventBundle from the bundles configuration. Additionally, test framework configurations are handled in a consolidated manner by moving assets configurations (json_manifest_path) from test/framework.yaml to framework.yaml. The obsolete test/framework.yaml has been deleted as it is no longer needed.
The export download script was refactored to use ES6 syntax and webpack's modular system. This included separating out the download script into its own file for better organization, removing globally-scoped JavaScript, and adding the new download script as a webpack entry point. Also, the import method for the 'mime' library was adjusted to use ES6 syntax.
A condition is added to check if the timezone is set as '0000' (UTC timezone), if yes then a new Date is returned with the Date.UTC method. This ensures that the time returned correctly reflects the current timezone
The import of the address list has been upgraded to use the latest version of the compiled addresses from Belgian-best-address. In the AddressReferenceBEFromBestAddress class, the RELEASE constant has been updated to point to the v1.1.1 tag.
Changed the first argument in the `createNamedBuilder` method from `null` to an empty string. This adjustment ensures the form factory correctly creates the builder in the SearchController.
The CalendarDocVoter now also supports Calendar instances, not only CalendarDoc instances. This allows refining permissions checks based on the actual instance type. In addition, the ChillCalendarBundle's view has been updated to correctly use permissions when displaying action buttons. Obsolete TODO comments are also removed.
The call to createNamedBuilder in EventController.php and ExportController.php was originally passing null as a parameter. This was generating PHPStan warnings. This commit replaces null with an empty string to comply with the method's expected types.
The Household class now implements the HasCentersInterface and includes a method to get all centers associated with current persons in the household. This enhancement will allow fetching of all household-associated centers easier.
The base class of BudgetElementVoter has been changed to Voter, and the form handling in PermissionsGroupController has been improved for better validation. In addition, minor changes were made for better menu building and service configuration was updated. Unnecessary date validation in AbstractElement has been removed as well.
Updated API creation to require an explicit controller definition. This change has been reflected in the ChillMainExtension and ChillPersonExtension files. Also, it has introduced a new exception, the InvalidCrudConfiguration, which will be thrown when a new API or CRUD is created without this explicit controller definition.
A new validation group 'household_metadata' has been added to the Household form. The 'waitingForBirth' field now has a type check, and for the 'waitingForBirthDate' field, an expression is added to ensure it's set if 'waitingForBirth' is true. Simultaneously, error handling for form submission has been enriched in the HouseholdController to display specific error messages.
The Relationship entity in ChillPersonBundle has been refactored to use TrackCreationTrait and TrackUpdateTrait. As a result, the redundant code for handling creation and update tracking has been removed. This change will simplify future development by reusing core functionality from the trait instead of manually controlling the process in each entity.
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.
Updated activity checks in ListActivitiesByAccompanyingPeriodContext to use getUserIdentifier method instead of getUsername. This change corresponds to check for both activity users and work referrers. The getUserIdentifier method grants a more reliable way to identify users.
The `chill.role` tag has been renamed to `chill_main.provide_role` to prevent any confusion and make the namespaces more consistent. During this process, the class RoleProvidersCompilerPass was deleted, simplifying the role provision process by injecting tagged services directly into the RoleProvider. The change is also reflected in multiple YAML service configurations and explained in the MIGRATION.md file.
A layout issue in the admin document generation has been fixed, particularly in the ChillDocGeneratorBundle. Unnecessary elements such as table headers and multiple entity data rows in DocGeneratorTemplate have been removed, simplifying the view page and improving its performance.
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.
Modified aggregator test methods throughout the Chill project to be now static methods. Also updated yield construction to array returns for more standardised code.
The methods getFormData() and getQueryBuilders() across multiple test classes have been updated to static methods. This refactoring is part of a broader effort to improve code structure and readability. A rector rule has been employed to assist in the systematic update of these existing methods.
The commit simplifies the setCenters method in the ThirdParty class by directly assigning the incoming centers collection to the $centers property. Additionally, the readonly keyword has been removed from the $centers property declaration, allowing its value to be modified.
The controller is tested from real request scraped from apache mod_dav implementation. The requests were scraped using a wireshark-like tool. Those requests have been adapted to suit to our xml.
Replaced most of the invocations of getDoctrine()->getManager() with ManagerRegistry->getManager(), and added ManagerRegistry injection to controllers where needed. This is part of an ongoing effort to improve code clarity, and avoid unnecessary method chaining in various parts of the codebase.
This change is made to comply with the new Symfony standards and to avoid deprecation warnings for future versions. The update touches various functionalities, including retrieving EntityManagerInterface instance and various service classes within the test files.
Modified the `SYMFONY_DEPRECATIONS_HELPER` value from 'max[direct]=0' to 'max[direct]=93' in the PHPUnit configuration file. This change allows up to 93 direct deprecations before the PHPUnit test suite will return a failure, helping to manage the process of upgrading Symfony components and maintaining compatibility.
This number of 93 match the current number of deprecations in the CI for the execution of whole tests.
Removed the ReportSearch class from ChillReportBundle and updated the corresponding services configuration. This removal is part of a larger refactoring process to enhance maintainability, eliminate unused code and simplify application architecture. This will not affect the application's functionality as the class was not used.
Removed unnecessary comments and added type hinting to the function parseDate in the AbstractSearch class. Any string passed to this function will now explicitly be expected as a string data type, increasing code robustness and easing debugging process.
The path for Symfony container XML in the rector configuration file has been updated. This adjustment specifically refers to the internal testing application. By updating this path, consistency and efficiency within the testing process will be promoted.
En symfony 5.4 le typage a été vraiment amélioré, et phpstan peut détecter plus d'erreur potentielles.
Mais le problème est que Symfony "type" les `User` avec son propre `Symfony\Component\Security\Core\User\UserInterface` alors qu'on a besoin de `Chill\MainBundle\Entity\User`.
Imaginons qu'on a ceci:
```php
namespace Chill\Bundle\Service;
final readonly class SomeService
{
public function myMethod(\Chill\MainBundle\Entity\User $user): void
{
// ...
}
}
```
Quand on l'appelle dans un contrôleur ou dans un service:
```php
namespace Chill\Bundle\Service;
use Symfony\Component\Security\Core\Security;
final readonly OtherService
{
public function __construct(private Security $security, private SomeService $service) {}
public function __invoke(): void
{
$this->service->myMethod($this->security->getUser());
}
}
```
PHPstan va se plaindre:
```
Parameter #1 $user of method SomeService::myMethod() expects Chill\MainBundle\Entity\User, Symfony\Component\Security\Core\User\UserInterface|null given.
```
Du coup, j'ai créé ce service:
```php
<?php
namespace Chill\MainBundle\Security;
use Chill\MainBundle\Entity\User;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
use Symfony\Component\Security\Core\Security;
/**
* Security helper for Chill user
*
* Provides security-related functionality such as user retrieval, authorization checks,
* and token retrieval, in a context where only an authenticated @see{User::class} is expected.
*
*/
final readonly class ChillSecurity implements AuthorizationCheckerInterface
{
public function hasUser(): bool
{
// implementation detail not shown here
}
public function getUser(): User
{
// implementation detail not shown here
}
public function isGranted($attribute, $subject = null): bool
{
// implementation detail not shown here
}
public function getToken(): ?TokenInterface
{
// implementation detail not shown here
}
}
```
Et maintenant, on peut faire:
```php
namespace Chill\Bundle\Service;
use Chill\MainBundle\Security\ChillSecurity;
final readonly OtherService
{
public function __construct(private ChillSecurity $security, private SomeService $service) {}
public function __invoke(): void
{
$this->service->myMethod($this->security->getUser());
}
}
```
Et tout va bien se passer.
Ca sera dans la version de chill qui fait passer à symfony 5.4.
Added new command file "ConfigureOpenstackObjectStorageCommand.php" under ChillDocStoreBundle that helps in setting up OpenStack container for document storage. Along with the command, added corresponding test file "ConfigureOpenstackObjectStorageCommandTest.php" to ensure the functionality is working as expected.
Introduced two new exceptions, `BadCallToRemoteServer` and `TempUrlRemoteServerException`, to improve error handling in asynchronous file operations. These exceptions are thrown when there are issues with the remote server during an async file operation such as HTTP status codes >= 400 and if the server is unreachable.
Created AsyncUploadExtension under Chill\DocStoreBundle\AsyncUpload\Templating to provide Twig filter functions for generating URLs for asynchronous file uploads. To ensure correctness, AsyncUploadExtensionTest was implemented in Bundle\ChillDocStoreBundle\Tests\AsyncUpload\Templating. Service definitions were also updated in services.yaml.
Serializer groups have been added to the SignedUrl and SignedUrlPost classes to ensure correct serialization. Two new test files were also included: SignedUrlNormalizerTest and SignedUrlPostNormalizerTest which test the normalization of instances of the classes.
The TempUrlOpenstackGenerator now uses a ParameterBag for configuration instead of individual parameters. This simplifies the handling of configuration values and makes the code more maintainable. The parameter configuration has also been included in the chill_doc_store configuration array for a unified approach.
Added new files for handling asynchronous file uploads in ChillDocStoreBundle. The new files include a controller for generating temporary URLs (AsyncUploadController.php), a security authorization file (AsyncUploadVoter.php), and a corresponding test file (AsyncUploadControllerTest.php). These implementations permit asynchronous uploads via POST, GET, and HEAD methods while maintaining security protocols.
Those features were previously stored in champs-libres/async-upload-bundle
This commit introduces several new classes within the ChillDocStore bundle for handling asynchronous uploads onto an Openstack Object Store. Specifically, the TempUrlOpenstackGenerator, SignedUrl, TempUrlGeneratorInterface, TempUrlGenerateEvent, and TempUrlGeneratorException classes have been created.
This implementation will allow for generating "temporary URLs", which assist in securely and temporarily uploading resources to the OpenStack Object Store. This feature enables the handling of file uploads in a more scalable and efficient manner in high-volume environments.
Additionally, corresponding unit tests have also been added to ensure the accuracy of this new feature.
2023-12-12 11:36:14 +01:00
2878 changed files with 117534 additions and 66875 deletions
* ([#308](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/308)) Show only the current referrer in the page "show" for an accompanying period workf
* ([#309](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/309)) Correctly compute the grouping by referrer aggregator
* Fixed typing of custom field long choice and custom field group
* ([#365](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/365)) Add counters of actions and activities, with 2 boxes to (1) show the number of active actions on total actions and (2) show the number of activities in a accompanying period, and pills in menus for showing the number of active actions and the number of activities.
* ([#364](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/364)) Added a second phone number "telephone2" to the thirdParty entity. Adapted twig templates and vuejs apps to handle this phone number
**Schema Change**: Add columns or tables
* Signature: add a button to go directly to the signature zone, even if there is only one
### Fixed
* Fixed wrong translations in the on-the-fly for creation of thirdParty
* Fixed update of phone number in on-the-fly edition of thirdParty
* Fixed closing of modal when editing thirdParty in accompanying course works
* Shorten the delay between two execution of AccompanyingPeriodStepChangeCronjob, to ensure at least one execution in a day
* ([#102](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/102)) Fix display of title in document list
* When cleaning the old stored object versions, do not throw an error if the stored object is not found on disk
* Add consistent log prefix and key to logs when stale workflows are automatically canceled
* ([#380](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/380)) Remove the "not null" validation constraint on recently added properties on HouseholdComposition
### DX
* Add new chill-col style for displaying title and aside in a flex table
* ([#377](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/377)) Add the document file name to the document title when a user upload a document, unless there is already a document title.
* Add desactivation date for social action and issue csv export
* Add Emoji and Fullscreen feature to ckeditor configuration
* ([#321](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/321)) Create editor which allow us to toggle between rich and simple text editor
* Do not remove workflow which are automatically canceled after staling for more than 30 days
### Fixed
* ([#376](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/376)) trying to prevent bug of typeerror in doc-history + improved display of document history
* ([#381](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/381)) Display previous participation in acc course work even if the person has left the acc course
* ([#372](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/372)) Fix display of text in calendar events
* Add missing translation for user_group.no_user_groups
* Fix admin entity edit actions for event admin entities and activity reason (category) entities
* ([#392](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/392)) Allow null and cast as string to setContent method for NewsItem
* ([#393](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/393)) Doc Generation: the "dump only" method send the document as an email attachment.
### DX
* ([#352](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/352)) Remove dead code for wopi-link module
* Replace library node-sass by sass, and upgrade bootstrap to version 5.3 (yarn upgrade / install is required)
### UX
* ([#374](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/374)) Remove default filter in_progress for the page 'my tasks'; Allows for new tasks to be displayed upon opening of the page
* Improve labeling of fields in person resource creation form
* ([#315](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/315)) Fix display of accompanying period work referrers. Only current referrers should be displayed.
Implementation of the electronic signature for documents within chill.
* ([#286](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/286)) The behavoir of the voters for stored objects is adjusted so as to limit edit and delete possibilities to users related to the activity, social action or workflow entity.
* ([#288](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/288)) Metadata form added for person signatures
* Add a signature step in workflow, which allow to apply an electronic signature on documents
* Keep an history of each version of a stored object.
* Add a "send external" step in workflow, which allow to send stored objects and other elements to remote people, by sending them a public url
### Fixed
* Adjust household list export to include households even if their address is NULL
* ([#329](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/329)) Fix the serialization of gender for the generation of documents
* ([#337](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/337)) Enforce unique contraint on activity storedobject
### DX
* ([#310](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/310)) Clean migrations, to reduce the number of bloated migration when running diff on schema
* ([#345](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/345)) Export: activity filtering of users that were associated to an activity between certain dates. Results contained activities that were not within the specified date range"
* Importer for addresses does not fails when the postal code is not found with some addresses, and compute a recap list of all addresses that could not be imported. This recap list can be send by email.
* ([#346](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/346)) Create a driver for storing documents on disk (instead of openstack object store)
* Add address importer from french Base d'Adresse Nationale (BAN)
* ([#343](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/343)) Add csv export for social issues and social actions
### Fixed
* Export: fix missing alias in activity between certain dates filter. Condition added for alias.
* Use the Notifier component from Symfony to sens short messages (SMS). This allow to use more provider.
### Fixed
* ([#348](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/348)) [export] Fix aggregation of referrer's scope and job: fix the date range comparison
### Warning on configuration of Notifier component
If installed in an symfony app where the recipes are activated, this configuration should be added automatically:
```yaml
framework:
notifier:
chatter_transports:
texter_transports:
ovhcloud:'%env(OVHCLOUD_DSN)%'
channel_policy:
# use chat/slack, chat/telegram, sms/twilio or sms/nexmo
urgent:['email']
high:['email']
medium:['email']
low:['email']
admin_recipients:
- {email:admin@example.com }
```
Actually, you should either:
- remove the configuration of ovhcloud added by the recipe
- or remove the previous configuration of chill, to avoid keeping legacy configuration
#### Remove the added configuration and keep the legacy configuration
To remove the configuration:
```diff
framework:
notifier:
chatter_transports:
texter_transports:
- ovhcloud: '%env(OVHCLOUD_DSN)%'
```
In that case, the previous configuration, which was stored under the `chill_main.short_messages.dsn` will be reconfigured into the Notifier component's configuration.
#### Properly configure SMS
You can also properly configure it, as [described in the OVH cloud provider repository](https://github.com/symfony/ovh-cloud-notifier/tree/5.4?tab=readme-ov-file#dsn-example) (where the scheme is `ovhcloud`):
**NOTE**: You have access to all notifier available with the [Notifier component](https://symfony.com/doc/current/notifier.html#notifier-sms-channel). You are not restricted to use OVH as a provider.
```diff
framework:
notifier:
chatter_transports:
texter_transports:
+ ovhcloud: '%env(OVHCLOUD_DSN)%' # this value should be located in a variable, and have `ovhcloud://` as a scheme
* ([#358](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/358)) Remove "filter" button on list of documents in the workflow's "add attachement" modal
* ([#349](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/349)) Suggest all referrers within actions of the accompanying period when creating an activity
* ([#343](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/343)) Add possibility to export a csv with all social issues and social actions
* ([#360](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/360)) Restore document to previous kept version when a workflow is canceled
* ([#341](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/341)) Add a list of third parties from within the admin (csv download)
### Fixed
* fix generation of document with accompanying period context, and list of activities and works
### DX
* ([#333](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/333)) Create an unique source of trust for translations
* ([#359](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/359)) Allow the merge of two accompanying period works
### Fixed
* ([#390](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/390)) Display the list of participant in the results, even if there is only one participant and that the search result display the requestor
* Fix admin entity edit actions for event admin entities and activity reason (category) entities
* Fix translations for social action fields in admin form: results, goals, evaluations
### DX
* Rewrite exports to run them asynchronously
**Schema Change**: Add columns or tables
* Allow TranslatableMessage in flash messages
### UX
* Improve labeling of fields in person resource creation form
**Release notes**
- Add new methods to serialize data using the rector rule
- Remove all references to the Request in filters, aggregators, filters. Actually, the most frequent occurence is `$security->getUser()`.
- Refactor manually the initializeQuery method
- Remove the injection of ExportManager into the constructor of each export element:
```diff
- class MyFormatter implements FormatterInterface
+ class MyFormatter implements FormatterInterface, \Chill\MainBundle\Export\ExportManagerAwareInterface
{
+ use \Chill\MainBundle\Export\Helper\ExportManagerAwareTrait;
- public function __construct(private ExportManager $exportmanager) {}
public function MyMethod(): void
{
- $this->exportManager->getFilter('alias');
+ $this->getExportManager()->getFilter('alias');
}
}
```
- configure messenger to handle export in a queue:
This rule will create most of the work necessary, but some manuals changes are still necessary:
- we must set manually the correct repository for method `denormalizeDoctrineEntity`;
- when the form data contains some entities, and the form type is not one of EntityType::class, PickUserDynamicType::class, PickUserLocationType::class, PickThirdpartyDynamicType::class, Select2CountryType::class, then we must handle the normalization manually (using the `\Chill\MainBundle\Export\ExportDataNormalizerTrait`)
* ([#400](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/400)) Add filter to social actions list to filter out actions where current user intervenes
* ([#399](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/399)) Show filters on list pages unfolded by default
* Expansion of event module with new fields in the creation form: thematic, internal/external animator, responsable, and budget elements. Filtering options in the event list + adapted exports
**Schema Change**: Add columns or tables
### Fixed
* ([#382](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/382)) adjust display logic for accompanying period dates, include closing date if period is closed.
* ([#384](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/384)) add min and step attributes to integer field in DateIntervalType
# Note: it is possible to add a `.custom.Long` text manually into the yaml file produced by `changie new`. This will add a long description.
changeFormat:>-
* {{ if not (eq .Custom.Issue "") }}([#{{ .Custom.Issue }}](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/{{ .Custom.Issue }})) {{ end }}{{.Body}} {{ if and (.Custom.Long) (not (eq .Custom.Long "")) }}
* {{ if not (eq .Custom.Issue "") }}([#{{ .Custom.Issue }}](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/{{ .Custom.Issue }})) {{ end }}{{.Body}} {{ if and .Custom.SchemaChange (ne .Custom.SchemaChange "No schema change") }}
**Schema Change**: {{ .Custom.SchemaChange }}
{{- end -}}
{{ if and (.Custom.Long) (not (eq .Custom.Long "")) }}{{ .Custom.Long }}{{ end }}
{{ .Custom.Long }}{{ end }}
custom:
- key:SchemaChange
label:Is a schema change required?
optional:false
type:enum
enumOptions:
- "No schema change"
- "Add columns or tables"
- "Drop or rename table or columns, or enforce new constraint that must be manually fixed"
- key:Issue
label:Issue number (on chill-bundles repository) (optional)
# Generate a password using `symfony console security:hash-password --empty-salt <password> 'Symfony\Component\Security\Core\User\User'` and paste it into .env.local file
# ADMIN_PASSWORD=
# Add a configuration for sending SMS (before calendar appointments, aka "Rendez-vous"). See https://symfony.com/doc/current/notifier.html#sms-channel
Chill is a comprehensive web application built as a set of Symfony bundles. It is a case management system, for social work. The project consists of multiple specialized bundles that provide different functionalities:
- **ChillMainBundle**: Core bundles that provide the foundation of the application
- **ChillPersonBundle**: Core bundles that provide the foundation of the bundles associated to person (which is the case for all other bundles)
- **ChillCalendarBundle**: Calendar and scheduling functionality
- **ChillDocStoreBundle** and **ChillDocGeneratorBundle**: Document management and generation
- **ChillActivityBundle**, **ChillEventBundle**, **ChillTaskBundle**: Activity and task tracking
- **ChillBudgetBundle**: Financial management
- **ChillThirdPartyBundle**: Integration with external systems
- **ChillCustomFieldsBundle**: Extensibility through custom fields
- **ChillReportBundle**: Save arbitrary reports about persons
- **ChillTicketBundle**: Record and track issues about persons
Note: This is a project that's existed for a long time, and throughout the years we've used multiple structures inside each bundle. When having the choice, the developers should choose the new structure.
The project follows a standard Symfony bundle structure:
-`/src/Bundle/`: Contains all the Chill bundles. The code is either at the root of the bundle directory, or within a `src/` directory (preferred). See psr4 mapping at the root's `composer.json`.
- each bundle comes with its own tests, either in the `Tests` directory (when the code is directly within the bundle directory (for instance `src/Bundle/ChillMainBundle/Tests`, `src/Bundle/ChillPersonBundle/Tests`)), or inside the `tests` directory, alongside the `src/` sub-directory (example: `src/Bundle/ChillWopiBundle/tests`) (this is the preferred way).
-`/docs/`: Contains project documentation
Each bundle typically has the following structure:
-`Controller/`: Contains controllers
-`Entity/`: Contains Doctrine entities
-`Repository/`: Contains Doctrine repositories
-`Resources/`: Contains views, translations, and public assets
-`DependencyInjection/`: Contains service configuration
-`Export/`: Contains services related to exports
-`Security/`: Contains services related to security. Most of the time, those are new voters, and so on.
### A special word about TicketBundle
The ticket bundle is developed using a kind of "Command" pattern. The controller fills a "Command," and a "CommandHandler" handles this command. They are saved in the `src/Bundle/ChillTicketBundle/src/Action` directory.
## Development Guidelines
### Building and Configuration Instructions
All the commands should be run through the `symfony` command, which will configure the required variables.
For assets, we must ensure that we use node at version `^20.0.0`. This is done using `nvm use 20`.
#### Initial Setup
1.**Clone the Repository**:
```bash
git clone <repository-url>
cd chill-bundles
```
2. **Install PHP Dependencies**:
```bash
composer install
```
3. **Install JavaScript Dependencies**:
```bash
nvm use 20
yarn install
```
4. **Configure Environment Variables**:
- Create a `.env.local` file with minimal configuration
```bash
echo "APP_ENV=dev" >> .env.local
```
5. Start the associated services (database, and so on):
```bash
docker compose up -d
```
6. **Set Up the Database**:
```bash
# Create the database
symfony console doctrine:database:create
# Run migrations
symfony console doctrine:migrations:migrate
# Load fixtures (optional)
symfony console doctrine:fixtures:load
```
7. **Build Assets**:
```bash
nvm use 20
yarn run encore dev
```
8. **Start the Development Server**:
```bash
symfony server:start -d
```
#### Docker Setup
The project includes a Docker configuration for easier development:
1. **Start Docker Services**:
```bash
docker-compose up -d
```
2. **Access the Application**:
- The application will be available at `http://localhost:8000`
- PostgreSQL will be available at `localhost:5432`
- Redis will be available at `localhost:6379`
#### Building Assets
Before submitting any changes, you should build the project to ensure that all assets are properly compiled:
- `webpack.config.js`: Webpack Encore configuration
- `composer.json`: PHP dependencies and scripts
- `package.json`: JavaScript dependencies and scripts
- `.env`: Default environment variables. Must usually not be updated: use `.env.local` instead.
### Database migrations
Each time a doctrine entity is created, we generate migration to adapt the database.
The migration is created using the command `symfony console doctrine:migrations:diff --no-interaction --namespace <namespace>`, where the namespace is the relevant namespace for migration. As this is a bash script, remember to quote the `\` (`\` must become `\\` in your command).
Each bundle has his own namespace for migration (always ask me to confirm that command with a list of updated / created entities so that I can confirm to you that it is ok):
-`Chill\Bundle\ActivityBundle` writes migrations to `Chill\Migrations\Activity`;
-`Chill\Bundle\BudgetBundle` writes migrations to `Chill\Migrations\Budget`;
-`Chill\Bundle\CustomFieldsBundle` writes migrations to `Chill\Migrations\CustomFields`;
-`Chill\Bundle\DocGeneratorBundle` writes migrations to `Chill\Migrations\DocGenerator`;
-`Chill\Bundle\DocStoreBundle` writes migrations to `Chill\Migrations\DocStore`;
-`Chill\Bundle\EventBundle` writes migrations to `Chill\Migrations\Event`;
-`Chill\Bundle\CalendarBundle` writes migrations to `Chill\Migrations\Calendar`;
-`Chill\Bundle\FamilyMembersBundle` writes migrations to `Chill\Migrations\FamilyMembers`;
-`Chill\Bundle\FranceTravailApiBundle` writes migrations to `Chill\Migrations\FranceTravailApi`;
-`Chill\Bundle\JobBundle` writes migrations to `Chill\Migrations\Job`;
-`Chill\Bundle\MainBundle` writes migrations to `Chill\Migrations\Main`;
-`Chill\Bundle\PersonBundle` writes migrations to `Chill\Migrations\Person`;
-`Chill\Bundle\ReportBundle` writes migrations to `Chill\Migrations\Report`;
-`Chill\Bundle\TaskBundle` writes migrations to `Chill\Migrations\Task`;
-`Chill\Bundle\ThirdPartyBundle` writes migrations to `Chill\Migrations\ThirdParty`;
-`Chill\Bundle\TicketBundle` writes migrations to `Chill\Migrations\Ticket`;
-`Chill\Bundle\WopiBundle` writes migrations to `Chill\Migrations\Wopi`;
Once created the, comment's classes should be removed and a description of the changes made to the entities should be added to the migrations, using the `getDescription` method. The migration should not be cleaned by any artificial intelligence, as modifying this migration is error prone.
### Guidelines related to code structure and requirements
#### Usage of clock
When we need to use a DateTime or DateTimeImmutable that need to express "now", we prefer the usage of
`Symfony\Component\Clock\ClockInterface`, where possible. This is usually not possible in doctrine entities,
where injection does not work when restoring an entity from a database, but usually possible in services.
In test, we use `\Symfony\Component\Clock\MockClock` which is an implementation of `Symfony\Component\Clock\ClockInterface`
where we have full and easy control of the date.
### Testing Information
The project uses PHPUnit for testing. Each bundle has its own test suite, and there's also a global test suite at the root level.
#### Use of mock in tests
##### General mocking
For creating mock, we prefer using prophecy (library phpspec/prophecy).
##### Useful helpers and tips that avoid creating a mock
Some notable implementations that are test helpers and avoid creating a mock:
-`\Psr\Log\NullLogger`, an implementation of `\Psr\Log\LoggerInterface`;
-`\Symfony\Component\Clock\MockClock`, an implementation of `Symfony\Component\Clock\ClockInterface` (already mentioned above);
-`\Symfony\Component\HttpClient\MockHttpClient`, an implementation of `\Symfony\Contracts\HttpClient\HttpClientInterface`;
- When using `\Symfony\Component\Mailer\MailerInterface`, we can create the mock with "InMemoryTransport":
```php
use Symfony\Component\Mailer\Transport\InMemoryTransport;
use \Symfony\Component\Mailer\Mailer;
$transport = new InMemoryTransport();
$mailer = new Mailer($transport);
// After sending:
$messages = $transport->getSent(); // array of SentMessage
```
- When using `\Symfony\Contracts\EventDispatcher\EventDispatcherInterface`, we can use directly an instance of `\Symfony\Component\EventDispatcher\EventDispatcher`;
##### When we prefer not creating a mock
- When we use Doctrine Entities related to the project, we prefer not to use a mock: we instantiate them directly (unless it requires too much code to write);
##### Mocking final and readonly classes
Classes marked as final can't be mocked. To avoid that, either:
- we remove the `final` keyword from the class;
- we extract an interface from the final class.
This must be a decision made by a human, not by an AI. Every AI task must abort with an explicit message in that case.
#### Running Tests
The tests are run from the project's root (not from the bundle's root).
Tests are organized by bundle and follow the same structure as the bundle itself:
- Unit tests: Test individual components in isolation
- Integration tests: Test components working together
- Functional tests: Test the application from the user's perspective
#### Writing Tests
Tests should be placed in the appropriate bundle's test directory. For example, tests for the TicketBundle should be placed in `src/Bundle/ChillTicketBundle/tests/`.
Here's an example of a simple entity test:
```php
<?php
namespace Chill\TicketBundle\Tests\Entity;
use Chill\TicketBundle\Entity\Ticket;
use PHPUnit\Framework\TestCase;
class TicketTest extends TestCase
{
public function testGetAndSetExternalRef(): void
{
$ticket = new Ticket();
$externalRef = 'REF-123';
// Set the external reference
$ticket->setExternalRef($externalRef);
// Verify that getExternalRef returns the correct value
For tests that require a database, the project uses a postgresql database filled with fixtures (usage of doctrine-fixtures). You can configure a different database for testing in the `.env.test` file.
### Code Quality Tools
The project uses several tools to maintain code quality:
#### PHP Code Style
The project uses PHP-CS-Fixer for code style. You can run it with:
The project uses PHPStan for static analysis. You can run it with:
```bash
# Using the composer script
composer phpstan
# Or directly
vendor/bin/phpstan analyse
```
#### Automated Refactoring
The project uses Rector for automated refactoring. You can run it with:
```bash
# Using the composer script
composer rector
# Or directly
vendor/bin/rector
```
#### JavaScript/TypeScript Linting
The project uses ESLint for JavaScript/TypeScript code quality. You can run it with:
```bash
yarn run eslint
```
## Deployment
The project can be deployed in a production environment following Symfony's deployment guidelines. The documentation provides detailed instructions for setting up a production environment.
3. Compile assets for production: `yarn run encore production`
4. Clear and warm up the cache: `php bin/console cache:clear --env=prod`
5. Run database migrations: `php bin/console doctrine:migrations:migrate --env=prod`
## Documentation
Comprehensive documentation is available in the `/docs/` directory, including installation instructions, configuration guides, and operational procedures.
## Development Workflow
1. **Create a Feature Branch**: Always create a new branch for your feature or bugfix
2. **Write Tests**: Write tests for your changes before implementing them
3. **Implement Changes**: Implement your changes following the project's coding standards
4. **Run Tests**: Make sure all tests pass
5. **Run Code Quality Tools**: Make sure your code passes all code quality checks
6. **Submit a Pull Request**: Submit a pull request for review
## Debugging
The project includes several tools for debugging:
- **Symfony Profiler**: Available in development mode at `/_profiler`
- **Xdebug**: Configure your IDE to use Xdebug for step-by-step debugging
- **Symfony Debug Toolbar**: Available at the bottom of the page in development mode
## Conclusion
When working with this project, Junie should:
1. Understand the modular bundle structure and how the different components interact
2. Build the project before submitting changes to ensure assets are properly compiled
3. Run relevant tests to ensure changes don't break existing functionality
4. Follow the established code style and patterns
5. Use the provided tools for debugging and code quality
@@ -6,12 +6,421 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
and is generated by [Changie](https://github.com/miniscruff/changie).
## v4.3.0 - 2025-09-08
### Feature
* ([#409](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/409)) Add 45 and 60 min calendar ranges
* Add a command to generate a list of permissions
* ([#412](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/412)) Add an absence end date
**Schema Change**: Add columns or tables
### Fixed
* fix date formatting in calendar range display
* Change route URL to avoid clash with person duplicate controller method
## v4.2.1 - 2025-09-03
### Fixed
* Fix exports to work with DirectExportInterface
### DX
* Improve error message when a stored object cannot be written on local disk
## v4.2.0 - 2025-09-02
### Feature
* ([#64](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/64)) Add external identifier for a Person
**Schema Change**: Add columns or tables
* ([#330](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/330) Allow users to choose for which notifications they want to receive an email
### Fixed
* ([#422](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/422)) Fixed html layout of pages for recovering password
* Fix typo in 'uncheckAll' script for centers selection
* Fix incorrect parameter name in event details link
## v4.1.0 - 2025-08-26
### Feature
* ([#400](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/400)) Add filter to social actions list to filter out actions where current user intervenes
* ([#399](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/399)) Show filters on list pages unfolded by default
* Expansion of event module with new fields in the creation form: thematic, internal/external animator, responsable, and budget elements. Filtering options in the event list + adapted exports
**Schema Change**: Add columns or tables
### Fixed
* ([#382](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/382)) adjust display logic for accompanying period dates, include closing date if period is closed.
* ([#384](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/384)) add min and step attributes to integer field in DateIntervalType
### UX
* Limit display of participations in event list
## v4.0.2 - 2025-07-09
### Fixed
* Fix add missing translation
* Fix the transfer of evaluations and documents during of accompanyingperiodwork
## v4.0.1 - 2025-07-08
### Fixed
* Fix package.json for compilation
## v4.0.0 - 2025-07-08
### Feature
* ([#359](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/359)) Allow the merge of two accompanying period works
### Fixed
* ([#390](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/390)) Display the list of participant in the results, even if there is only one participant and that the search result display the requestor
* Fix admin entity edit actions for event admin entities and activity reason (category) entities
* Fix translations for social action fields in admin form: results, goals, evaluations
### DX
* Rewrite exports to run them asynchronously
**Schema Change**: Add columns or tables
* Allow TranslatableMessage in flash messages
### UX
* Improve labeling of fields in person resource creation form
**Release notes**
- Add new methods to serialize data using the rector rule
- Remove all references to the Request in filters, aggregators, filters. Actually, the most frequent occurence is `$security->getUser()`.
- Refactor manually the initializeQuery method
- Remove the injection of ExportManager into the constructor of each export element:
```diff
- class MyFormatter implements FormatterInterface
+ class MyFormatter implements FormatterInterface, \Chill\MainBundle\Export\ExportManagerAwareInterface
{
+ use \Chill\MainBundle\Export\Helper\ExportManagerAwareTrait;
- public function __construct(private ExportManager $exportmanager) {}
public function MyMethod(): void
{
- $this->exportManager->getFilter('alias');
+ $this->getExportManager()->getFilter('alias');
}
}
```
- configure messenger to handle export in a queue:
This rule will create most of the work necessary, but some manuals changes are still necessary:
- we must set manually the correct repository for method `denormalizeDoctrineEntity`;
- when the form data contains some entities, and the form type is not one of EntityType::class, PickUserDynamicType::class, PickUserLocationType::class, PickThirdpartyDynamicType::class, Select2CountryType::class, then we must handle the normalization manually (using the `\Chill\MainBundle\Export\ExportDataNormalizerTrait`)
## v3.12.1 - 2025-06-30
### Fixed
* Fix loading of the list of documents
## v3.12.0 - 2025-06-30
### Feature
* ([#377](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/377)) Add the document file name to the document title when a user upload a document, unless there is already a document title.
* Add desactivation date for social action and issue csv export
* Add Emoji and Fullscreen feature to ckeditor configuration
* ([#321](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/321)) Create editor which allow us to toggle between rich and simple text editor
* Do not remove workflow which are automatically canceled after staling for more than 30 days
### Fixed
* ([#376](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/376)) trying to prevent bug of typeerror in doc-history + improved display of document history
* ([#381](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/381)) Display previous participation in acc course work even if the person has left the acc course
* ([#372](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/372)) Fix display of text in calendar events
* Add missing translation for user_group.no_user_groups
* Fix admin entity edit actions for event admin entities and activity reason (category) entities
* ([#392](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/392)) Allow null and cast as string to setContent method for NewsItem
* ([#393](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/393)) Doc Generation: the "dump only" method send the document as an email attachment.
### DX
* ([#352](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/352)) Remove dead code for wopi-link module
* Replace library node-sass by sass, and upgrade bootstrap to version 5.3 (yarn upgrade / install is required)
### UX
* ([#374](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/374)) Remove default filter in_progress for the page 'my tasks'; Allows for new tasks to be displayed upon opening of the page
* Improve labeling of fields in person resource creation form
## v3.11.0 - 2025-04-17
### Feature
* ([#365](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/365)) Add counters of actions and activities, with 2 boxes to (1) show the number of active actions on total actions and (2) show the number of activities in a accompanying period, and pills in menus for showing the number of active actions and the number of activities.
* ([#364](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/364)) Added a second phone number "telephone2" to the thirdParty entity. Adapted twig templates and vuejs apps to handle this phone number
**Schema Change**: Add columns or tables
* Signature: add a button to go directly to the signature zone, even if there is only one
### Fixed
* Fixed wrong translations in the on-the-fly for creation of thirdParty
* Fixed update of phone number in on-the-fly edition of thirdParty
* Fixed closing of modal when editing thirdParty in accompanying course works
* Shorten the delay between two execution of AccompanyingPeriodStepChangeCronjob, to ensure at least one execution in a day
* ([#102](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/102)) Fix display of title in document list
* When cleaning the old stored object versions, do not throw an error if the stored object is not found on disk
* Add consistent log prefix and key to logs when stale workflows are automatically canceled
* ([#380](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/380)) Remove the "not null" validation constraint on recently added properties on HouseholdComposition
### DX
* Add new chill-col style for displaying title and aside in a flex table
## v3.10.3 - 2025-03-18
### DX
* Eslint fixes
## v3.10.2 - 2025-03-17
### Fixed
* Replace a ts-expect-error with a ts-ignore
## v3.10.1 - 2025-03-17
### DX
* Remove yarn dependency to symfony/ux-translator, to ease the build process
## v3.10.0 - 2025-03-17
### Feature
* ([#363](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/363)) Display social actions grouped per social issue within activity form
### Fixed
* ([#362](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/362)) Fix Dependency Injection, which prevented to save the CalendarRange
* ([#368](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/368)) fix search query for user groups
## v3.9.2 - 2025-02-27
### Fixed
* Use fetchResults method to fetch all social issues instead of only the first page
## v3.9.1 - 2025-02-27
### Fixed
* Fix post/patch request with missing 'type' property for gender
## v3.9.0 - 2025-02-27
### Feature
* ([#349](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/349)) Suggest all referrers within actions of the accompanying period when creating an activity
* ([#343](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/343)) Add possibility to export a csv with all social issues and social actions
* ([#360](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/360)) Restore document to previous kept version when a workflow is canceled
* ([#341](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/341)) Add a list of third parties from within the admin (csv download)
### Fixed
* fix generation of document with accompanying period context, and list of activities and works
### DX
* ([#333](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/333)) Create an unique source of trust for translations
## v3.8.2 - 2025-02-10
### Fixed
* ([#358](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/358)) Remove "filter" button on list of documents in the workflow's "add attachement" modal
## v3.8.1 - 2025-02-05
### Fixed
* Fix household link in the parcours banner
## v3.8.0 - 2025-02-03
### Feature
* Improve the UX of the news item admin form to prevent wrong usage
* ([#319](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/319)) Notification list: display the concerned person's badges in the list
* ([#320](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/320)) Show the first 3 persons directly in the accompanying period's banner
* ([#334](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/334)) Suggest current user when creating an activity
* ([#331](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/331)) Add attachments to workflows
### Fixed
* ([#350](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/350)) Add validation error to manual selection of person in PersonDuplicateController
* ([#351](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/351)) Add definitive whitespace between span elements in vue PersonText component
## v3.7.1 - 2025-01-21
### Fixed
* Fix legacy configuration processor for notifier component
## v3.7.0 - 2025-01-21
### Feature
* Use the Notifier component from Symfony to sens short messages (SMS). This allow to use more provider.
### Fixed
* ([#348](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/348)) [export] Fix aggregation of referrer's scope and job: fix the date range comparison
### Warning on configuration of Notifier component
If installed in an symfony app where the recipes are activated, this configuration should be added automatically:
```yaml
framework:
notifier:
chatter_transports:
texter_transports:
ovhcloud: '%env(OVHCLOUD_DSN)%'
channel_policy:
# use chat/slack, chat/telegram, sms/twilio or sms/nexmo
urgent: ['email']
high: ['email']
medium: ['email']
low: ['email']
admin_recipients:
- { email: admin@example.com }
```
Actually, you should either:
- remove the configuration of ovhcloud added by the recipe
- or remove the previous configuration of chill, to avoid keeping legacy configuration
#### Remove the added configuration and keep the legacy configuration
To remove the configuration:
```diff
framework:
notifier:
chatter_transports:
texter_transports:
- ovhcloud: '%env(OVHCLOUD_DSN)%'
```
In that case, the previous configuration, which was stored under the `chill_main.short_messages.dsn` will be reconfigured into the Notifier component's configuration.
#### Properly configure SMS
You can also properly configure it, as [described in the OVH cloud provider repository](https://github.com/symfony/ovh-cloud-notifier/tree/5.4?tab=readme-ov-file#dsn-example) (where the scheme is `ovhcloud`):
**NOTE**: You have access to all notifier available with the [Notifier component](https://symfony.com/doc/current/notifier.html#notifier-sms-channel). You are not restricted to use OVH as a provider.
```diff
framework:
notifier:
chatter_transports:
texter_transports:
+ ovhcloud: '%env(OVHCLOUD_DSN)%' # this value should be located in a variable, and have `ovhcloud://` as a scheme
chill_main:
- short_messages:
- dsn: '%env(string:SHORT_MESSAGE_DSN)%'
```
## v3.6.0 - 2025-01-16
### Feature
* Importer for addresses does not fails when the postal code is not found with some addresses, and compute a recap list of all addresses that could not be imported. This recap list can be send by email.
* ([#346](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/346)) Create a driver for storing documents on disk (instead of openstack object store)
* Add address importer from french Base d'Adresse Nationale (BAN)
* ([#343](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/343)) Add csv export for social issues and social actions
### Fixed
* Export: fix missing alias in activity between certain dates filter. Condition added for alias.
## v3.5.3 - 2025-01-07
### Fixed
* Fix the EntityToJsonTransformer to return an empty array if the value is ""
## v3.5.2 - 2024-12-19
### Fixed
* ([#345](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/345)) Export: activity filtering of users that were associated to an activity between certain dates. Results contained activities that were not within the specified date range"
## v3.5.1 - 2024-12-16
### Fixed
* Filiation: fix the display of the gender label in the graph
* Wrap handling of PdfSignedMessage into transactions
## v3.5.0 - 2024-12-09
### Feature
* ([#318](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/318)) Show all the pages of the documents in the signature app
### Fixed
* Wrap the signature's change state into a transaction, to avoid race conditions
* Fix display of gender label
## v3.4.3 - 2024-12-05
### Fixed
* Remove the "not null" constraint on person supplementary phones
* Remove doctrine annotation that prevent from adding documents to activities
## v3.4.2 - 2024-12-05
### Fixed
* ([#329](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/329)) Fix the serialization of gender for the generation of documents
* ([#337](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/337)) Enforce unique contraint on activity storedobject
### DX
* ([#310](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/310)) Clean migrations, to reduce the number of bloated migration when running diff on schema
## v3.4.1 - 2024-11-22
### Fixed
* Set the workflow's title to notification content and subject
## v3.4.0 - 2024-11-20
### Feature
* ([#314](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/314)) Admin: improve document type admin form with a select field for related class.
Admin: Allow administrator to assign multiple group centers in one go to a user.
## v3.3.0 - 2024-11-20
### Feature
* Electronic signature
Implementation of the electronic signature for documents within chill.
* ([#286](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/286)) The behavoir of the voters for stored objects is adjusted so as to limit edit and delete possibilities to users related to the activity, social action or workflow entity.
* ([#288](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/288)) Metadata form added for person signatures
* Add a signature step in workflow, which allow to apply an electronic signature on documents
* Keep an history of each version of a stored object.
* Add a "send external" step in workflow, which allow to send stored objects and other elements to remote people, by sending them a public url
### Fixed
* Adjust household list export to include households even if their address is NULL
* Remove validation of date string on deathDate
## v3.2.4 - 2024-11-06
### Fixed
* Fix compilation of chill assets
## v3.2.3 - 2024-11-05
### Fixed
* ([#315](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/315)) Fix display of accompanying period work referrers. Only current referrers should be displayed.
Fix color of Chill footer
## v3.2.2 - 2024-10-31
### Fixed
* Fix gender translation for unknown
## v3.2.1 - 2024-10-31
### Fixed
* Add the possibility of unknown to the gender entity
* Fix the fusion of person doubles by excluding accompanyingPeriod work entities to be deleted. They are moved instead.
## v3.2.0 - 2024-10-30
### Feature
* Introduce a gender entity
## v3.1.1 - 2024-10-01
### Fixed
* ([#308](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/308)) Show only the current referrer in the page "show" for an accompanying period workf
* ([#309](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/309)) Correctly compute the grouping by referrer aggregator
* Fixed typing of custom field long choice and custom field group
## v3.1.0 - 2024-08-30
### Feature
* Add export aggregator to aggregate activities by household + filter persons that are not part of an accompanyingperiod during a certain timeframe.
## v3.0.0 - 2024-08-26
### Fixed
* Fix delete action for accompanying periods in draft state
* Fix connection to azure when making an calendar event in chill
* CollectionType js fixes for remove button and adding multiple entries
## v2.24.0 - 2024-09-11
### Feature
* ([#306](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/306)) When a document is converted or downloaded in the browser, this document is removed from the browser memory after 45s. Future click on the button re-download the document.
## v2.23.0 - 2024-07-19
## v2.23.0 - 2024-07-23 & 2024-07-19
### Feature
* ([#221](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/221)) [DX] move async-upload-bundle features into chill-bundles
* Add job bundle (module emploi)
* Upgrade import of address list to the last version of compiled addresses of belgian-best-address
* Upgrade CKEditor and refactor configuration with use of typescript
* ([#123](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/123)) Add a button to duplicate calendar ranges from a week to another one
* [admin] filter users by active / inactive in the admin user's list
* ([#273](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/273)) Add the possibility to mark all notifications as read
@@ -21,6 +430,8 @@ and is generated by [Changie](https://github.com/miniscruff/changie).
* Do not update the "createdAt" column when importing postal code which does not change
* Display filename on file upload within the UI interface
### Fixed
* Fix resolving of centers for an household, which will fix in turn the access control
* Resolved type hinting error in activity list export
* ([#271](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/271)) Take into account the acp closing date in the acp works date filter
### Traduction française des principaux changements
Per bundle, all translations for Twig pages are located in a single file: translations/messages.fr.yaml.
## File Locations
Controllers, form types, and Twig templates are placed in the root folders Controller, Form, and Resources/views, respectively.
Admin pages are no longer placed in subfolders under Admin.
## Assets: Entrypoint Naming
There are three types of entry points:
* Vue application-specific (often for a single page): Prefixed with vue_.
* Reusable JavaScript/CSS code:
Examples include:
* ckeditor
* async_upload (used for forms)
* bootstrap
* chill.js
* ...
=> We prefix with `mod_`
* Page-specific CSS/JS:
* Often reuses functionalities like ShowHide.
=> We prefix with `page_`.
## Folder Structure
````
# Under Resources/public:
- chill/ => Contains the theme (Chill).
- chillmain.scss: Compiled into the chill entrypoint.
- lib/ => Libraries never used as entrypoints but reused elsewhere.
- Examples: ShowHide, Collection, Select2.
- module/: Ends up in reusable entrypoints (mod_).
- bootstrap
- custom.scss
- custom/
- variable.scss
- ...
- AsyncUpload.
- vue/ => Vue applications only (vue_).
- Examples: _components, app.
- page/ => Page-specific assets (page_).
- login
- person
- personvendee
- household_edit_metadata
- index.js
````
# Stylesheet Organization
1. The mod_bootstrap (module bootstrap) entry point is the first level. All parts (modules) of bootstrap are included in the bootstrap.js file located in ChillMainBundle/Resources/public/module/bootstrap.
* At the beginning, this file imports the variables.scss file, which determines most of the bootstrap settings as customized. This file overrides the original, and many variables are adjusted for Chill.
* Care must be taken to ensure this file can always be compared to the original bootstrap file. In the event of a bootstrap update, a diff must be generated and this diff applied to the variable file of the new version.
* At the end, it imports the custom.scss file, which includes bootstrap adaptations to prepare it for our Chill theme.
* This `custom.scss` file can be split into smaller files using `@import 'custom/...'`.
* The idea is that this first bootstrap layer sets an important part of the application’s styles, particularly those related to layout positioning, responsive breakpoints, and the default margins and spacing applied to elements being manipulated.
2. The chill entry point is the second level. It contains the Chill theme, which is recognizable in the application.
* Each bundle has a `Resources/public/chill` folder containing a main sass file, which can optionally be split using `@imports`. All these files are compiled into a single Chill entry point, which serves as the application’s theme and overrides bootstrap.
* The chillmain.scss file should contain the most general style cascades, those applied to many areas of the application.
* The chillperson.scss file also includes styles specific to different contexts related to people: person, household, and accompanying course.
* Some smaller bundles contain only styles specific to their functionality.
3. The vue_ entry points are used for Vue components. Vue files can contain an scss style block. These styles are specific to the component and its inheritance, with the scoped tag precisely defining their scope (see the documentation).
4. The page_ entry points are used to add assets specific to certain pages, most often scripts and styles.
## HTML Tagging and Style Cascades
The following example shows how to tag a code element without overdoing it. Note that:
* It is not necessary to tag all inner classes.
* The parent class should not be repeated in all child classes. Sass cascading allows for flexible HTML structuring without overloading the tag hierarchy.
* Often, the first class will have variations created with additional classes that start in the same way: bloc-dark simply adds the dark version of bloc. We do not use bloc dark because we don’t want the dark class of bloc to interact with the same dark class of table. As a result, we will have an element bloc bloc-dark and another element table table-dark.
```html
<div class="bloc bloc-dark my-bloc">
<h3>My Title</h3>
<ul class="record_actions">
<li>
<a class="btn btn-edit"></a>
</li>
</ul>
</div>
```
Finally, it is important to define what a block, an action zone, and a button are. These three elements exist independently and are the only ones we tag.
For example, to style the title, we simply specify h3 within the block cascade.
```scss
div.bloc {
// un bloc générique, utilisé à plusieurs endroits
&.bloc-dark {
// la version sombre du bloc
}
h3 {}
ul {
// une liste standard dans bloc
li {
// des items de liste standard dans bloc
}
}
}
div.mon-bloc {
// des exceptions spécifiques à mon-bloc,
// qui sont des adaptations de bloc
}
ul.record_actions {
// va uniformiser tous les record_actions de l'application
li {
//...
}
}
.btn {
// les boutons de bootstrap
.btn-edit {
// chill étends les boutons bootstrap pour ses propres besoins
}
}
</style>
```
## Render box
## URL
## Route Naming Conventions
:::warning
These rules have not always been followed in the past. They are desired for the future.
:::
Routes follow this structure:
`chill_(api|crud)_bundle_(api)_entity_action`
1. First, chill_ (for all Chill modules).
2. Then, crud or api, optional, automatically added if the route is generated by the configuration.
3. Then, a string indicating the bundle (`main`, `person`, `activity`, ...).
4. Then, api, if the route is an API route.
5. Then, a string indicating the entity the route targets, and possibly the sub-entities.
6. Then, an action (`list`, `view`, `edit`, `new`, ...).
Indicating `api` in the fourth position allows distinguishing API routes generated by the configuration (which are all prefixed with `chill_api`) from those generated manually. (For example: `chill_api_household__index` and `chill_person_api_household_members_move`).
If points 4 and 5 are missing, they are replaced by other elements to ensure the uniqueness of the route and its clear understanding.
#### HTML pages
:::warning
These rules have not always been followed in the past. They are desired for the future.
:::
Syntaxe:
```
/{_locale}/bundle/entity/{id}/action
/{_locale}/bundle/entity/sub-entity/{id}/action
```
The following elements should be included in the list:
1. The locale;
2. An identifier for the bundle;
3. The entity it relates to;
4. Any sub-entities that the URL refers to;
5. The action.
```
# list of activities for a person
/fr/activity/person/25/activity/list
# new activity
/fr/activity/activity/new?person_id=25
```
#### Pour les API
:::info
Automatically generated routes are prefixed with `chill_api`
:::
Syntaxe:
```
/api/1.0/bundle/entity/{id}/action
/api/1.0/bundle/entity/sub-entity/{id}/action
```
The following elements should be included in the list:
1. The string `/api/` followed by the version (e.g., 1.0);
2. An identifier for the bundle;
3. The entity it relates to;
4. Any sub-entities that the URL refers to;
5. The action.
These elements may be interspersed with the entity identifier. In this case, the identifier should be placed immediately after the entity it relates to.
#### URLS for admin pages
Same conventions as for other html pages, **but `admin` is added in second position**. Soit:
`/{_locale}/admin/bundle/entity/{id}/action`
## Database table naming convention
When creating a new entity and the corresponding database table, we follow the following naming convention for the database table:
`chill_{bundle_identifier}_{entity_name}`.
Eg. chill_person_spoken_languages
## UI Rules
### Page Titles
#### Every page must have a title (in the head tag and page header).
Each page contains a title in the <head> tag. This title is typically the same as the header title on the page.
Tip: It is possible to use the block function in Twig for this.
Example:
```htmlmixed=
{% block title "Titre de la page" %}
{% block content %}
<h1>
{{ block('title')}}
</h1>
{% endblock %}
```
### entity_render usage
#### in Twig
Always use chill_entity_render_box for rendering entities like:
* User
* Person
* SocialAction
* SocialIssue
* Address
* Thirdparty
* ...
Example:
```
address|chill_entity_render_box
```
Justification:
1. Customization by installation: Some elements are sometimes customized during installation (for example, the name of each user will be followed by the name of the service).
2. To streamline and make displays consistent: Ensures uniformity in the way information is displayed across different pages or sections.
3. To simplify Twig code: By using blocks and centralizing title logic, it reduces repetition and makes the Twig code easier to maintain.
* Three rendering modes:
* inline
* block
* item.
#### In Vue
There is always a renderbox equivalent in vue.
#### HTML Links to Sections
Always include links/icons for accessing records, such as person or household details, if the user has access.
### Form Guidelines
#### Vocabulary:
* `Create` in a `bt bt-create` for links to the form to create an entity (to access the form).
* `Save` in a `bt bt-save` for "Save" buttons (in either an edit or create form).
* `Save and new`
* `Save and view`
* `Edit` in a `bt bt-edit` for links to the edit form.
* `Duplicate` (specify where it can be seen).
* `Cancel` for leaving an edit page with a link to the list, or the `returnPath`.
#### After Saving:
Redirect to the returnPath if available; otherwise, redirect to the view page.
### Sticky Form Buttons:
Buttons like "Cancel" and "Save" must be within a "sticky-form" bar at the bottom of the form.
If relevant:
* The banner contains a "Cancel" button that returns to the previous page. It is mandatory for forms, but optional for lists or "summary" pages.
#### Display a flash message upon entity creation:
Everytime an entity has been created
> "The entity has been created."
The name of the element can be replaced with something more relevant:
> * The activity has been created
> * The appointment has been created
> * ...
#### On Saving an Entity
Each time an entity is saved, a flash message should appear:
> The data has been modified
#### Form Error (Validation Error)
At the top of the form, a flash message should indicate that validations have failed:
> This form contains errors
Errors should appear attached to the field they concern. However, it is acceptable to display errors at the root of the form if it is technically difficult to attach errors.
### Return Links
Each time a link is provided, check whether the function chill_return_path, chill_forward_return_path, or chill_return_path_or should be used.
* From the list page, to the opening of an element, or the creation button => use chill_path_add_return_path
* In these edit pages:
* use chill_return_path_or in the "Cancel" button;
* for the "Save and view" and "Save and close" buttons => ?
### Assets for Suggestion Lists
Create a list of suggestions to add (the entire item is clickable)
```html
<ul class="list-suggest add-items">
<li>
<span>item</span>
</li>
</ul>
```
Create a list of suggestions to remove (with a clickable red cross, the anchor <a> is empty)
```html
<ul class="list-suggest remove-items">
<li>
<span>
item
</span>
</li>
</ul>
```
Create a removable title (with a clickable red cross, the anchor <a> is empty)
```html
<div class="item-title">
<span>title</span>
</div>
```
The classes `cols` or `inline` can be added alongside `list-suggest` to modify the layout of the list. In the last example, add a `removable` class to the `<span>` if you want to make the item removable.
Par bundle, toutes les traductions des pages twig se trouvent dans un seul fichier `translations/messages.fr.yaml`.
## Emplacement des fichiers
@@ -142,7 +141,6 @@ ul.record_actions {
## Render box
## URL
### Nommage des routes
@@ -234,6 +232,13 @@ Même conventions que dans les autres pages html de l'application, **mais `admin
`/{_locale}/admin/bundle/entity/{id}/action`
### Nommage des tables de base de donnée
Lors de la création d'une nouvelle entité et de la table de base de données correspondante, nous suivons la convention d'appellation suivante pour la table de base de données :
`chill_{bundle_identifier}_{nom_de_l'entité}`.
Par exemple : chill_person_spoken_languages
## Règles UI chill
@@ -293,8 +298,6 @@ A prevoir:
> quand on passe l’option render: bloc, on peut placer le render_box dans une boucle for plus large qui fonctionne avec la classe flex-table ou la classe flex-bloc, ce qui donnera un affichage en rangée (table) ou en blocs. [name=Mathieu]
#### En vue
Il existe systématiquement une "box" équivalente en vue.
Chill is a software for social workers. It allows them to keep track of the social work they do.
The online documentation can be found at http://docs.chill.social
See our website for more information https://www.chill.social
See the [`docs`][1] directory for more.
## Installation
[1]: docs/README.md
Chill-bundles is a set of bundles that should be used within a Symfony application.
A symfony application will help you to customize all the configuration options, change the behaviour of some parts of the usual-way that chill works, … without to have to fork this repository !
See [the instructions in the docs](./docs/source/installation/index.rst).
Those instructions are also built [online](https://docs.chill.social).
thrownewError(`Unable to choose a translation for "${id}" with locale "${locale}" for value "${number}". Double check that this translation has the correct plural options (e.g. "There is one apple|There are %count% apples").`);
# To persist libphonenumber\PhoneNumber objects, add the Misd\PhoneNumberBundle\Doctrine\DBAL\Types\PhoneNumberType mapping to your application's config.
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.