diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 37a4d21..44a516e 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -5,12 +5,18 @@ on: push: branches: - main - workflow_dispatch: + tags: + - '*' + pull_request: + types: [ opened, reopened, synchronize, labeled ] + workflow_dispatch: ~ + permissions: pull-requests: write id-token: write contents: read packages: write + jobs: # remove-deploy-label: # name: Remove deploy label diff --git a/Dockerfile b/Dockerfile index 77830db..bb3bacf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,8 +4,8 @@ # https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact -ARG PHP_VERSION=8.1 -ARG CADDY_VERSION=2.9.1 +ARG PHP_VERSION=8.1.32 +ARG CADDY_VERSION=2.10.0 # yarn build FROM gmolaire/yarn AS yarn_build @@ -185,6 +185,11 @@ RUN rm -f .env.local.php # Build Caddy with the Mercure and Vulcain modules FROM caddy:${CADDY_VERSION}-builder-alpine AS app_caddy_builder +# Temporary fix for https://github.com/dunglas/mercure/issues/770 +# https://github.com/dunglas/symfony-docker/pull/407/files + +# FROM caddy:2.9.1-builder-alpine AS app_caddy_builder + # RUN xcaddy build \ # --with github.com/dunglas/mercure \ # --with github.com/dunglas/mercure/caddy \ diff --git a/src/Entity/User.php b/src/Entity/User.php index a2c3aef..b960ec9 100755 --- a/src/Entity/User.php +++ b/src/Entity/User.php @@ -61,6 +61,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface, ImageIn private const EMAIL_MAX_LENGTH = 180; private const NAME_LENGTH = 180; + private const DESCRIPTION_LENGTH = 255; private const PHONE_LENGTH = 15; private const SCHEDULE_LENGTH = 180; @@ -241,6 +242,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface, ImageIn * User's description. */ #[ORM\Column(type: 'string', nullable: true, )] + #[Assert\Length(max: self::DESCRIPTION_LENGTH)] private ?string $description = null; /** diff --git a/src/Form/Type/User/EditProfileFormType.php b/src/Form/Type/User/EditProfileFormType.php index 28e8562..6e5ee39 100644 --- a/src/Form/Type/User/EditProfileFormType.php +++ b/src/Form/Type/User/EditProfileFormType.php @@ -61,6 +61,22 @@ final class EditProfileFormType extends AbstractType ->add('submit', SubmitType::class, [ 'label' => self::I18N_PREFIX.'.submit', 'attr' => ['class' => 'btn-sm btn-primary'], + ]) + ->add('category', EntityType::class, [ + 'class' => Category::class, + 'query_builder' => fn (CategoryRepository $er) => $er->getHierarchy(), + 'group_by' => fn (Category $category) => $this->translator->trans(self::I18N_PREFIX.'.'.$category->getType()->value), + 'label' => self::I18N_PREFIX.'.category', + 'label_attr' => ['class' => 'text-black fs-6 fw-normal'], + 'choice_label' => 'getNameWithIndent', + 'expanded' => false, + 'required' => false, + ]) + ->add('description', TextareaType::class, [ + 'label' => self::I18N_PREFIX.'.description', + 'label_attr' => ['class' => 'text-black fs-6 fw-normal'], + 'attr' => ['style' => 'height: 120px'], + 'required' => false, ]); if ($user->isPlace()) { @@ -93,22 +109,6 @@ final class EditProfileFormType extends AbstractType 'attr' => [ 'class' => 'form-control-sm', ], - ]) - ->add('category', EntityType::class, [ - 'class' => Category::class, - 'query_builder' => fn (CategoryRepository $er) => $er->getHierarchy(), - 'group_by' => fn (Category $category) => $this->translator->trans(self::I18N_PREFIX.'.'.$category->getType()->value), - 'label' => self::I18N_PREFIX.'.category', - 'label_attr' => ['class' => 'text-black fs-6 fw-normal'], - 'choice_label' => 'getNameWithIndent', - 'expanded' => false, - 'required' => false, - ]) - ->add('description', TextareaType::class, [ - 'label' => self::I18N_PREFIX.'.description', - 'label_attr' => ['class' => 'text-black fs-6 fw-normal'], - 'attr' => ['style' => 'height: 120px'], - 'required' => false, ]); }