Skip to content
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

Draft
wants to merge 19 commits into
base: 6.x
Choose a base branch
from
Draft

feat: group entity #1199

wants to merge 19 commits into from

Conversation

Zki49
Copy link

@Zki49 Zki49 commented Feb 12, 2025

Q A
Bug fix? n
New feature? y
BC breaks? n
Deprecations? n
Fixed tickets? n
Documentation? n

Description for the pull request
developpement de groupe pour centraliser la gestion des roles

@Zki49 Zki49 requested a review from a team as a code owner February 12, 2025 15:06
@Zki49 Zki49 marked this pull request as draft February 12, 2025 15:06
Comment on lines 10 to 12
/**
* Auto-generated Migration: Please modify to your needs!
*/
Copy link
Member

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 '';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add description

Comment on lines 71 to 74
// dump($this->getClickedButtonName($form));
// if (GroupType::DELETE_BUTTON === $this->getClickedButtonName($form)) {
// dump('c un delete');
// }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

Comment on lines 43 to 72
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;
}
Copy link
Member

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

Comment on lines 84 to 98

/**
* @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;
}
Copy link
Member

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 ?

Comment on lines 26 to 28
public function __construct()
{
}
Copy link
Member

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à.");
Copy link
Member

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

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';
Copy link
Member

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>
Copy link
Member

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>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

translation keys

@Davidmattei
Copy link
Member

You should also create a mysql migration, I will give more information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

2 participants