From a738b0cac9b51e07940a45024d4c749104896e59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 15 Apr 2024 13:22:36 +0200 Subject: [PATCH 001/283] Initialize ChillTicketBundle --- composer.json | 1 + .../DependencyInjection/config/routes.yaml | 0 .../DependencyInjection/config/services.yaml | 1 + .../ChillTicketBundle/src/ChillTicketBundle.php | 10 ++++++++++ .../ChillTicketExtension.php | 17 +++++++++++++++++ 5 files changed, 29 insertions(+) create mode 100644 src/Bundle/ChillThirdPartyBundle/DependencyInjection/config/routes.yaml create mode 100644 src/Bundle/ChillThirdPartyBundle/DependencyInjection/config/services.yaml create mode 100644 src/Bundle/ChillTicketBundle/src/ChillTicketBundle.php create mode 100644 src/Bundle/ChillTicketBundle/src/DependencyInjection/ChillTicketExtension.php diff --git a/composer.json b/composer.json index a000d5b3c..928a65292 100644 --- a/composer.json +++ b/composer.json @@ -118,6 +118,7 @@ "Chill\\PersonBundle\\": "src/Bundle/ChillPersonBundle", "Chill\\ReportBundle\\": "src/Bundle/ChillReportBundle", "Chill\\TaskBundle\\": "src/Bundle/ChillTaskBundle", + "Chill\\TicketBundle\\": "src/Bundle/ChillTicketBundle/src", "Chill\\ThirdPartyBundle\\": "src/Bundle/ChillThirdPartyBundle", "Chill\\WopiBundle\\": "src/Bundle/ChillWopiBundle/src", "Chill\\Utils\\Rector\\": "utils/rector/src" diff --git a/src/Bundle/ChillThirdPartyBundle/DependencyInjection/config/routes.yaml b/src/Bundle/ChillThirdPartyBundle/DependencyInjection/config/routes.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/src/Bundle/ChillThirdPartyBundle/DependencyInjection/config/services.yaml b/src/Bundle/ChillThirdPartyBundle/DependencyInjection/config/services.yaml new file mode 100644 index 000000000..0baad4766 --- /dev/null +++ b/src/Bundle/ChillThirdPartyBundle/DependencyInjection/config/services.yaml @@ -0,0 +1 @@ +services: diff --git a/src/Bundle/ChillTicketBundle/src/ChillTicketBundle.php b/src/Bundle/ChillTicketBundle/src/ChillTicketBundle.php new file mode 100644 index 000000000..9bb39e1f9 --- /dev/null +++ b/src/Bundle/ChillTicketBundle/src/ChillTicketBundle.php @@ -0,0 +1,10 @@ +load('services.yml'); + } +} From a59ea7db31adc876956d16c2d5eec626c7eed5db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 15 Apr 2024 13:48:49 +0200 Subject: [PATCH 002/283] Compiles with ticket bundle --- .../config/routes.yaml | 0 .../config/services.yaml | 0 .../src/DependencyInjection/ChillTicketExtension.php | 4 ++-- 3 files changed, 2 insertions(+), 2 deletions(-) rename src/Bundle/{ChillThirdPartyBundle/DependencyInjection => ChillTicketBundle}/config/routes.yaml (100%) rename src/Bundle/{ChillThirdPartyBundle/DependencyInjection => ChillTicketBundle}/config/services.yaml (100%) diff --git a/src/Bundle/ChillThirdPartyBundle/DependencyInjection/config/routes.yaml b/src/Bundle/ChillTicketBundle/config/routes.yaml similarity index 100% rename from src/Bundle/ChillThirdPartyBundle/DependencyInjection/config/routes.yaml rename to src/Bundle/ChillTicketBundle/config/routes.yaml diff --git a/src/Bundle/ChillThirdPartyBundle/DependencyInjection/config/services.yaml b/src/Bundle/ChillTicketBundle/config/services.yaml similarity index 100% rename from src/Bundle/ChillThirdPartyBundle/DependencyInjection/config/services.yaml rename to src/Bundle/ChillTicketBundle/config/services.yaml diff --git a/src/Bundle/ChillTicketBundle/src/DependencyInjection/ChillTicketExtension.php b/src/Bundle/ChillTicketBundle/src/DependencyInjection/ChillTicketExtension.php index c3c3add41..7c9227cfb 100644 --- a/src/Bundle/ChillTicketBundle/src/DependencyInjection/ChillTicketExtension.php +++ b/src/Bundle/ChillTicketBundle/src/DependencyInjection/ChillTicketExtension.php @@ -11,7 +11,7 @@ class ChillTicketExtension extends Extension { public function load(array $configs, ContainerBuilder $container) { - $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../config')); - $loader->load('services.yml'); + $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../../config')); + $loader->load('services.yaml'); } } From deb3d9218975142f7a299b6e75f074e2b0ccb39a Mon Sep 17 00:00:00 2001 From: Boris Waaub Date: Mon, 15 Apr 2024 14:34:09 +0200 Subject: [PATCH 003/283] Add ChillTicketBundle webpack configuration --- src/Bundle/ChillTicketBundle/chill.webpack.config.js | 4 ++++ src/Bundle/ChillTicketBundle/src/Resources/public/types.ts | 0 .../src/Resources/public/vuejs/TicketApp/index.ts | 0 3 files changed, 4 insertions(+) create mode 100644 src/Bundle/ChillTicketBundle/chill.webpack.config.js create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/types.ts create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/index.ts diff --git a/src/Bundle/ChillTicketBundle/chill.webpack.config.js b/src/Bundle/ChillTicketBundle/chill.webpack.config.js new file mode 100644 index 000000000..5f40de9f2 --- /dev/null +++ b/src/Bundle/ChillTicketBundle/chill.webpack.config.js @@ -0,0 +1,4 @@ +// this file loads all assets from the Chill person bundle +module.exports = function(encore, entries) { + encore.addEntry('ticket_app', __dirname + '/src/Resources/public/vuejs/TicketApp/index.ts'); +}; diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/types.ts b/src/Bundle/ChillTicketBundle/src/Resources/public/types.ts new file mode 100644 index 000000000..e69de29bb diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/index.ts b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/index.ts new file mode 100644 index 000000000..e69de29bb From 4d67702a7693ebccaeddec9caac984d41fe9d904 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 15 Apr 2024 15:48:25 +0200 Subject: [PATCH 004/283] Bootstrap loading of controllers and routes for ticket bundle --- src/Bundle/ChillTicketBundle/config/routes.yaml | 0 src/Bundle/ChillTicketBundle/config/services.yaml | 1 - .../src/Controller/ViewTicketController.php | 15 +++++++++++++++ .../DependencyInjection/ChillTicketExtension.php | 2 +- .../ChillTicketBundle/src/config/services.yaml | 12 ++++++++++++ 5 files changed, 28 insertions(+), 2 deletions(-) delete mode 100644 src/Bundle/ChillTicketBundle/config/routes.yaml delete mode 100644 src/Bundle/ChillTicketBundle/config/services.yaml create mode 100644 src/Bundle/ChillTicketBundle/src/Controller/ViewTicketController.php create mode 100644 src/Bundle/ChillTicketBundle/src/config/services.yaml diff --git a/src/Bundle/ChillTicketBundle/config/routes.yaml b/src/Bundle/ChillTicketBundle/config/routes.yaml deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/Bundle/ChillTicketBundle/config/services.yaml b/src/Bundle/ChillTicketBundle/config/services.yaml deleted file mode 100644 index 0baad4766..000000000 --- a/src/Bundle/ChillTicketBundle/config/services.yaml +++ /dev/null @@ -1 +0,0 @@ -services: diff --git a/src/Bundle/ChillTicketBundle/src/Controller/ViewTicketController.php b/src/Bundle/ChillTicketBundle/src/Controller/ViewTicketController.php new file mode 100644 index 000000000..ddc1f8f2f --- /dev/null +++ b/src/Bundle/ChillTicketBundle/src/Controller/ViewTicketController.php @@ -0,0 +1,15 @@ +load('services.yaml'); } } diff --git a/src/Bundle/ChillTicketBundle/src/config/services.yaml b/src/Bundle/ChillTicketBundle/src/config/services.yaml new file mode 100644 index 000000000..6d2f9e1bf --- /dev/null +++ b/src/Bundle/ChillTicketBundle/src/config/services.yaml @@ -0,0 +1,12 @@ +services: + _defaults: + autoconfigure: true + autowire: true + + Chill\TicketBundle\Controller\: + resource: '../Controller/' + tags: + - controller.service_arguments + + + From a2f1e20ddff78bf42e157b7645c06e0e1a7c9de4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 15 Apr 2024 15:49:47 +0200 Subject: [PATCH 005/283] Fix cs --- .../ChillTicketBundle/src/ChillTicketBundle.php | 14 ++++++++++---- .../src/Controller/ViewTicketController.php | 9 +++++++++ .../DependencyInjection/ChillTicketExtension.php | 9 +++++++++ 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/src/Bundle/ChillTicketBundle/src/ChillTicketBundle.php b/src/Bundle/ChillTicketBundle/src/ChillTicketBundle.php index 9bb39e1f9..de1b1535e 100644 --- a/src/Bundle/ChillTicketBundle/src/ChillTicketBundle.php +++ b/src/Bundle/ChillTicketBundle/src/ChillTicketBundle.php @@ -1,10 +1,16 @@ Date: Tue, 16 Apr 2024 14:41:29 +0200 Subject: [PATCH 006/283] Fix loading of environment variable in bootstrap process --- tests/app/config/bootstrap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/app/config/bootstrap.php b/tests/app/config/bootstrap.php index 4a7385190..6f243bb04 100644 --- a/tests/app/config/bootstrap.php +++ b/tests/app/config/bootstrap.php @@ -23,7 +23,7 @@ if (is_array($env = @include dirname(__DIR__).'/.env.local.php') && (!isset($env (new Dotenv(false))->populate($env); } else { // load all the .env files - (new Dotenv(false))->loadEnv(dirname(__DIR__).'/../../.env.test'); + (new Dotenv(false))->loadEnv(dirname(__DIR__).'/../../.env'); } $_SERVER += $_ENV; From 58325429783421f4e1b4a59a41867b18496d6086 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 16 Apr 2024 14:41:39 +0200 Subject: [PATCH 007/283] load also tests for ticket bundle --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 928a65292..482dcc72f 100644 --- a/composer.json +++ b/composer.json @@ -126,8 +126,8 @@ }, "autoload-dev": { "psr-4": { - "App\\": "tests/", "Chill\\DocGeneratorBundle\\Tests\\": "src/Bundle/ChillDocGeneratorBundle/tests", + "Chill\\TicketBundle\\Tests": "src/Bundle/ChillTicketBundle/tests", "Chill\\WopiBundle\\Tests\\": "src/Bundle/ChillDocGeneratorBundle/tests", "Chill\\Utils\\Rector\\Tests\\": "utils/rector/tests" } From 912fdd63499826f2365317f716f74b693bb29511 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 16 Apr 2024 14:41:55 +0200 Subject: [PATCH 008/283] Add phone number search function to PersonACLAwareRepository A new function, findByPhone, has been added to the PersonACLAwareRepository. This function allows searching for people based on their phone numbers. Changes also reflect in the PersonACLAwareRepositoryInterface, and new test cases have been added to the PersonACLAwareRepositoryTest. --- .../Repository/PersonACLAwareRepository.php | 25 +++++++ .../PersonACLAwareRepositoryInterface.php | 10 +++ .../PersonACLAwareRepositoryTest.php | 66 +++++++++++++++++++ 3 files changed, 101 insertions(+) diff --git a/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepository.php b/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepository.php index 303773c3e..3eaa1d989 100644 --- a/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepository.php @@ -21,6 +21,8 @@ use Chill\PersonBundle\Security\Authorization\PersonVoter; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\NonUniqueResultException; use Doctrine\ORM\Query; +use libphonenumber\PhoneNumber; +use libphonenumber\PhoneNumberFormat; use Symfony\Component\Security\Core\Security; final readonly class PersonACLAwareRepository implements PersonACLAwareRepositoryInterface @@ -298,4 +300,27 @@ final readonly class PersonACLAwareRepository implements PersonACLAwareRepositor \array_map(static fn (Center $c) => $c->getId(), $authorizedCenters) ); } + + public function findByPhone(PhoneNumber $phoneNumber, int $start = 0, int $limit = 20): array + { + $authorizedCenters = $this->authorizationHelper + ->getReachableCenters($this->security->getUser(), PersonVoter::SEE); + + if ([] === $authorizedCenters) { + return []; + } + + $util = \libphonenumber\PhoneNumberUtil::getInstance(); + + return $this->em->createQuery( + 'SELECT p FROM '.Person::class.' p LEFT JOIN p.otherPhoneNumbers opn JOIN p.centerCurrent pcc '. + 'WHERE (p.phonenumber LIKE :phone OR p.mobilenumber LIKE :phone OR opn.phonenumber LIKE :phone) '. + 'AND pcc.center IN (:centers)' + ) + ->setMaxResults($limit) + ->setFirstResult($start) + ->setParameter('phone', $util->format($phoneNumber, PhoneNumberFormat::E164)) + ->setParameter('centers', $authorizedCenters) + ->getResult(); + } } diff --git a/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepositoryInterface.php b/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepositoryInterface.php index c327ecd40..42e61bf21 100644 --- a/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepositoryInterface.php +++ b/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepositoryInterface.php @@ -13,6 +13,7 @@ namespace Chill\PersonBundle\Repository; use Chill\MainBundle\Search\SearchApiQuery; use Chill\PersonBundle\Entity\Person; +use libphonenumber\PhoneNumber; interface PersonACLAwareRepositoryInterface { @@ -60,4 +61,13 @@ interface PersonACLAwareRepositoryInterface ?string $phonenumber = null, ?string $city = null ): array; + + /** + * @return list + */ + public function findByPhone( + PhoneNumber $phoneNumber, + int $start = 0, + int $limit = 20 + ): array; } diff --git a/src/Bundle/ChillPersonBundle/Tests/Repository/PersonACLAwareRepositoryTest.php b/src/Bundle/ChillPersonBundle/Tests/Repository/PersonACLAwareRepositoryTest.php index 94df35d88..667242111 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Repository/PersonACLAwareRepositoryTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Repository/PersonACLAwareRepositoryTest.php @@ -11,14 +11,17 @@ declare(strict_types=1); namespace Chill\PersonBundle\Tests\Repository; +use Chill\MainBundle\Entity\Center; use Chill\MainBundle\Entity\User; use Chill\MainBundle\Repository\CenterRepositoryInterface; use Chill\MainBundle\Repository\CountryRepository; use Chill\MainBundle\Security\Authorization\AuthorizationHelperInterface; use Chill\PersonBundle\Entity\Person; +use Chill\PersonBundle\Entity\PersonPhone; use Chill\PersonBundle\Repository\PersonACLAwareRepository; use Chill\PersonBundle\Security\Authorization\PersonVoter; use Doctrine\ORM\EntityManagerInterface; +use PHPUnit\Framework\Attributes\DataProvider; use Prophecy\Argument; use Prophecy\PhpUnit\ProphecyTrait; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; @@ -98,4 +101,67 @@ final class PersonACLAwareRepositoryTest extends KernelTestCase $this->assertStringContainsString('diallo', strtolower($person->getFirstName().' '.$person->getLastName())); } } + + /** + * @dataProvider providePersonsWithPhoneNumbers + */ + public function testFindByPhonenumber(\libphonenumber\PhoneNumber $phoneNumber, ?int $expectedId): void + { + $user = new User(); + + $authorizationHelper = $this->prophesize(AuthorizationHelperInterface::class); + $authorizationHelper->getReachableCenters(Argument::exact($user), Argument::exact(PersonVoter::SEE)) + ->willReturn($this->centerRepository->findAll()); + + $security = $this->prophesize(Security::class); + $security->getUser()->willReturn($user); + + $repository = new PersonACLAwareRepository( + $security->reveal(), + $this->entityManager, + $this->countryRepository, + $authorizationHelper->reveal() + ); + + $actual = $repository->findByPhone($phoneNumber, 0, 10); + + if (null === $expectedId) { + self::assertCount(0, $actual); + } else { + $actualIds = array_map(fn (Person $person) => $person->getId(), $actual); + + self::assertContains($expectedId, $actualIds); + } + } + + public static function providePersonsWithPhoneNumbers(): iterable + { + self::bootKernel(); + $em = self::getContainer()->get(EntityManagerInterface::class); + $center = $em->createQuery('SELECT c FROM '.Center::class.' c ')->setMaxResults(1) + ->getSingleResult(); + $util = \libphonenumber\PhoneNumberUtil::getInstance(); + + $mobile = $util->parse('+32486123456'); + $fixed = $util->parse('+3281136917'); + $anotherMobile = $util->parse('+32486123478'); + $person = (new Person())->setFirstName('diallo')->setLastName('diallo')->setCenter($center); + $person->setMobilenumber($mobile)->setPhonenumber($fixed); + $otherPhone = new PersonPhone(); + $otherPhone->setPerson($person); + $otherPhone->setPhonenumber($anotherMobile); + $otherPhone->setType('mobile'); + + $em->persist($person); + $em->persist($otherPhone); + + $em->flush(); + + self::ensureKernelShutdown(); + + yield [$mobile, $person->getId()]; + yield [$anotherMobile, $person->getId()]; + yield [$fixed, $person->getId()]; + yield [$util->parse('+331234567890'), null]; + } } From 75fbec5489cb7b97e7975f5b399f1a1307be23e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 17 Apr 2024 09:56:18 +0200 Subject: [PATCH 009/283] Create entities and doctrine mapping for ticket --- composer.json | 2 +- .../ChillMainBundle/Entity/UserGroup.php | 74 ++++++++ .../migrations/Version20240416145021.php | 41 +++++ .../src/Entity/AddresseeHistory.php | 97 ++++++++++ .../ChillTicketBundle/src/Entity/Comment.php | 55 ++++++ .../src/Entity/InputHistory.php | 91 ++++++++++ .../ChillTicketBundle/src/Entity/Motive.php | 55 ++++++ .../src/Entity/MotiveHistory.php | 72 ++++++++ .../src/Entity/PersonHistory.php | 80 +++++++++ .../ChillTicketBundle/src/Entity/Ticket.php | 166 ++++++++++++++++++ .../src/migrations/Version20240416145919.php | 139 +++++++++++++++ 11 files changed, 871 insertions(+), 1 deletion(-) create mode 100644 src/Bundle/ChillMainBundle/Entity/UserGroup.php create mode 100644 src/Bundle/ChillMainBundle/migrations/Version20240416145021.php create mode 100644 src/Bundle/ChillTicketBundle/src/Entity/AddresseeHistory.php create mode 100644 src/Bundle/ChillTicketBundle/src/Entity/Comment.php create mode 100644 src/Bundle/ChillTicketBundle/src/Entity/InputHistory.php create mode 100644 src/Bundle/ChillTicketBundle/src/Entity/Motive.php create mode 100644 src/Bundle/ChillTicketBundle/src/Entity/MotiveHistory.php create mode 100644 src/Bundle/ChillTicketBundle/src/Entity/PersonHistory.php create mode 100644 src/Bundle/ChillTicketBundle/src/Entity/Ticket.php create mode 100644 src/Bundle/ChillTicketBundle/src/migrations/Version20240416145919.php diff --git a/composer.json b/composer.json index 482dcc72f..1dbb8fc27 100644 --- a/composer.json +++ b/composer.json @@ -127,7 +127,7 @@ "autoload-dev": { "psr-4": { "Chill\\DocGeneratorBundle\\Tests\\": "src/Bundle/ChillDocGeneratorBundle/tests", - "Chill\\TicketBundle\\Tests": "src/Bundle/ChillTicketBundle/tests", + "Chill\\TicketBundle\\Tests\\": "src/Bundle/ChillTicketBundle/tests", "Chill\\WopiBundle\\Tests\\": "src/Bundle/ChillDocGeneratorBundle/tests", "Chill\\Utils\\Rector\\Tests\\": "utils/rector/tests" } diff --git a/src/Bundle/ChillMainBundle/Entity/UserGroup.php b/src/Bundle/ChillMainBundle/Entity/UserGroup.php new file mode 100644 index 000000000..3bd9870a6 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Entity/UserGroup.php @@ -0,0 +1,74 @@ + '[]'])] + private array $label = []; + + /** + * @var \Doctrine\Common\Collections\Collection + */ + #[ORM\ManyToMany(targetEntity: User::class)] + #[ORM\JoinTable(name: 'chill_main_user_group_user')] + private Collection $users; + + public function __construct() + { + $this->users = new ArrayCollection(); + } + + public function addUser(User $user): self + { + if (!$this->users->contains($user)) { + $this->users[] = $user; + } + + return $this; + } + + public function removeUser(User $user): self + { + if ($this->users->contains($user)) { + $this->users->removeElement($user); + } + + return $this; + } + + public function getId(): ?int + { + return $this->id; + } + + public function getLabel(): array + { + return $this->label; + } + + public function getUsers(): Collection + { + return $this->users; + } +} diff --git a/src/Bundle/ChillMainBundle/migrations/Version20240416145021.php b/src/Bundle/ChillMainBundle/migrations/Version20240416145021.php new file mode 100644 index 000000000..f2f8d37dd --- /dev/null +++ b/src/Bundle/ChillMainBundle/migrations/Version20240416145021.php @@ -0,0 +1,41 @@ +addSql('CREATE SEQUENCE chill_main_user_group_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE TABLE chill_main_user_group (id INT NOT NULL, label JSON DEFAULT \'[]\' NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE TABLE chill_main_user_group_user (usergroup_id INT NOT NULL, user_id INT NOT NULL, PRIMARY KEY(usergroup_id, user_id))'); + $this->addSql('CREATE INDEX IDX_1E07F044D2112630 ON chill_main_user_group_user (usergroup_id)'); + $this->addSql('CREATE INDEX IDX_1E07F044A76ED395 ON chill_main_user_group_user (user_id)'); + $this->addSql('ALTER TABLE chill_main_user_group_user ADD CONSTRAINT FK_1E07F044D2112630 FOREIGN KEY (usergroup_id) REFERENCES chill_main_user_group (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_main_user_group_user ADD CONSTRAINT FK_1E07F044A76ED395 FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + } + + public function down(Schema $schema): void + { + $this->addSql('DROP SEQUENCE chill_main_user_group_id_seq'); + $this->addSql('DROP TABLE chill_main_user_group_user'); + $this->addSql('DROP TABLE chill_main_user_group'); + } +} diff --git a/src/Bundle/ChillTicketBundle/src/Entity/AddresseeHistory.php b/src/Bundle/ChillTicketBundle/src/Entity/AddresseeHistory.php new file mode 100644 index 000000000..3939a24c3 --- /dev/null +++ b/src/Bundle/ChillTicketBundle/src/Entity/AddresseeHistory.php @@ -0,0 +1,97 @@ +addresseeUser = $addressee; + } else { + $this->addresseeGroup = $addressee; + } + } + + public function getAddressee(): UserGroup|User + { + if (null !== $this->addresseeGroup) { + return $this->addresseeGroup; + } + + return $this->addresseeUser; + } + + public function getAddresseeGroup(): ?UserGroup + { + return $this->addresseeGroup; + } + + public function getAddresseeUser(): ?User + { + return $this->addresseeUser; + } + + public function getEndDate(): ?\DateTimeImmutable + { + return $this->endDate; + } + + public function getId(): ?int + { + return $this->id; + } + + public function getStartDate(): \DateTimeImmutable + { + return $this->startDate; + } + + public function getTicket(): Ticket + { + return $this->ticket; + } +} diff --git a/src/Bundle/ChillTicketBundle/src/Entity/Comment.php b/src/Bundle/ChillTicketBundle/src/Entity/Comment.php new file mode 100644 index 000000000..d62e6d8b4 --- /dev/null +++ b/src/Bundle/ChillTicketBundle/src/Entity/Comment.php @@ -0,0 +1,55 @@ + ''])] + private string $content = '' + ) {} + + public function getId(): ?int + { + return $this->id; + } + + public function getContent(): string + { + return $this->content; + } + + public function getTicket(): Ticket + { + return $this->ticket; + } +} diff --git a/src/Bundle/ChillTicketBundle/src/Entity/InputHistory.php b/src/Bundle/ChillTicketBundle/src/Entity/InputHistory.php new file mode 100644 index 000000000..2b25ae6ac --- /dev/null +++ b/src/Bundle/ChillTicketBundle/src/Entity/InputHistory.php @@ -0,0 +1,91 @@ + null])] + private ?\DateTimeImmutable $endDate = null; + + #[ORM\ManyToOne(targetEntity: User::class)] + #[ORM\JoinColumn(nullable: true)] + private ?User $removedBy = null; + + public function __construct( + Person|ThirdParty $input, + #[ORM\ManyToOne(targetEntity: Ticket::class)] + #[ORM\JoinColumn(nullable: false)] + private Ticket $ticket, + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: false)] + private \DateTimeImmutable $startDate, + ) { + if ($input instanceof Person) { + $this->person = $input; + } else { + $this->thirdParty = $input; + } + } + + public function getId(): ?int + { + return $this->id; + } + + public function getEndDate(): ?\DateTimeImmutable + { + return $this->endDate; + } + + public function getRemovedBy(): ?User + { + return $this->removedBy; + } + + public function getStartDate(): \DateTimeImmutable + { + return $this->startDate; + } + + public function getTicket(): Ticket + { + return $this->ticket; + } + + public function getInput(): Person|ThirdParty + { + if (null !== $this->person) { + return $this->person; + } + + return $this->thirdParty; + } +} diff --git a/src/Bundle/ChillTicketBundle/src/Entity/Motive.php b/src/Bundle/ChillTicketBundle/src/Entity/Motive.php new file mode 100644 index 000000000..fd744392c --- /dev/null +++ b/src/Bundle/ChillTicketBundle/src/Entity/Motive.php @@ -0,0 +1,55 @@ + '[]'])] + private array $label = []; + + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, nullable: false, options: ['default' => true])] + private bool $active = true; + + public function isActive(): bool + { + return $this->active; + } + + public function setActive(bool $active): void + { + $this->active = $active; + } + + public function getId(): ?int + { + return $this->id; + } + + public function getLabel(): array + { + return $this->label; + } + + public function setLabel(array $label): void + { + $this->label = $label; + } +} diff --git a/src/Bundle/ChillTicketBundle/src/Entity/MotiveHistory.php b/src/Bundle/ChillTicketBundle/src/Entity/MotiveHistory.php new file mode 100644 index 000000000..c96c2d6f4 --- /dev/null +++ b/src/Bundle/ChillTicketBundle/src/Entity/MotiveHistory.php @@ -0,0 +1,72 @@ + null])] + private ?\DateTimeImmutable $endDate = null; + + public function __construct( + #[ORM\ManyToOne(targetEntity: Motive::class)] + #[ORM\JoinColumn(nullable: false)] + private Motive $motive, + #[ORM\ManyToOne(targetEntity: Ticket::class)] + #[ORM\JoinColumn(nullable: false)] + private Ticket $ticket, + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: false)] + private \DateTimeImmutable $startDate = new \DateTimeImmutable('now') + ) {} + + public function getEndDate(): ?\DateTimeImmutable + { + return $this->endDate; + } + + public function getId(): ?int + { + return $this->id; + } + + public function getMotive(): Motive + { + return $this->motive; + } + + public function getStartDate(): \DateTimeImmutable + { + return $this->startDate; + } + + public function getTicket(): Ticket + { + return $this->ticket; + } + + public function setEndDate(?\DateTimeImmutable $endDate): void + { + $this->endDate = $endDate; + } +} diff --git a/src/Bundle/ChillTicketBundle/src/Entity/PersonHistory.php b/src/Bundle/ChillTicketBundle/src/Entity/PersonHistory.php new file mode 100644 index 000000000..9914f96a1 --- /dev/null +++ b/src/Bundle/ChillTicketBundle/src/Entity/PersonHistory.php @@ -0,0 +1,80 @@ + null])] + private ?\DateTimeImmutable $endDate = null; + + #[ORM\ManyToOne(targetEntity: User::class)] + #[ORM\JoinColumn(nullable: true)] + private ?User $removedBy = null; + + public function __construct( + #[ORM\ManyToOne(targetEntity: Person::class, fetch: 'EAGER')] + private Person $person, + #[ORM\ManyToOne(targetEntity: Ticket::class)] + #[ORM\JoinColumn(nullable: false)] + private Ticket $ticket, + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: false)] + private \DateTimeImmutable $startDate, + ) { + // keep ticket instance in sync with this + $this->ticket->addPersonHistory($this); + } + + public function getId(): ?int + { + return $this->id; + } + + public function getPerson(): Person + { + return $this->person; + } + + public function getEndDate(): ?\DateTimeImmutable + { + return $this->endDate; + } + + public function getTicket(): Ticket + { + return $this->ticket; + } + + public function getStartDate(): \DateTimeImmutable + { + return $this->startDate; + } + + public function getRemovedBy(): ?User + { + return $this->removedBy; + } +} diff --git a/src/Bundle/ChillTicketBundle/src/Entity/Ticket.php b/src/Bundle/ChillTicketBundle/src/Entity/Ticket.php new file mode 100644 index 000000000..f74a55a3f --- /dev/null +++ b/src/Bundle/ChillTicketBundle/src/Entity/Ticket.php @@ -0,0 +1,166 @@ + + */ + #[ORM\OneToMany(targetEntity: AddresseeHistory::class, mappedBy: 'ticket')] + private Collection $addresseeHistory; + + /** + * @var Collection + */ + #[ORM\OneToMany(targetEntity: Comment::class, mappedBy: 'ticket')] + private Collection $comments; + + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => ''])] + private string $externalRef = ''; + + /** + * @var Collection + */ + #[ORM\OneToMany(targetEntity: InputHistory::class, mappedBy: 'ticket')] + private Collection $inputHistories; + + /** + * @var Collection + */ + #[ORM\OneToMany(targetEntity: MotiveHistory::class, mappedBy: 'ticket')] + private Collection $motiveHistories; + + /** + * @var Collection + */ + #[ORM\OneToMany(targetEntity: PersonHistory::class, mappedBy: 'ticket')] + private Collection $personHistories; + + public function __construct() + { + $this->addresseeHistory = new ArrayCollection(); + $this->comments = new ArrayCollection(); + $this->motiveHistories = new ArrayCollection(); + $this->personHistories = new ArrayCollection(); + $this->inputHistories = new ArrayCollection(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function getExternalRef(): string + { + return $this->externalRef; + } + + public function setExternalRef(string $externalRef): void + { + $this->externalRef = $externalRef; + } + + /** + * @return list + */ + public function getPersons(): array + { + return $this->personHistories + ->filter(fn (PersonHistory $personHistory) => null === $personHistory->getEndDate()) + ->map(fn (PersonHistory $personHistory) => $personHistory->getPerson()) + ->getValues(); + } + + /** + * Add a PersonHistory. + * + * This method should not be used, use @see{PersonHistory::__construct()} insted. + */ + public function addPersonHistory(PersonHistory $personHistory): void + { + $this->personHistories->add($personHistory); + } + + /** + * @return list + */ + public function getCurrentAddressee(): array + { + $addresses = []; + + foreach ($this->addresseeHistory + ->filter(fn (AddresseeHistory $addresseeHistory) => null === $addresseeHistory->getEndDate()) as $addressHistory) { + $addresses[] = $addressHistory->getAddressee(); + } + + return $addresses; + } + + /** + * @return ReadableCollection + */ + public function getComments(): ReadableCollection + { + return $this->comments; + } + + /** + * @return list + */ + public function getCurrentInputs(): array + { + $inputs = []; + + foreach ($this->inputHistories + ->filter(fn (InputHistory $inputHistory) => null === $inputHistory->getEndDate()) as $inputHistory + ) { + $inputs[] = $inputHistory->getInput(); + } + + return $inputs; + } + + public function getMotive(): ?Motive + { + foreach ($this->motiveHistories as $motiveHistory) { + if (null === $motiveHistory->getEndDate()) { + return $motiveHistory->getMotive(); + } + } + + return null; + } +} diff --git a/src/Bundle/ChillTicketBundle/src/migrations/Version20240416145919.php b/src/Bundle/ChillTicketBundle/src/migrations/Version20240416145919.php new file mode 100644 index 000000000..f627a4143 --- /dev/null +++ b/src/Bundle/ChillTicketBundle/src/migrations/Version20240416145919.php @@ -0,0 +1,139 @@ +addSql('CREATE SCHEMA chill_ticket'); + $this->addSql('CREATE SEQUENCE chill_ticket.addressee_history_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE chill_ticket.comment_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE chill_ticket.input_history_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE chill_ticket.motive_id_seq INCREMENT BY 1 MINVALUE 1 START 1000'); + $this->addSql('CREATE SEQUENCE chill_ticket.motives_history_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE chill_ticket.person_history_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE chill_ticket.ticket_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE TABLE chill_ticket.addressee_history (id INT NOT NULL, ticket_id INT NOT NULL, startDate TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, createdAt TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, updatedAt TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, addresseeUser_id INT DEFAULT NULL, addresseeGroup_id INT DEFAULT NULL, createdBy_id INT DEFAULT NULL, updatedBy_id INT DEFAULT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE INDEX IDX_434EBDBD4D06F00C ON chill_ticket.addressee_history (addresseeUser_id)'); + $this->addSql('CREATE INDEX IDX_434EBDBD776D9A84 ON chill_ticket.addressee_history (addresseeGroup_id)'); + $this->addSql('CREATE INDEX IDX_434EBDBD700047D2 ON chill_ticket.addressee_history (ticket_id)'); + $this->addSql('CREATE INDEX IDX_434EBDBD3174800F ON chill_ticket.addressee_history (createdBy_id)'); + $this->addSql('CREATE INDEX IDX_434EBDBD65FF1AEC ON chill_ticket.addressee_history (updatedBy_id)'); + $this->addSql('COMMENT ON COLUMN chill_ticket.addressee_history.startDate IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('COMMENT ON COLUMN chill_ticket.addressee_history.createdAt IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('COMMENT ON COLUMN chill_ticket.addressee_history.updatedAt IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('CREATE TABLE chill_ticket.comment (id INT NOT NULL, ticket_id INT NOT NULL, content TEXT DEFAULT \'\' NOT NULL, createdAt TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, updatedAt TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, createdBy_id INT DEFAULT NULL, updatedBy_id INT DEFAULT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE INDEX IDX_79EBD416700047D2 ON chill_ticket.comment (ticket_id)'); + $this->addSql('CREATE INDEX IDX_79EBD4163174800F ON chill_ticket.comment (createdBy_id)'); + $this->addSql('CREATE INDEX IDX_79EBD41665FF1AEC ON chill_ticket.comment (updatedBy_id)'); + $this->addSql('COMMENT ON COLUMN chill_ticket.comment.createdAt IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('COMMENT ON COLUMN chill_ticket.comment.updatedAt IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('CREATE TABLE chill_ticket.input_history (id INT NOT NULL, person_id INT DEFAULT NULL, ticket_id INT NOT NULL, endDate TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, startDate TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, thirdParty_id INT DEFAULT NULL, removedBy_id INT DEFAULT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE INDEX IDX_E2AA301F217BBB47 ON chill_ticket.input_history (person_id)'); + $this->addSql('CREATE INDEX IDX_E2AA301F3EA5CAB0 ON chill_ticket.input_history (thirdParty_id)'); + $this->addSql('CREATE INDEX IDX_E2AA301FB8346CCF ON chill_ticket.input_history (removedBy_id)'); + $this->addSql('CREATE INDEX IDX_E2AA301F700047D2 ON chill_ticket.input_history (ticket_id)'); + $this->addSql('COMMENT ON COLUMN chill_ticket.input_history.endDate IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('COMMENT ON COLUMN chill_ticket.input_history.startDate IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('CREATE TABLE chill_ticket.motive (id INT NOT NULL, label JSON DEFAULT \'[]\' NOT NULL, active BOOLEAN DEFAULT true NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE TABLE chill_ticket.motives_history (id INT NOT NULL, motive_id INT NOT NULL, ticket_id INT NOT NULL, endDate TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, startDate TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, createdAt TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, createdBy_id INT DEFAULT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE INDEX IDX_48995CFF9658649C ON chill_ticket.motives_history (motive_id)'); + $this->addSql('CREATE INDEX IDX_48995CFF700047D2 ON chill_ticket.motives_history (ticket_id)'); + $this->addSql('CREATE INDEX IDX_48995CFF3174800F ON chill_ticket.motives_history (createdBy_id)'); + $this->addSql('COMMENT ON COLUMN chill_ticket.motives_history.endDate IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('COMMENT ON COLUMN chill_ticket.motives_history.startDate IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('COMMENT ON COLUMN chill_ticket.motives_history.createdAt IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('CREATE TABLE chill_ticket.person_history (id INT NOT NULL, person_id INT DEFAULT NULL, ticket_id INT NOT NULL, endDate TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, startDate TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, createdAt TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, removedBy_id INT DEFAULT NULL, createdBy_id INT DEFAULT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE INDEX IDX_F2969246B8346CCF ON chill_ticket.person_history (removedBy_id)'); + $this->addSql('CREATE INDEX IDX_F2969246217BBB47 ON chill_ticket.person_history (person_id)'); + $this->addSql('CREATE INDEX IDX_F2969246700047D2 ON chill_ticket.person_history (ticket_id)'); + $this->addSql('CREATE INDEX IDX_F29692463174800F ON chill_ticket.person_history (createdBy_id)'); + $this->addSql('COMMENT ON COLUMN chill_ticket.person_history.endDate IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('COMMENT ON COLUMN chill_ticket.person_history.startDate IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('COMMENT ON COLUMN chill_ticket.person_history.createdAt IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('CREATE TABLE chill_ticket.ticket (id INT NOT NULL, externalRef TEXT DEFAULT \'\' NOT NULL, createdAt TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, updatedAt TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, createdBy_id INT DEFAULT NULL, updatedBy_id INT DEFAULT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE INDEX IDX_B0A5F7233174800F ON chill_ticket.ticket (createdBy_id)'); + $this->addSql('CREATE INDEX IDX_B0A5F72365FF1AEC ON chill_ticket.ticket (updatedBy_id)'); + $this->addSql('COMMENT ON COLUMN chill_ticket.ticket.createdAt IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('COMMENT ON COLUMN chill_ticket.ticket.updatedAt IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('ALTER TABLE chill_ticket.addressee_history ADD CONSTRAINT FK_434EBDBD4D06F00C FOREIGN KEY (addresseeUser_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_ticket.addressee_history ADD CONSTRAINT FK_434EBDBD776D9A84 FOREIGN KEY (addresseeGroup_id) REFERENCES chill_main_user_group (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_ticket.addressee_history ADD CONSTRAINT FK_434EBDBD700047D2 FOREIGN KEY (ticket_id) REFERENCES chill_ticket.ticket (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_ticket.addressee_history ADD CONSTRAINT FK_434EBDBD3174800F FOREIGN KEY (createdBy_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_ticket.addressee_history ADD CONSTRAINT FK_434EBDBD65FF1AEC FOREIGN KEY (updatedBy_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_ticket.comment ADD CONSTRAINT FK_79EBD416700047D2 FOREIGN KEY (ticket_id) REFERENCES chill_ticket.ticket (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_ticket.comment ADD CONSTRAINT FK_79EBD4163174800F FOREIGN KEY (createdBy_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_ticket.comment ADD CONSTRAINT FK_79EBD41665FF1AEC FOREIGN KEY (updatedBy_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_ticket.input_history ADD CONSTRAINT FK_E2AA301F217BBB47 FOREIGN KEY (person_id) REFERENCES chill_person_person (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_ticket.input_history ADD CONSTRAINT FK_E2AA301F3EA5CAB0 FOREIGN KEY (thirdParty_id) REFERENCES chill_3party.third_party (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_ticket.input_history ADD CONSTRAINT FK_E2AA301FB8346CCF FOREIGN KEY (removedBy_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_ticket.input_history ADD CONSTRAINT FK_E2AA301F700047D2 FOREIGN KEY (ticket_id) REFERENCES chill_ticket.ticket (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_ticket.motives_history ADD CONSTRAINT FK_48995CFF9658649C FOREIGN KEY (motive_id) REFERENCES chill_ticket.motive (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_ticket.motives_history ADD CONSTRAINT FK_48995CFF700047D2 FOREIGN KEY (ticket_id) REFERENCES chill_ticket.ticket (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_ticket.motives_history ADD CONSTRAINT FK_48995CFF3174800F FOREIGN KEY (createdBy_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_ticket.person_history ADD CONSTRAINT FK_F2969246B8346CCF FOREIGN KEY (removedBy_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_ticket.person_history ADD CONSTRAINT FK_F2969246217BBB47 FOREIGN KEY (person_id) REFERENCES chill_person_person (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_ticket.person_history ADD CONSTRAINT FK_F2969246700047D2 FOREIGN KEY (ticket_id) REFERENCES chill_ticket.ticket (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_ticket.person_history ADD CONSTRAINT FK_F29692463174800F FOREIGN KEY (createdBy_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_ticket.ticket ADD CONSTRAINT FK_B0A5F7233174800F FOREIGN KEY (createdBy_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_ticket.ticket ADD CONSTRAINT FK_B0A5F72365FF1AEC FOREIGN KEY (updatedBy_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + } + + public function down(Schema $schema): void + { + $this->addSql('DROP SEQUENCE chill_ticket.addressee_history_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE chill_ticket.comment_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE chill_ticket.input_history_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE chill_ticket.motive_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE chill_ticket.motives_history_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE chill_ticket.person_history_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE chill_ticket.ticket_id_seq CASCADE'); + $this->addSql('ALTER TABLE chill_ticket.addressee_history DROP CONSTRAINT FK_434EBDBD4D06F00C'); + $this->addSql('ALTER TABLE chill_ticket.addressee_history DROP CONSTRAINT FK_434EBDBD776D9A84'); + $this->addSql('ALTER TABLE chill_ticket.addressee_history DROP CONSTRAINT FK_434EBDBD700047D2'); + $this->addSql('ALTER TABLE chill_ticket.addressee_history DROP CONSTRAINT FK_434EBDBD3174800F'); + $this->addSql('ALTER TABLE chill_ticket.addressee_history DROP CONSTRAINT FK_434EBDBD65FF1AEC'); + $this->addSql('ALTER TABLE chill_ticket.comment DROP CONSTRAINT FK_79EBD416700047D2'); + $this->addSql('ALTER TABLE chill_ticket.comment DROP CONSTRAINT FK_79EBD4163174800F'); + $this->addSql('ALTER TABLE chill_ticket.comment DROP CONSTRAINT FK_79EBD41665FF1AEC'); + $this->addSql('ALTER TABLE chill_ticket.input_history DROP CONSTRAINT FK_E2AA301F217BBB47'); + $this->addSql('ALTER TABLE chill_ticket.input_history DROP CONSTRAINT FK_E2AA301F3EA5CAB0'); + $this->addSql('ALTER TABLE chill_ticket.input_history DROP CONSTRAINT FK_E2AA301FB8346CCF'); + $this->addSql('ALTER TABLE chill_ticket.input_history DROP CONSTRAINT FK_E2AA301F700047D2'); + $this->addSql('ALTER TABLE chill_ticket.motives_history DROP CONSTRAINT FK_48995CFF9658649C'); + $this->addSql('ALTER TABLE chill_ticket.motives_history DROP CONSTRAINT FK_48995CFF700047D2'); + $this->addSql('ALTER TABLE chill_ticket.motives_history DROP CONSTRAINT FK_48995CFF3174800F'); + $this->addSql('ALTER TABLE chill_ticket.person_history DROP CONSTRAINT FK_F2969246B8346CCF'); + $this->addSql('ALTER TABLE chill_ticket.person_history DROP CONSTRAINT FK_F2969246217BBB47'); + $this->addSql('ALTER TABLE chill_ticket.person_history DROP CONSTRAINT FK_F2969246700047D2'); + $this->addSql('ALTER TABLE chill_ticket.person_history DROP CONSTRAINT FK_F29692463174800F'); + $this->addSql('ALTER TABLE chill_ticket.ticket DROP CONSTRAINT FK_B0A5F7233174800F'); + $this->addSql('ALTER TABLE chill_ticket.ticket DROP CONSTRAINT FK_B0A5F72365FF1AEC'); + $this->addSql('DROP TABLE chill_ticket.addressee_history'); + $this->addSql('DROP TABLE chill_ticket.comment'); + $this->addSql('DROP TABLE chill_ticket.input_history'); + $this->addSql('DROP TABLE chill_ticket.motive'); + $this->addSql('DROP TABLE chill_ticket.motives_history'); + $this->addSql('DROP TABLE chill_ticket.person_history'); + $this->addSql('DROP TABLE chill_ticket.ticket'); + $this->addSql('DROP SCHEMA chill_ticket CASCADE'); + } +} From 4b30d922820bd47739c461f9514478440d948e75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 17 Apr 2024 09:56:41 +0200 Subject: [PATCH 010/283] Add ticket creation and associating by phone number functionality This update introduces new features allowing the creation of tickets and associating them with a phone number. Specifically, relevant commands and their handlers have been created along with corresponding tests. An endpoint for ticket creation has also been set up, and the ViewTicketController has been renamed and refactored to EditTicketController to better reflect its function. --- .../Ticket/AssociateByPhonenumberCommand.php | 19 ++++++ .../Command/Ticket/CreateTicketCommand.php | 19 ++++++ .../AssociateByPhonenumberCommandHandler.php | 41 ++++++++++++ .../Handler/CreateTicketCommandHandler.php | 26 ++++++++ .../src/Controller/CreateTicketController.php | 60 ++++++++++++++++++ ...ontroller.php => EditTicketController.php} | 10 +-- .../src/config/services.yaml | 3 +- ...sociateByPhonenumberCommandHandlerTest.php | 62 +++++++++++++++++++ .../CreateTicketCommandHandlerTest.php | 48 ++++++++++++++ 9 files changed, 283 insertions(+), 5 deletions(-) create mode 100644 src/Bundle/ChillTicketBundle/src/Command/Ticket/AssociateByPhonenumberCommand.php create mode 100644 src/Bundle/ChillTicketBundle/src/Command/Ticket/CreateTicketCommand.php create mode 100644 src/Bundle/ChillTicketBundle/src/Command/Ticket/Handler/AssociateByPhonenumberCommandHandler.php create mode 100644 src/Bundle/ChillTicketBundle/src/Command/Ticket/Handler/CreateTicketCommandHandler.php create mode 100644 src/Bundle/ChillTicketBundle/src/Controller/CreateTicketController.php rename src/Bundle/ChillTicketBundle/src/Controller/{ViewTicketController.php => EditTicketController.php} (64%) create mode 100644 src/Bundle/ChillTicketBundle/tests/Command/Ticket/Handler/AssociateByPhonenumberCommandHandlerTest.php create mode 100644 src/Bundle/ChillTicketBundle/tests/Command/Ticket/Handler/CreateTicketCommandHandlerTest.php diff --git a/src/Bundle/ChillTicketBundle/src/Command/Ticket/AssociateByPhonenumberCommand.php b/src/Bundle/ChillTicketBundle/src/Command/Ticket/AssociateByPhonenumberCommand.php new file mode 100644 index 000000000..61e652190 --- /dev/null +++ b/src/Bundle/ChillTicketBundle/src/Command/Ticket/AssociateByPhonenumberCommand.php @@ -0,0 +1,19 @@ +phoneNumberUtil->parse($command->phonenumber); + $persons = $this->personRepository->findByPhone($phone); + + foreach ($persons as $person) { + $history = new PersonHistory($person, $ticket, $this->clock->now()); + $this->entityManager->persist($history); + } + } +} diff --git a/src/Bundle/ChillTicketBundle/src/Command/Ticket/Handler/CreateTicketCommandHandler.php b/src/Bundle/ChillTicketBundle/src/Command/Ticket/Handler/CreateTicketCommandHandler.php new file mode 100644 index 000000000..a62c0418e --- /dev/null +++ b/src/Bundle/ChillTicketBundle/src/Command/Ticket/Handler/CreateTicketCommandHandler.php @@ -0,0 +1,26 @@ +setExternalRef($command->externalReference); + + return $ticket; + } +} diff --git a/src/Bundle/ChillTicketBundle/src/Controller/CreateTicketController.php b/src/Bundle/ChillTicketBundle/src/Controller/CreateTicketController.php new file mode 100644 index 000000000..ec2ea7b90 --- /dev/null +++ b/src/Bundle/ChillTicketBundle/src/Controller/CreateTicketController.php @@ -0,0 +1,60 @@ +security->isGranted('ROLE_USER')) { + throw new AccessDeniedHttpException('Only users are allowed to create tickets.'); + } + + $createCommand = new CreateTicketCommand($request->query->get('extId', '')); + $ticket = $this->createTicketCommandHandler->__invoke($createCommand); + + $this->entityManager->persist($ticket); + + if ($request->query->has('caller')) { + $associateByPhonenumberCommand = new AssociateByPhonenumberCommand($request->query->get('caller')); + $this->associateByPhonenumberCommandHandler->__invoke($ticket, $associateByPhonenumberCommand); + } + + $this->entityManager->flush(); + + return new RedirectResponse( + $this->urlGenerator->generate('chill_ticket_ticket_edit', ['id' => $ticket->getId()]) + ); + } +} diff --git a/src/Bundle/ChillTicketBundle/src/Controller/ViewTicketController.php b/src/Bundle/ChillTicketBundle/src/Controller/EditTicketController.php similarity index 64% rename from src/Bundle/ChillTicketBundle/src/Controller/ViewTicketController.php rename to src/Bundle/ChillTicketBundle/src/Controller/EditTicketController.php index 9b35c0d48..a51c3a4a8 100644 --- a/src/Bundle/ChillTicketBundle/src/Controller/ViewTicketController.php +++ b/src/Bundle/ChillTicketBundle/src/Controller/EditTicketController.php @@ -11,14 +11,16 @@ declare(strict_types=1); namespace Chill\TicketBundle\Controller; +use Chill\TicketBundle\Entity\Ticket; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; -class ViewTicketController +class EditTicketController { - #[Route('/{_locale}/ticket/ticket/{ticketId}', name: 'chill_ticket_ticket_view')] - public function __invoke(int $ticketId): Response - { + #[Route('/{_locale}/ticket/ticket/{id}/edit', name: 'chill_ticket_ticket_edit')] + public function __invoke( + Ticket $ticket + ): Response { return new Response('ok'); } } diff --git a/src/Bundle/ChillTicketBundle/src/config/services.yaml b/src/Bundle/ChillTicketBundle/src/config/services.yaml index 6d2f9e1bf..372baa81f 100644 --- a/src/Bundle/ChillTicketBundle/src/config/services.yaml +++ b/src/Bundle/ChillTicketBundle/src/config/services.yaml @@ -8,5 +8,6 @@ services: tags: - controller.service_arguments - + Chill\TicketBundle\Command\Ticket\Handler\: + resource: '../Command/Ticket/Handler/' diff --git a/src/Bundle/ChillTicketBundle/tests/Command/Ticket/Handler/AssociateByPhonenumberCommandHandlerTest.php b/src/Bundle/ChillTicketBundle/tests/Command/Ticket/Handler/AssociateByPhonenumberCommandHandlerTest.php new file mode 100644 index 000000000..ab0744015 --- /dev/null +++ b/src/Bundle/ChillTicketBundle/tests/Command/Ticket/Handler/AssociateByPhonenumberCommandHandlerTest.php @@ -0,0 +1,62 @@ +prophesize(ObjectManager::class); + + return new AssociateByPhonenumberCommandHandler( + $personACLAwareRepository, + PhoneNumberUtil::getInstance(), + new MockClock(), + $objectManager->reveal() + ); + } + + public function testHandleWithPersonFoundByPhonenumber(): void + { + $person = new Person(); + + $personAclAwareRepository = $this->prophesize(PersonACLAwareRepositoryInterface::class); + $personAclAwareRepository->findByPhone(Argument::any())->willReturn([$person]); + + $handler = $this->getHandler($personAclAwareRepository->reveal()); + + $ticket = new Ticket(); + $handler($ticket, new AssociateByPhonenumberCommand('+3281136917')); + + self::assertSame($person, $ticket->getPersons()[0]); + } +} diff --git a/src/Bundle/ChillTicketBundle/tests/Command/Ticket/Handler/CreateTicketCommandHandlerTest.php b/src/Bundle/ChillTicketBundle/tests/Command/Ticket/Handler/CreateTicketCommandHandlerTest.php new file mode 100644 index 000000000..3b94dd706 --- /dev/null +++ b/src/Bundle/ChillTicketBundle/tests/Command/Ticket/Handler/CreateTicketCommandHandlerTest.php @@ -0,0 +1,48 @@ +getHandler())($command); + + self::assertInstanceOf(Ticket::class, $actual); + self::assertEquals('', $actual->getExternalRef()); + } + + public function testHandleWithReference(): void + { + $command = new CreateTicketCommand($ref = 'external-ref'); + $actual = ($this->getHandler())($command); + + self::assertInstanceOf(Ticket::class, $actual); + self::assertEquals($ref, $actual->getExternalRef()); + } +} From 36bc4dab24ae952c5994e32ebe9696df7a2bf7cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 17 Apr 2024 10:26:33 +0200 Subject: [PATCH 011/283] Configure a testsuite for TicketBundle --- phpunit.xml.dist | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 336877a0c..fa8f479c5 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -49,6 +49,10 @@ src/Bundle/ChillPersonBundle/Tests/Controller/PersonDuplicateControllerViewTest.php + + + src/Bundle/ChillTicketBundle/tests/ + +

