Skip to content

Commit

Permalink
Revert "feat: provide an 'actions' dropdown for extensions to add the…
Browse files Browse the repository at this point in the history
…ir additional buttons"

This reverts commit 772852b.
  • Loading branch information
imorland committed Oct 2, 2024
1 parent 772852b commit ea2fd2c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 31 deletions.
36 changes: 8 additions & 28 deletions framework/core/js/src/admin/components/UserListPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import extractText from '../../common/utils/extractText';
import AdminPage from './AdminPage';
import { debounce } from '../../common/utils/throttleDebounce';
import CreateUserModal from './CreateUserModal';
import Dropdown from '../../common/components/Dropdown';

type ColumnData = {
/**
Expand Down Expand Up @@ -426,18 +425,17 @@ export default class UserListPage extends AdminPage {
);

columns.add(
'userActions',
'editUser',
{
name: app.translator.trans('core.admin.users.grid.columns.user_actions.title'),
name: app.translator.trans('core.admin.users.grid.columns.edit_user.title'),
content: (user: User) => (
<Dropdown
className="User-controls"
buttonClassName="Button Button--icon Button--flat"
menuClassName="Dropdown-menu--right"
icon="fas fa-ellipsis-h"
<Button
className="Button UserList-editModalBtn"
title={app.translator.trans('core.admin.users.grid.columns.edit_user.tooltip', { username: user.username() })}
onclick={() => app.modal.show(EditUserModal, { user })}
>
{this.userActionItems(user).toArray()}
</Dropdown>
{app.translator.trans('core.admin.users.grid.columns.edit_user.button')}
</Button>
),
},
-90
Expand All @@ -455,24 +453,6 @@ export default class UserListPage extends AdminPage {
};
}

userActionItems(user: User): ItemList<Mithril.Children> {
const items = new ItemList<Mithril.Children>();

items.add(
'editUser',
<Button
icon="fas fa-pencil-alt"
className="Button UserList-editModalBtn"
title={app.translator.trans('core.admin.users.grid.columns.edit_user.tooltip', { username: user.username() })}
onclick={() => app.modal.show(EditUserModal, { user })}
>
{app.translator.trans('core.admin.users.grid.columns.edit_user.button')}
</Button>
);

return items;
}

/**
* Asynchronously fetch the next set of users to be rendered.
*
Expand Down
4 changes: 1 addition & 3 deletions framework/core/locale/core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ core:

edit_user:
button: => core.ref.edit
title: => core.ref.edit_user
tooltip: Edit {username}

email:
Expand All @@ -285,9 +286,6 @@ core:
join_time:
title: Joined

user_actions:
title: Actions

user_id:
title: ID

Expand Down

0 comments on commit ea2fd2c

Please sign in to comment.