handle hidden users in teams (#1841)

* allow to add disabled users to team
* allow to include disabled users in user-select
* include disabled users when editing team members ONLY if they are already part of team
This commit is contained in:
Kevin Papst
2020-07-26 13:13:06 +02:00
committed by GitHub
parent ecea92942c
commit 130e6ac057
9 changed files with 99 additions and 15 deletions

View File

@@ -23,6 +23,9 @@ class TeamEditForm extends AbstractType
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
/** @var Team|null $team */
$team = $options['data'] ?? null;
$builder
->add('name', TextType::class, [
'label' => 'label.name',
@@ -55,6 +58,8 @@ class TeamEditForm extends AbstractType
'title' => 'Team member',
'description' => 'Array of team member IDs',
],
// make sure that disabled users show up in the result list
'include_users' => (null !== $team && $team->getUsers()->count() > 0 ? $team->getUsers()->toArray() : [])
])
;
}