This is the Transfert tab pane content.

+ +
+ +

This is the Motif tab pane content.

+
+
+ +

This is the Fermer tab pane content.

+
+ + + + - - diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/MotiveSelectorComponent.vue b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/MotiveSelectorComponent.vue new file mode 100644 index 000000000..70f851396 --- /dev/null +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/MotiveSelectorComponent.vue @@ -0,0 +1,42 @@ + + + + + diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/TicketSelectorComponent.vue b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/TicketSelectorComponent.vue index 7d1326513..bfab4dfb8 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/TicketSelectorComponent.vue +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/TicketSelectorComponent.vue @@ -2,9 +2,9 @@
@@ -20,8 +20,6 @@ import { PropType, defineComponent } from 'vue'; - - // Types import { Ticket } from '../../../types'; diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/index.ts b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/index.ts index e6f9011b0..f27823031 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/index.ts +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/index.ts @@ -3,7 +3,6 @@ import {createApp} from "vue"; import { _createI18n } from "../../../../../../ChillMainBundle/Resources/public/vuejs/_js/i18n"; - import VueToast from 'vue-toast-notification'; import 'vue-toast-notification/dist/theme-sugar.css'; From b40ad9e44569e71fce1762272d74dc7fc75adee5 Mon Sep 17 00:00:00 2001 From: Boris Waaub Date: Thu, 25 Apr 2024 11:16:08 +0200 Subject: [PATCH 037/283] =?UTF-8?q?Mise=20=C3=A0=20jour=20des=20messages?= =?UTF-8?q?=20de=20l'interface=20utilisateur=20pour=20inclure=20les=20fonc?= =?UTF-8?q?tionnalit=C3=A9s=20de=20commentaire,=20de=20motif=20et=20de=20t?= =?UTF-8?q?ransfert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Resources/public/vuejs/TicketApp/App.vue | 5 -- .../components/ActionToolbarComponent.vue | 53 +++++++++++++------ .../components/MotiveListComponent.vue | 43 --------------- .../components/MotiveSelectorComponent.vue | 21 ++++---- .../public/vuejs/TicketApp/i18n/messages.ts | 15 ++++++ 5 files changed, 61 insertions(+), 76 deletions(-) delete mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/MotiveListComponent.vue diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue index b44e84dc8..9568dd95e 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue @@ -3,7 +3,6 @@
-
@@ -22,7 +21,6 @@ import TicketSelectorComponent from './components/TicketSelectorComponent.vue'; import TicketHistoryListComponent from './components/TicketHistoryListComponent.vue'; import ActionToolbarComponent from './components/ActionToolbarComponent.vue'; import BannerComponent from './components/BannerComponent.vue'; -import MotiveListComponent from './components/MotiveListComponent.vue'; export default defineComponent({ name: 'App', @@ -30,7 +28,6 @@ export default defineComponent({ BannerComponent, TicketSelectorComponent, TicketHistoryListComponent, - MotiveListComponent, ActionToolbarComponent }, setup() { @@ -44,8 +41,6 @@ export default defineComponent({ const ticket = computed(() => store.getters.getTicket as Ticket) onMounted(() => { - console.log(headline.value.textContent); - try { store.dispatch('fetchMotives') } catch (error) { diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/ActionToolbarComponent.vue b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/ActionToolbarComponent.vue index f53447c8a..2c5fc284d 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/ActionToolbarComponent.vue +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/ActionToolbarComponent.vue @@ -4,29 +4,43 @@
- - + +
+ +
-
- -

This is the Transfert tab pane content.

+
+ + +
+ +
-
- -

This is the Motif tab pane content.

-
-
- -

This is the Fermer tab pane content.

+
+ +
+ +
+
+ +
-
diff --git a/src/Bundle/ChillTicketBundle/translations/messages.fr.yaml b/src/Bundle/ChillTicketBundle/translations/messages.fr.yaml index 6f2c57afa..bcc75537e 100644 --- a/src/Bundle/ChillTicketBundle/translations/messages.fr.yaml +++ b/src/Bundle/ChillTicketBundle/translations/messages.fr.yaml @@ -3,3 +3,4 @@ caller: Appelant speaker: Intervenant open: Ouvert since: Depuis +no_motive: Pas de motif From 7b8cd90cf17eda4f2beefe01394d99a014aeffec Mon Sep 17 00:00:00 2001 From: Boris Waaub Date: Thu, 2 May 2024 12:03:10 +0200 Subject: [PATCH 043/283] Add user store --- .../public/vuejs/TicketApp/store/index.ts | 5 +- .../vuejs/TicketApp/store/modules/ticket.ts | 2 - .../vuejs/TicketApp/store/modules/user.ts | 70 +++++++++++++++++++ 3 files changed, 74 insertions(+), 3 deletions(-) create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/user.ts diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/index.ts b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/index.ts index 82dd600a9..61c13b9b9 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/index.ts +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/index.ts @@ -1,12 +1,14 @@ import { createStore } from "vuex"; import { State as MotiveStates, moduleMotive } from "./modules/motive"; import { State as TicketStates, moduleTicket } from "./modules/ticket"; -import { State as CommentStates, moduleComment } from "./modules/comment"; +import { State as CommentStates, moduleComment } from "./modules/comment"; +import { State as UserStates, moduleUser } from "./modules/user"; export type RootState = { motive: MotiveStates; ticket: TicketStates; comment: CommentStates; + user: UserStates; }; export const store = createStore({ @@ -14,6 +16,7 @@ export const store = createStore({ motive:moduleMotive, ticket:moduleTicket, comment:moduleComment, + user:moduleUser, } }); diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/ticket.ts b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/ticket.ts index 4e3a55762..c02b520eb 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/ticket.ts +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/ticket.ts @@ -1,5 +1,3 @@ -import { fetchResults, makeFetch } from "../../../../../../../../ChillMainBundle/Resources/public/lib/api/apiMethods"; - import { Module } from "vuex"; import { RootState } from ".."; diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/user.ts b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/user.ts new file mode 100644 index 000000000..5fa9e8be1 --- /dev/null +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/user.ts @@ -0,0 +1,70 @@ +import { + fetchResults, + makeFetch, +} from "../../../../../../../../ChillMainBundle/Resources/public/lib/api/apiMethods"; + +import { Module } from "vuex"; +import { RootState } from ".."; + +import { + User, + UserGroup, + UserGroupOrUser, +} from "../../../../../../../../ChillMainBundle/Resources/public/types"; + +export interface State { + userGroups: Array; + users: Array; +} + +export const moduleUser: Module = { + state: () => ({ + userGroups: [] as Array, + users: [] as Array, + }), + getters: { + getUserGroups(state) { + return state.userGroups; + }, + getUsers(state) { + return state.users; + }, + }, + mutations: {}, + actions: { + getUserGroups({ commit }) { + try { + fetchResults("/api/1.0/main/user-group.json").then( + (results) => { + commit("setUserGroups", results); + } + ); + } catch (e: any) { + throw e.name; + } + }, + getUsers({ commit }) { + try { + fetchResults("/1.0/main/user.json").then((results) => { + commit("setUserGroups", results); + }); + } catch (e: any) { + throw e.name; + } + }, + + async setAdressees({ commit }, datas: { ticketId: number; addressees: Array}) { + const { ticketId, addressees } = datas; + try { + const result = await makeFetch( + "POST", + `/api/1.0/ticket/${ticketId}/addressees/set`, + addressees + ); + commit("setTicket", result); + } catch (e: any) { + throw e.name; + } + }, + }, +}; From eb0bf56cff7a1e8df36e6e38ba079efa43c74510 Mon Sep 17 00:00:00 2001 From: Boris Waaub Date: Thu, 2 May 2024 13:18:45 +0200 Subject: [PATCH 044/283] Add user group addressee --- .../src/Resources/public/types.ts | 2 +- .../Resources/public/vuejs/TicketApp/App.vue | 6 +- .../components/ActionToolbarComponent.vue | 49 ++++++++++---- .../components/AddresseeSelectorComponent.vue | 65 +++++++++++++++++++ .../components/MotiveSelectorComponent.vue | 10 +-- .../TicketHistoryAddresseeComponent .vue | 30 +++++++++ .../components/TicketHistoryListComponent.vue | 2 + .../public/vuejs/TicketApp/i18n/messages.ts | 1 + .../vuejs/TicketApp/store/modules/motive.ts | 19 +++--- .../vuejs/TicketApp/store/modules/user.ts | 28 ++++++-- .../Resources/views/Banner/banner.html.twig | 12 ++-- 11 files changed, 178 insertions(+), 46 deletions(-) create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/AddresseeSelectorComponent.vue create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/TicketHistoryAddresseeComponent .vue diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/types.ts b/src/Bundle/ChillTicketBundle/src/Resources/public/types.ts index 2c347977c..9c0d467f8 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/public/types.ts +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/types.ts @@ -52,7 +52,7 @@ export interface Comment { updatedAt: DateTime|null, } -interface AddresseeHistory { +export interface AddresseeHistory { type: "ticket_addressee_history", id: number, startDate: DateTime|null, diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue index b993caa2f..cf4eff359 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue @@ -37,9 +37,11 @@ export default defineComponent({ const motives = computed(() => store.getters.getMotives as Motive[]) const ticket = computed(() => store.getters.getTicket as Ticket) - onMounted(() => { + onMounted(async () => { try { - store.dispatch('fetchMotives') + await store.dispatch('fetchMotives') + await store.dispatch('fetchUserGroups') + await store.dispatch('fetchUsers') } catch (error) { toast.error(error) }; diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/ActionToolbarComponent.vue b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/ActionToolbarComponent.vue index 986e466eb..ed38bedae 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/ActionToolbarComponent.vue +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/ActionToolbarComponent.vue @@ -24,19 +24,21 @@
-
- -
+
+ +
+ +
+
- +
diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/i18n/messages.ts b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/i18n/messages.ts index f1605c4a5..e320b84e7 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/i18n/messages.ts +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/i18n/messages.ts @@ -10,6 +10,7 @@ const messages = { user: "Prise en charge par {username}", motive: "Motif indiqué: {motive}", comment: "Commentaire: {comment}", + user_group: "Transferer au group: {user_group}", }, comment: { title: "Commentaire", diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/motive.ts b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/motive.ts index 296301fc2..1c2696106 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/motive.ts +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/motive.ts @@ -20,12 +20,6 @@ export const moduleMotive: Module = { getMotives(state) { return state.motives; }, - getMotiveOptions(state) { - return state.motives.map((motive) => ({ - value: motive.id, - text: motive.label.fr, - })); - }, }, mutations: { setMotives(state, motives) { @@ -39,8 +33,7 @@ export const moduleMotive: Module = { "/api/1.0/ticket/motive.json" )) as Motive[]; commit("setMotives", results); - } - catch(e: any) { + } catch (e: any) { throw e.name; } }, @@ -54,11 +47,15 @@ export const moduleMotive: Module = { const result = await makeFetch( "POST", `/api/1.0/ticket/${ticketId}/motive/set`, - { motive } + { + motive: { + id: motive.id, + type: motive.type, + }, + } ); commit("setTicket", result); - } - catch(e: any) { + } catch (e: any) { throw e.name; } }, diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/user.ts b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/user.ts index 5fa9e8be1..f4441e34b 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/user.ts +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/user.ts @@ -30,9 +30,16 @@ export const moduleUser: Module = { return state.users; }, }, - mutations: {}, + mutations: { + setUserGroups(state, userGroups) { + state.userGroups = userGroups; + }, + setUsers(state, users) { + state.users = users; + }, + }, actions: { - getUserGroups({ commit }) { + fetchUserGroups({ commit }) { try { fetchResults("/api/1.0/main/user-group.json").then( (results) => { @@ -43,23 +50,30 @@ export const moduleUser: Module = { throw e.name; } }, - getUsers({ commit }) { + fetchUsers({ commit }) { try { - fetchResults("/1.0/main/user.json").then((results) => { - commit("setUserGroups", results); + fetchResults("/api/1.0/main/user.json").then((results) => { + commit("setUsers", results); }); } catch (e: any) { throw e.name; } }, - async setAdressees({ commit }, datas: { ticketId: number; addressees: Array}) { + async setAdressees( + { commit }, + datas: { ticketId: number; addressees: Array } + ) { const { ticketId, addressees } = datas; try { const result = await makeFetch( "POST", `/api/1.0/ticket/${ticketId}/addressees/set`, - addressees + { + addressees: addressees.map((addressee) => { + return { id: addressee.id, type: addressee.type }; + }), + } ); commit("setTicket", result); } catch (e: any) { diff --git a/src/Bundle/ChillTicketBundle/src/Resources/views/Banner/banner.html.twig b/src/Bundle/ChillTicketBundle/src/Resources/views/Banner/banner.html.twig index c8a7ff724..46f02d298 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/views/Banner/banner.html.twig +++ b/src/Bundle/ChillTicketBundle/src/Resources/views/Banner/banner.html.twig @@ -36,7 +36,7 @@

{{'concerned_patient' | trans}}

{% for person in ticket.getPersons() %} - + {{ person.firstName }} {{ person.lastName }} @@ -51,12 +51,10 @@

{{'speaker' | trans}}

{% for addressee in ticket.getCurrentAddressee() %} - - {% if addressee.type=='chill_main_user_group' %} - {{ addressee.label.fr }} - {% else %} - {{ addressee.username }} - {% endif %} + + + {{ addressee.label.fr }} + {% endfor %}

From 1d0045714188f791a42a9fe95fdf68373cd66bda Mon Sep 17 00:00:00 2001 From: Boris Waaub Date: Thu, 2 May 2024 14:09:52 +0200 Subject: [PATCH 045/283] =?UTF-8?q?Ajouter=20les=20propri=C3=A9t=C3=A9s=20?= =?UTF-8?q?createdAt=20et=20updatedBy=20=C3=A0=20l'interface=20Ticket?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Bundle/ChillTicketBundle/src/Resources/public/types.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/types.ts b/src/Bundle/ChillTicketBundle/src/Resources/public/types.ts index 9c0d467f8..6d8657f82 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/public/types.ts +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/types.ts @@ -80,5 +80,7 @@ export interface Ticket { currentPersons: Person[], currentMotive: null|Motive, history: TicketHistoryLine[], + createdAt: DateTime|null, + updatedBy: User|null, } From 6500c24a7f436ced4bed0f1963c2f6fa7b7564d2 Mon Sep 17 00:00:00 2001 From: Boris Waaub Date: Thu, 2 May 2024 14:10:22 +0200 Subject: [PATCH 046/283] =?UTF-8?q?D=C3=A9placer=20le=20r=C3=A9pertoire=20?= =?UTF-8?q?translation=20dans=20source?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ChillTicketBundle/{ => src}/translations/messages.fr.yaml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/Bundle/ChillTicketBundle/{ => src}/translations/messages.fr.yaml (100%) diff --git a/src/Bundle/ChillTicketBundle/translations/messages.fr.yaml b/src/Bundle/ChillTicketBundle/src/translations/messages.fr.yaml similarity index 100% rename from src/Bundle/ChillTicketBundle/translations/messages.fr.yaml rename to src/Bundle/ChillTicketBundle/src/translations/messages.fr.yaml From 473765366a6c72f1bc78f2ec98272e095af8a647 Mon Sep 17 00:00:00 2001 From: Boris Waaub Date: Mon, 6 May 2024 16:38:56 +0200 Subject: [PATCH 047/283] Add tranfert with AddPerson --- .../components/ActionToolbarComponent.vue | 10 +- .../components/AddresseeSelectorComponent.vue | 184 ++++++++++++++++-- .../TicketHistoryAddresseeComponent .vue | 30 --- .../TicketHistoryAddresseeComponent.vue | 48 +++++ .../components/TicketHistoryListComponent.vue | 67 ++++--- .../TicketHistoryPersonComponent.vue | 20 +- .../public/vuejs/TicketApp/i18n/messages.ts | 6 +- 7 files changed, 275 insertions(+), 90 deletions(-) delete mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/TicketHistoryAddresseeComponent .vue create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/TicketHistoryAddresseeComponent.vue diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/ActionToolbarComponent.vue b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/ActionToolbarComponent.vue index ed38bedae..d188bdab0 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/ActionToolbarComponent.vue +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/ActionToolbarComponent.vue @@ -24,9 +24,9 @@

- + -
+
From f0045edd6c5cf9289c8bb9257de1b9a2a84d0adf Mon Sep 17 00:00:00 2001 From: Boris Waaub Date: Mon, 13 May 2024 12:33:11 +0200 Subject: [PATCH 056/283] FIX: Ouvert depuis --- .../src/Resources/public/vuejs/TicketApp/App.vue | 7 ++++--- .../src/Resources/public/vuejs/TicketApp/i18n/messages.ts | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue index 6a7ee99f0..305e22896 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue @@ -22,7 +22,7 @@

{{ $t("banner.since", { - days: getSince(ticket.createdAt), + count: getSince(ticket.createdAt), }) }}

@@ -128,9 +128,10 @@ export default defineComponent({ () => store.getters.getDistinctAddressesHistory ); - function getSince(createdAt: DateTime) { + function getSince(createdAt: any) { const today = new Date(); - const date = new Date(createdAt.datetime); + const date = new Date(createdAt.date); + const timeDiff = Math.abs(today.getTime() - date.getTime()); const daysDiff = Math.ceil(timeDiff / (1000 * 3600 * 24)); return daysDiff; diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/i18n/messages.ts b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/i18n/messages.ts index 219c834bf..7175a7fe3 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/i18n/messages.ts +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/i18n/messages.ts @@ -42,7 +42,7 @@ const messages = { caller: "Appelant", speaker: "Intervenant", open: "Ouvert", - since: "Depuis 1 jour | Depuis {days} jour(s)", + since: "Aucun jour | Depuis 1 jour | Depuis {count} jours", no_motive: "Pas de motif", }, }, From c81828e04f46a992ce0a149c28012defa38aa8c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 17 May 2024 12:16:28 +0200 Subject: [PATCH 057/283] Add phone number parsing functionality Added a new method 'parse' in the PhonenumberHelper class in ChillMainBundle to sanitize and parse phone numbers. This method specifically handles phone numbers that start with '00', '+' or '0'. Associated unit tests for this new method were also added in PhonenumberHelperTest.php. --- .../Phonenumber/PhonenumberHelper.php | 18 ++++++++ .../Phonenumber/PhonenumberHelperTest.php | 45 +++++++++++++++++++ 2 files changed, 63 insertions(+) diff --git a/src/Bundle/ChillMainBundle/Phonenumber/PhonenumberHelper.php b/src/Bundle/ChillMainBundle/Phonenumber/PhonenumberHelper.php index d08d393a3..dfdf0ca49 100644 --- a/src/Bundle/ChillMainBundle/Phonenumber/PhonenumberHelper.php +++ b/src/Bundle/ChillMainBundle/Phonenumber/PhonenumberHelper.php @@ -76,6 +76,24 @@ final class PhonenumberHelper implements PhoneNumberHelperInterface ->formatOutOfCountryCallingNumber($phoneNumber, $this->config['default_carrier_code']); } + /** + * @throws NumberParseException + */ + public function parse(string $phoneNumber): PhoneNumber + { + $sanitizedPhoneNumber = $phoneNumber; + + if (str_starts_with($sanitizedPhoneNumber, '00')) { + $sanitizedPhoneNumber = '+'.substr($sanitizedPhoneNumber, 2, null); + } + + if (!str_starts_with($sanitizedPhoneNumber, '+') && !str_starts_with($sanitizedPhoneNumber, '0')) { + $sanitizedPhoneNumber = '+'.$sanitizedPhoneNumber; + } + + return $this->phoneNumberUtil->parse($sanitizedPhoneNumber, $this->config['default_carrier_code']); + } + /** * Get type (mobile, landline, ...) for phone number. */ diff --git a/src/Bundle/ChillMainBundle/Tests/Phonenumber/PhonenumberHelperTest.php b/src/Bundle/ChillMainBundle/Tests/Phonenumber/PhonenumberHelperTest.php index 6f65c612f..556fa9fde 100644 --- a/src/Bundle/ChillMainBundle/Tests/Phonenumber/PhonenumberHelperTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Phonenumber/PhonenumberHelperTest.php @@ -12,6 +12,7 @@ declare(strict_types=1); namespace Chill\MainBundle\Tests\Phonenumber; use Chill\MainBundle\Phonenumber\PhonenumberHelper; +use libphonenumber\PhoneNumber; use libphonenumber\PhoneNumberUtil; use Psr\Log\NullLogger; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; @@ -52,12 +53,36 @@ final class PhonenumberHelperTest extends KernelTestCase ]; } + public static function providePhoneNumbersToParse(): iterable + { + $util = PhoneNumberUtil::getInstance(); + + yield [ + 'FR', + '+32486544999', + $util->parse('+32486544999', 'FR'), + ]; + + yield [ + 'FR', + '32486544999', + $util->parse('+32486544999', 'FR'), + ]; + + yield [ + 'FR', + '0228858040', + $util->parse('+33228858040', 'FR'), + ]; + } + /** * @dataProvider formatPhonenumbers */ public function testFormatPhonenumbers(string $defaultCarrierCode, string $phoneNumber, string $expected) { $util = PhoneNumberUtil::getInstance(); + $subject = new PhonenumberHelper( new ArrayAdapter(), new ParameterBag([ @@ -70,4 +95,24 @@ final class PhonenumberHelperTest extends KernelTestCase $this->assertEquals($expected, $subject->format($util->parse($phoneNumber))); } + + /** + * @dataProvider providePhoneNumbersToParse + */ + public function testParsePhonenumbers(string $defaultCarrierCode, string $phoneNumber, PhoneNumber $expected): void + { + $subject = new PhonenumberHelper( + new ArrayAdapter(), + new ParameterBag([ + 'chill_main.phone_helper' => [ + 'default_carrier_code' => $defaultCarrierCode, + ], + ]), + new NullLogger() + ); + + $actual = $subject->parse($phoneNumber); + + self::assertTrue($expected->equals($actual)); + } } From 3a8154ecce24183147cc3ee44a155eb7fb609396 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 17 May 2024 12:17:00 +0200 Subject: [PATCH 058/283] Replace PhoneNumberUtil with PhonenumberHelper The PhoneNumberUtil has been replaced with PhonenumberHelper in AssociateByPhonenumberCommandHandler and its test class. The purpose of this change is to improve phone number parsing which is now delegated to the PhonenumberHelper class in the Chill\MainBundle\Phonenumber namespace. As a consequence, the related dependencies in both the service and the test class have been updated accordingly. --- .../AssociateByPhonenumberCommandHandler.php | 6 +++--- .../AssociateByPhonenumberCommandHandlerTest.php | 16 ++++++++++++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/Bundle/ChillTicketBundle/src/Action/Ticket/Handler/AssociateByPhonenumberCommandHandler.php b/src/Bundle/ChillTicketBundle/src/Action/Ticket/Handler/AssociateByPhonenumberCommandHandler.php index 40276622e..deec240f2 100644 --- a/src/Bundle/ChillTicketBundle/src/Action/Ticket/Handler/AssociateByPhonenumberCommandHandler.php +++ b/src/Bundle/ChillTicketBundle/src/Action/Ticket/Handler/AssociateByPhonenumberCommandHandler.php @@ -11,26 +11,26 @@ declare(strict_types=1); namespace Chill\TicketBundle\Action\Ticket\Handler; +use Chill\MainBundle\Phonenumber\PhonenumberHelper; use Chill\PersonBundle\Repository\PersonACLAwareRepositoryInterface; use Chill\TicketBundle\Action\Ticket\AssociateByPhonenumberCommand; use Chill\TicketBundle\Entity\PersonHistory; use Chill\TicketBundle\Entity\Ticket; use Doctrine\ORM\EntityManagerInterface; -use libphonenumber\PhoneNumberUtil; use Symfony\Component\Clock\ClockInterface; class AssociateByPhonenumberCommandHandler { public function __construct( private PersonACLAwareRepositoryInterface $personRepository, - private PhoneNumberUtil $phoneNumberUtil, + private PhonenumberHelper $phonenumberHelper, private ClockInterface $clock, private EntityManagerInterface $entityManager, ) {} public function __invoke(Ticket $ticket, AssociateByPhonenumberCommand $command): void { - $phone = $this->phoneNumberUtil->parse($command->phonenumber); + $phone = $this->phonenumberHelper->parse($command->phonenumber); $persons = $this->personRepository->findByPhone($phone); foreach ($persons as $person) { diff --git a/src/Bundle/ChillTicketBundle/tests/Action/Ticket/Handler/AssociateByPhonenumberCommandHandlerTest.php b/src/Bundle/ChillTicketBundle/tests/Action/Ticket/Handler/AssociateByPhonenumberCommandHandlerTest.php index 7907712ab..5ade6ec82 100644 --- a/src/Bundle/ChillTicketBundle/tests/Action/Ticket/Handler/AssociateByPhonenumberCommandHandlerTest.php +++ b/src/Bundle/ChillTicketBundle/tests/Action/Ticket/Handler/AssociateByPhonenumberCommandHandlerTest.php @@ -11,17 +11,20 @@ declare(strict_types=1); namespace Chill\TicketBundle\Tests\Action\Ticket\Handler; +use Chill\MainBundle\Phonenumber\PhonenumberHelper; use Chill\PersonBundle\Entity\Person; use Chill\PersonBundle\Repository\PersonACLAwareRepositoryInterface; use Chill\TicketBundle\Action\Ticket\AssociateByPhonenumberCommand; use Chill\TicketBundle\Action\Ticket\Handler\AssociateByPhonenumberCommandHandler; use Chill\TicketBundle\Entity\Ticket; use Doctrine\ORM\EntityManagerInterface; -use libphonenumber\PhoneNumberUtil; use PHPUnit\Framework\TestCase; use Prophecy\Argument; use Prophecy\PhpUnit\ProphecyTrait; +use Psr\Log\NullLogger; +use Symfony\Component\Cache\Adapter\ArrayAdapter; use Symfony\Component\Clock\MockClock; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; /** * @internal @@ -36,10 +39,19 @@ class AssociateByPhonenumberCommandHandlerTest extends TestCase PersonACLAwareRepositoryInterface $personACLAwareRepository, ): AssociateByPhonenumberCommandHandler { $entityManager = $this->prophesize(EntityManagerInterface::class); + $phonenumberHelper = new PhonenumberHelper( + new ArrayAdapter(), + new ParameterBag([ + 'chill_main.phone_helper' => [ + 'default_carrier_code' => 'BE', + ], + ]), + new NullLogger() + ); return new AssociateByPhonenumberCommandHandler( $personACLAwareRepository, - PhoneNumberUtil::getInstance(), + $phonenumberHelper, new MockClock(), $entityManager->reveal() ); From 66dc603c859e84cce4cb2b419e9d67f5d99ae296 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 17 May 2024 12:20:33 +0200 Subject: [PATCH 059/283] fix cs with new version of php-cs-fixer --- src/Bundle/ChillTicketBundle/src/Entity/Ticket.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Bundle/ChillTicketBundle/src/Entity/Ticket.php b/src/Bundle/ChillTicketBundle/src/Entity/Ticket.php index 9fc4d6a15..689f34e87 100644 --- a/src/Bundle/ChillTicketBundle/src/Entity/Ticket.php +++ b/src/Bundle/ChillTicketBundle/src/Entity/Ticket.php @@ -83,7 +83,6 @@ class Ticket implements TrackCreationInterface, TrackUpdateInterface $this->motiveHistories = new ArrayCollection(); $this->personHistories = new ArrayCollection(); $this->inputHistories = new ArrayCollection(); - } public function getId(): ?int @@ -229,6 +228,4 @@ class Ticket implements TrackCreationInterface, TrackUpdateInterface { return $this->updatedBy; } - - } From 78d17767331a05b7ce0baf497c139ed0c0b7a659 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 17 May 2024 13:14:26 +0200 Subject: [PATCH 060/283] Add functionality to find a caller by phone number Added a new method in PersonRepository to allow querying people by phone number. Also, a new REST API endpoint "/public/api/1.0/ticket/find-caller" was introduced and it can find a caller by their phone number. Accompanied this feature addition with corresponding test cases. --- .../Repository/PersonRepository.php | 39 ++++++ .../src/Controller/FindCallerController.php | 58 ++++++++ .../Controller/FindCallerControllerTest.php | 128 ++++++++++++++++++ 3 files changed, 225 insertions(+) create mode 100644 src/Bundle/ChillTicketBundle/src/Controller/FindCallerController.php create mode 100644 src/Bundle/ChillTicketBundle/tests/Controller/FindCallerControllerTest.php diff --git a/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php b/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php index b7104a843..6b36ddd11 100644 --- a/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php @@ -12,10 +12,12 @@ declare(strict_types=1); namespace Chill\PersonBundle\Repository; use Chill\PersonBundle\Entity\Person; +use Chill\PersonBundle\Entity\PersonPhone; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityRepository; use Doctrine\ORM\QueryBuilder; use Doctrine\Persistence\ObjectRepository; +use libphonenumber\PhoneNumber; class PersonRepository implements ObjectRepository { @@ -29,6 +31,8 @@ class PersonRepository implements ObjectRepository /** * @throws \Doctrine\ORM\NoResultException * @throws \Doctrine\ORM\NonUniqueResultException + * + * @deprecated */ public function countByPhone( string $phonenumber, @@ -71,6 +75,8 @@ class PersonRepository implements ObjectRepository /** * @throws \Exception + * + * @deprecated Use @see{self::findByPhoneNumber} or use a dedicated method in PersonACLAwareRepository */ public function findByPhone( string $phonenumber, @@ -91,6 +97,25 @@ class PersonRepository implements ObjectRepository return $qb->getQuery()->getResult(); } + /** + * Find a person which is associated to the given phonenumber, without restrictions + * on any. + * + * @return listrepository->createQueryBuilder('p'); + $qb->select('p'); + + $this->searchByPhoneNumbers($qb, $phoneNumber); + + $qb->setFirstResult($firstResult) + ->setMaxResults($maxResults); + + return $qb->getQuery()->getResult(); + } + public function findOneBy(array $criteria) { return $this->repository->findOneBy($criteria); @@ -109,6 +134,20 @@ class PersonRepository implements ObjectRepository } } + private function searchByPhoneNumbers(QueryBuilder $qb, PhoneNumber $phoneNumber): void + { + $qb->setParameter('number', $phoneNumber, 'phone_number'); + + $orX = $qb->expr()->orX(); + $orX->add($qb->expr()->eq('p.mobilenumber', ':number')); + $orX->add($qb->expr()->eq('p.phonenumber', ':number')); + $orX->add( + $qb->expr()->exists('SELECT 1 FROM '.PersonPhone::class.' k WHERE k.phonenumber = :number AND k.person = p') + ); + + $qb->andWhere($orX); + } + /** * @throws \Exception */ diff --git a/src/Bundle/ChillTicketBundle/src/Controller/FindCallerController.php b/src/Bundle/ChillTicketBundle/src/Controller/FindCallerController.php new file mode 100644 index 000000000..94febedaa --- /dev/null +++ b/src/Bundle/ChillTicketBundle/src/Controller/FindCallerController.php @@ -0,0 +1,58 @@ +query->get('caller', ''); + + if ('' === $caller) { + throw new BadRequestHttpException('Missing "caller" query parameter'); + } + + try { + $phoneNumber = $this->phonenumberHelper->parse($caller); + } catch (NumberParseException $e) { + throw new BadRequestHttpException('Unable to parse number', $e); + } + + $persons = $this->personRepository->findByPhoneNumber($phoneNumber, 0, 2); + + $asArray = match (count($persons)) { + 0 => ['found' => false, 'name' => null], + 1 => ['found' => true, 'name' => $this->personRender->renderString($persons[0], ['addAge' => false])], + default => ['found' => true, 'name' => 'multiple'], + }; + + return new JsonResponse($asArray); + } +} diff --git a/src/Bundle/ChillTicketBundle/tests/Controller/FindCallerControllerTest.php b/src/Bundle/ChillTicketBundle/tests/Controller/FindCallerControllerTest.php new file mode 100644 index 000000000..301b8f4ac --- /dev/null +++ b/src/Bundle/ChillTicketBundle/tests/Controller/FindCallerControllerTest.php @@ -0,0 +1,128 @@ +buildController($persons); + + $request = new Request(query: ['caller' => $caller]); + + $response = $controller->findCaller($request); + + $actual = json_decode($response->getContent(), true); + + self::assertEqualsCanonicalizing($expected, $actual); + } + + public function testFindCallerWithoutCallerArgument(): void + { + self::expectException(BadRequestHttpException::class); + + $controller = $this->buildController([]); + + $request = new Request(query: []); + + $controller->findCaller($request); + } + + public function testFindCallerWithEmptyCallerArgument(): void + { + self::expectException(BadRequestHttpException::class); + + $controller = $this->buildController([]); + + $request = new Request(query: ['caller' => '']); + + $controller->findCaller($request); + } + + public function testFindCallerWithInvalidCaller(): void + { + self::expectException(BadRequestHttpException::class); + + $controller = $this->buildController([]); + + $request = new Request(query: ['caller' => 'abcde']); + + $controller->findCaller($request); + } + + public static function provideFindCaller(): iterable + { + yield [ + '32486540600', + [], + ['found' => false, 'name' => null], + ]; + + yield [ + '32486540600', + [new Person()], + ['found' => true, 'name' => 'pppp'], + ] + ; + yield [ + '32486540600', + [new Person(), new Person()], + ['found' => true, 'name' => 'multiple'], + ]; + } + + private function buildController(array $personsFound): FindCallerController + { + $phonenumberHelper = + $subject = new PhonenumberHelper( + new ArrayAdapter(), + new ParameterBag([ + 'chill_main.phone_helper' => [ + 'default_carrier_code' => 'BE', + ], + ]), + new NullLogger() + ); + + $personRepository = $this->prophesize(PersonRepository::class); + $personRepository->findByPhoneNumber(Argument::any(), Argument::type('int'), Argument::type('int'))->willReturn($personsFound); + + $personRender = $this->prophesize(PersonRenderInterface::class); + $personRender->renderString(Argument::type(Person::class), Argument::type('array'))->willReturn('pppp'); + + return new FindCallerController($phonenumberHelper, $personRepository->reveal(), $personRender->reveal()); + } +} From 650d2596d9b4898b8d6bd4b71028b7793fc98ef3 Mon Sep 17 00:00:00 2001 From: Boris Waaub Date: Tue, 21 May 2024 09:54:06 +0200 Subject: [PATCH 061/283] Update ticket display to use ticket ID instead of external reference --- .../src/Resources/public/vuejs/TicketApp/App.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue index 305e22896..3ef5bbea3 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue @@ -3,7 +3,7 @@
-

#{{ ticket.externalRef }}

+

#{{ ticket.id }}

{{ ticket.currentMotive.label.fr }}

From 2a23bf19cbb876b3f9ed4818a29935daf3cedd66 Mon Sep 17 00:00:00 2001 From: Boris Waaub Date: Tue, 21 May 2024 10:53:25 +0200 Subject: [PATCH 062/283] use record_actions sticky-form-buttons --- .../components/ActionToolbarComponent.vue | 154 +++++++++++------- .../public/vuejs/TicketApp/i18n/messages.ts | 2 + 2 files changed, 95 insertions(+), 61 deletions(-) diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/ActionToolbarComponent.vue b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/ActionToolbarComponent.vue index 818a46536..cf24952b2 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/ActionToolbarComponent.vue +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/ActionToolbarComponent.vue @@ -1,83 +1,102 @@ From b9e130c159fda77a4cb5cb7b523218ecc49fc34c Mon Sep 17 00:00:00 2001 From: Boris Waaub Date: Tue, 21 May 2024 20:44:23 +0200 Subject: [PATCH 067/283] Use suggestion for user asignee --- .../components/AddresseeSelectorComponent.vue | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/AddresseeSelectorComponent.vue b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/AddresseeSelectorComponent.vue index 56388e41a..db763b4e9 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/AddresseeSelectorComponent.vue +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/AddresseeSelectorComponent.vue @@ -71,10 +71,14 @@ ref="addPersons" @addNewPersons="addNewEntity" /> -
- - {{ user.username }} - +
+
    +
  • + + {{ user.username }} + +
  • +
@@ -173,6 +177,14 @@ export default defineComponent({ }; }); + function removeUser(user: User) { + users.value.splice(users.value.indexOf(user), 1); + addressees.value = addressees.value.filter( + (addressee) => addressee.id !== user.id + ); + ctx.emit("update:modelValue", addressees.value); + } + watch(userGroupLevel, (userGroupLevelAdd, userGroupLevelRem) => { if (userGroupLevelRem) { addressees.value.splice( @@ -203,6 +215,7 @@ export default defineComponent({ addPersons, addPersonsOptions, addNewEntity, + removeUser, getUserGroupBtnColor, customUserGroupLabel(selectedUserGroup: UserGroup) { return selectedUserGroup.label From c7d20eebc544ccf7d984af6ba575bfd498fa9bec Mon Sep 17 00:00:00 2001 From: Boris Waaub Date: Tue, 21 May 2024 20:53:15 +0200 Subject: [PATCH 068/283] chore: Remove unused code in AddresseeSelectorComponent.vue --- .../vuejs/TicketApp/components/AddresseeSelectorComponent.vue | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/AddresseeSelectorComponent.vue b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/AddresseeSelectorComponent.vue index db763b4e9..6fe6dabba 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/AddresseeSelectorComponent.vue +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/AddresseeSelectorComponent.vue @@ -134,12 +134,10 @@ export default defineComponent({ const userGroup = ref( userGroups.filter((userGroup) => userGroup.excludeKey == "") as | UserGroup[] - | [] ); const users = ref( props.modelValue.filter((addressee) => addressee.type == "user") as | User[] - | [] ); const addPersons = ref(); From 8778bb073189d9b1e82a9d26d9c4bf49cafca758 Mon Sep 17 00:00:00 2001 From: Boris Waaub Date: Tue, 21 May 2024 22:22:33 +0200 Subject: [PATCH 069/283] Use colors and badges for history and banner --- .../Resources/public/vuejs/TicketApp/App.vue | 105 +---------------- .../components/AddresseeComponent.vue | 74 ++++++++++++ .../TicketApp/components/BannerComponent.vue | 106 ++++++++++++++++++ .../TicketHistoryAddresseeComponent.vue | 36 ++---- .../components/TicketHistoryListComponent.vue | 24 ++-- .../public/vuejs/TicketApp/i18n/messages.ts | 2 +- 6 files changed, 206 insertions(+), 141 deletions(-) create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/AddresseeComponent.vue create mode 100644 src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/BannerComponent.vue diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue index 3ef5bbea3..d75694f0d 100644 --- a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue +++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue @@ -1,87 +1,5 @@ - - +}); + +const altNameLabel = computed(() => { + let altNameLabel = ""; + (props.person.altNames || []).forEach( + (altName) => (altNameLabel += altName.label), + ); + return altNameLabel; +}); + +const altNameKey = computed(() => { + let altNameKey = ""; + (props.person.altNames || []).forEach( + (altName) => (altNameKey += altName.key), + ); + return altNameKey; +}); + +const getUrl = computed(() => { + return `/fr/person/${props.person.id}/general`; +}); + +const getCurrentHouseholdUrl = computed(() => { + let returnPath = props.returnPath ? `?returnPath=${props.returnPath}` : ``; + return `/fr/person/household/${props.person.current_household_id}/summary${returnPath}`; +}); + diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/PersonText.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/PersonText.vue index f3005f235..36be069b6 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/PersonText.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/PersonText.vue @@ -2,65 +2,65 @@ {{ cutText }} {{ person.firstName }} -  {{ person.lastName }} -  ({{ altNameLabel }}) -  {{ person.suffixText }} -  {{ $tc("renderbox.years_old", person.age) }} {{ trans(RENDERBOX_YEARS_OLD, person.age) }} -  (‡) +  (‡) - diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/OnTheFly/Person.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/OnTheFly/Person.vue index 9abd03991..3a93a305d 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/OnTheFly/Person.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/OnTheFly/Person.vue @@ -17,7 +17,7 @@ isMultiline: true, }" :show-residential-addresses="true" - > + />
@@ -27,10 +27,10 @@ class="form-control form-control-lg" id="lastname" v-model="lastName" - :placeholder="$t('person.lastname')" + :placeholder="trans(PERSON_MESSAGES_PERSON_LASTNAME)" @change="checkErrors" /> - +
@@ -50,10 +50,12 @@ class="form-control form-control-lg" id="firstname" v-model="firstName" - :placeholder="$t('person.firstname')" + :placeholder="trans(PERSON_MESSAGES_PERSON_FIRSTNAME)" @change="checkErrors" /> - +
@@ -86,12 +88,14 @@ -->
- +
- +
@@ -114,64 +120,50 @@ v-model="civility" > - +
- - -
- -
- + + +
- + + +
- + + +
@@ -183,22 +175,21 @@ v-model="showAddressForm" name="showAddressForm" /> - +
-

{{ $t("person.address.warning") }}

- {{ trans(PERSON_MESSAGES_PERSON_ADDRESS_WARNING) }}

+ -
+ />
@@ -208,8 +199,8 @@
- - +}); +const mobilenumber = computed({ + get: () => person.mobilenumber, + set: (value) => { + person.mobilenumber = value; + }, +}); +const email = computed({ + get: () => person.email, + set: (value) => { + person.email = value; + }, +}); +const showAddressForm = computed({ + get: () => showAddressFormValue.value, + set: (value) => { + showAddressFormValue.value = value; + }, +}); +const center = computed({ + get: () => { + const c = config.centers.find( + (c) => person.center !== null && person.center.id === c.id, + ); + return typeof c === "undefined" ? null : c; + }, + set: (value) => { + person.center = { id: value.id, type: value.type }; + }, +}); - +}); + +defineExpose(genderClass, genderTranslation, feminized, birthDate); + diff --git a/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml b/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml index 830e21d2d..f81efac8c 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml +++ b/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml @@ -198,3 +198,59 @@ accompanying_course_evaluation_document: accompanying_period_work: title: Action d'accompagnement (n°{id}) - {action_title} + +add_persons: + title: "Ajouter des usagers" + suggested_counter: >- + {count, plural, + =0 {Pas de résultats} + =1 {1 résultat} + other {# résultats} + } + selected_counter: >- + {count, plural, + =1 {1 sélectionné} + other {# sélectionnés} + } + search_some_persons: "Rechercher des personnes.." + + item: + type_person: "Usager" + type_user: "TMS" + type_thirdparty: "Tiers professionnel" + type_household: "Ménage" + + person: + firstname: "Prénom" + lastname: "Nom" + born: + man: "Né le" + woman: "Née le" + neutral: "Né·e le" + center_id: "Identifiant du centre" + center_type: "Type de centre" + center_name: "Territoire" + phonenumber: "Téléphone" + mobilenumber: "Mobile" + altnames: "Autres noms" + email: "Courriel" + gender: + title: "Genre" + placeholder: "Choisissez le genre de l'usager" + woman: "Féminin" + man: "Masculin" + neutral: "Neutre, non binaire" + unknown: "Non renseigné" + undefined: "Non renseigné" + civility: + title: "Civilité" + placeholder: "Choisissez la civilité" + address: + create_address: "Ajouter une adresse" + show_address_form: "Ajouter une adresse pour un usager non suivi et seul dans un ménage" + warning: "Un nouveau ménage va être créé. L'usager sera membre de ce ménage." + center: + placeholder: "Choisissez un centre" + title: "Centre" + + error_only_one_person: "Une seule personne peut être sélectionnée !" diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 9bce912a0..47d4feed3 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -1505,3 +1505,48 @@ my_parcours_filters: parcours_intervening: Intervenant is_open: Parcours ouverts is_closed: Parcours clôturés + +person_messages: + add_persons: + title: "Ajouter des usagers" + suggested_counter: "Pas de résultats | 1 résultat | {count} résultats" + selected_counter: " 1 sélectionné | {count} sélectionnés" + search_some_persons: "Rechercher des personnes.." + item: + type_person: "Usager" + type_user: "TMS" + type_thirdparty: "Tiers professionnel" + type_household: "Ménage" + person: + firstname: "Prénom" + lastname: "Nom" + born: + man: "Né le" + woman: "Née le" + neutral: "Né·e le" + center_id: "Identifiant du centre" + center_type: "Type de centre" + center_name: "Territoire" + phonenumber: "Téléphone" + mobilenumber: "Mobile" + altnames: "Autres noms" + email: "Courriel" + gender: + title: "Genre" + placeholder: "Choisissez le genre de l'usager" + woman: "Féminin" + man: "Masculin" + neutral: "Neutre, non binaire" + unknown: "Non renseigné" + undefined: "Non renseigné" + civility: + title: "Civilité" + placeholder: "Choisissez la civilité" + address: + create_address: "Ajouter une adresse" + show_address_form: "Ajouter une adresse pour un usager non suivi et seul dans un ménage" + warning: "Un nouveau ménage va être créé. L'usager sera membre de ce ménage." + center: + placeholder: "Choisissez un centre" + title: "Centre" + error_only_one_person: "Une seule personne peut être sélectionnée !" diff --git a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue index 623926807..eab1db50b 100644 --- a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue +++ b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue @@ -27,18 +27,18 @@
- {{ $t("child_of") }} + {{ trans(THIRDPARTY_MESSAGES_CHILD_OF) }} {{ parent.text }}
-
+
@@ -53,7 +53,7 @@ @@ -95,7 +95,7 @@ v-model="thirdparty.civility" >
@@ -123,10 +127,12 @@ class="form-control form-control-lg" id="firstname" v-model="thirdparty.firstname" - :placeholder="$t('thirdparty.firstname')" + :placeholder=" + trans(THIRDPARTY_MESSAGES_THIRDPARTY_FIRSTNAME) + " />
@@ -147,10 +153,12 @@ class="form-control form-control-lg" id="name" v-model="thirdparty.name" - :placeholder="$t('thirdparty.lastname')" + :placeholder=" + trans(THIRDPARTY_MESSAGES_THIRDPARTY_LASTNAME) + " />
@@ -174,9 +182,11 @@ class="form-control form-control-lg" id="name" v-model="thirdparty.name" - :placeholder="$t('thirdparty.name')" + :placeholder="trans(THIRDPARTY_MESSAGES_THIRDPARTY_NAME)" /> - +
    @@ -188,7 +198,7 @@
diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Confidential.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Confidential.vue index 13459b390..9c010e8d1 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Confidential.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Confidential.vue @@ -1,40 +1,40 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/AddressRenderBox.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/AddressRenderBox.vue index 86f4155b6..7085b3b18 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/AddressRenderBox.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/AddressRenderBox.vue @@ -1,83 +1,77 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/GenderIconRenderBox.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/GenderIconRenderBox.vue index 0579b4c5f..794771014 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/GenderIconRenderBox.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/GenderIconRenderBox.vue @@ -1,28 +1,28 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/UserGroupRenderBox.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/UserGroupRenderBox.vue index 7c37e98a9..81f836c62 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/UserGroupRenderBox.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/UserGroupRenderBox.vue @@ -4,23 +4,23 @@ import { computed } from "vue"; import { localizeString } from "ChillMainAssets/lib/localizationHelper/localizationHelper"; interface UserGroupRenderBoxProps { - userGroup: UserGroup; + userGroup: UserGroup; } const props = defineProps(); const styles = computed<{ color: string; "background-color": string }>(() => { - return { - color: props.userGroup.foregroundColor, - "background-color": props.userGroup.backgroundColor, - }; + return { + color: props.userGroup.foregroundColor, + "background-color": props.userGroup.backgroundColor, + }; }); diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/UserRenderBoxBadge.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/UserRenderBoxBadge.vue index 63c43c37f..4bae3b541 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/UserRenderBoxBadge.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/UserRenderBoxBadge.vue @@ -1,31 +1,31 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/EntityWorkflow/EntityWorkflowVueSubscriber.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/EntityWorkflow/EntityWorkflowVueSubscriber.vue index 332849ef5..4d817a2f9 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/EntityWorkflow/EntityWorkflowVueSubscriber.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/EntityWorkflow/EntityWorkflowVueSubscriber.vue @@ -1,83 +1,83 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/EntityWorkflow/ListWorkflowModal.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/EntityWorkflow/ListWorkflowModal.vue index 59dcd80f4..658c0f9e9 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/EntityWorkflow/ListWorkflowModal.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/EntityWorkflow/ListWorkflowModal.vue @@ -1,49 +1,45 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Modal.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Modal.vue index 9350fc897..4808e2bda 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Modal.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Modal.vue @@ -1,42 +1,39 @@ @@ -82,17 +79,17 @@ const emits = defineEmits<{ * This is a mask behind the modal. */ .modal-mask { - position: fixed; - z-index: 9998; - top: 0; - left: 0; - width: 100%; - height: 100%; - background-color: rgba(0, 0, 0, 0.75); - transition: opacity 0.3s ease; + position: fixed; + z-index: 9998; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.75); + transition: opacity 0.3s ease; } .modal-header .close { - border-top-right-radius: 0.3rem; + border-top-right-radius: 0.3rem; } /* * The following styles are auto-applied to elements with @@ -103,23 +100,23 @@ const emits = defineEmits<{ * these styles. */ .modal-enter { - opacity: 0; + opacity: 0; } .modal-leave-active { - opacity: 0; + opacity: 0; } .modal-enter .modal-container, .modal-leave-active .modal-container { - -webkit-transform: scale(1.1); - transform: scale(1.1); + -webkit-transform: scale(1.1); + transform: scale(1.1); } h3.modal-title { - font-size: 1.5rem; - font-weight: bold; + font-size: 1.5rem; + font-weight: bold; } div.modal-footer { - button:first-child { - margin-right: auto; - } + button:first-child { + margin-right: auto; + } } diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Notification/NotificationReadAllToggle.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Notification/NotificationReadAllToggle.vue index 57f7fd7f8..bb7a43c92 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Notification/NotificationReadAllToggle.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Notification/NotificationReadAllToggle.vue @@ -1,17 +1,17 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Notification/NotificationReadToggle.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Notification/NotificationReadToggle.vue index cc64d4835..fb94af80f 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Notification/NotificationReadToggle.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Notification/NotificationReadToggle.vue @@ -1,96 +1,96 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.ts b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.ts index db9a37104..cbee6bf25 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.ts +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.ts @@ -2,87 +2,86 @@ import { createI18n } from "vue-i18n"; import datetimeFormats from "../i18n/datetimeFormats"; const messages = { - fr: { - action: { - actions: "Actions", - show: "Voir", - edit: "Modifier", - create: "Créer", - remove: "Enlever", - delete: "Supprimer", - save: "Enregistrer", - valid: "Valider", - valid_and_see: "Valider et voir", - add: "Ajouter", - show_modal: "Ouvrir une modale", - ok: "OK", - cancel: "Annuler", - close: "Fermer", - back: "Retour", - check_all: "cocher tout", - reset: "réinitialiser", - redirect: { - person: "Quitter la page et ouvrir la fiche de l'usager", - thirdparty: "Quitter la page et voir le tiers", - }, - refresh: "Rafraîchir", - addContact: "Ajouter un contact", - }, - nav: { - next: "Suivant", - previous: "Précédent", - top: "Haut", - bottom: "Bas", - }, - renderbox: { - person: "Usager", - birthday: { - man: "Né le", - woman: "Née le", - neutral: "Né·e le", - unknown: "Né·e le", - }, - deathdate: "Date de décès", - household_without_address: "Le ménage de l'usager est sans adresse", - no_data: "Aucune information renseignée", - type: { - thirdparty: "Tiers", - person: "Usager", - }, - holder: "Titulaire", - years_old: "1 an | {n} an | {n} ans", - residential_address: "Adresse de résidence", - located_at: "réside chez", - }, + fr: { + action: { + actions: "Actions", + show: "Voir", + edit: "Modifier", + create: "Créer", + remove: "Enlever", + delete: "Supprimer", + save: "Enregistrer", + valid: "Valider", + valid_and_see: "Valider et voir", + add: "Ajouter", + show_modal: "Ouvrir une modale", + ok: "OK", + cancel: "Annuler", + close: "Fermer", + back: "Retour", + check_all: "cocher tout", + reset: "réinitialiser", + redirect: { + person: "Quitter la page et ouvrir la fiche de l'usager", + thirdparty: "Quitter la page et voir le tiers", + }, + refresh: "Rafraîchir", + addContact: "Ajouter un contact", }, + nav: { + next: "Suivant", + previous: "Précédent", + top: "Haut", + bottom: "Bas", + }, + renderbox: { + person: "Usager", + birthday: { + man: "Né le", + woman: "Née le", + neutral: "Né·e le", + unknown: "Né·e le", + }, + deathdate: "Date de décès", + household_without_address: "Le ménage de l'usager est sans adresse", + no_data: "Aucune information renseignée", + type: { + thirdparty: "Tiers", + person: "Usager", + }, + holder: "Titulaire", + years_old: "1 an | {n} an | {n} ans", + residential_address: "Adresse de résidence", + located_at: "réside chez", + }, + }, }; const _createI18n = (appMessages: any, legacy?: boolean) => { - Object.assign(messages.fr, appMessages.fr); - return createI18n({ - legacy: typeof legacy === undefined ? true : legacy, - locale: "fr", - fallbackLocale: "fr", - // @ts-ignore - datetimeFormats, - messages, - }); + Object.assign(messages.fr, appMessages.fr); + return createI18n({ + legacy: typeof legacy === undefined ? true : legacy, + locale: "fr", + fallbackLocale: "fr", + // @ts-ignore + datetimeFormats, + messages, + }); }; export { _createI18n }; export const multiSelectMessages = { - fr: { - multiselect: { - placeholder: "Choisir", - tag_placeholder: "Créer un nouvel élément", - select_label: '"Entrée" ou cliquez pour sélectionner', - deselect_label: '"Entrée" ou cliquez pour désélectionner', - select_group_label: - 'Appuyer sur "Entrée" pour sélectionner ce groupe', - deselect_group_label: - 'Appuyer sur "Entrée" pour désélectionner ce groupe', - selected_label: "Sélectionné", - }, + fr: { + multiselect: { + placeholder: "Choisir", + tag_placeholder: "Créer un nouvel élément", + select_label: '"Entrée" ou cliquez pour sélectionner', + deselect_label: '"Entrée" ou cliquez pour désélectionner', + select_group_label: 'Appuyer sur "Entrée" pour sélectionner ce groupe', + deselect_group_label: + 'Appuyer sur "Entrée" pour désélectionner ce groupe', + selected_label: "Sélectionné", }, + }, }; diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/i18n/datetimeFormats.ts b/src/Bundle/ChillMainBundle/Resources/public/vuejs/i18n/datetimeFormats.ts index fe20cb217..aca1328ac 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/i18n/datetimeFormats.ts +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/i18n/datetimeFormats.ts @@ -1,27 +1,27 @@ export default { - fr: { - short: { - year: "numeric", - month: "numeric", - day: "numeric", - }, - text: { - year: "numeric", - month: "long", - day: "numeric", - }, - long: { - year: "numeric", - month: "numeric", - day: "numeric", - hour: "numeric", - minute: "numeric", - hour12: false, - }, - hoursOnly: { - hour: "numeric", - minute: "numeric", - hour12: false, - }, + fr: { + short: { + year: "numeric", + month: "numeric", + day: "numeric", }, + text: { + year: "numeric", + month: "long", + day: "numeric", + }, + long: { + year: "numeric", + month: "numeric", + day: "numeric", + hour: "numeric", + minute: "numeric", + hour12: false, + }, + hoursOnly: { + hour: "numeric", + minute: "numeric", + hour12: false, + }, + }, }; diff --git a/src/Bundle/ChillPersonBundle/Resources/public/mod/DuplicateSelector/AccompanyingPeriodWorkSelector.ts b/src/Bundle/ChillPersonBundle/Resources/public/mod/DuplicateSelector/AccompanyingPeriodWorkSelector.ts index 8f117d6ef..6ceb64b98 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/mod/DuplicateSelector/AccompanyingPeriodWorkSelector.ts +++ b/src/Bundle/ChillPersonBundle/Resources/public/mod/DuplicateSelector/AccompanyingPeriodWorkSelector.ts @@ -3,49 +3,47 @@ import AccompanyingPeriodWorkSelectorModal from "../../vuejs/_components/Accompa import { AccompanyingPeriodWork } from "../../types"; document.addEventListener("DOMContentLoaded", () => { - const elements = document.querySelectorAll( - 'div[data-pick-entities-type="acpw"]', + const elements = document.querySelectorAll( + 'div[data-pick-entities-type="acpw"]', + ); + elements.forEach((el) => { + const uniqid = el.dataset.inputUniqid; + + if (undefined === uniqid) { + throw "Uniqid not found on this element"; + } + + const input = document.querySelector( + `input[data-input-uniqid="${uniqid}"]`, ); - elements.forEach((el) => { - const uniqid = el.dataset.inputUniqid; - if (undefined === uniqid) { - throw "Uniqid not found on this element"; - } + if (null === input) { + throw "Element with uniqid not found: " + uniqid; + } - const input = document.querySelector( - `input[data-input-uniqid="${uniqid}"]`, - ); + const accompanyingPeriodIdAsString = input.dataset.accompanyingPeriodId; - if (null === input) { - throw "Element with uniqid not found: " + uniqid; - } + if (undefined === accompanyingPeriodIdAsString) { + throw "accompanying period id not found"; + } - const accompanyingPeriodIdAsString = input.dataset.accompanyingPeriodId; + const accompanyingPeriodId = Number.parseInt(accompanyingPeriodIdAsString); - if (undefined === accompanyingPeriodIdAsString) { - throw "accompanying period id not found"; - } - - const accompanyingPeriodId = Number.parseInt( - accompanyingPeriodIdAsString, - ); - - const app = createApp({ - template: - '', - components: { AccompanyingPeriodWorkSelectorModal }, - data() { - return { accompanyingPeriodId }; - }, - methods: { - pickWork: function (payload: { work: AccompanyingPeriodWork }) { - console.log("payload", payload); - input.value = payload.work.id.toString(); - }, - }, - }); - - app.mount(el); + const app = createApp({ + template: + '', + components: { AccompanyingPeriodWorkSelectorModal }, + data() { + return { accompanyingPeriodId }; + }, + methods: { + pickWork: function (payload: { work: AccompanyingPeriodWork }) { + console.log("payload", payload); + input.value = payload.work.id.toString(); + }, + }, }); + + app.mount(el); + }); }); diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/App.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/App.vue index 85f031a64..e81949711 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/App.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/App.vue @@ -1,28 +1,28 @@ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Confirm.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Confirm.vue index 408852711..3ce902daa 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Confirm.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Confirm.vue @@ -1,127 +1,120 @@ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/CourseLocation.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/CourseLocation.vue index f781eca0b..af985e502 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/CourseLocation.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/CourseLocation.vue @@ -1,95 +1,85 @@ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/OriginDemand.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/OriginDemand.vue index 641c9ef37..053eb058f 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/OriginDemand.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/OriginDemand.vue @@ -1,33 +1,33 @@ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated.vue index d6979928b..b4e0e70b8 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated.vue @@ -1,121 +1,106 @@ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated/ParticipationItem.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated/ParticipationItem.vue index 61a9d2571..c2dbd6e0c 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated/ParticipationItem.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated/ParticipationItem.vue @@ -1,98 +1,97 @@ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Referrer.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Referrer.vue index dbb21fa40..963ff65b5 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Referrer.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Referrer.vue @@ -1,116 +1,113 @@ - + + + - +
+ - -
+ -
-
    -
  • - -
  • -
-
+ -
- {{ $t("job.not_valid") }} -
+ + +
+ +
+
    +
  • + +
  • +
+
+ +
+ {{ $t("job.not_valid") }} +
+ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Requestor.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Requestor.vue index c2b9acfc4..5858cdb00 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Requestor.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Requestor.vue @@ -1,263 +1,239 @@ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Resources.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Resources.vue index 1ef9bfe45..fa600bfdd 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Resources.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Resources.vue @@ -1,57 +1,57 @@ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Resources/ResourceItem.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Resources/ResourceItem.vue index 8a52748d4..87daacf47 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Resources/ResourceItem.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Resources/ResourceItem.vue @@ -1,107 +1,107 @@ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Resources/WriteComment.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Resources/WriteComment.vue index 26b561c5d..416c6085c 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Resources/WriteComment.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Resources/WriteComment.vue @@ -1,34 +1,32 @@ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Scopes.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Scopes.vue index 1d05e0bbe..fee6a89ad 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Scopes.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Scopes.vue @@ -1,25 +1,25 @@ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/SocialIssue.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/SocialIssue.vue index 02d3b0c84..21c290f48 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/SocialIssue.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/SocialIssue.vue @@ -1,30 +1,30 @@ @@ -96,20 +91,20 @@ export default { @import "ChillPersonAssets/chill/scss/mixins"; @import "ChillMainAssets/chill/scss/chill_variables"; div#accompanying-course { - span.multiselect__tag { - @include badge_social($social-issue-color); - background: $chill-l-gray; - color: $dark; + span.multiselect__tag { + @include badge_social($social-issue-color); + background: $chill-l-gray; + color: $dark; + } + span.multiselect__option--highlight { + &::after { + background: $green; } - span.multiselect__option--highlight { - &::after { - background: $green; - } - &.multiselect__option--selected { - &::after { - background: $red; - } - } + &.multiselect__option--selected { + &::after { + background: $red; + } } + } } diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StartDate.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StartDate.vue index 0bfd87b18..d3e9ae97a 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StartDate.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StartDate.vue @@ -1,22 +1,22 @@ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StickyNav.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StickyNav.vue index 890aa5153..3ff18f03a 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StickyNav.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StickyNav.vue @@ -1,207 +1,195 @@ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StickyNav/Item.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StickyNav/Item.vue index 8e175f72b..ecdf3026c 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StickyNav/Item.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StickyNav/Item.vue @@ -1,26 +1,22 @@ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Test.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Test.vue index 904d4ff42..929b4edd8 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Test.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Test.vue @@ -1,155 +1,146 @@ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/App.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/App.vue index 745317211..f8b5389f4 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/App.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/App.vue @@ -1,152 +1,135 @@ @@ -288,46 +267,46 @@ export default { @import "ChillPersonAssets/chill/scss/mixins"; @import "ChillMainAssets/chill/scss/chill_variables"; span.badge { - @include badge_social($social-issue-color); - font-size: 95%; - margin-bottom: 5px; - margin-right: 1em; - margin-left: 1em; + @include badge_social($social-issue-color); + font-size: 95%; + margin-bottom: 5px; + margin-right: 1em; + margin-left: 1em; } diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue index f3404e2de..bd87224b2 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue @@ -1,482 +1,453 @@