12324 Commits

Author SHA1 Message Date
edeb8edbea
Add role-based access controls for export functionality
Introduced `CHILL_MAIN_COMPOSE_EXPORT` and `CHILL_MAIN_GENERATE_SAVED_EXPORT` roles for managing export creation and execution permissions. Updated access checks, menu routing, and templates to align with the new roles. Added a migration to extend existing permission groups with the `CHILL_MAIN_COMPOSE_EXPORT` role.
2025-04-17 17:34:09 +02:00
fc8e3789e0
Refactor SavedExportVoter to improve export permission check
Revised the permission logic in `canUserGenerate` to enhance clarity and maintainability. Replaced nested condition with early return and updated the export permission check to use `isGrantedForElement`.
2025-04-17 15:47:38 +02:00
a14ed78e25
[wip] temporary changie 2025-04-14 11:01:03 +02:00
420dd4f868
Add SHARE permission to SavedExportVoter with tests
Introduced the SHARE attribute and updated SavedExportVoter to handle it. Added new functionality to check if a SavedExport is shared with a specific user and included corresponding unit tests for both the voter and entity behaviors.
2025-04-14 10:59:47 +02:00
3d9b9ea672
Layout of saved export page 2025-04-14 10:59:31 +02:00
9f12b42961
saved export: add form to share the export 2025-04-14 10:59:09 +02:00
2842548c17
Layout for export list 2025-04-14 10:58:52 +02:00
35f5501489
Add sharing functionality for SavedExport with users/groups
Introduced support for sharing SavedExport entities with individual users or groups. Added new collections, methods for adding/removing/viewing shares, and a migration to create relevant join tables in the database. This enhances collaboration by enabling flexible access control.
2025-04-14 10:58:13 +02:00
5e2d960a19
Fix comparison in new GenerateButton 2025-04-11 09:34:21 +02:00
4129283a58
fix tests 2025-04-08 17:41:34 +02:00
f807d62dab
Merge branch 'refs/heads/master' into 339-partage-d'export-enregistré 2025-04-08 17:30:38 +02:00
5a7bba83f7
Ignore PHPStan warning for deprecated method usage
Added a PHPStan ignore comment to bypass warnings for calling a deprecated method, which remains necessary for compatibility. This ensures functionality while avoiding static analysis issues.
2025-04-08 17:30:08 +02:00
50c75dff1a
Refactor export method to use FormattedExportGeneration.
Replaces direct BinaryFileResponse usage with FormattedExportGeneration for handling file exports. Removes unnecessary imports and ensures temporary file cleanup after processing.
2025-04-08 17:29:10 +02:00
e37f3e7c37
Refactor GenderFilter to enhance data normalization.
Introduced logic to map and transform gender data for normalization and denormalization, aligning with expected formats. Updated associated tests to cover new scenarios and ensure consistent behavior.
2025-04-08 17:24:38 +02:00
b6375cad6c
fix tests 2025-04-08 16:32:56 +02:00
8516c87a14
fix tests 2025-04-08 15:50:03 +02:00
8c5abbff74
Update type handling in entity normalization methods
Extended support for `string` types in `normalizeDoctrineEntity` and `denormalizeDoctrineEntity` methods. This ensures compatibility with a broader range of identifier formats and improves flexibility in entity processing.
2025-04-08 15:49:55 +02:00
e0f94ae900
Handle null input in fromNormalized method
Updated the `fromNormalized` method to return null when provided with a null input. This ensures better handling of edge cases and prevents potential errors from null data.
2025-04-08 15:49:04 +02:00
f683e45b6e
Fix tests 2025-04-08 15:42:03 +02:00
b1b7fb6401
Fix tests 2025-04-08 15:40:33 +02:00
8fa06e143d
Fix tests 2025-04-08 15:37:27 +02:00
ec3d901d2f
Fix tests 2025-04-08 15:30:25 +02:00
f12d689382
Fix tests 2025-04-08 15:24:52 +02:00
1c04219859
Add RegroupmentRepository dependency to ExportConfigNormalizer
This change introduces the RegroupmentRepositoryInterface as a new dependency in the ExportConfigNormalizer. It updates related test cases to mock and pass the new repository, ensuring proper coverage and functionality.
2025-04-08 15:24:40 +02:00
2b88593e64
Add RegroupmentRepositoryInterface and integrate it
Created a new `RegroupmentRepositoryInterface` to define repository methods for Regroupment entities. Updated `RegroupmentRepository` to implement this interface, and replaced its usage in `ExportConfigNormalizer` for better abstraction and testability.
2025-04-08 15:24:18 +02:00
ee65c46d2a
Add handling for iterable values in test assertions
This update ensures that iterable values are properly handled in test assertions by skipping over them when needed. The change was applied consistently across AbstractAggregatorTest, AbstractFilterTest, and AbstractExportTest to improve test robustness.
2025-04-08 14:57:37 +02:00
7c239eaf6a
Refactor entity check logic in test assertions.
Replaced the usage of `$em->contains` with a more generic `is_object` and `method_exists` check for `getId`. This improves test flexibility and removes reliance on the EntityManager in these cases.
2025-04-08 14:42:40 +02:00
694b1f3c1f
Add data normalization test and context handling improvements
Introduced data normalization testing methods to validate form data processing. Enhanced `initiateQuery` to include `ExportGenerationContext` with user retrieval logic for improved query handling. These changes strengthen data integrity and contextual query execution within export functionality.
2025-04-08 14:42:34 +02:00
80b9ce3c3e
Refactor tests to include ExportGenerationContext and data normalization
Added ExportGenerationContext usage in aggregator and filter tests to provide user context during query alterations. Introduced new data normalization tests and related logic, ensuring consistency and validation for normalized and denormalized forms. Refactored `getUser` methods for better scoping and reusability.
2025-04-08 14:26:19 +02:00
3f218e7183
Add data provider and test for form data normalization
Introduced a `dataProviderFormDataToNormalize` method to supply test cases for normalization. Added `testDataNormalization` to validate form data normalization and ensure consistency between normalized and denormalized data.
2025-04-08 14:09:26 +02:00
a2713041da
fix cs 2025-04-08 14:09:16 +02:00
3a904e8ea1
Fix method return type from closure to callable
Updated the return type of the `getLabels` method to `callable` for better type accuracy. This aligns with PHP standards and improves code clarity and maintainability.
2025-04-08 13:40:11 +02:00
6f1a26742d
Refactor method signatures for stricter type safety
Updated method parameters to enforce stricter type declarations, improving code clarity and reducing potential runtime errors. This change ensures better consistency across interfaces and aligns with modern PHP typing practices.
2025-04-08 13:40:05 +02:00
0d0a626f50
Implements return types on aggregators 2025-04-08 12:38:52 +02:00
ec5f4ed1d6
Refactor type annotations in export interfaces
Updated return type annotations in `AggregatorInterface` for clarity and adjusted generics in `ListInterface` to better reflect supported query types. This improves code readability and strengthens type safety.
2025-04-08 12:38:38 +02:00
d9251239f7
Remove unused CSVFormatter and improve translations handling
CSVFormatter was deprecated and is no longer in use, so it was removed. Additionally, translation handling was enhanced across multiple formatters, supporting `TranslatableInterface` to ensure better localization compatibility.
2025-04-08 10:38:07 +02:00
b2d3d806b6
Fix PHPDocs and return type declarations in export interfaces
Corrected typos in PHPDocs, added missing type templates, and ensured proper return type declarations. These changes improve code readability, consistency, and type safety across export-related interfaces.
2025-04-08 10:37:47 +02:00
8e952cc966
Implements new return types 2025-04-07 14:35:29 +02:00
1c4ee37507
Refactor entity normalization to handle Doctrine Collection.
Updated `normalizeDoctrineEntity` to support normalizing `Collection` objects and handle null values in arrays. This ensures compatibility with a broader range of entity structures and improves data integrity during normalization.
2025-04-07 14:35:07 +02:00
8331a836f2
Add explicit return types and TranslatableInterface support
Updated interfaces to include explicit return types for improved type safety and readability. Integrated support for Symfony's TranslatableInterface in relevant methods to enhance translation handling.
2025-04-07 14:26:11 +02:00
2482dcc62e
Refactor ExportManager integration and remove ExportsCompilerPass
Replaced direct ExportManager dependencies in formatters with an ExportManagerAwareTrait to decouple components and enhance flexibility. Removed the ExportsCompilerPass as it is no longer required, and adjusted service configurations to improve reliability and consistency.
2025-04-07 12:42:28 +02:00
f9a55a1bfd
Fix debug artifact in ExportFormHelper
Removed unnecessary `dump()` calls when resolving centers and regroupments. This ensures cleaner processing and
2025-04-07 12:37:29 +02:00
15aa565caf
Add custom exception classes for export errors
Introduced `ExportRuntimeException` and `ExportLogicException` to better categorize exceptions in the export process. Updated `ExportGenerationException` to extend `ExportRuntimeException` for clearer hierarchy and improved maintainability.
2025-04-07 11:38:42 +02:00
566b72ec9e
Add $context parameter to export query generation
This update introduces the $context parameter to the query generator method. It ensures additional contextual data can be passed and utilized, improving the flexibility of export generation logic.
2025-04-07 11:31:52 +02:00
bb42ee25ff
Update initiateQuery method to include ExportGenerationContext
The `initiateQuery` method now consistently incorporates the `ExportGenerationContext` parameter across various export classes, improving functionality and standardization. This change ensures compatibility and alignment with the expected method signature.
2025-04-07 11:29:04 +02:00
aebeca1d7a
Use readonly properties in constructors for better immutability.
Converted constructor properties to readonly where applicable, ensuring immutability and promoting safer code practices. Updated throwable class reference for clarity and consistency.
2025-04-05 00:56:54 +02:00
1955249a60
Fix type handling in JSON decode for migration script
Ensure `json_decode` explicitly casts database values to strings to avoid type errors during migration. This prevents potential issues when processing `options` fields that may not already be of string type.
2025-04-05 00:53:01 +02:00
3b0a4e9c73
Refactor exports to include ExportGenerationContext.
Updated initiateQuery methods to pass ExportGenerationContext, enabling better user-specific query filtering. Removed redundant user retrieval in FilterListAccompanyingPeriodHelper, now relying on context-provided user data.
2025-04-05 00:35:42 +02:00
b5fd9cf4af
Add SavedExportOptionsMigrator for migrating export options
Introduced SavedExportOptionsMigrator to handle the migration of saved export options with structures ensuring versioning. Added unit tests to validate transformation logic and edge cases for better reliability.
2025-04-05 00:35:16 +02:00
bb30ddc876
Add logging and validation to export generation handler
Introduce a logger to track processing steps, durations, and outcomes in `ExportRequestGenerationMessageHandler`. Add validation to prevent reprocessing of already generated export objects, ensuring robust error handling and improved traceability.
2025-04-05 00:08:37 +02:00