mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Update dialog title to show user to be deleted
This commit is contained in:
parent
e7d9e8c737
commit
150964a2e6
5 changed files with 11 additions and 6 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -8,6 +8,7 @@ config.json
|
||||||
|
|
||||||
# ide
|
# ide
|
||||||
.idea
|
.idea
|
||||||
|
.vs
|
||||||
|
|
||||||
# log
|
# log
|
||||||
yarn-error.log
|
yarn-error.log
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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 () {
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue