Conversation
Expose operator notification config with secret redaction, validated PATCH updates, delivery log filters, and relay-named test messages. Closes #760.
Reject persisting redacted placeholders on new targets, add PATCH controller coverage, reload settings in the maintenance worker, and record test deliveries in the delivery log.
Add Notifications admin view for targets, event toggles, save/reload, test delivery, and delivery history on top of the notifications API.
🦋 Changeset detectedLatest commit: e1adfca The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
| elements.success.classList.remove('d-none') | ||
| } | ||
|
|
||
| const defaultEvents = () => ({ |
There was a problem hiding this comment.
| try { | ||
| await deliverToTarget(target, envelope) | ||
| await this.deliveryLogRepository.append({ | ||
| outboxId: null, | ||
| eventType, | ||
| targetId: target.id, | ||
| targetType: target.type, | ||
| status: NotificationDeliveryStatus.SUCCESS, | ||
| attemptNumber: 1, | ||
| errorSnippet: null, | ||
| }) | ||
| } catch (error) { | ||
| const message = error instanceof Error ? error.message : String(error) | ||
| logger.error('test delivery failed for %s: %s', maskTargetForLog(target), message) | ||
| await this.deliveryLogRepository.append({ |
There was a problem hiding this comment.
| elements.logMore?.addEventListener('click', () => { | ||
| logLimit = Math.min(logLimit + 25, 200) | ||
| void loadDeliveryLog(false) |
There was a problem hiding this comment.
| card.querySelector('[data-action="test-target"]')?.addEventListener('click', () => { | ||
| void testTarget(target.id, card) | ||
| }) |
There was a problem hiding this comment.
Unsaved targets cannot be tested
A new target immediately has a Test button, but the request sends only its ID and the endpoint looks up that ID in saved settings. Testing a newly added card therefore returns “Unknown notification target” instead of testing the details on the card. Disable Test until the target is saved, or support testing pending details.
| <label class="visually-hidden" for="target-type-${target.id}">Target type</label> | ||
| <select id="target-type-${target.id}" data-target-field="type" class="form-select form-select-sm console-input notifications-target-type"> |
There was a problem hiding this comment.
Saved target IDs need only be nonempty, but this card inserts them directly into HTML attributes. An ID containing a quote or markup can break labels and controls or add unwanted elements. The delivery table also inserts stored fields through innerHTML. Build these elements with DOM APIs and assign dynamic values as text or attributes.
Description
This PR adds the Operator Notifications section to the admin dashboard, on top of the notifications API in #784.
GET/PATCH /admin/notificationsPOST /admin/notifications/testGET /admin/notifications/deliverieswith status/event filters, refresh, and load moreStack: base branch
feat/admin-notifications-api(feat(admin): add GET/PATCH /admin/notifications API #784), notmain.Related Issue
Closes:- #761
Motivation and Context
How Has This Been Tested?
/admin, open Notificationshttps://webhook.site/<uuid>(no#!/view/...), Save configurationsettings.changeddelivery)***for webhook URL; save again without changing URL still worksScreenshots (if appropriate):
Video Demontration :- https://github.com/user-attachments/assets/0f82a097-ef14-409e-b954-b989ee974028
Types of changes
Checklist: