Update dialog title to show user to be deleted

This commit is contained in:
Chris Hill 2023-11-05 23:15:02 +00:00 committed by Bill Thornton
parent e7d9e8c737
commit 150964a2e6
5 changed files with 11 additions and 6 deletions

1
.gitignore vendored
View File

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

View File

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

View File

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

View File

@ -61,7 +61,7 @@ const UserCardBox: FunctionComponent<IProps> = ({ user = {} }: IProps) => {
</div>`;
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='cardScalable visualCardBox-cardScalable'>
<div className='cardPadder cardPadder-square'></div>

View File

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