From 5c49b71c0217ffe8c49eb769e592893e89944639 Mon Sep 17 00:00:00 2001 From: David Sevilla Martin Date: Sat, 8 Aug 2020 15:47:42 -0400 Subject: [PATCH] update: forum/utils/UserControls --- js/src/forum/utils/UserControls.js | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/js/src/forum/utils/UserControls.js b/js/src/forum/utils/UserControls.js index beb3d47c1..b2f5dacb9 100644 --- a/js/src/forum/utils/UserControls.js +++ b/js/src/forum/utils/UserControls.js @@ -22,10 +22,10 @@ export default { const items = new ItemList(); ['user', 'moderation', 'destructive'].forEach((section) => { - const controls = this[section + 'Controls'](user, context).toArray(); + const controls = this[section](user, context).toArray(); if (controls.length) { controls.forEach((item) => items.add(item.itemName, item)); - items.add(section + 'Separator', Separator.component()); + items.add(section + 'Separator', ); } }); @@ -41,7 +41,7 @@ export default { * @return {ItemList} * @protected */ - userControls() { + user() { return new ItemList(); }, @@ -54,17 +54,15 @@ export default { * @return {ItemList} * @protected */ - moderationControls(user) { + moderation(user) { const items = new ItemList(); if (user.canEdit()) { items.add( 'edit', - Button.component({ - icon: 'fas fa-pencil-alt', - children: app.translator.trans('core.forum.user_controls.edit_button'), - onclick: this.editAction.bind(this, user), - }) + ); } @@ -80,17 +78,15 @@ export default { * @return {ItemList} * @protected */ - destructiveControls(user) { + destructive(user) { const items = new ItemList(); if (user.id() !== '1' && user.canDelete()) { items.add( 'delete', - Button.component({ - icon: 'fas fa-times', - children: app.translator.trans('core.forum.user_controls.delete_button'), - onclick: this.deleteAction.bind(this, user), - }) + ); }