From b7bab2811d86a25f60f964e42be2b722578b52e0 Mon Sep 17 00:00:00 2001
From: Davide Iadeluca <146922689+DavideIadeluca@users.noreply.github.com>
Date: Fri, 14 Feb 2025 10:46:40 +0100
Subject: [PATCH] feat: actions dropdown in admin user list (#4188)
---
.../js/src/admin/components/UserListPage.tsx | 35 ++++++++++++++-----
framework/core/locale/core.yml | 11 +++---
2 files changed, 33 insertions(+), 13 deletions(-)
diff --git a/framework/core/js/src/admin/components/UserListPage.tsx b/framework/core/js/src/admin/components/UserListPage.tsx
index fec51bb61..5a4af6e70 100644
--- a/framework/core/js/src/admin/components/UserListPage.tsx
+++ b/framework/core/js/src/admin/components/UserListPage.tsx
@@ -4,6 +4,7 @@ import app from '../../admin/app';
import LoadingIndicator from '../../common/components/LoadingIndicator';
import Button from '../../common/components/Button';
+import Dropdown from '../../common/components/Dropdown';
import listItems from '../../common/helpers/listItems';
@@ -363,17 +364,18 @@ export default class UserListPage extends AdminPage {
);
columns.add(
- 'editUser',
+ 'userActions',
{
- name: app.translator.trans('core.admin.users.grid.columns.edit_user.title'),
+ name: app.translator.trans('core.admin.users.grid.columns.user_actions.title'),
content: (user: User) => (
-
+ {this.userActionItems(user).toArray()}
+
),
},
-90
@@ -382,6 +384,23 @@ export default class UserListPage extends AdminPage {
return columns;
}
+ userActionItems(user: User): ItemList {
+ const items = new ItemList();
+
+ items.add(
+ 'editUser',
+
+ );
+
+ return items;
+ }
+
headerInfo() {
return {
className: 'UserListPage',
diff --git a/framework/core/locale/core.yml b/framework/core/locale/core.yml
index 534166e48..856dedd76 100644
--- a/framework/core/locale/core.yml
+++ b/framework/core/locale/core.yml
@@ -360,11 +360,6 @@ core:
display_name:
title: Display name
- edit_user:
- button: => core.ref.edit
- title: => core.ref.edit_user
- tooltip: Edit {username}
-
email:
title: => core.ref.email
visibility_hide: Hide email address
@@ -377,6 +372,12 @@ core:
join_time:
title: Joined
+ user_actions:
+ title: Actions
+ edit_user:
+ button: => core.ref.edit
+ tooltip: Edit {username}
+
user_id:
title: ID