Repository navigation
Show when an alert is disabled and not running - #38286
Conversation
…xplains the state
UI browser testsRan: all test files (no impact map from main yet) Result: ✅ 1070 passed · 154 skipped Changed code executed by these browser tests: 5 / 5 lines (100%)
Changed files no browser test loads
|
ShaileshParmar11
left a comment
There was a problem hiding this comment.
Review of the UI changes only, at 3352471.
Spec compliance: pass.
- The Status column is in all four lists.
- "Not running" shows in all three places that show the pending count.
- The Diagnostics tab has a Status row.
- All three form surfaces have the Enabled switch.
enabledis loaded and saved for both classic and AI forms. Both AI edit mappers spread the alert, so a disabled alert opens with the switch off.- View mode hides the basic fields, so the switch never shows on a read-only page.
- The
isViewModeprop now passed to extension widgets is already handled by Collate's template section.
Blocking issues: none. The inline comments are 🟡 nits.
Checked and found clean:
- The classic
Input isDisabledis not passed to the react-hook-form controller, so a disabled field keeps its value on save. - When the alert is switched back on, the description editor is mounted again with the current text.
- The Playwright step checks
enabledin the PATCH response. - No new antd components and no raw palette classes.
…ecks the entry points already make
Code Review ✅ Approved 🟡 Medium risk 2 closed / 2 findingsThe Enabled toggle changes whether configured alerts send notifications; switching one off could suppress future event notifications until it is re-enabled. Adds an Enabled switch to alert forms and status display across alert lists and details, so disabled alerts show as "Not running" instead of 0 pending events. The AI form now hides empty Filters and Trigger sections while disabled, and the typography text colour is set via the ✅ 2 closed✅ Bug: Disabled AI form does not hide empty Filters/Trigger sections as claimed
✅ Quality: Typography text colour set via className, not the color prop
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
ShaileshParmar11
left a comment
There was a problem hiding this comment.
Approving the UI changes at 637f2ef. I did not review the backend, spec or ADR changes.
All seven inline comments from the earlier review are resolved:
- The duplicated permission check is removed from
AlertEditModalandAddObservabilityPage. - Switching off an alert now locks its fields only when editing a saved alert.
isEditModereaches both the AI form and the classic form, and new tests cover create mode and edit mode. - The
aria-disabledattribute and the test that only checked a mock are removed. - The props now have a named interface.
alertStatusOfstays as a helper. This is correct, becausesonarjs/no-nested-conditionalis set toerrorineslint.config.mjs.
ui-checkstyle, ui-coverage-tests and the browser-test shards all pass.
* Report nothing pending for a disabled alert * Cover alerts created disabled with a position an older release wrote * Share the read-nothing progress and test the no-row read * Keep the raw alert offset getter Collate tests read * Say a disabled alert is not running and report its stored offsets * Show when an alert is disabled and not running * Map the notification list page to its alert specs * Describe the status row neutrally and test each disabled alert screen * Organise the alert badge imports * Show alert status in a column and switch alerts on or off from the form * Show a disabled alert's description as a preview instead of a locked editor * Organise the alert status and switch imports * Format the alert form fields and map the enabled switch to its spec * Show alert status as a dot badge, green for active and gray for disabled * Turn the alert Enabled switch into a settings row whose description explains the state * Close the profile source picker from the start of the header subtitle * Follow the helper placement, core styling and permission test rules in the alert UI * Lock a switched-off alert only when editing it and drop permission checks the entry points already make
…title (#38605) * test(playwright): dismiss AI alert popovers from the start of the subtitle #38286 added the Enabled row to the alert form, so on the profile alert page the source picker opens its list upwards over the middle of the header subtitle and dismissPopover's click lands on an option row. Click the subtitle's start, as closeSourcePicker already does. * test(playwright): close the profile source picker through dismissPopover closeSourcePicker repeated dismissPopover's subtitle click, and the two drifted apart once already. Reuse it.
…title (#38605) (#38653) * test(playwright): dismiss AI alert popovers from the start of the subtitle #38286 added the Enabled row to the alert form, so on the profile alert page the source picker opens its list upwards over the middle of the header subtitle and dismissPopover's click lands on an option row. Click the subtitle's start, as closeSourcePicker already does. * test(playwright): close the profile source picker through dismissPopover closeSourcePicker repeated dismissPopover's subtitle click, and the two drifted apart once already. Reuse it. (cherry picked from commit 2d215b7)
Describe your changes:
Fixes #38280
Stacked on PR #38279; until it merges, only the last eleven commits are this change.
Problem. After PR #38279, a disabled alert reports 0 pending events and "processed all events: Yes". The API now returns
enabledoneventsRecordanddiagnosticInfo, but the UI did not show it, and there was no way to switch an alert off or on.Fix.
BadgeWithDot: Active in green, Disabled in gray.enabled. Its description follows the state: on, the alert sends notifications for the configured events; off, it sends nothing and events from that time are not sent later. While a saved alert is off, its other fields are read-only; a new alert stays editable, so it can still be filled in and saved disabled. Save and Cancel stay active. Only users who can edit the alert can use the toggle (canEditAll): the edit page and drawer open only with it, and the profile form checks it.While off, the classic form shows the description as a preview: the rich text editor cannot become read-only in place. AI mode hides empty Filters and Trigger sections, as in view mode.
Why this way. It reuses the alert's
enabledfield, the coreCard,ToggleandBadgeWithDot, and existing keys. Five keys are new, translated in every locale.Type of change:
Tests:
Unit tests
AlertStatusBadge,AlertEnabledSwitch(accessible name, disabled without edit access, a description per state in a live region) andAlertPendingEvents.AddObservabilityPage,AlertAiFormFields,AlertEditModal,NotificationAlertForm: new alerts start enabled and stay editable when switched off; switching a saved alert off makes its fields read-only and changes the description while Save and Cancel stay active; switching on restores editing.AlertsClassBase,ClassicAlertForm.utils:enabledis loaded and saved.AlertAiFormFieldsPureUtils: which fields are read-only for a switched-off saved alert, a switched-off new alert, a view-only form and rules without selections. The permission tests run the real permission derivation over a minimal permission object.After merging main, the 15 test files this PR changes pass (307 tests). ESLint and Prettier pass;
yarn tsc:checkreports no error in this PR's files (the existing ones are inOMSelectWidget.tsxandSSOUtils.test.ts).Playwright (UI) tests
ObservabilityAlerts.spec.tsgains a step that switches an alert off from its form, checks the fields are read-only and the description changes, saves, then switches it back on.closeSourcePickernow clicks the start of the subtitle, which the source list, opening upward below the taller row, no longer covers.Run locally against a server built from this branch, across the five alert specs: 30 of 35 pass, including the new step. The 5 failures need webhook delivery to a
localhostreceiver the Docker server cannot reach; CI can.UI screen recording:
alert-status-and-switch.webm
Recorded locally on
04ee242: the Status column in both lists, an edit form on, switched off (read-only fields and the changed description) and back on, and the details page with "Not running" and the Diagnostics Status row.Checklist:
Fixes #<issue-number>above.Summary by Gitar
This will update automatically on new commits.
The latest changes add no new blocker, but the two earlier repository requirements still need to be satisfied before merging.
Findings
Summary
The PR shows disabled alerts clearly and adds an Enabled switch to alert forms.
Reviews (7) · Last reviewed commit: "Close the profile source picker from the..." · Reviewed by Greptile