improve: replace browser confirm with styled modal for role notification
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
f959323121
commit
9ff07ae57a
@ -1958,25 +1958,33 @@ Lub format CSV, Excel, lista emaili..."></textarea>
|
||||
}
|
||||
}
|
||||
|
||||
async function sendRoleNotification(userId, userName, userEmail) {
|
||||
if (!confirm(`Wysłać powiadomienie o uprawnieniach do ${userName} (${userEmail})?`)) return;
|
||||
try {
|
||||
const response = await fetch(`/admin/users-api/${userId}/send-role-notification`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-CSRFToken': csrfToken
|
||||
function sendRoleNotification(userId, userName, userEmail) {
|
||||
showConfirmModal(
|
||||
'Wyślij powiadomienie',
|
||||
`Wysłać email z podsumowaniem uprawnień do ${userName} (${userEmail})?`,
|
||||
async () => {
|
||||
try {
|
||||
const response = await fetch(`/admin/users-api/${userId}/send-role-notification`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-CSRFToken': csrfToken
|
||||
}
|
||||
});
|
||||
const data = await response.json();
|
||||
if (data.success) {
|
||||
showToast(data.message, 'success');
|
||||
} else {
|
||||
showToast(data.error || 'Błąd wysyłania', 'error');
|
||||
}
|
||||
} catch (error) {
|
||||
showToast('Błąd połączenia', 'error');
|
||||
}
|
||||
});
|
||||
const data = await response.json();
|
||||
if (data.success) {
|
||||
showMessage(data.message, 'success');
|
||||
} else {
|
||||
showMessage(data.error || 'Błąd wysyłania', 'error');
|
||||
}
|
||||
} catch (error) {
|
||||
showMessage('Błąd połączenia', 'error');
|
||||
}
|
||||
},
|
||||
'success',
|
||||
'Wyślij',
|
||||
'btn-primary'
|
||||
);
|
||||
}
|
||||
|
||||
function getRoleLabel(role) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user