1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Merge pull request #4943 from Chris-Codes-It/feature/deleting_a_user_should_show_name

This commit is contained in:
Bill Thornton 2024-03-17 05:08:18 -04:00 committed by GitHub
commit b026148d32
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 11 additions and 6 deletions

1
.gitignore vendored
View file

@ -8,6 +8,7 @@ config.json
# ide # ide
.idea .idea
.vs
# log # log
yarn-error.log yarn-error.log

View file

@ -80,6 +80,7 @@
- [Rasmus Krämer](https://github.com/rasmuslos) - [Rasmus Krämer](https://github.com/rasmuslos)
- [ntarelix](https://github.com/ntarelix) - [ntarelix](https://github.com/ntarelix)
- [András Maróy](https://github.com/andrasmaroy) - [András Maróy](https://github.com/andrasmaroy)
- [Chris-Codes-It](https://github.com/Chris-Codes-It)
## Emby Contributors ## Emby Contributors

View file

@ -49,6 +49,7 @@ const UserProfiles: FunctionComponent = () => {
const showUserMenu = (elem: HTMLElement) => { const showUserMenu = (elem: HTMLElement) => {
const card = dom.parentWithClass(elem, 'card'); const card = dom.parentWithClass(elem, 'card');
const userId = card?.getAttribute('data-userid'); const userId = card?.getAttribute('data-userid');
const username = card?.getAttribute('data-username');
if (!userId) { if (!userId) {
console.error('Unexpected null user id'); console.error('Unexpected null user id');
@ -106,7 +107,7 @@ const UserProfiles: FunctionComponent = () => {
break; break;
case 'delete': case 'delete':
deleteUser(userId); deleteUser(userId, username);
} }
} }
}).catch(() => { }).catch(() => {
@ -117,12 +118,13 @@ const UserProfiles: FunctionComponent = () => {
}); });
}; };
const deleteUser = (id: string) => { const deleteUser = (id: string, username?: string | null) => {
const msg = globalize.translate('DeleteUserConfirmation'); const title = username ? globalize.translate('DeleteName', username) : globalize.translate('DeleteUser');
const text = globalize.translate('DeleteUserConfirmation');
confirm({ confirm({
title: globalize.translate('DeleteUser'), title,
text: msg, text,
confirmText: globalize.translate('Delete'), confirmText: globalize.translate('Delete'),
primary: 'delete' primary: 'delete'
}).then(function () { }).then(function () {

View file

@ -61,7 +61,7 @@ const UserCardBox: FunctionComponent<IProps> = ({ user = {} }: IProps) => {
</div>`; </div>`;
return ( return (
<div data-userid={user.Id} className={cssClass}> <div data-userid={user.Id} data-username={user.Name} className={cssClass}>
<div className='cardBox visualCardBox'> <div className='cardBox visualCardBox'>
<div className='cardScalable visualCardBox-cardScalable'> <div className='cardScalable visualCardBox-cardScalable'>
<div className='cardPadder cardPadder-square'></div> <div className='cardPadder cardPadder-square'></div>

View file

@ -187,6 +187,7 @@
"DeleteImage": "Delete Image", "DeleteImage": "Delete Image",
"DeleteImageConfirmation": "Are you sure you wish to delete this image?", "DeleteImageConfirmation": "Are you sure you wish to delete this image?",
"DeleteMedia": "Delete media", "DeleteMedia": "Delete media",
"DeleteName": "Delete {0}",
"DeleteUser": "Delete User", "DeleteUser": "Delete User",
"DeleteUserConfirmation": "Are you sure you wish to delete this user?", "DeleteUserConfirmation": "Are you sure you wish to delete this user?",
"Depressed": "Depressed", "Depressed": "Depressed",