Skip to content

Commit

Permalink
Fix missing × icon within buttons listing user's admin groups
Browse files Browse the repository at this point in the history
This icon is used as "hint" that clicking this button will remove
user from admin group.

Solution: Button name was set directly within `addSubmit()`. Method `setHtml`
(which set html with icon) doesn't override it.

remp/crm!2549
  • Loading branch information
markoph committed Aug 21, 2023
1 parent a4c1015 commit 59e5d02
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Forms/AdminUserGroupFormFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ public function create($userId)
$group = $userGroup->group;
$userGroupsIds[] = $group->id;
$accesses = $group->related('admin_groups_access')->count('*');
$button = $form->addSubmit('group_' . $group->id, $group->name);
$button = $form->addSubmit('group_' . $group->id);
$button->setHtmlAttribute('class', 'btn btn-default btn-blxock btn-sm');
$button->getControlPrototype()->setName('button')->setHtml('<i class="fa fa-times"></i> ' . $group->name . ' (' . $accesses . ')');
$button->getControlPrototype()
->setName('button')
->setHtml('<i class="fa fa-times"></i> ' . $group->name . ' (' . $accesses . ')');
$button->onClick[] = function () use ($factory, $group, $user, $form) {
$this->adminUserGroupsRepository->remove($group, $user);
$factory->onRemovedUserFromGroup->__invoke($form, $group, $user);
Expand Down

0 comments on commit 59e5d02

Please sign in to comment.