Remove all native alert()/confirm() calls
Native confirm() dialogs block browser automation entirely (discovered via a frozen tab while browser-testing the app.messages/app.modal adoption), and native alert()/confirm() are visually inconsistent with the rest of the UI. Replaced every call site with app.messages.action/confirm/toast: - directory.ejs: rotateSecret/deleteResource confirms and all inline save/add/remove-group/edge error alerts now target #resourceModal's actionMessage (or, for deleteResource — called from the outer table row, not the modal — the page's own card). - impersonate_modal.ejs, onboarding.ejs: no local .actionMessage target exists on these pages, so their alerts became page-wide toasts. - executive.ejs: two alerts in sendNotification's validation now use the existing $compose target; saveTos's alert now reuses the function's own msgEl inline-message element instead of introducing a second mechanism. - users.ejs, profile.ejs, proxy's profile.ejs: toggleActive's alert (no row context available at the call site) became a toast; revokeInvite/revokeToken/rotateToken use the row/card element already in scope. - app.js: removed app.user.remove and app.oauthClient.remove, which contained native confirm() guards and had zero callers anywhere in the app — dead code, deleted rather than converted. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
async function acceptTos() {
|
||||
var checkbox = document.getElementById('tosCheckbox');
|
||||
if (!checkbox.checked) {
|
||||
alert('Please read and check the box to accept the Terms of Service.');
|
||||
app.messages.toast('Please read and check the box to accept the Terms of Service.', 'danger');
|
||||
return;
|
||||
}
|
||||
try {
|
||||
@@ -50,14 +50,14 @@
|
||||
document.getElementById('section-tos').style.display = 'none';
|
||||
checkAllDone();
|
||||
} catch(e) {
|
||||
alert('Could not save TOS acceptance. Please try again.');
|
||||
app.messages.toast('Could not save TOS acceptance. Please try again.', 'danger');
|
||||
}
|
||||
}
|
||||
|
||||
async function saveDob() {
|
||||
var dob = document.getElementById('dobInput').value;
|
||||
if (!dob) {
|
||||
alert('Please enter your date of birth.');
|
||||
app.messages.toast('Please enter your date of birth.', 'danger');
|
||||
return;
|
||||
}
|
||||
try {
|
||||
@@ -73,7 +73,7 @@
|
||||
document.getElementById('section-dob').style.display = 'none';
|
||||
checkAllDone();
|
||||
} catch(e) {
|
||||
alert('Could not save date of birth. Please try again.');
|
||||
app.messages.toast('Could not save date of birth. Please try again.', 'danger');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,11 +81,11 @@
|
||||
var pw = document.getElementById('pwInput').value;
|
||||
var pw2 = document.getElementById('pwInput2').value;
|
||||
if (!pw || pw.length < 5) {
|
||||
alert('Password must be at least 5 characters.');
|
||||
app.messages.toast('Password must be at least 5 characters.', 'danger');
|
||||
return;
|
||||
}
|
||||
if (pw !== pw2) {
|
||||
alert('Passwords do not match.');
|
||||
app.messages.toast('Passwords do not match.', 'danger');
|
||||
return;
|
||||
}
|
||||
try {
|
||||
@@ -101,7 +101,7 @@
|
||||
document.getElementById('section-password').style.display = 'none';
|
||||
checkAllDone();
|
||||
} catch(e) {
|
||||
alert('Could not change password. Please try again.');
|
||||
app.messages.toast('Could not change password. Please try again.', 'danger');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user