-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: group entity #1199
base: 6.x
Are you sure you want to change the base?
feat: group entity #1199
Conversation
/** | ||
* Auto-generated Migration: Please modify to your needs! | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove see other migrations
{ | ||
public function getDescription(): string | ||
{ | ||
return ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add description
// dump($this->getClickedButtonName($form)); | ||
// if (GroupType::DELETE_BUTTON === $this->getClickedButtonName($form)) { | ||
// dump('c un delete'); | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
public function getAliasesName(): array | ||
{ | ||
// TODO: Implement getAliasesName() method. | ||
return []; | ||
} | ||
|
||
public function count(string $searchValue = '', mixed $context = null): int | ||
{ | ||
// TODO: Implement count() method. | ||
return 0; | ||
} | ||
|
||
public function getByItemName(string $name): ?EntityInterface | ||
{ | ||
return $this->groupRepository->getByName($name); | ||
} | ||
|
||
public function updateEntityFromJson(EntityInterface $entity, string $json): EntityInterface | ||
{ | ||
// TODO: Implement updateEntityFromJson() method. | ||
return $entity; | ||
} | ||
|
||
public function createEntityFromJson(string $json, ?string $name = null): EntityInterface | ||
{ | ||
// TODO: Implement createEntityFromJson() method. | ||
$form = Form::fromJson($json); | ||
|
||
return $form; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix todo's see how other services do it
|
||
/** | ||
* @param array<mixed> $routeParams | ||
*/ | ||
public function addTableToolbarActionDelete(TableAbstract $table, string $route, array $routeParams = []): self | ||
{ | ||
$table->addToolbarAction( | ||
label: t('action.delete', [], 'emsco-core'), | ||
icon: 'fa fa-trash', | ||
routeName: $route, | ||
routeParams: $routeParams | ||
)->setCssClass('btn btn-sm btn-danger'); | ||
|
||
return $this; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why a new toolbar action for delete ? It should work the same as other tables ?
public function __construct() | ||
{ | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove does not do anything
->findOneBy(['name' => $group->getName()]); | ||
|
||
if ($existingGroup) { | ||
throw new \Exception("Le groupe avec ce nom existe déjà."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never french in our code
EMS/core-bundle/src/Routes.php
Outdated
final public const string GROUP_ADD = 'emsco_group_admin_add'; | ||
final public const string GROUP_EDIT = 'emsco_group_admin_edit'; | ||
final public const string GROUP_DELETE = 'emsco_group_admin_delete'; | ||
final public const string DELETE_ALL_GROUP = 'emsco_group_admin_delete_all_group'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bad naming DELETE_ALL_GROUP -> GROUP_DELETE_ALL
{% for user in list_user_group %} | ||
<li style="display: flex; justify-content: flex-start; align-items: center; margin-bottom: 10px;"> | ||
{{ user.name }} | ||
<button class="btn btn-danger" style="margin-left: 10px;">delete</button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use translation keys
{% endfor %} | ||
</ul> | ||
<form action="group/add"> | ||
<button type="submit" class="btn btn-primary" style="margin-left: 5px;">Add group</button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
translation keys
You should also create a mysql migration, I will give more information |
Description for the pull request
developpement de groupe pour centraliser la gestion des roles