10791 Commits

Author SHA1 Message Date
8fcdb58556
Adjust SYMFONY_DEPRECATIONS_HELPER value in phpunit.xml.dist
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.
2023-12-14 23:18:03 +01:00
4e1f46154c
Remove ReportSearch class and update services config
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.
2023-12-14 23:05:36 +01:00
312eb5ec7c
Refactor parseDate function signature in AbstractSearch
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.
2023-12-14 23:05:36 +01:00
2dd1b7c943
Fix some tests 2023-12-14 23:05:35 +01:00
d5476df14c
rename main firewall 2023-12-14 22:56:50 +01:00
7ba3435c41
Refactor PrepareClientTrait to use the loginUser method 2023-12-14 22:56:50 +01:00
5030b67c5d
fix gitlab-ci configuration 2023-12-14 18:14:02 +01:00
d6ff3f422f
change messenger configuration 2023-12-14 14:33:23 +01:00
912f7d3211
remove some deprecations 2023-12-14 14:09:57 +01:00
47c3be6217
Merge remote-tracking branch 'origin/master' into upgrade-sf5 2023-12-13 16:04:48 +01:00
0da12cdc2e Merge branch '245-rewrite-test-relationship-api' into 'master'
Refactor RelationshipApiControllerTest to avoid failures

Closes #245

See merge request Chill-Projet/chill-bundles!635
2023-12-13 15:02:42 +00:00
9c17261175
update phpunit configuration file 2023-12-13 15:54:33 +01:00
8c2dc490d0
re-configure test app with new scripts (wip) 2023-12-13 15:47:38 +01:00
b4063bf1df
Update path for Symfony container XML in rector.php
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.
2023-12-13 15:27:27 +01:00
de6277494a
update configuration of app for internal testing app 2023-12-13 15:00:31 +01:00
d1ce99e6d3 Merge branch '167build_the_docs' into 'master'
DX: re-instate the build of documentation on read-the-docs

See merge request Chill-Projet/chill-bundles!638
2023-12-13 08:39:56 +00:00
juminet
0ad27328c9 DX: re-instate the build of documentation on read-the-docs 2023-12-13 08:39:56 +00:00
da997badd9
Fix phpstan issues 2023-12-12 22:43:44 +01:00
af663cf27c
Create the helper ChillSecurity
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.
2023-12-12 22:43:24 +01:00
ac98ba4555
re-organize phpstan deprecations files, with a baseline of deprecations for symfony 5.4 2023-12-12 17:56:27 +01:00
f35f5f0876
fixup! fix typo in classname (Phonenumber => PhoneNumber) 2023-12-12 17:19:28 +01:00
99b7b2ec88
upgrade rector rules and apply them 2023-12-12 17:17:15 +01:00
e2a37fd80b
fix typo in classname (Phonenumber => PhoneNumber) 2023-12-12 17:12:01 +01:00
b64ac8fd20
Merge MR !636 into master: Merge async upload bundle into chill-bundles
See https://gitlab.com/Chill-Projet/chill-bundles/-/merge_requests/636

Merge remote-tracking branch 'origin/async-upload-merge' into upgrade-sf5
2023-12-12 16:18:49 +01:00
f68deca992
Fix icu message 2023-12-12 16:13:58 +01:00
f9a2d7f2d5
Add symfony runtime to composer.json 2023-12-12 16:08:47 +01:00
2f8de4bf01
Upgrade recipes: symfony/security-bundle 2023-12-12 16:08:46 +01:00
c6bb7b1d98
Rector rules: apply rules for 5.0 types 2023-12-12 16:08:46 +01:00
4c52aa366a
Rector rules: add rules for 5.0 types 2023-12-12 16:08:46 +01:00
ceaabfb034
Downgrade symfony bundle to ^5.4 (some were on 6.3)
composer: restrict missing bundle to symfony 5.4
2023-12-12 16:08:46 +01:00
16a5745df9
Update composer to symfony 5 (without config) 2023-12-12 16:08:45 +01:00
3fb04594eb
add changie [ci-skip] 2023-12-12 15:55:14 +01:00
1065706e60
Re-configure test app 2023-12-12 15:55:14 +01:00
f131572344
Remove references to old async upload bundle 2023-12-12 15:55:14 +01:00
45e1ce034a
Add ConfigureOpenstackObjectStorageCommand to ChillDocStoreBundle
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.
2023-12-12 15:55:14 +01:00
82ca321715
Add exceptions for async file handling failures
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.
2023-12-12 15:55:13 +01:00
28d09a8206
Add form and types to handle async files 2023-12-12 15:55:13 +01:00
1195767eb3
Add Twig AsyncUploadExtension and its associated test
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.
2023-12-12 15:55:13 +01:00
4fd5a37df3
Add serializer groups to SignedUrl and SignedUrlPost classes, include tests
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.
2023-12-12 15:55:13 +01:00
450e7c348b
Fix and clean DI configuration for chill_doc_store for usage with AsyncUpload 2023-12-12 15:55:12 +01:00
a70572266f
Refactor TempUrlOpenstackGenerator to use parameter bag and Bundle configuration
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.
2023-12-12 15:55:12 +01:00
d688022825
Add Controller to get asyncUpload signatures
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.
2023-12-12 11:36:14 +01:00
264fff5c36
Implement asynchronous upload feature in Openstack Object Store
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
91e6b035bd
release 2.15.0 2.15.0 2023-12-11 17:23:47 +01:00
2adb6105eb Merge branch '246-do-not-show-confidential-in-list' into 'master'
Filter confidential courses from list of accompanying periods and related

Closes #246

See merge request Chill-Projet/chill-bundles!633
2023-12-11 16:22:38 +00:00
33d187f329 Merge branch '228-fix-export-activity-from-v1' into 'master'
Fix export for people created before 'createdAt' column introduction

Closes #228

See merge request Chill-Projet/chill-bundles!634
2023-12-11 16:22:12 +00:00
f02873c6e0
Refactor RelationshipApiControllerTest
The codebase has been improved by refining and optimizing the test methods in the RelationshipApiControllerTest class. The check for relations was also added to exclude persons without any relationship, this may exclude duplicate relations. This change should avoid errors on this test.
2023-12-08 11:07:14 +01:00
8cc93a8b07
add changie [ci-skip] 2023-12-07 23:25:38 +01:00
f7184ca7bb
Fix export for people created before 'createdAt' column introduction
This commit introduces a migration to fix the export for individuals who were created before the introduction of the 'createdAt' column. The 'startdate' column is now updated to match the individual's first activity date. This migration is irreversible. It's been added as a response to Issue #228
2023-12-07 23:22:48 +01:00
dab80a84d8 Merge branch '235-add-date-filter-course-by-activity' into 'master'
Add dates in the filter "filter course by activity type"

Closes #235

See merge request Chill-Projet/chill-bundles!632
2023-12-07 15:25:09 +00:00