Skip to content

Commit b7026dc

Browse files
fix(ux): wrap showNewRuleModal in try/catch on empty-install banner CTA
QA-review of 7ed8f8a flagged MEDIUM: original CTA handler called _actions.showNewRuleModal() then removed the banner; if the modal init throws, banner is gone AND no modal renders — admin loses both onboarding paths until reload (silent failure). Fix: try/catch the modal call. On exception, keep the banner visible and surface UI.showMsg("Could not open the new-rule dialog. Reload the page to retry.", "error"). On success, remove banner non-stickily (unchanged behavior). Verified in browser (Playwright, build 662): - Patched Modals.showNewRuleModal to throw; CTA click: * exception contained inside try/catch (cta_throw_propagated: false) * banner stayed visible (banner_visible_after_click: true) * modal did NOT open (modal_open: false) * error toast appeared with the exact message text - Restored Modals.showNewRuleModal; re-clicked CTA: * modal opened (modal_open_happy: true) * banner removed (banner_after_happy_click: false) QA findings dispositions: - MEDIUM (deferred-exception in UI handler) → fixed in this commit - LOW (analyst-tier verification missing): backend check confirmed that ALL non-admin verification paths in this dev container return can_create_rules=True because superadmin enabled allow_analyst_create_rules — by design. The banner's gate `if (!canCreateRules) return;` mirrors the dropdown's `if (canCreateRules) { createBtn = ... }` (wl_nav.js:99-106), so banner-visibility = create-button-availability. No bypass. - OPEN (RELEASE_CHECKLIST.md re-run section): docs/RELEASE_CHECKLIST.md §5 "AppInspect Dry-Run" is the existing mechanism — my note in docs/APPINSPECT_FINDINGS.md correctly defers to that gate at release time. Bumps build 661 → 662 + urlArgs _b=662 in lockstep (cache-bust pairing per CLAUDE.md decision-log 2026-04-22).
1 parent 7ed8f8a commit b7026dc

3 files changed

Lines changed: 19 additions & 7 deletions

File tree

appserver/static/modules/wl_nav.js

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,25 @@ define([
139139
);
140140

141141
$banner.on("click", ".wl-empty-install-cta", function () {
142-
if (_actions && typeof _actions.showNewRuleModal === "function") {
142+
if (!_actions || typeof _actions.showNewRuleModal !== "function") {
143+
return;
144+
}
145+
try {
143146
_actions.showNewRuleModal();
144-
// Hide banner for this session — admin took action. Non-sticky
145-
// (no localStorage flag): if the modal is cancelled and state
146-
// is still empty, the banner reappears on the next page load.
147-
$banner.remove();
147+
} catch (e) {
148+
// Modal failed to open — keep banner visible so admin can
149+
// retry. Without this branch, both onboarding paths would
150+
// disappear silently.
151+
showMsg(
152+
"Could not open the new-rule dialog. Reload the page to retry.",
153+
"error"
154+
);
155+
return;
148156
}
157+
// Modal opened — remove banner for this session. Non-sticky
158+
// (no localStorage flag): if the modal is cancelled and state
159+
// is still empty, the banner reappears on the next page load.
160+
$banner.remove();
149161
});
150162

151163
function dismiss() {

appserver/static/whitelist_manager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// disk cache. Splunk serves /static/@<server-hash>/... with Cache-Control:
1212
// public, max-age=31536000; without urlArgs, bumped build numbers don't force
1313
// a re-fetch and clients run stale JS until they hard-refresh.
14-
require.config({ urlArgs: "_b=661" });
14+
require.config({ urlArgs: "_b=662" });
1515
require([
1616
"jquery",
1717
"underscore",

default/app.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
[install]
77
is_configured = false
8-
build = 661
8+
build = 662
99

1010
[launcher]
1111
author = Oleh Bezsonov

0 commit comments

Comments
 (0)