diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ab0e3192..51cf606e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ and this project adheres to ## Unreleased +* [activity] display error messages above the form in creating a new location (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/481) +* [activity] show required field in activity edit/new by an asterix in the vuejs fields (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/494) * [ACL] fix allow to see the course, event if the scope'course does not contains the scope's user * [search] enforce limit of results for fetching rsults by search api https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/576 * [activity] Fix delete button for document (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/554) diff --git a/src/Bundle/ChillActivityBundle/Form/ActivityType.php b/src/Bundle/ChillActivityBundle/Form/ActivityType.php index 891eb8577..3a772d878 100644 --- a/src/Bundle/ChillActivityBundle/Form/ActivityType.php +++ b/src/Bundle/ChillActivityBundle/Form/ActivityType.php @@ -125,7 +125,9 @@ class ActivityType extends AbstractType } if ($activityType->isVisible('socialIssues') && $accompanyingPeriod) { - $builder->add('socialIssues', HiddenType::class); + $builder->add('socialIssues', HiddenType::class, [ + 'required' => $activityType->getSocialIssuesVisible() === 2 + ]); $builder->get('socialIssues') ->addModelTransformer(new CallbackTransformer( static function (iterable $socialIssuesAsIterable): string { @@ -151,7 +153,9 @@ class ActivityType extends AbstractType } if ($activityType->isVisible('socialActions') && $accompanyingPeriod) { - $builder->add('socialActions', HiddenType::class); + $builder->add('socialActions', HiddenType::class, [ + 'required' => $activityType->getSocialActionsVisible() === 2 + ]); $builder->get('socialActions') ->addModelTransformer(new CallbackTransformer( static function (iterable $socialActionsAsIterable): string { @@ -339,7 +343,9 @@ class ActivityType extends AbstractType } if ($activityType->isVisible('location')) { - $builder->add('location', HiddenType::class) + $builder->add('location', HiddenType::class, [ + 'required' => $activityType->getLocationVisible() === 2 + ]) ->get('location') ->addModelTransformer(new CallbackTransformer( static function (?Location $location): string { diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/Location.vue b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/Location.vue index 91c5db839..42a69e4c5 100644 --- a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/Location.vue +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/Location.vue @@ -1,7 +1,7 @@