10980 Commits

Author SHA1 Message Date
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
68e00dc42f Merge branch '234-fix-date-validation-aside-activity-filter-by-date' into 'master'
Fix "filter aside activity by date"

Closes #234

See merge request Chill-Projet/chill-bundles!631
2023-12-07 15:24:16 +00:00
5fae49821f Merge branch '191-export-number-of-household-by-activities' into 'master'
Export: add export "number of household associated with an activity"

Closes #191

See merge request Chill-Projet/chill-bundles!629
2023-12-07 15:23:43 +00:00
0e599a99a7 Merge branch '233-fix-filter-by-evaluation-type' into 'master'
Fix filter evaluation by evaluation type

Closes #233

See merge request Chill-Projet/chill-bundles!628
2023-12-07 15:23:24 +00:00
f0605c6b08
Use dedicated FilterListAccompanyingPeriodHelper to filter confidential course in different lists 2023-12-07 16:18:37 +01:00
54606403b4
Refactor confidential filtering on list to let it usable by other lists 2023-12-07 15:13:54 +01:00
47d829d72d
Filter confidential courses from list of accompanying periods 2023-12-06 22:46:50 +01:00
fa3b305ab9 Merge branch 'issue214_fix_error_empty_comment' into 'master'
Notification: avoid the comment's content to be null

Closes #214

See merge request Chill-Projet/chill-bundles!623
2023-12-05 16:26:06 +00:00
b26b7a2706 Notification: avoid the comment's content to be null 2023-12-05 16:26:06 +00:00
fe54e51362
Add dates in the filter "filter course by activity type" 2023-12-04 18:17:00 +01:00
179e3e92ed
Fix "filter aside activity by date" 2023-12-04 17:30:40 +01:00
c00c6066a9 Merge branch 'fix-rector-issues-20231204' into 'master'
Fix issues with new version of rector

See merge request Chill-Projet/chill-bundles!630
2023-12-04 16:11:38 +00:00