agent_crew icon indicating copy to clipboard operation
agent_crew copied to clipboard

feat: Post-Action bindings section in Webhook/Schedule detail pages

Open sre-helmcode opened this issue 8 months ago • 1 comments

Description

Add a "Post-Actions" section to WebhookDetailPage and ScheduleDetailPage that shows linked post-actions and allows managing bindings inline.

WebhookDetailPage Changes

Add a collapsible section after the existing content:

"Post-Actions" Section:

  • Uses reverse lookup endpoint: GET /api/webhooks/:id/post-actions
  • Shows list of bound post-actions: | Post-Action Name | Condition | Body Override | Enabled | Actions |
    • Post-Action Name links to /post-actions/:id
    • Condition badge: success (green), failure (red), any (blue)
    • Body Override: indicator icon if set, expandable to view
    • Actions: edit condition, toggle, unlink
  • "Link Post-Action" button:
    • Opens modal with:
      • Dropdown of available post-actions (from GET /api/post-actions)
      • Condition select (success/failure/any)
      • Optional body override textarea with variable hints
    • Creates binding via POST /api/post-actions/:paId/bindings
  • Empty state: "No post-actions linked. Link one to get notified when this webhook runs."

ScheduleDetailPage Changes

Identical section as WebhookDetailPage, but using:

  • GET /api/schedules/:id/post-actions for listing
  • trigger_type: "schedule" when creating bindings

Shared Component

Consider extracting a PostActionBindingsSection component that both pages can use:

interface PostActionBindingsSectionProps {
  triggerType: 'webhook' | 'schedule';
  triggerId: string;
  onBindingChange?: () => void;
}

Acceptance Criteria

  • [ ] Post-Actions section visible in WebhookDetailPage
  • [ ] Post-Actions section visible in ScheduleDetailPage
  • [ ] List bindings with condition badges
  • [ ] Link new post-action via modal
  • [ ] Edit binding condition and body override
  • [ ] Unlink (delete) binding with confirmation
  • [ ] Empty state when no bindings
  • [ ] Shared component to avoid duplication
  • [ ] Polling/refresh after binding changes

References

  • Depends on: Types + API client issue, Post-Actions pages issue
  • Plan: PLAN_POST_ACTIONS.md

sre-helmcode avatar Mar 05 '26 16:03 sre-helmcode

Closed: implemented in commit 84b881b (post-actions UI — pages, bindings section, and sidebar navigation)

sre-helmcode avatar Mar 07 '26 12:03 sre-helmcode