Skip to content

Add the Connector Failure Alerts card to admin settings - #1019

Merged
helpcodeai merged 2 commits into
HelpCode-ai:mainfrom
rangarajan19:feat/1006-alerts-ui
Oct 11, 2026
Merged

helpcodeai merged 2 commits into
HelpCode-ai:mainfrom
rangarajan19:feat/1006-alerts-ui

Conversation

@rangarajan19

Copy link
Copy Markdown
Contributor

Summary

PR 2 (UI) for #1006, following up on the merged backend PR #976. Adds the Alerts card to /settings/admin, same shape and conventions as the existing SMTP card right above it.

Changes

  • lib/api.ts: adminSettings.getAlertWebhook/updateAlertWebhook/deleteAlertWebhook/testAlertWebhook, typed against the actual merged backend contract (note: GET returns { configured: false } when unset, or the config fields directly with no wrapper key when set — handled by checking for url rather than a configured flag).
  • app/settings/admin/page.tsx: new "Connector Failure Alerts" card — URL, payload type (JSON/Slack), threshold/window/cooldown, enabled toggle, save/test/remove, a rotate-secret option, and a shown-once secret reveal using the existing copyText clipboard helper. Shows an https-required hint on Cloud via useAuth().deploymentMode.

Testing

  • Tested manually (steps below)
  • All existing tests pass (no backend changes in this PR)

This sandbox has no network access for Google Fonts, which breaks next build/next dev under Turbopack (pre-existing on main, confirmed by reproducing it on a clean checkout — unrelated to this change). Built and ran with --webpack instead, which isn't the project's default dev command, so noting it explicitly: npx next build --webpack succeeds, including /settings/admin and the TypeScript pass.

Verified against a real local stack (Postgres via docker compose, migrations applied, backend on :4000, frontend on :3000, webpack mode), logged in as a fresh self-hosted ADMIN, and exercised the full lifecycle on the real merged API:

  • Save: generates and reveals the signing secret once, shows the Rotate-secret checkbox and Test/Remove buttons afterward.
  • Test: dispatches a real signed POST (hit a real domain without a webhook listener and correctly surfaced Error: Webhook responded with 405, confirming SSRF check → HMAC signing → outbound POST → response status all round-trip into the UI).
  • Remove: confirm dialog fires with the expected message, deletes the config, resets the form, shows "Alert webhook removed".
npx tsc --noEmit -p tsconfig.json
npx eslint src/app/settings/admin/page.tsx src/lib/api.ts

Both clean.

Related Issues

Relates to #1006

UI for the alert-webhook backend from HelpCode-ai#1006 (PR 1, merged): URL, payload
type (JSON/Slack), threshold/window/cooldown, enabled toggle, save/test/
remove, and a rotate-secret option with a shown-once secret reveal,
mirroring the existing SMTP card's conventions on the same page.
@helpcodeai
helpcodeai enabled auto-merge (squash) October 11, 2026 07:57
@helpcodeai
helpcodeai merged commit 9834e6a into HelpCode-ai:main Oct 11, 2026
13 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants