Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions public/js/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,10 @@

function openUserModal() {
hideError(userFormError);
userOverlay.style.display = '';
// Explicit 'flex' (not '') so the overlay overrides aurora.css's base
// `.modal-overlay{display:none}`; inline style beats the class rule. Matches
// routes.js. Opening with '' would fall back to that rule and stay hidden.
userOverlay.style.display = 'flex';
}

function closeUserModal() {
Expand Down Expand Up @@ -595,7 +598,9 @@
// Custom scopes checkboxes
renderCustomScopes();

tokenOverlay.style.display = '';
// Explicit 'flex' (not '') — see openUserModal: aurora.css base hides
// .modal-overlay, so '' would fall back to display:none and stay hidden.
tokenOverlay.style.display = 'flex';
}

function renderCustomScopes() {
Expand Down
24 changes: 24 additions & 0 deletions tests/aurora_theme.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1580,3 +1580,27 @@ describe('aurora theme — settings + sidebar UX fixes (Issues 17/18/19)', () =>
assert.match(res.text, /class="[^"]*app[^"]*"/, '.app shell present');
});
});

describe('users modals — Aurora-safe overlay open (regression)', () => {
// aurora.css base `.modal-overlay{display:none}` (loaded after pro.css, same
// specificity → wins). The shared users.js must therefore open overlays with an
// explicit inline display:flex (inline beats the class rule), exactly like
// routes.js does. Opening with style.display='' falls back to aurora.css → none,
// so the Add User / Edit User (and token) modals never appear in Aurora.
const js = fs.readFileSync(path.join(__dirname, '..', 'public', 'js', 'users.js'), 'utf8');

it('aurora.css hides .modal-overlay by default (documents why flex is required)', () => {
const css = fs.readFileSync(path.join(__dirname, '..', 'public', 'css', 'aurora.css'), 'utf8');
assert.match(css, /\.modal-overlay\s*\{[^}]*display\s*:\s*none/, 'aurora .modal-overlay base is display:none');
});

it('user modal overlay is opened with display:flex, not an empty string', () => {
assert.match(js, /userOverlay\.style\.display\s*=\s*'flex'/, "openUserModal must set userOverlay display to 'flex'");
assert.doesNotMatch(js, /userOverlay\.style\.display\s*=\s*''/, "userOverlay must not be opened with '' (aurora.css → none)");
});

it('token modal overlay is opened with display:flex, not an empty string', () => {
assert.match(js, /tokenOverlay\.style\.display\s*=\s*'flex'/, "token modal must set tokenOverlay display to 'flex'");
assert.doesNotMatch(js, /tokenOverlay\.style\.display\s*=\s*''/, "tokenOverlay must not be opened with '' (aurora.css → none)");
});
});
Loading