-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
FEATURE: [2.2] [AdminBundle] #15890 Introduce sylius:admin-user:list command #15946
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
FEATURE: [2.2] [AdminBundle] #15890 Introduce sylius:admin-user:list command #15946
Conversation
❌ Preview Environment deleted from BunnyshellAvailable commands:
|
|
By default, all available admin users will be display. But you can also show only one admin user with the |
Rafikooo
left a comment
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.
Thank you @crydotsnake for another contribution,
It would be awesome if you could try to test this feature, you can refer to how we tested other, similar CLI command here: https://github.com/Sylius/Sylius/pull/14571/files#diff-0cc123576bf137514df3bef27330b372df9d5016c6e3a27cbe1c29338934e1d5R26
Yes. Good point 🤦🏼♂️ will take a look at it. A test for #15889 would be good aswell.. |
src/Sylius/Bundle/AdminBundle/Console/Command/ListAdminUsersCommand.php
Outdated
Show resolved
Hide resolved
|
Hello @crydotsnake, are you still interested in completing this task? We want to incorporate this feature, however, Sylius 1.13-RC version has been released, so this pull request should now be directed to the 2.0 branch 💃 |
Hello @Rafikooo ! Yes, i'm. But i had no time to work on the tests so far 😓. |
Does a list command really need a test? I mean, what could i test? 😅 |
|
cfd5505 to
4bb44d7
Compare
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughAdds a new Symfony console command Changes
Sequence Diagram(s)sequenceDiagram
actor Dev as Developer (CLI)
participant SC as Symfony Console
participant CMD as ListAdminUsersCommand
participant REPO as UserRepositoryInterface
participant IO as SymfonyStyle
Dev->>SC: sylius:admin-user:list [--username <name>]
SC->>CMD: initialize()
CMD->>IO: construct SymfonyStyle
SC->>CMD: execute()
alt username provided
CMD->>REPO: findOneByUsername(name)
REPO-->>CMD: AdminUser|null
alt found
CMD->>IO: render single-user table
CMD-->>SC: Command::SUCCESS
else not found
CMD->>IO: error("Admin user not found")
CMD-->>SC: Command::FAILURE
end
else no username
CMD->>REPO: findAll()
REPO-->>CMD: AdminUser[]
CMD->>IO: render all-users table
CMD-->>SC: Command::SUCCESS
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Assessment against linked issues
✨ Finishing touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 4
♻️ Duplicate comments (1)
src/Sylius/Bundle/AdminBundle/Console/Command/ListAdminUsersCommand.php (1)
71-93: Render one table for all users and handle the empty case.Currently a separate table is printed per user and there’s duplication with listSingleAdminUser. Prefer one table; warn if none. (Also addresses an earlier comment about reuse.)
private function listAllAdminUsers(): void { - $adminUsers = $this->userRepositoryInterface->findAll(); - /** @var AdminUser $adminUser */ - foreach ($adminUsers as $adminUser) { - $this->io->table( - [ - 'ID', 'E-Mail', 'Username', 'First name', 'Last name', 'Locale code', 'Enabled', - ], - [ - [ - $adminUser->getId(), - $adminUser->getEmail(), - $adminUser->getUsername(), - $adminUser->getFirstname() ?? 'No Firstname Set', - $adminUser->getLastName() ?? 'No Lastname Set', - $adminUser->getLocaleCode(), - $adminUser->isEnabled() ? 'Enabled' : 'Disabled', - ], - ], - ); - } + $adminUsers = $this->adminUserRepository->findAll(); + if ($adminUsers === []){ + $this->io->warning('No admin users found.'); + return; + } + + $rows = array_map( + static function (AdminUserInterface $adminUser): array { + return [ + $adminUser->getId(), + $adminUser->getEmail(), + $adminUser->getUsername(), + $adminUser->getFirstName() ?? 'No first name set', + $adminUser->getLastName() ?? 'No last name set', + $adminUser->getLocaleCode(), + $adminUser->isEnabled() ? 'Enabled' : 'Disabled', + ]; + }, + $adminUsers, + ); + + $this->io->table( + ['ID', 'Email', 'Username', 'First name', 'Last name', 'Locale code', 'Enabled'], + $rows, + ); }
🧹 Nitpick comments (6)
src/Sylius/Bundle/AdminBundle/Console/Command/ListAdminUsersCommand.php (6)
32-32: Restrict visibility of $io.Make it private; the class is final and nothing extends it.
- protected SymfonyStyle $io; + private SymfonyStyle $io;
46-50: Drop redundant PHPDoc on execute().Types are already declared; remove the boilerplate per coding guidelines.
- /** - * @param InputInterface $input - * @param OutputInterface $output - * @return int - */
78-78: Consistent header label.Prefer “Email” over “E-Mail”.
- 'ID', 'E-Mail', 'Username', 'First name', 'Last name', 'Locale code', 'Enabled', + 'ID', 'Email', 'Username', 'First name', 'Last name', 'Locale code', 'Enabled',- 'ID', 'E-Mail', 'Username', 'First name', 'Last name', 'Locale code', 'Enabled', + 'ID', 'Email', 'Username', 'First name', 'Last name', 'Locale code', 'Enabled',Also applies to: 100-100
74-74: Prefer interface types in annotations or remove them.Docblocks reference the concrete AdminUser; either switch to AdminUserInterface or drop the annotations (they’re not needed).
- /** @var AdminUser $adminUser */ + /** @var AdminUserInterface $adminUser */- /** @var AdminUser $adminUser */ + /** @var AdminUserInterface $adminUser */Also applies to: 97-97
95-114: Optional DRY: extract a row builder and reuse headers.Reduce duplication between listAllAdminUsers and listSingleAdminUser by extracting a toRow(AdminUserInterface) and a TABLE_HEADERS constant.
Example:
private const TABLE_HEADERS = ['ID', 'Email', 'Username', 'First name', 'Last name', 'Locale code', 'Enabled']; private function toRow(AdminUserInterface $u): array { return [ $u->getId(), $u->getEmail(), $u->getUsername(), $u->getFirstName() ?? 'No first name set', $u->getLastName() ?? 'No last name set', $u->getLocaleCode(), $u->isEnabled() ? 'Enabled' : 'Disabled', ]; } private function listSingleAdminUser(AdminUserInterface $adminUser): void { $this->io->table(self::TABLE_HEADERS, [$this->toRow($adminUser)]); }
51-69: Please add tests for the command.Cover happy path (all users), filter by existing username, and “not found” failure (exit code 1). Use CommandTester.
Sample:
public function test_it_lists_all_admin_users(): void { // arrange fixtures (2 admin users) // act $tester = new CommandTester(self::getContainer()->get(ListAdminUsersCommand::class)); $exit = $tester->execute([]); // assert self::assertSame(Command::SUCCESS, $exit); $display = $tester->getDisplay(); self::assertStringContainsString('Admin users', $display); self::assertStringContainsString('Enabled', $display); } public function test_it_lists_one_user_when_username_is_provided(): void { /* ... */ } public function test_it_fails_when_username_not_found(): void { /* ... */ }I can scaffold these in a dedicated test class if helpful.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/Sylius/Bundle/AdminBundle/Console/Command/ListAdminUsersCommand.php(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{php,yaml,yml,xml,twig}
📄 CodeRabbit inference engine (AGENTS.md)
Use 4 spaces for indentation in PHP, YAML, XML, and Twig files
Files:
src/Sylius/Bundle/AdminBundle/Console/Command/ListAdminUsersCommand.php
**/*.php
📄 CodeRabbit inference engine (AGENTS.md)
**/*.php: Use modern PHP 8.2+ syntax and features
Declare strict_types=1 in all PHP files
Follow the Sylius Coding Standard
Do not use deprecated features from PHP, Symfony, or Sylius
Use final for all classes, except entities and repositories
Use readonly for immutable services and value objects
Add type declarations for all properties, arguments, and return values
Use camelCase for variables and method names
Use SCREAMING_SNAKE_CASE for constants
Use fast returns instead of unnecessary nesting
Use trailing commas in multi-line arrays and argument lists
Order array keys alphabetically where applicable
Use PHPDoc only when necessary (e.g., @var Collection)
Group class elements in order: constants, properties, constructor, public, protected, private methods
Group getter and setter methods for the same properties together
Suffix interfaces with Interface and traits with Trait
Use use statements for all non-global classes
Sort use imports alphabetically and group by type (classes, functions, constants)
Files:
src/Sylius/Bundle/AdminBundle/Console/Command/ListAdminUsersCommand.php
🧬 Code graph analysis (1)
src/Sylius/Bundle/AdminBundle/Console/Command/ListAdminUsersCommand.php (1)
src/Sylius/Bundle/CoreBundle/Fixture/Factory/AdminUserExampleFactory.php (4)
AdminUserExampleFactory(28-112)__construct(38-49)configureOptions(82-97)create(51-80)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (17)
- GitHub Check: End-to-end tests (MySQL) / JS with Panther, PHP 8.3, Symfony ^7.2 (test_cached), MySQL 8.4, Twig ^3.3
- GitHub Check: End-to-end tests (MySQL) / JS with Panther, PHP 8.2, Symfony ^6.4 (test_cached), MySQL 8.0, Twig ^3.3
- GitHub Check: End-to-end tests (MySQL) / JS with Panther, PHP 8.4, Symfony ^7.2 (test_cached), MySQL 8.4, Twig ^3.3
- GitHub Check: End-to-end tests (MySQL) / JS with Chromedriver, PHP 8.3, Symfony ^7.2 (test_cached), MySQL 8.4, Twig ^3.3
- GitHub Check: End-to-end tests (MySQL) / Non-JS, PHP 8.4, Symfony ^7.2 (test_cached), MySQL 8.4, Twig ^3.3
- GitHub Check: End-to-end tests (MySQL) / JS with Chromedriver, PHP 8.2, Symfony ^6.4 (test_cached), MySQL 8.0, Twig ^3.3
- GitHub Check: End-to-end tests (MySQL) / Non-JS, PHP 8.3, Symfony ^7.2 (test_cached), MySQL 8.4, Twig ^3.3
- GitHub Check: End-to-end tests (MySQL) / Non-JS, PHP 8.2, Symfony ^6.4 (test_cached), MySQL 8.0, Twig ^3.3
- GitHub Check: End-to-end tests (MySQL) / JS with Chromedriver, PHP 8.4, Symfony ^7.2 (test_cached), MySQL 8.4, Twig ^3.3
- GitHub Check: Packages / PHP 8.4, Symfony ^7.2
- GitHub Check: Packages / PHP 8.2, Symfony ^6.4
- GitHub Check: Packages / PHP 8.3, Symfony ^7.2, ORM ^3.3
- GitHub Check: End-to-end tests (MariaDB) / Non-JS, PHP 8.4, Symfony ^7.2, MariaDB 11.4.7, State Machine Adapter symfony_workflow
- GitHub Check: End-to-end tests (MariaDB) / Non-JS, PHP 8.2, Symfony ^6.4, MariaDB 10.11.13, State Machine Adapter winzou_state_machine
- GitHub Check: End-to-end tests (PostgreSQL) / Non-JS, PHP 8.2, Symfony ^6.4, PostgreSQL 15.13
- GitHub Check: End-to-end tests (PostgreSQL) / Non-JS, PHP 8.4, Symfony ^7.2, PostgreSQL 17.5
- GitHub Check: Frontend / NodeJS 24.x
🔇 Additional comments (1)
src/Sylius/Bundle/AdminBundle/Console/Command/ListAdminUsersCommand.php (1)
84-85: Confirm Username API compatibility in your target Sylius version.If AdminUserInterface no longer guarantees getUsername() (migrated to getUserIdentifier()), update accordingly.
#!/bin/bash # Verify AdminUserInterface still declares getUsername() in this repo rg -nP -C2 'interface\s+AdminUserInterface\b' --type=php rg -nP '\bfunction\s+getUsername\s*\(' --type=php rg -nP '\bfunction\s+getUserIdentifier\s*\(' --type=phpAlso applies to: 106-106
src/Sylius/Bundle/AdminBundle/Console/Command/ListAdminUsersCommand.php
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/AdminBundle/Console/Command/ListAdminUsersCommand.php
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/AdminBundle/Console/Command/ListAdminUsersCommand.php
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/AdminBundle/Console/Command/ListAdminUsersCommand.php
Outdated
Show resolved
Hide resolved
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/Sylius/Bundle/AdminBundle/Resources/config/services.xml (1)
56-59: Align service ID/visibility with existing console commandsOther commands here use a named service ID and are marked public. For consistency, consider switching to a named ID, add the class attribute, and set public="true". Indentation can also follow the file’s convention.
- <service id="Sylius\Bundle\AdminBundle\Console\Command\ListAdminUsersCommand"> - <argument type="service" id="sylius.repository.admin_user" /> - <tag name="console.command" /> - </service> + <service id="sylius_admin.console.command.list_admin_users" + class="Sylius\Bundle\AdminBundle\Console\Command\ListAdminUsersCommand" + public="true"> + <argument type="service" id="sylius.repository.admin_user" /> + <tag name="console.command" /> + </service>Note: If #[AsCommand] is present, the explicit tag is optional; keeping it is fine for parity with neighbors.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/Sylius/Bundle/AdminBundle/Resources/config/services.xml(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{php,yaml,yml,xml,twig}
📄 CodeRabbit inference engine (AGENTS.md)
Use 4 spaces for indentation in PHP, YAML, XML, and Twig files
Files:
src/Sylius/Bundle/AdminBundle/Resources/config/services.xml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (13)
- GitHub Check: End-to-end tests (MySQL) / JS with Panther, PHP 8.4, Symfony ^7.2 (test_cached), MySQL 8.4, Twig ^3.3
- GitHub Check: End-to-end tests (MySQL) / JS with Panther, PHP 8.3, Symfony ^7.2 (test_cached), MySQL 8.4, Twig ^3.3
- GitHub Check: End-to-end tests (MySQL) / JS with Panther, PHP 8.2, Symfony ^6.4 (test_cached), MySQL 8.0, Twig ^3.3
- GitHub Check: End-to-end tests (MySQL) / Non-JS, PHP 8.4, Symfony ^7.2 (test_cached), MySQL 8.4, Twig ^3.3
- GitHub Check: End-to-end tests (MySQL) / JS with Chromedriver, PHP 8.4, Symfony ^7.2 (test_cached), MySQL 8.4, Twig ^3.3
- GitHub Check: End-to-end tests (MySQL) / Non-JS, PHP 8.3, Symfony ^7.2 (test_cached), MySQL 8.4, Twig ^3.3
- GitHub Check: End-to-end tests (MySQL) / JS with Chromedriver, PHP 8.2, Symfony ^6.4 (test_cached), MySQL 8.0, Twig ^3.3
- GitHub Check: End-to-end tests (MySQL) / JS with Chromedriver, PHP 8.3, Symfony ^7.2 (test_cached), MySQL 8.4, Twig ^3.3
- GitHub Check: End-to-end tests (MySQL) / Non-JS, PHP 8.2, Symfony ^6.4 (test_cached), MySQL 8.0, Twig ^3.3
- GitHub Check: End-to-end tests (PostgreSQL) / Non-JS, PHP 8.2, Symfony ^6.4, PostgreSQL 15.13
- GitHub Check: End-to-end tests (PostgreSQL) / Non-JS, PHP 8.4, Symfony ^7.2, PostgreSQL 17.5
- GitHub Check: End-to-end tests (MariaDB) / Non-JS, PHP 8.4, Symfony ^7.2, MariaDB 11.4.7, State Machine Adapter symfony_workflow
- GitHub Check: End-to-end tests (MariaDB) / Non-JS, PHP 8.2, Symfony ^6.4, MariaDB 10.11.13, State Machine Adapter winzou_state_machine
99ce5bc to
4259170
Compare
|
I have a small feature request. Could we format the table so that each column automatically adjusts to the widest field value? I think this would make it more readable and would also allow removing the repeated table headers 💃 |
Sure! |
Yup, it looks like something we're looking for 🚀 |
Because i already use the table helper. Thats why i dont quite understand what you mean with "format the table" 🤔 |
I mean the content isn't aligned 🙂 |
This is the new output. |
|
Last feature request: it might be useful to add a field for the privileges that admins have 🎉 |
@Rafikooo I like the idea too !🧙🏽♂️ 🪄 I added the |
src/Sylius/Bundle/AdminBundle/Console/Command/ListAdminUsersCommand.php
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/AdminBundle/Console/Command/ListAdminUsersCommand.php
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/AdminBundle/Console/Command/ListAdminUsersCommand.php
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/AdminBundle/Console/Command/ListAdminUsersCommand.php
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/AdminBundle/Console/Command/ListAdminUsersCommand.php
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/AdminBundle/Console/Command/ListAdminUsersCommand.php
Outdated
Show resolved
Hide resolved
ca6ec35 to
1dba01f
Compare
|
squashing done :) ! |
|
If this one is merged, i will rebase #15889 and include also a unit test for that! 🙂 |
1dba01f to
f357663
Compare
src/Sylius/Bundle/AdminBundle/Console/Command/ListAdminUsersCommand.php
Outdated
Show resolved
Hide resolved
0ff6c52 to
a48d63e
Compare
src/Sylius/Bundle/AdminBundle/Console/Command/ListAdminUsersCommand.php
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/AdminBundle/Console/Command/ListAdminUsersCommand.php
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/AdminBundle/Console/Command/ListAdminUsersCommand.php
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/AdminBundle/Console/Command/ListAdminUsersCommand.php
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/AdminBundle/Console/Command/ListAdminUsersCommand.php
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/AdminBundle/Console/Command/ListAdminUsersCommand.php
Outdated
Show resolved
Hide resolved
2c78190 to
91bd08c
Compare
91bd08c to
b8a4ee0
Compare
|
FYI: I rebased the branch 🙂 |
b8a4ee0 to
8a2d9a8
Compare
| )] | ||
| final class ListAdminUsersCommand extends Command | ||
| { | ||
| protected SymfonyStyle $io; |
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.
Since class is final and closed to extension.
| protected SymfonyStyle $io; | |
| private SymfonyStyle $io; |
| $searchTerm = $input->getOption('search'); | ||
| if ($searchTerm === null || $searchTerm === '') { | ||
| $this->renderUsersTable($output, $this->adminUserRepository->findAll()); | ||
|
|
||
| return Command::SUCCESS; | ||
| } | ||
|
|
||
| $users = $this->searchUsers($searchTerm); | ||
| if (empty($users)) { | ||
| $this->io->warning(sprintf('No users found matching "%s"', $searchTerm)); | ||
|
|
||
| return Command::SUCCESS; | ||
| } |
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.
Now, that code was refactored few times, I think logic branching for all and filtered users is not necessary anymore
| $searchTerm = $input->getOption('search'); | |
| if ($searchTerm === null || $searchTerm === '') { | |
| $this->renderUsersTable($output, $this->adminUserRepository->findAll()); | |
| return Command::SUCCESS; | |
| } | |
| $users = $this->searchUsers($searchTerm); | |
| if (empty($users)) { | |
| $this->io->warning(sprintf('No users found matching "%s"', $searchTerm)); | |
| return Command::SUCCESS; | |
| } | |
| $adminUsers = $this->findAdminUsers($input->getOption('search')); | |
| if (empty($adminUsers)) { | |
| $this->io->warning('No admin users found.'); | |
| return Command::SUCCESS; | |
| } |
and
/**
* @return array<AdminUserInterface>
*/
private function findAdminUsers(?string $criteria): array
{
if (empty($criteria)) {
return $this->adminUserRepository->findAll();
}
return $this->adminUserManager->createQueryBuilder()
->from(AdminUserInterface::class, 'o')
->select('o')
->where('LOWER(o.email) LIKE :criteria
OR LOWER(o.username) LIKE :criteria
OR LOWER(o.firstName) LIKE :criteria
OR LOWER(o.lastName) LIKE :criteria')
->setParameter('criteria', '%' . mb_strtolower($searchTerm) . '%')
->orderBy('o.createdAt', 'DESC')
->getQuery()
->getResult();
}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.
I'm confused. Why should the filter logic removed?
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.
I’m not suggesting removing the filtering logic, but rather refactoring the code. It has been modified several times, and as a result, the overall clarity and structure have been affected.
| $criteria = '%' . mb_strtolower($searchTerm) . '%'; | ||
|
|
||
| return $this->adminManager->createQueryBuilder() | ||
| ->from(AdminUserInterface::class, 'u') |
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.
It's sylius default to use o as alias for all queries.
| ->from(AdminUserInterface::class, 'u') | |
| ->from(AdminUserInterface::class, 'o') |
| { | ||
| $table = new Table($output); | ||
| $table->setHeaders([ | ||
| 'ID', 'E-Mail', 'Username', 'First name', 'Last name', 'Locale code', 'Enabled', 'Roles', |
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.
| /** @param UserRepositoryInterface<AdminUserInterface> $adminUserRepository */ | ||
| public function __construct( | ||
| private readonly UserRepositoryInterface $adminUserRepository, | ||
| private readonly EntityManagerInterface $adminManager, |
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.
| private readonly EntityManagerInterface $adminManager, | |
| private readonly EntityManagerInterface $adminUserManager, |
…command FEATURE: Implement option to also select single admin user by username TASK: add ListAdminUsersCommand back too services.xml after rebase TASK: apply review suggestions & use ternary operator for getFirstName() & getLastName() TASK: Integrate Table Helper and format table TASK: add roles column with priviliges to table TASK: apply cs fixes TASK: adjust namings of variables and switch from AdminUser to AdminUserInterface TASK: make logic more compact and use one function for generate table TASK: move configure() function at the top TASK: make phpstan happy TASK: add unit test for ListAdminUsersCommand class TASK: adjust unit test TASK: adjust services.xml TASK: adjust ListAdminUsersCommand by adding ability to search by email, username, first and lastname TASK: check users array with empty function instead of with null TASK: apply review suggestions BUGFIX: make sure table only renders once TASK: inject EntityManagerInterface and write custom query method to search for users
8a2d9a8 to
b2ba496
Compare
Description:
As described in: #15890
This pull request introduces a new CLI command:
By default all available admin users are listed, and each data of a user is showed in a table:
If you want to see only one admin user, you can use the
--usernameoption:Any feedback or improvement ideas are much appreciated!
Summary by CodeRabbit