10913 Commits

Author SHA1 Message Date
0b50cbfe4c adjust form for activity type presence field, setting placeholder to false 2024-01-10 13:12:59 +01:00
3a6a125bb1 Merge branch 'test_branch' into 'master'
Apply code styling according to new rules php-cs-fixer

See merge request Chill-Projet/chill-bundles!642
2024-01-10 11:22:13 +00:00
e67c5d98ef force pipeline to run again 2024-01-10 11:09:33 +01:00
3c8e59e088 php cs fixes after updating php cs fixer 2024-01-10 10:31:25 +01:00
825cd127d1
update php-cs-fixer and rector + fix rules 2024-01-09 13:50:45 +01:00
a63b40fb6c
use service subscriber injection to inject manager registry 2024-01-09 13:48:14 +01:00
60ede58af0 Update chill-bundles version 2.15.1 2023-12-20 11:49:38 +01:00
afb79141f0 Merge branch 'fix_household_export' into 'master'
Fix household export

See merge request Chill-Projet/chill-bundles!640
2023-12-20 10:46:30 +00:00
4d72933edb Add condition to household export queries to exclude accompanying periods that are in draft. 2023-12-20 10:46:29 +00:00
469e379166 php cs fixes 2023-12-18 17:05:18 +01:00
f103b228e4 Create test for the participationBetweenDatesFilter 2023-12-18 17:04:42 +01:00
d2a31de1be Add a missing translation for the filter description 2023-12-18 17:04:16 +01:00
138a537d2b Add changie 2023-12-18 15:51:52 +01:00
c06c861e17 Php cs fixes 2023-12-18 15:38:20 +01:00
34cbd2605c Add a changie 2023-12-18 15:32:04 +01:00
044bab45ad Fix query : was missing parenthesis. 2023-12-18 15:29:59 +01:00
b9890d1302 Minor fixes 2023-12-18 10:33:30 +01:00
5703fd0046
Refactor code to directly use Doctrine's ManagerRegistry
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.
2023-12-16 19:09:34 +01:00
655dc02538
CRUDRoutesLoader: use the syntax controller::method instead of the deprecated controller:method 2023-12-14 23:57:20 +01:00
1098bafd3d
Replaced the deprecated 'self::$container->get' with 'self::getContainer()->get' using rector
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.
2023-12-14 23:36:56 +01:00
4a99480f50
fixup! Fix some tests 2023-12-14 23:22:48 +01:00
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
5b2a2a1bc5 Add WithParticipationBetweenDatesFilter to ChillPersonBundle
This update adds a new filter, WithParticipationBetweenDatesFilter, to the ChillPersonBundle. This filter helps to find persons who participated in any parcours between specified date ranges. Additionally, relevant French translations have been updated and the filter has been registered in the services configuration file.
2023-12-13 17:45:08 +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