mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-30 11:33:49 +00:00
Activity form: add required class name on required field built with vue
This commit is contained in:
@@ -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 {
|
||||
@@ -338,7 +342,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 {
|
||||
|
Reference in New Issue
Block a user