diff --git a/config/domain/registry/validation/mesurement.yaml b/config/domain/registry/validation/mesurement.yaml index e4ec4ce9b4ef4eff1cb52bf9b3f51f80312ab0c0..870f89b4b018c0d51273353aa9c100633efa5808 100644 --- a/config/domain/registry/validation/mesurement.yaml +++ b/config/domain/registry/validation/mesurement.yaml @@ -15,10 +15,6 @@ App\Domain\Registry\Model\Mesurement: - Length: max: 255 groups: ['default'] - comment: - - Length: - max: 255 - groups: ['default'] priority: - Knp\DictionaryBundle\Validator\Constraints\Dictionary: name: 'registry_mesurement_priority' diff --git a/migrations/Version20250211143000.php b/migrations/Version20250211143000.php new file mode 100644 index 0000000000000000000000000000000000000000..10b52487318bcd7613809247cc108915c2124d25 --- /dev/null +++ b/migrations/Version20250211143000.php @@ -0,0 +1,35 @@ +<?php + +declare(strict_types=1); + +namespace DoctrineMigrations; + +use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; + +/** + * Auto-generated Migration: Please modify to your needs! + */ +final class Version20250211143000 extends AbstractMigration +{ + public function getDescription(): string + { + return ''; + } + + public function up(Schema $schema): void + { + // this up() migration is auto-generated, please modify it to your needs + $this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); + + $this->addSql('ALTER TABLE registry_mesurement CHANGE comment comment LONGTEXT DEFAULT NULL'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); + + $this->addSql('ALTER TABLE registry_mesurement CHANGE comment comment VARCHAR(255) DEFAULT NULL'); + } +} diff --git a/src/Domain/Registry/Form/Type/MesurementType.php b/src/Domain/Registry/Form/Type/MesurementType.php index f7a51a956cd98e3f16b468ac0d3a78556b01e4b6..2ab2d55649a781f8d774389d0d203a1c6606d31c 100644 --- a/src/Domain/Registry/Form/Type/MesurementType.php +++ b/src/Domain/Registry/Form/Type/MesurementType.php @@ -133,11 +133,11 @@ class MesurementType extends LinkableType 'class' => 'datepicker', ], ]) - ->add('comment', TextType::class, [ + ->add('comment', TextareaType::class, [ 'label' => 'registry.mesurement.label.comment', 'required' => false, 'attr' => [ - 'maxlength' => 255, + 'rows' => 3, ], 'purify_html' => true, ]) diff --git a/tests/Domain/Registry/Form/Type/MesurementTypeTest.php b/tests/Domain/Registry/Form/Type/MesurementTypeTest.php index 311a6941158710c5b15c1351324884a395dae05d..2312989777d6ab323b7cd2bfa1146234ac81c98d 100644 --- a/tests/Domain/Registry/Form/Type/MesurementTypeTest.php +++ b/tests/Domain/Registry/Form/Type/MesurementTypeTest.php @@ -72,7 +72,7 @@ class MesurementTypeTest extends FormTypeHelper 'charge' => TextType::class, 'status' => DictionaryType::class, 'planificationDate' => DateType::class, - 'comment' => TextType::class, + 'comment' => TextareaType::class, 'priority' => DictionaryType::class, 'manager' => TextType::class, 'service' => EntityType::class, @@ -102,7 +102,7 @@ class MesurementTypeTest extends FormTypeHelper 'charge' => TextType::class, 'status' => DictionaryType::class, 'planificationDate' => DateType::class, - 'comment' => TextType::class, + 'comment' => TextareaType::class, 'priority' => DictionaryType::class, 'manager' => TextType::class, 'mesurements' => EntityType::class,