From 3eb338234b16033960b73315a8df36d38a886a47 Mon Sep 17 00:00:00 2001 From: Lealefoulon <116151499+Lealefoulon@users.noreply.github.com> Date: Tue, 26 Nov 2024 16:02:37 +0100 Subject: [PATCH] Renomme la colonne "description" en "title" (#1087) * change form title * points 10 & 11 * sup point 5 * change description en untitled * change entitled en title * Update tests/Integration/Infrastructure/Controller/Regulation/Fragments/GetRegulationGeneralInfoControllerTest.php Co-authored-by: Mathieu MARCHOIS --------- Co-authored-by: Mathieu MARCHOIS --- .../SaveRegulationGeneralInfoCommand.xml | 2 +- .../DuplicateRegulationCommandHandler.php | 2 +- .../SaveRegulationGeneralInfoCommand.php | 4 +-- ...aveRegulationGeneralInfoCommandHandler.php | 4 +-- .../Query/GetGeneralInfoQueryHandler.php | 2 +- ...ulationOrdersToDatexFormatQueryHandler.php | 2 +- .../Regulation/View/GeneralInfoView.php | 2 +- .../View/RegulationOrderDatexListItemView.php | 2 +- src/Domain/Regulation/RegulationOrder.php | 10 +++---- .../BacIdf/BacIdfTransformer.php | 2 +- .../EudonetParis/EudonetParisTransformer.php | 2 +- .../Form/Regulation/GeneralInfoFormType.php | 6 ++-- src/Infrastructure/JOP/JOPTransformer.php | 2 +- .../Litteralis/LitteralisTransformer.php | 2 +- .../Fixtures/RegulationOrderFixture.php | 20 ++++++------- .../Regulation.RegulationOrder.orm.xml | 2 +- .../Migrations/Version20241126131536.php | 30 +++++++++++++++++++ .../RegulationOrderRecordRepository.php | 14 ++++----- templates/api/regulations.xml.twig | 2 +- .../regulation/_general_info_form.html.twig | 2 +- templates/regulation/export.md.twig | 2 +- .../fragments/_general_info.html.twig | 4 +-- .../Api/get-regulations-expected-result.xml | 2 +- .../AddRegulationControllerTest.php | 10 +++---- ...GetRegulationGeneralInfoControllerTest.php | 6 ++-- ...aveRegulationGeneralInfoControllerTest.php | 6 ++-- .../RegulationDetailControllerTest.php | 4 +-- .../DuplicateRegulationCommandHandlerTest.php | 6 ++-- ...egulationGeneralInfoCommandHandlerTest.php | 10 +++---- .../SaveRegulationGeneralInfoCommandTest.php | 10 +++---- .../Query/GetGeneralInfoQueryHandlerTest.php | 4 +-- ...ionOrdersToDatexFormatQueryHandlerTest.php | 14 ++++----- .../Regulation/View/GeneralInfoViewTest.php | 4 +-- .../Domain/Regulation/RegulationOrderTest.php | 10 +++---- .../BacIdf/BacIdfTransformerTest.php | 6 ++-- .../EudonetParisTransformerTest.php | 2 +- .../Infrastructure/JOP/JOPTransformerTest.php | 4 +-- .../Litteralis/LitteralisTransformerTest.php | 8 ++--- translations/messages.fr.xlf | 12 ++++---- 39 files changed, 131 insertions(+), 107 deletions(-) create mode 100644 src/Infrastructure/Persistence/Doctrine/Migrations/Version20241126131536.php diff --git a/config/validator/Application/Regulation/Command/SaveRegulationGeneralInfoCommand.xml b/config/validator/Application/Regulation/Command/SaveRegulationGeneralInfoCommand.xml index 1cba65117..213edaf83 100644 --- a/config/validator/Application/Regulation/Command/SaveRegulationGeneralInfoCommand.xml +++ b/config/validator/Application/Regulation/Command/SaveRegulationGeneralInfoCommand.xml @@ -45,7 +45,7 @@ - + diff --git a/src/Application/Regulation/Command/DuplicateRegulationCommandHandler.php b/src/Application/Regulation/Command/DuplicateRegulationCommandHandler.php index 370d7ac9d..17a59c867 100644 --- a/src/Application/Regulation/Command/DuplicateRegulationCommandHandler.php +++ b/src/Application/Regulation/Command/DuplicateRegulationCommandHandler.php @@ -44,7 +44,7 @@ private function duplicateRegulationOrderRecord( $generalInfo->otherCategoryText = $originalRegulationOrder->getOtherCategoryText(); $generalInfo->organization = $organization; $generalInfo->identifier = $identifier; - $generalInfo->description = $originalRegulationOrder->getDescription(); + $generalInfo->title = $originalRegulationOrder->getTitle(); $generalInfo->additionalVisas = $originalRegulationOrder->getAdditionalVisas(); $generalInfo->additionalReasons = $originalRegulationOrder->getAdditionalReasons(); $generalInfo->visaModelUuid = $originalRegulationOrder->getVisaModel()?->getUuid(); diff --git a/src/Application/Regulation/Command/SaveRegulationGeneralInfoCommand.php b/src/Application/Regulation/Command/SaveRegulationGeneralInfoCommand.php index 698442af1..d5a706375 100644 --- a/src/Application/Regulation/Command/SaveRegulationGeneralInfoCommand.php +++ b/src/Application/Regulation/Command/SaveRegulationGeneralInfoCommand.php @@ -16,7 +16,7 @@ final class SaveRegulationGeneralInfoCommand implements CommandInterface public string $source = RegulationOrderRecordSourceEnum::DIALOG->value; public ?string $category; public ?string $otherCategoryText = null; - public ?string $description; + public ?string $title; public ?Organization $organization; public array $additionalVisas = []; public array $additionalReasons = []; @@ -38,7 +38,7 @@ public static function create( $command->source = $regulationOrderRecord?->getSource() ?? RegulationOrderRecordSourceEnum::DIALOG->value; $command->category = $regulationOrder?->getCategory(); $command->otherCategoryText = $regulationOrder?->getOtherCategoryText(); - $command->description = $regulationOrder?->getDescription(); + $command->title = $regulationOrder?->getTitle(); $command->additionalVisas = $regulationOrder?->getAdditionalVisas() ?? []; $command->additionalReasons = $regulationOrder?->getAdditionalReasons() ?? []; $command->visaModelUuid = $regulationOrder?->getVisaModel()?->getUuid(); diff --git a/src/Application/Regulation/Command/SaveRegulationGeneralInfoCommandHandler.php b/src/Application/Regulation/Command/SaveRegulationGeneralInfoCommandHandler.php index a0871e2b9..48969b189 100644 --- a/src/Application/Regulation/Command/SaveRegulationGeneralInfoCommandHandler.php +++ b/src/Application/Regulation/Command/SaveRegulationGeneralInfoCommandHandler.php @@ -38,7 +38,7 @@ public function __invoke(SaveRegulationGeneralInfoCommand $command): RegulationO uuid: $this->idFactory->make(), identifier: $command->identifier, category: $command->category, - description: $command->description, + title: $command->title, otherCategoryText: $command->otherCategoryText, additionalVisas: $command->additionalVisas, additionalReasons: $command->additionalReasons, @@ -64,7 +64,7 @@ public function __invoke(SaveRegulationGeneralInfoCommand $command): RegulationO $command->regulationOrderRecord->getRegulationOrder()->update( identifier: $command->identifier, category: $command->category, - description: $command->description, + title: $command->title, otherCategoryText: $command->otherCategoryText, additionalVisas: $command->additionalVisas, additionalReasons: $command->additionalReasons, diff --git a/src/Application/Regulation/Query/GetGeneralInfoQueryHandler.php b/src/Application/Regulation/Query/GetGeneralInfoQueryHandler.php index e45c8503d..c59765f35 100644 --- a/src/Application/Regulation/Query/GetGeneralInfoQueryHandler.php +++ b/src/Application/Regulation/Query/GetGeneralInfoQueryHandler.php @@ -34,7 +34,7 @@ public function __invoke(GetGeneralInfoQuery $query): GeneralInfoView regulationOrderUuid: $row['regulationOrderUuid'], category: $row['category'], otherCategoryText: $row['otherCategoryText'], - description: $row['description'], + title: $row['title'], startDate: $row['overallStartDate'] ? new \DateTimeImmutable($row['overallStartDate']) : null, endDate: $row['overallEndDate'] ? new \DateTimeImmutable($row['overallEndDate']) : null, ); diff --git a/src/Application/Regulation/Query/GetRegulationOrdersToDatexFormatQueryHandler.php b/src/Application/Regulation/Query/GetRegulationOrdersToDatexFormatQueryHandler.php index 5d35cb51e..64d81fb9f 100644 --- a/src/Application/Regulation/Query/GetRegulationOrdersToDatexFormatQueryHandler.php +++ b/src/Application/Regulation/Query/GetRegulationOrdersToDatexFormatQueryHandler.php @@ -153,7 +153,7 @@ public function __invoke(GetRegulationOrdersToDatexFormatQuery $query): array regulationId: $regulationOrder->getIdentifier() . '#' . $regulationOrderRecord->getOrganizationUuid(), organization: $regulationOrderRecord->getOrganizationName(), source: $regulationOrderRecord->getSource(), - description: $regulationOrder->getDescription(), + title: $regulationOrder->getTitle(), startDate: $overallDates[$uuid]['overallStartDate'], endDate: $overallDates[$uuid]['overallEndDate'], trafficRegulations: $trafficRegulations, diff --git a/src/Application/Regulation/View/GeneralInfoView.php b/src/Application/Regulation/View/GeneralInfoView.php index 8d73a1da7..2a9324090 100644 --- a/src/Application/Regulation/View/GeneralInfoView.php +++ b/src/Application/Regulation/View/GeneralInfoView.php @@ -18,7 +18,7 @@ public function __construct( public readonly string $regulationOrderUuid, public readonly string $category, public readonly ?string $otherCategoryText, - public readonly string $description, + public readonly string $title, public readonly ?\DateTimeInterface $startDate, public readonly ?\DateTimeInterface $endDate, ) { diff --git a/src/Application/Regulation/View/RegulationOrderDatexListItemView.php b/src/Application/Regulation/View/RegulationOrderDatexListItemView.php index ac07e2c85..e8096a773 100644 --- a/src/Application/Regulation/View/RegulationOrderDatexListItemView.php +++ b/src/Application/Regulation/View/RegulationOrderDatexListItemView.php @@ -12,7 +12,7 @@ public function __construct( public string $regulationId, public string $organization, public string $source, - public string $description, + public string $title, public ?\DateTimeInterface $startDate, public ?\DateTimeInterface $endDate, public array $trafficRegulations, diff --git a/src/Domain/Regulation/RegulationOrder.php b/src/Domain/Regulation/RegulationOrder.php index 76797eaf6..ba08202e2 100644 --- a/src/Domain/Regulation/RegulationOrder.php +++ b/src/Domain/Regulation/RegulationOrder.php @@ -18,7 +18,7 @@ public function __construct( private string $uuid, private string $identifier, private string $category, - private string $description, + private string $title, private ?string $otherCategoryText = null, private ?VisaModel $visaModel = null, private ?array $additionalVisas = [], @@ -47,9 +47,9 @@ public function getOtherCategoryText(): ?string return $this->otherCategoryText; } - public function getDescription(): string + public function getTitle(): string { - return $this->description; + return $this->title; } public function getMeasures(): iterable @@ -92,7 +92,7 @@ public function getAdditionalReasons(): array public function update( string $identifier, string $category, - string $description, + string $title, ?string $otherCategoryText = null, array $additionalVisas = [], array $additionalReasons = [], @@ -100,7 +100,7 @@ public function update( ): void { $this->identifier = $identifier; $this->category = $category; - $this->description = $description; + $this->title = $title; $this->otherCategoryText = $otherCategoryText; $this->additionalVisas = $additionalVisas; $this->additionalReasons = $additionalReasons; diff --git a/src/Infrastructure/BacIdf/BacIdfTransformer.php b/src/Infrastructure/BacIdf/BacIdfTransformer.php index 106aac25d..f3f4cfc03 100644 --- a/src/Infrastructure/BacIdf/BacIdfTransformer.php +++ b/src/Infrastructure/BacIdf/BacIdfTransformer.php @@ -51,7 +51,7 @@ public function transform(array $row): BacIdfTransformerResult $generalInfo = new SaveRegulationGeneralInfoCommand(); $generalInfo->identifier = $row['ARR_REF']; $generalInfo->category = RegulationOrderCategoryEnum::PERMANENT_REGULATION->value; - $generalInfo->description = $row['ARR_NOM']; + $generalInfo->title = $row['ARR_NOM']; $date = $row['ARR_DUREE']['PERIODE_DEBUT']['$date']; diff --git a/src/Infrastructure/EudonetParis/EudonetParisTransformer.php b/src/Infrastructure/EudonetParis/EudonetParisTransformer.php index 62a1898db..8232312a7 100644 --- a/src/Infrastructure/EudonetParis/EudonetParisTransformer.php +++ b/src/Infrastructure/EudonetParis/EudonetParisTransformer.php @@ -96,7 +96,7 @@ private function buildGeneralInfoCommand(array $row, Organization $organization) $command->otherCategoryText = $type; // Adhere to character limit - $command->description = mb_substr($row['fields'][EudonetParisExtractor::ARRETE_COMPLEMENT_DE_TITRE], 0, 255); + $command->title = mb_substr($row['fields'][EudonetParisExtractor::ARRETE_COMPLEMENT_DE_TITRE], 0, 255); $command->organization = $organization; diff --git a/src/Infrastructure/Form/Regulation/GeneralInfoFormType.php b/src/Infrastructure/Form/Regulation/GeneralInfoFormType.php index 4607ef24e..0d8749858 100644 --- a/src/Infrastructure/Form/Regulation/GeneralInfoFormType.php +++ b/src/Infrastructure/Form/Regulation/GeneralInfoFormType.php @@ -71,11 +71,11 @@ public function buildForm(FormBuilderInterface $builder, array $options): void ], ) ->add( - 'description', + 'title', TextareaType::class, options: [ - 'label' => 'regulation.general_info.description', - 'help' => 'regulation.general_info.description.help', + 'label' => 'regulation.general_info.title', + 'help' => 'regulation.general_info.title.help', ], ) ->add( diff --git a/src/Infrastructure/JOP/JOPTransformer.php b/src/Infrastructure/JOP/JOPTransformer.php index 687eeee7e..3643b87fc 100644 --- a/src/Infrastructure/JOP/JOPTransformer.php +++ b/src/Infrastructure/JOP/JOPTransformer.php @@ -39,7 +39,7 @@ public function transform(array $geoJSON, Organization $organization): ImportJOP $generalInfoCommand->identifier = self::JOP_REGULATION_ORDER_IDENTIFIER; $generalInfoCommand->organization = $organization; $generalInfoCommand->category = RegulationOrderCategoryEnum::EVENT->value; - $generalInfoCommand->description = $this->translator->trans('jop.regulation_order.description'); + $generalInfoCommand->title = $this->translator->trans('jop.regulation_order.title'); $measureCommands = []; $tz = new \DateTimeZone('Europe/Paris'); diff --git a/src/Infrastructure/Litteralis/LitteralisTransformer.php b/src/Infrastructure/Litteralis/LitteralisTransformer.php index d9b875293..1c7c4bf39 100644 --- a/src/Infrastructure/Litteralis/LitteralisTransformer.php +++ b/src/Infrastructure/Litteralis/LitteralisTransformer.php @@ -63,7 +63,7 @@ public function transform( $generalInfoCommand = new SaveRegulationGeneralInfoCommand(); $generalInfoCommand->identifier = $identifier; $this->setCategory($generalInfoCommand, $properties); - $generalInfoCommand->description = $this->buildDescription($properties); + $generalInfoCommand->title = $this->buildDescription($properties); $generalInfoCommand->organization = $organization; // (2) Parsing des mesures et leur contenu diff --git a/src/Infrastructure/Persistence/Doctrine/Fixtures/RegulationOrderFixture.php b/src/Infrastructure/Persistence/Doctrine/Fixtures/RegulationOrderFixture.php index 9dc451486..551765610 100644 --- a/src/Infrastructure/Persistence/Doctrine/Fixtures/RegulationOrderFixture.php +++ b/src/Infrastructure/Persistence/Doctrine/Fixtures/RegulationOrderFixture.php @@ -23,34 +23,34 @@ public function load(ObjectManager $manager): void uuid: '54eacea0-e1e0-4823-828d-3eae72b76da8', identifier: self::TYPICAL_IDENTIFIER, category: RegulationOrderCategoryEnum::EVENT->value, - description: 'Description 1', + title: 'Title 1', ); $publishedRegulationOrder = new RegulationOrder( uuid: '2e5eb289-90c8-4c3f-8e7c-2e9e7de8948c', identifier: 'FO2/2023', category: RegulationOrderCategoryEnum::ROAD_MAINTENANCE->value, - description: 'Description 2', + title: 'Title 2', ); $regulationOrderPermanent = new RegulationOrder( uuid: 'c147cc20-ed02-4bd9-9f6b-91b67df296bd', identifier: 'FO3/2023', category: RegulationOrderCategoryEnum::PERMANENT_REGULATION->value, - description: 'Description 3', + title: 'Title 3', ); $fullCityRegulationOrder = new RegulationOrder( uuid: '0658c568-dfbe-7c64-8000-303f7e2ae9b3', identifier: 'F2023/full-city', category: RegulationOrderCategoryEnum::ROAD_MAINTENANCE->value, - description: 'Description 2', + title: 'Title 2', ); $regulationOrderNoLocations = new RegulationOrder( uuid: 'e589f277-ccd4-4364-967a-7e9db80e6d34', identifier: 'F2023/no-locations', - description: 'Description 5 that is very long and will be truncated', + title: 'Title 5 that is very long and will be truncated', category: RegulationOrderCategoryEnum::OTHER->value, otherCategoryText: 'Dérogation préfectorale', ); @@ -58,7 +58,7 @@ public function load(ObjectManager $manager): void $regulationOrderNoMeasures = new RegulationOrder( uuid: '0650037e-8f8e-7f66-8000-c8ebe51493b9', identifier: 'FO14/2023', - description: 'No measures', + title: 'No measures', category: RegulationOrderCategoryEnum::ROAD_MAINTENANCE->value, ); @@ -66,28 +66,28 @@ public function load(ObjectManager $manager): void uuid: '06549047-db9d-74bb-8000-754a6f2ff4c3', identifier: self::IDENTIFIER_CIFS, category: RegulationOrderCategoryEnum::ROAD_MAINTENANCE->value, - description: 'Arrêté exporté vers CIFS', + title: 'Arrêté exporté vers CIFS', ); $outDatedRegulationOrderCifs = new RegulationOrder( uuid: 'edc8dd18-5f56-4684-b2ba-d18658d53518', identifier: 'F/OUTDATED/CIFS/2021', category: RegulationOrderCategoryEnum::ROAD_MAINTENANCE->value, - description: 'Arrêté exporté vers CIFS', + title: 'Arrêté exporté vers CIFS', ); $rawGeoJSONRegulationOrder = new RegulationOrder( uuid: '06672e5f-f248-785b-8000-5f4ee64ca094', identifier: 'F2024/RAWGEOJSON', category: RegulationOrderCategoryEnum::ROAD_MAINTENANCE->value, - description: 'Arrêté avec données brutes GeoJSON', + title: 'Arrêté avec données brutes GeoJSON', ); $litteralisRegulationOrder = new RegulationOrder( uuid: '066e9849-f802-7a4c-8000-845f47c4b0de', identifier: '117374#24-A-0473', category: RegulationOrderCategoryEnum::ROAD_MAINTENANCE->value, - description: 'Arrêté de voirie (URL : https://dl.sogelink.fr/?iX5UN3GL)', + title: 'Arrêté de voirie (URL : https://dl.sogelink.fr/?iX5UN3GL)', ); $manager->persist($typicalRegulationOrder); diff --git a/src/Infrastructure/Persistence/Doctrine/Mapping/Regulation.RegulationOrder.orm.xml b/src/Infrastructure/Persistence/Doctrine/Mapping/Regulation.RegulationOrder.orm.xml index d3691a418..c6e31982e 100644 --- a/src/Infrastructure/Persistence/Doctrine/Mapping/Regulation.RegulationOrder.orm.xml +++ b/src/Infrastructure/Persistence/Doctrine/Mapping/Regulation.RegulationOrder.orm.xml @@ -7,7 +7,7 @@ - + diff --git a/src/Infrastructure/Persistence/Doctrine/Migrations/Version20241126131536.php b/src/Infrastructure/Persistence/Doctrine/Migrations/Version20241126131536.php new file mode 100644 index 000000000..9b51efb48 --- /dev/null +++ b/src/Infrastructure/Persistence/Doctrine/Migrations/Version20241126131536.php @@ -0,0 +1,30 @@ +addSql('ALTER TABLE regulation_order RENAME COLUMN description TO title'); + } + + public function down(Schema $schema): void + { + $this->addSql('ALTER TABLE regulation_order RENAME COLUMN title TO description'); + } +} diff --git a/src/Infrastructure/Persistence/Doctrine/Repository/Regulation/RegulationOrderRecordRepository.php b/src/Infrastructure/Persistence/Doctrine/Repository/Regulation/RegulationOrderRecordRepository.php index c21a32f37..b29107ee6 100644 --- a/src/Infrastructure/Persistence/Doctrine/Repository/Regulation/RegulationOrderRecordRepository.php +++ b/src/Infrastructure/Persistence/Doctrine/Repository/Regulation/RegulationOrderRecordRepository.php @@ -92,8 +92,7 @@ public function findAllRegulations( ->addSelect(\sprintf('(%s) as nbLocations', self::COUNT_LOCATIONS_QUERY)) ->addSelect(\sprintf('(%s) as namedStreet', self::GET_NAMED_STREET_QUERY)) ->addSelect(\sprintf('(%s) as numberedRoad', self::GET_NUMBERED_ROAD_QUERY)) - ->addSelect(\sprintf('(%s) as rawGeoJSON', self::GET_RAW_GEOJSON_QUERY)) - ; + ->addSelect(\sprintf('(%s) as rawGeoJSON', self::GET_RAW_GEOJSON_QUERY)); $parameters = []; @@ -185,8 +184,7 @@ public function findOneUuidByIdentifierInOrganization(string $identifier, Organi 'organization' => $organization, ]) ->getQuery() - ->getOneOrNullResult() - ; + ->getOneOrNullResult(); return $row ? $row['uuid'] : null; } @@ -208,7 +206,7 @@ public function findGeneralInformation(string $uuid): ?array ro.uuid as regulationOrderUuid, ro.category, ro.otherCategoryText, - ro.description, + ro.title, (%s) as overallStartDate, (%s) as overallEndDate ', @@ -233,8 +231,7 @@ public function findOrganizationUuid(string $uuid): ?string ->where('roc.uuid = :uuid') ->setParameter('uuid', $uuid) ->getQuery() - ->getOneOrNullResult() - ; + ->getOneOrNullResult(); return $row ? $row['uuid'] : null; } @@ -275,8 +272,7 @@ public function getOverallDatesByRegulationUuids(array $uuids): array ->where('roc.uuid IN (:uuids)') ->setParameter('uuids', $uuids, ArrayParameterType::STRING) ->getQuery() - ->getResult() - ; + ->getResult(); // Return array of $uuid => {overallStartDate, overallEndDate} $result = []; diff --git a/templates/api/regulations.xml.twig b/templates/api/regulations.xml.twig index d49bfc592..87293b867 100644 --- a/templates/api/regulations.xml.twig +++ b/templates/api/regulations.xml.twig @@ -29,7 +29,7 @@ - {{ regulationOrder.description }} + {{ regulationOrder.title }} diff --git a/templates/regulation/_general_info_form.html.twig b/templates/regulation/_general_info_form.html.twig index 5d0b4f63b..fb45d5124 100644 --- a/templates/regulation/_general_info_form.html.twig +++ b/templates/regulation/_general_info_form.html.twig @@ -68,7 +68,7 @@ {{ form_row(form.otherCategoryText, { group_class: 'fr-input-group', widget_class: 'fr-input', attr: { 'data-form-reveal-target': 'form-control' } }) }} - {{ form_row(form.description, {group_class: 'fr-input-group', attr: {class: 'fr-input'}, help_attr: {class: 'fr-hint-text'}}) }} + {{ form_row(form.title, {group_class: 'fr-input-group', attr: {class: 'fr-input'}, help_attr: {class: 'fr-hint-text'}}) }}

{{ 'regulation.general_info.visas_and_reasons.description'|trans }}

diff --git a/templates/regulation/export.md.twig b/templates/regulation/export.md.twig index bcc72a90f..87c177d75 100644 --- a/templates/regulation/export.md.twig +++ b/templates/regulation/export.md.twig @@ -30,7 +30,7 @@ Arrếté n°[{{ generalInfo.identifier }}]{custom-style="Dialog_Variable"} ::: ::: {custom-style="Dialog_Description"} -[{{ generalInfo.description }}]{custom-style="Dialog_Variable"} +[{{ generalInfo.title }}]{custom-style="Dialog_Variable"} ::: {% if signingAuthority %} diff --git a/templates/regulation/fragments/_general_info.html.twig b/templates/regulation/fragments/_general_info.html.twig index 176097920..d02b40398 100644 --- a/templates/regulation/fragments/_general_info.html.twig +++ b/templates/regulation/fragments/_general_info.html.twig @@ -3,7 +3,7 @@

- {{ generalInfo.description|u.truncate(36, '...', false) }} + {{ generalInfo.title|u.truncate(36, '...', false) }}

@@ -16,7 +16,7 @@ {{ ('regulation.category.' ~ generalInfo.category)|trans }} {% endif %} -
  • {{ generalInfo.description }}
  • +
  • {{ generalInfo.title }}
  • {% include 'regulation/_overall_period.html.twig' with { generalInfo } only %}
  • diff --git a/tests/Integration/Infrastructure/Controller/Api/get-regulations-expected-result.xml b/tests/Integration/Infrastructure/Controller/Api/get-regulations-expected-result.xml index f87cb01f3..71402813b 100644 --- a/tests/Integration/Infrastructure/Controller/Api/get-regulations-expected-result.xml +++ b/tests/Integration/Infrastructure/Controller/Api/get-regulations-expected-result.xml @@ -632,7 +632,7 @@ - Description 2 + Title 2 diff --git a/tests/Integration/Infrastructure/Controller/Regulation/AddRegulationControllerTest.php b/tests/Integration/Infrastructure/Controller/Regulation/AddRegulationControllerTest.php index 1841812be..b8cf635e9 100644 --- a/tests/Integration/Infrastructure/Controller/Regulation/AddRegulationControllerTest.php +++ b/tests/Integration/Infrastructure/Controller/Regulation/AddRegulationControllerTest.php @@ -43,7 +43,7 @@ public function testAdd(): void $values = $form->getPhpValues(); $values['general_info_form']['identifier'] = 'F022023'; $values['general_info_form']['organization'] = OrganizationFixture::MAIN_ORG_ID; - $values['general_info_form']['description'] = 'Interdiction de circuler dans Paris'; + $values['general_info_form']['title'] = 'Interdiction de circuler dans Paris'; $values['general_info_form']['category'] = RegulationOrderCategoryEnum::OTHER->value; $values['general_info_form']['otherCategoryText'] = 'Trou en formation'; $values['general_info_form']['visaModelUuid'] = '7eca6579-c07e-4e8e-8f10-fda610d7ee73'; @@ -86,7 +86,7 @@ public function testOtherCategoryTextMissing(): void $crawler = $client->submit($form); $this->assertResponseStatusCodeSame(422); $this->assertSame('Cette valeur ne doit pas être vide.', $crawler->filter('#general_info_form_identifier_error')->text()); - $this->assertSame('Cette valeur ne doit pas être vide.', $crawler->filter('#general_info_form_description_error')->text()); + $this->assertSame('Cette valeur ne doit pas être vide.', $crawler->filter('#general_info_form_title_error')->text()); $this->assertSame('Cette valeur ne doit pas être vide. Cette valeur doit être l\'un des choix proposés.', $crawler->filter('#general_info_form_category_error')->text()); } @@ -100,7 +100,7 @@ public function testAddWithAnAlreadyExistingIdentifier(): void $identifier = RegulationOrderFixture::TYPICAL_IDENTIFIER; $form['general_info_form[identifier]'] = $identifier; $form['general_info_form[organization]'] = OrganizationFixture::MAIN_ORG_ID; - $form['general_info_form[description]'] = 'Travaux'; + $form['general_info_form[title]'] = 'Travaux'; $form['general_info_form[category]'] = RegulationOrderCategoryEnum::ROAD_MAINTENANCE->value; $crawler = $client->submit($form); @@ -128,13 +128,13 @@ public function testFieldsTooLong(): void $saveButton = $crawler->selectButton('Continuer'); $form = $saveButton->form(); $form['general_info_form[identifier]'] = str_repeat('a', 61); - $form['general_info_form[description]'] = str_repeat('a', 256); + $form['general_info_form[title]'] = str_repeat('a', 256); $form['general_info_form[otherCategoryText]'] = str_repeat('a', 101); $crawler = $client->submit($form); $this->assertResponseStatusCodeSame(422); $this->assertSame('Cette chaîne est trop longue. Elle doit avoir au maximum 60 caractères.', $crawler->filter('#general_info_form_identifier_error')->text()); - $this->assertSame('Cette chaîne est trop longue. Elle doit avoir au maximum 255 caractères.', $crawler->filter('#general_info_form_description_error')->text()); + $this->assertSame('Cette chaîne est trop longue. Elle doit avoir au maximum 255 caractères.', $crawler->filter('#general_info_form_title_error')->text()); $this->assertSame('Cette chaîne est trop longue. Elle doit avoir au maximum 100 caractères.', $crawler->filter('#general_info_form_otherCategoryText_error')->text()); } diff --git a/tests/Integration/Infrastructure/Controller/Regulation/Fragments/GetRegulationGeneralInfoControllerTest.php b/tests/Integration/Infrastructure/Controller/Regulation/Fragments/GetRegulationGeneralInfoControllerTest.php index 85383a18b..bc238dcb2 100644 --- a/tests/Integration/Infrastructure/Controller/Regulation/Fragments/GetRegulationGeneralInfoControllerTest.php +++ b/tests/Integration/Infrastructure/Controller/Regulation/Fragments/GetRegulationGeneralInfoControllerTest.php @@ -19,10 +19,10 @@ public function testGet(): void $this->assertResponseStatusCodeSame(200); $this->assertSecurityHeaders(); - $this->assertSame('Description 3', $crawler->filter('h3')->text()); + $this->assertSame('Title 3', $crawler->filter('h3')->text()); $this->assertSame(OrganizationFixture::MAIN_ORG_NAME, $crawler->filter('li')->eq(0)->text()); $this->assertSame('Réglementation permanente', $crawler->filter('li')->eq(1)->text()); - $this->assertSame('Description 3', $crawler->filter('li')->eq(2)->text()); + $this->assertSame('Title 3', $crawler->filter('li')->eq(2)->text()); $this->assertSame('Depuis le 11/03/2023', $crawler->filter('li')->eq(3)->text()); $editForm = $crawler->selectButton('Modifier')->form(); $this->assertSame('http://localhost/_fragment/regulations/general_info/form/' . RegulationOrderRecordFixture::UUID_PERMANENT, $editForm->getUri()); @@ -35,7 +35,7 @@ public function testGetDescriptionTruncated(): void $crawler = $client->request('GET', '/_fragment/regulations/' . RegulationOrderRecordFixture::UUID_LONG_DESCRIPTION . '/general_info'); $this->assertResponseStatusCodeSame(200); $this->assertSecurityHeaders(); - $this->assertSame('Description 5 that is very long and...', $crawler->filter('h3')->text()); + $this->assertSame('Title 5 that is very long and will be...', $crawler->filter('h3')->text()); } public function testGetOtherCategoryTextDisplay(): void diff --git a/tests/Integration/Infrastructure/Controller/Regulation/Fragments/SaveRegulationGeneralInfoControllerTest.php b/tests/Integration/Infrastructure/Controller/Regulation/Fragments/SaveRegulationGeneralInfoControllerTest.php index 133d06e48..07a3f91fe 100644 --- a/tests/Integration/Infrastructure/Controller/Regulation/Fragments/SaveRegulationGeneralInfoControllerTest.php +++ b/tests/Integration/Infrastructure/Controller/Regulation/Fragments/SaveRegulationGeneralInfoControllerTest.php @@ -29,7 +29,7 @@ public function testEditWithAnAlreadyExistingIdentifier(): void $values = $form->getPhpValues(); $values['general_info_form']['identifier'] = $identifier; $values['general_info_form']['organization'] = OrganizationFixture::MAIN_ORG_ID; - $values['general_info_form']['description'] = 'Interdiction de circuler dans Paris'; + $values['general_info_form']['title'] = 'Interdiction de circuler dans Paris'; $values['general_info_form']['category'] = RegulationOrderCategoryEnum::ROAD_MAINTENANCE->value; $values['general_info_form']['otherCategoryText'] = 'Travaux'; $values['general_info_form']['additionalVisas'][0] = 'Vu 1'; @@ -80,13 +80,13 @@ public function testFieldsTooLong(): void $saveButton = $crawler->selectButton('Valider'); $form = $saveButton->form(); - $form['general_info_form[description]'] = str_repeat('a', 256); + $form['general_info_form[title]'] = str_repeat('a', 256); $form['general_info_form[identifier]'] = str_repeat('a', 61); $crawler = $client->submit($form); $this->assertResponseStatusCodeSame(422); $this->assertSame('Cette chaîne est trop longue. Elle doit avoir au maximum 60 caractères.', $crawler->filter('#general_info_form_identifier_error')->text()); - $this->assertSame('Cette chaîne est trop longue. Elle doit avoir au maximum 255 caractères.', $crawler->filter('#general_info_form_description_error')->text()); + $this->assertSame('Cette chaîne est trop longue. Elle doit avoir au maximum 255 caractères.', $crawler->filter('#general_info_form_title_error')->text()); } public function testEmptyReasonsAndVisas(): void diff --git a/tests/Integration/Infrastructure/Controller/Regulation/RegulationDetailControllerTest.php b/tests/Integration/Infrastructure/Controller/Regulation/RegulationDetailControllerTest.php index 8297cb935..c9395b51b 100644 --- a/tests/Integration/Infrastructure/Controller/Regulation/RegulationDetailControllerTest.php +++ b/tests/Integration/Infrastructure/Controller/Regulation/RegulationDetailControllerTest.php @@ -27,10 +27,10 @@ public function testDraftRegulationDetailAsAdmin(): void $measures = $crawler->filter('[data-testid="measure"]'); // General info - $this->assertSame('Description 1', $generalInfo->filter('h3')->text()); + $this->assertSame('Title 1', $generalInfo->filter('h3')->text()); $this->assertSame(OrganizationFixture::MAIN_ORG_NAME, $generalInfo->filter('li')->eq(0)->text()); $this->assertSame('Évènement', $generalInfo->filter('li')->eq(1)->text()); - $this->assertSame('Description 1', $generalInfo->filter('li')->eq(2)->text()); + $this->assertSame('Title 1', $generalInfo->filter('li')->eq(2)->text()); $this->assertSame('Du 31/10/2023 au 31/10/2023', $generalInfo->filter('li')->eq(3)->text()); $editGeneralInfoForm = $generalInfo->selectButton('Modifier')->form(); $this->assertSame('http://localhost/_fragment/regulations/general_info/form/' . RegulationOrderRecordFixture::UUID_TYPICAL, $editGeneralInfoForm->getUri()); diff --git a/tests/Unit/Application/Regulation/Command/DuplicateRegulationCommandHandlerTest.php b/tests/Unit/Application/Regulation/Command/DuplicateRegulationCommandHandlerTest.php index 7e2632ed4..cf55c87df 100644 --- a/tests/Unit/Application/Regulation/Command/DuplicateRegulationCommandHandlerTest.php +++ b/tests/Unit/Application/Regulation/Command/DuplicateRegulationCommandHandlerTest.php @@ -64,8 +64,8 @@ public function testRegulationFullyDuplicated(): void $this->originalRegulationOrder ->expects(self::once()) - ->method('getDescription') - ->willReturn('Description'); + ->method('getTitle') + ->willReturn('title'); $this->originalRegulationOrder ->expects(self::once()) @@ -104,7 +104,7 @@ public function testRegulationFullyDuplicated(): void $generalInfoCommand = new SaveRegulationGeneralInfoCommand(); $generalInfoCommand->identifier = 'F01/2023-1'; - $generalInfoCommand->description = 'Description'; + $generalInfoCommand->title = 'title'; $generalInfoCommand->category = RegulationOrderCategoryEnum::ROAD_MAINTENANCE->value; $generalInfoCommand->organization = $originalOrganization; $generalInfoCommand->additionalVisas = []; diff --git a/tests/Unit/Application/Regulation/Command/SaveRegulationGeneralInfoCommandHandlerTest.php b/tests/Unit/Application/Regulation/Command/SaveRegulationGeneralInfoCommandHandlerTest.php index 662096a98..f51841bfc 100644 --- a/tests/Unit/Application/Regulation/Command/SaveRegulationGeneralInfoCommandHandlerTest.php +++ b/tests/Unit/Application/Regulation/Command/SaveRegulationGeneralInfoCommandHandlerTest.php @@ -63,15 +63,15 @@ public function testCreate(): void uuid: 'd035fec0-30f3-4134-95b9-d74c68eb53e3', identifier: 'FO2/2023', category: RegulationOrderCategoryEnum::ROAD_MAINTENANCE->value, - description: 'Interdiction de circuler', + title: 'Interdiction de circuler', ), ), ) ->willReturn($createdRegulationOrder); $this->queryBus - ->expects(self::never()) - ->method('handle'); + ->expects(self::never()) + ->method('handle'); $this->regulationOrderRecordRepository ->expects(self::once()) @@ -101,7 +101,7 @@ public function testCreate(): void $command = new SaveRegulationGeneralInfoCommand(); $command->identifier = 'FO2/2023'; $command->category = RegulationOrderCategoryEnum::ROAD_MAINTENANCE->value; - $command->description = 'Interdiction de circuler'; + $command->title = 'Interdiction de circuler'; $command->organization = $this->organization; $result = $handler($command); @@ -173,7 +173,7 @@ public function testUpdate(): void $command->identifier = 'FO2/2030'; $command->organization = $organization; $command->category = RegulationOrderCategoryEnum::OTHER->value; - $command->description = 'Interdiction de circuler'; + $command->title = 'Interdiction de circuler'; $command->otherCategoryText = 'Trou en formation'; $command->visaModelUuid = 'b748e11a-e76f-4aba-b94c-c9f08cabd7d6'; diff --git a/tests/Unit/Application/Regulation/Command/SaveRegulationGeneralInfoCommandTest.php b/tests/Unit/Application/Regulation/Command/SaveRegulationGeneralInfoCommandTest.php index d9a0e421a..841ffd76e 100644 --- a/tests/Unit/Application/Regulation/Command/SaveRegulationGeneralInfoCommandTest.php +++ b/tests/Unit/Application/Regulation/Command/SaveRegulationGeneralInfoCommandTest.php @@ -21,15 +21,13 @@ public function testWithoutRegulationOrderRecord(): void $this->assertEmpty($command->identifier); $this->assertSame(RegulationOrderRecordSourceEnum::DIALOG->value, $command->source); $this->assertEmpty($command->organization); - $this->assertEmpty($command->description); + $this->assertEmpty($command->title); } public function testWithRegulationOrderRecord(): void { $organization = $this->createMock(Organization::class); $regulationOrder = $this->createMock(RegulationOrder::class); - $start = new \DateTimeImmutable('2023-03-13'); - $end = new \DateTimeImmutable('2023-03-15'); $regulationOrder ->expects(self::once()) @@ -38,8 +36,8 @@ public function testWithRegulationOrderRecord(): void $regulationOrder ->expects(self::once()) - ->method('getDescription') - ->willReturn('Description'); + ->method('getTitle') + ->willReturn('title'); $regulationOrderRecord = $this->createMock(RegulationOrderRecord::class); $regulationOrderRecord @@ -61,7 +59,7 @@ public function testWithRegulationOrderRecord(): void $this->assertSame($command->identifier, 'F02/2023'); $this->assertSame('my_source', $command->source); - $this->assertSame($command->description, 'Description'); + $this->assertSame($command->title, 'title'); $this->assertSame($command->organization, $organization); } diff --git a/tests/Unit/Application/Regulation/Query/GetGeneralInfoQueryHandlerTest.php b/tests/Unit/Application/Regulation/Query/GetGeneralInfoQueryHandlerTest.php index 6242949a2..e8cc03799 100644 --- a/tests/Unit/Application/Regulation/Query/GetGeneralInfoQueryHandlerTest.php +++ b/tests/Unit/Application/Regulation/Query/GetGeneralInfoQueryHandlerTest.php @@ -28,7 +28,7 @@ public function testGetGeneralInformation(): void regulationOrderUuid: 'fce8177b-3737-4b4e-933d-fe29d0092c89', category: 'other', otherCategoryText: 'Other category 1', - description: 'Description 1', + title: 'title 1', startDate: new \DateTimeImmutable($startDate), endDate: new \DateTimeImmutable($endDate), ); @@ -46,7 +46,7 @@ public function testGetGeneralInformation(): void 'regulationOrderUuid' => 'fce8177b-3737-4b4e-933d-fe29d0092c89', 'category' => $generalInfo->category, 'otherCategoryText' => $generalInfo->otherCategoryText, - 'description' => $generalInfo->description, + 'title' => $generalInfo->title, 'overallStartDate' => $startDate, 'overallEndDate' => $endDate, ]); diff --git a/tests/Unit/Application/Regulation/Query/GetRegulationOrdersToDatexFormatQueryHandlerTest.php b/tests/Unit/Application/Regulation/Query/GetRegulationOrdersToDatexFormatQueryHandlerTest.php index d977b63fd..614a978db 100644 --- a/tests/Unit/Application/Regulation/Query/GetRegulationOrdersToDatexFormatQueryHandlerTest.php +++ b/tests/Unit/Application/Regulation/Query/GetRegulationOrdersToDatexFormatQueryHandlerTest.php @@ -98,8 +98,8 @@ public function testGetAll(): void ->willReturn('56456ff6-7e1c-4d24-aa09-9c650d7f6115'); $regulationOrder1 ->expects(self::once()) - ->method('getDescription') - ->willReturn('Description 1'); + ->method('getTitle') + ->willReturn('Title 1'); $measure1 = $this->createMock(Measure::class); $measure1 @@ -356,7 +356,7 @@ public function testGetAll(): void ->willReturn('df1895bf-17af-4d68-adbd-02a7110d3b29'); $regulationOrder2 ->expects(self::once()) - ->method('getDescription') + ->method('getTitle') ->willReturn('Description 2'); $measure3 = $this->createMock(Measure::class); @@ -479,7 +479,7 @@ public function testGetAll(): void ->willReturn('fde674d4-9e82-42f5-841d-13f7d20b43e0'); $regulationOrder3 ->expects(self::once()) - ->method('getDescription') + ->method('getTitle') ->willReturn('Description 3'); $measure4 = $this->createMock(Measure::class); @@ -585,7 +585,7 @@ public function testGetAll(): void regulationId: 'F01/2024#56456ff6-7e1c-4d24-aa09-9c650d7f6115', organization: 'Autorité 1', source: RegulationOrderRecordSourceEnum::DIALOG->value, - description: 'Description 1', + title: 'Title 1', startDate: $startDate1, endDate: $endDate1, trafficRegulations: [ @@ -613,7 +613,7 @@ public function testGetAll(): void regulationId: 'F02/2024#df1895bf-17af-4d68-adbd-02a7110d3b29', organization: 'Autorité 2', source: RegulationOrderRecordSourceEnum::DIALOG->value, - description: 'Description 2', + title: 'Description 2', startDate: $startDate2, endDate: null, trafficRegulations: [ @@ -645,7 +645,7 @@ public function testGetAll(): void regulationId: 'F03/2024#fde674d4-9e82-42f5-841d-13f7d20b43e0', organization: 'Autorité 3', source: RegulationOrderRecordSourceEnum::DIALOG->value, - description: 'Description 3', + title: 'Description 3', startDate: $startDate3, endDate: $endDate3, trafficRegulations: [ diff --git a/tests/Unit/Application/Regulation/View/GeneralInfoViewTest.php b/tests/Unit/Application/Regulation/View/GeneralInfoViewTest.php index 338b9919a..aacf1afd5 100644 --- a/tests/Unit/Application/Regulation/View/GeneralInfoViewTest.php +++ b/tests/Unit/Application/Regulation/View/GeneralInfoViewTest.php @@ -23,7 +23,7 @@ public function testView(): void regulationOrderUuid: 'ed97924b-bdc5-421a-b6e8-ac3ee6b16a7e', category: 'other', otherCategoryText: 'Other category 1', - description: 'Description 1', + title: 'title 1', startDate: $startDate, endDate: $endDate, ); @@ -39,7 +39,7 @@ public function testView(): void regulationOrderUuid: '8a32e881-a683-4caa-976f-6882296bc29b', category: 'other', otherCategoryText: 'Other category 1', - description: 'Description 1', + title: 'title 1', startDate: $startDate, endDate: $endDate, ); diff --git a/tests/Unit/Domain/Regulation/RegulationOrderTest.php b/tests/Unit/Domain/Regulation/RegulationOrderTest.php index 0c3cb94ae..3f04e0424 100644 --- a/tests/Unit/Domain/Regulation/RegulationOrderTest.php +++ b/tests/Unit/Domain/Regulation/RegulationOrderTest.php @@ -21,7 +21,7 @@ public function testGetters(): void uuid: '6598fd41-85cb-42a6-9693-1bc45f4dd392', identifier: 'F02/2023', category: RegulationOrderCategoryEnum::EVENT->value, - description: 'Arrêté temporaire portant réglementation de la circulation sur : Routes Départementales N° 3-93, Voie communautaire de la Colleraye', + title: 'Arrêté temporaire portant réglementation de la circulation sur : Routes Départementales N° 3-93, Voie communautaire de la Colleraye', otherCategoryText: null, visaModel: $visaModel, additionalVisas: ['vu que 1'], @@ -31,7 +31,7 @@ public function testGetters(): void $this->assertSame('6598fd41-85cb-42a6-9693-1bc45f4dd392', $regulationOrder->getUuid()); $this->assertSame('F02/2023', $regulationOrder->getIdentifier()); $this->assertSame(RegulationOrderCategoryEnum::EVENT->value, $regulationOrder->getCategory()); - $this->assertSame('Arrêté temporaire portant réglementation de la circulation sur : Routes Départementales N° 3-93, Voie communautaire de la Colleraye', $regulationOrder->getDescription()); + $this->assertSame('Arrêté temporaire portant réglementation de la circulation sur : Routes Départementales N° 3-93, Voie communautaire de la Colleraye', $regulationOrder->getTitle()); $this->assertEmpty($regulationOrder->getMeasures()); // Automatically set by Doctrine $this->assertEmpty($regulationOrder->getRegulationOrderRecord()); // Automatically set by Doctrine $this->assertEmpty($regulationOrder->getOtherCategoryText()); @@ -50,19 +50,19 @@ public function testUpdate(): void uuid: '6598fd41-85cb-42a6-9693-1bc45f4dd392', identifier: 'F02/2023', category: RegulationOrderCategoryEnum::EVENT->value, - description: 'Arrêté temporaire portant réglementation de la circulation sur : Routes Départementales N° 3-93, Voie communautaire de la Colleraye', + title: 'Arrêté temporaire portant réglementation de la circulation sur : Routes Départementales N° 3-93, Voie communautaire de la Colleraye', ); $regulationOrder->update( identifier: 'F01/2023', category: RegulationOrderCategoryEnum::OTHER->value, - description: 'Arrêté temporaire', + title: 'Arrêté temporaire', otherCategoryText: 'Trou en formation', ); $this->assertSame('F01/2023', $regulationOrder->getIdentifier()); $this->assertSame(RegulationOrderCategoryEnum::OTHER->value, $regulationOrder->getCategory()); - $this->assertSame('Arrêté temporaire', $regulationOrder->getDescription()); + $this->assertSame('Arrêté temporaire', $regulationOrder->getTitle()); $this->assertSame('Trou en formation', $regulationOrder->getOtherCategoryText()); $regulationOrder->addMeasure($measure1); diff --git a/tests/Unit/Infrastructure/BacIdf/BacIdfTransformerTest.php b/tests/Unit/Infrastructure/BacIdf/BacIdfTransformerTest.php index 8c63e51cd..4bb48d795 100644 --- a/tests/Unit/Infrastructure/BacIdf/BacIdfTransformerTest.php +++ b/tests/Unit/Infrastructure/BacIdf/BacIdfTransformerTest.php @@ -62,7 +62,7 @@ public function testTransform(): void $generalInfoCommand = new SaveRegulationGeneralInfoCommand(); $generalInfoCommand->identifier = '15.248-circ'; $generalInfoCommand->category = RegulationOrderCategoryEnum::PERMANENT_REGULATION->value; - $generalInfoCommand->description = 'Circulation passage Pierre Curie'; + $generalInfoCommand->title = 'Circulation passage Pierre Curie'; $locationCommand = new SaveLocationCommand(); $locationCommand->roadType = RoadTypeEnum::LANE->value; @@ -181,7 +181,7 @@ public function testTransformMinimal(): void $generalInfoCommand = new SaveRegulationGeneralInfoCommand(); $generalInfoCommand->identifier = 'arr_1'; $generalInfoCommand->category = RegulationOrderCategoryEnum::PERMANENT_REGULATION->value; - $generalInfoCommand->description = 'nom_1'; + $generalInfoCommand->title = 'nom_1'; $locationCommand = new SaveLocationCommand(); $locationCommand->roadType = RoadTypeEnum::LANE->value; @@ -593,7 +593,7 @@ private function doTestTransform(callable $callback): void $generalInfoCommand = new SaveRegulationGeneralInfoCommand(); $generalInfoCommand->identifier = 'arr_1'; $generalInfoCommand->category = RegulationOrderCategoryEnum::PERMANENT_REGULATION->value; - $generalInfoCommand->description = 'nom_1'; + $generalInfoCommand->title = 'nom_1'; $locationCommand = new SaveLocationCommand(); $locationCommand->roadType = RoadTypeEnum::LANE->value; diff --git a/tests/Unit/Infrastructure/EudonetParis/EudonetParisTransformerTest.php b/tests/Unit/Infrastructure/EudonetParis/EudonetParisTransformerTest.php index 00f9fcb28..25e0209f5 100644 --- a/tests/Unit/Infrastructure/EudonetParis/EudonetParisTransformerTest.php +++ b/tests/Unit/Infrastructure/EudonetParis/EudonetParisTransformerTest.php @@ -81,7 +81,7 @@ public function testTransform(): void $generalInfoCommand->identifier = '20230514-1'; $generalInfoCommand->category = RegulationOrderCategoryEnum::OTHER->value; $generalInfoCommand->otherCategoryText = 'Temporaire'; - $generalInfoCommand->description = str_repeat('a', 255); + $generalInfoCommand->title = str_repeat('a', 255); $generalInfoCommand->organization = $organization; $locationCommand1 = new SaveLocationCommand(); diff --git a/tests/Unit/Infrastructure/JOP/JOPTransformerTest.php b/tests/Unit/Infrastructure/JOP/JOPTransformerTest.php index 8ffa7503d..c00c5988a 100644 --- a/tests/Unit/Infrastructure/JOP/JOPTransformerTest.php +++ b/tests/Unit/Infrastructure/JOP/JOPTransformerTest.php @@ -86,7 +86,7 @@ public function testTransform(): void $translator ->expects(self::once()) ->method('trans') - ->with('jop.regulation_order.description') + ->with('jop.regulation_order.title') ->willReturn('Description arrêté JOP'); $permissions = [CanUseRawGeoJSON::PERMISSION_NAME]; @@ -94,7 +94,7 @@ public function testTransform(): void $generalInfoCommand = new SaveRegulationGeneralInfoCommand(); $generalInfoCommand->identifier = 'JOP2024-ZONES'; $generalInfoCommand->category = RegulationOrderCategoryEnum::EVENT->value; - $generalInfoCommand->description = 'Description arrêté JOP'; + $generalInfoCommand->title = 'Description arrêté JOP'; $generalInfoCommand->organization = $organization; $locationCommand1 = new SaveLocationCommand(); diff --git a/tests/Unit/Infrastructure/Litteralis/LitteralisTransformerTest.php b/tests/Unit/Infrastructure/Litteralis/LitteralisTransformerTest.php index 47bc99079..a452026b0 100644 --- a/tests/Unit/Infrastructure/Litteralis/LitteralisTransformerTest.php +++ b/tests/Unit/Infrastructure/Litteralis/LitteralisTransformerTest.php @@ -69,7 +69,7 @@ public function testTransformRealWorldExample(): void $generalInfo = new SaveRegulationGeneralInfoCommand(); $generalInfo->identifier = $identifier; $generalInfo->category = RegulationOrderCategoryEnum::ROAD_MAINTENANCE->value; - $generalInfo->description = "de chargement d'engin de chantier (URL : https://dl.sogelink.fr/?0dbjHha7)"; + $generalInfo->title = "de chargement d'engin de chantier (URL : https://dl.sogelink.fr/?0dbjHha7)"; $generalInfo->organization = $this->organization; $measureCommands = []; @@ -162,19 +162,19 @@ public function testTransformDescription(): void // Option 1: "Description des travaux" $features = [json_decode(self::feature, associative: true)]; $command = $this->transformer->transform($this->reporter, 'identifier', $features, $this->organization); - $this->assertSame('regulation description (URL : https://dl.sogelink.fr/?n3omzTyS)', $command->generalInfoCommand->description); + $this->assertSame('regulation description (URL : https://dl.sogelink.fr/?n3omzTyS)', $command->generalInfoCommand->title); // Option 2: "Description évènement" $feature = str_replace('Description des travaux : regulation description', 'Description évènement : event description', self::feature); $features = [json_decode($feature, associative: true)]; $command = $this->transformer->transform($this->reporter, 'identifier', $features, $this->organization); - $this->assertSame('event description (URL : https://dl.sogelink.fr/?n3omzTyS)', $command->generalInfoCommand->description); + $this->assertSame('event description (URL : https://dl.sogelink.fr/?n3omzTyS)', $command->generalInfoCommand->title); // Option 3: none is present, is 'nommodele' as a default $feature = str_replace('; Description des travaux : regulation description', '', self::feature); $features = [json_decode($feature, associative: true)]; $command = $this->transformer->transform($this->reporter, 'identifier', $features, $this->organization); - $this->assertSame('[MEL] - Arrêté permanent (URL : https://dl.sogelink.fr/?n3omzTyS)', $command->generalInfoCommand->description); + $this->assertSame('[MEL] - Arrêté permanent (URL : https://dl.sogelink.fr/?n3omzTyS)', $command->generalInfoCommand->title); } public function testTransformComplexMeasures(): void diff --git a/translations/messages.fr.xlf b/translations/messages.fr.xlf index a326a50a5..835e37d16 100644 --- a/translations/messages.fr.xlf +++ b/translations/messages.fr.xlf @@ -516,12 +516,12 @@ regulation.general_info.category Nature de l'arrêté - - regulation.general_info.description + + regulation.general_info.title Intitulé - - regulation.general_info.description.help + + regulation.general_info.title.help Décrivez brièvement les raisons de la perturbation. (Exemple : "travaux sur la voie") @@ -2268,8 +2268,8 @@ public.regulation.map.view Visualiser les restrictions sur la carte - - jop.regulation_order.description + + jop.regulation_order.title Zones réglementées dans le cadre des Jeux Olympiques et Paralympiques de Paris 2024 (JOP 2024)