Problem/Motivation
Updating to version 3.0 has blocking feature, but user cannot see list of people they have blocked.
This was implemented in version 2, but lost upon the upgrade.
Steps to reproduce
- Go to private-message/ban
- Banned a user
- Reloading private-message/ban should show list of banned users.
Proposed resolution
Implement the // @todo in the banUnbanPage() function in the Controller
public function banUnbanPage() {
return [
'#prefix' => '<div id="private_message_ban_page">',
'#suffix' => '</div>',
'content' => [
// @todo list banned users.
[
'form' => $this->formBuilder->getForm(BanUserForm::class),
],
],
];
}
Version 2.0 method is as follows
public function blockUnblockPage() {
/** @var \Drupal\private_message\Entity\PrivateMessageBlock $block */
$block = $this->privateMessageService->getPrivateMessageBlockEntity();
$user_has_permission = $this->currentUser->hasPermission('edit private message block entities');
return [
'#prefix' => '<div id="private_message_block_page">',
'#suffix' => '</div>',
'content' => [
0 => !empty($block) && $user_has_permission ? $block->toLink('Edit blocked users', 'edit-form')
->toRenderable() : [],
1 => !empty($block) ? $block->block_users->view('default') : [],
2 => [
'form' => $this->formBuilder->getForm('Drupal\private_message\Form\BlockUserForm'),
],
],
'#attached' => [
'library' => [
'private_message/block_page',
],
],
];
}
Remaining tasks
- Implement adding a list of banned users for the current user
- Have ability for user to unbanned a banned user.
User interface changes
TBD
API changes
TBD
Data model changes
PrivateMessageBlock changed into PrivateMessageBan and was simplified in version 3.0. I think we can remove the "edit blocked users" link, and just list the banned users with a link to unban.
Comment | File | Size | Author |
---|---|---|---|
#3 | ban_user_screenshot.png | 35.97 KB | sagesolutions |
Issue fork private_message-3427223
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
sagesolutions CreditAttribution: sagesolutions commentedAdded list of banned users on the ban/unban page.
Please review!