Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions ui/app/workspace/webhooks/views/webhookDetailsSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,7 @@ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
import { useCopyToClipboard } from "@/hooks/useCopyToClipboard";
import { getErrorMessage, useGetWebhookDeliveriesQuery, useRedeliverWebhookDeliveryMutation } from "@/lib/store";
import {
WEBHOOK_EVENT_COLORS,
WEBHOOK_TUNING_DEFAULTS,
WebhookDelivery,
WebhookDeliveryOutcome,
WebhookEndpoint,
WebhookEvent,
} from "@/lib/types/webhooks";
import { WEBHOOK_TUNING_DEFAULTS, WebhookDelivery, WebhookDeliveryOutcome, WebhookEndpoint, WebhookEvent } from "@/lib/types/webhooks";
import { format, formatDistanceToNow } from "date-fns";
import { ChevronDown, ChevronLeft, ChevronRight, Info, Loader2, RefreshCcw, Send } from "lucide-react";
import { Fragment, useEffect, useMemo, useState } from "react";
Expand Down Expand Up @@ -227,7 +220,7 @@ export function WebhookDetailsSheet({ endpoint, isTesting, canManage, onTest, on
value={
<div className="flex flex-wrap gap-1">
{endpoint?.events.map((event) => (
<Badge key={event} variant="outline" className={`font-mono text-xs ${WEBHOOK_EVENT_COLORS[event]}`}>
<Badge key={event} variant="outline" className="font-mono text-xs">
{event}
</Badge>
))}
Expand Down Expand Up @@ -401,7 +394,7 @@ export function WebhookDetailsSheet({ endpoint, isTesting, canManage, onTest, on
)}
</TableCell>
<TableCell className="whitespace-nowrap">
<Badge variant="outline" className={`font-mono text-xs ${WEBHOOK_EVENT_COLORS[latest.event]}`}>
<Badge variant="outline" className="font-mono text-xs">
{latest.event}
</Badge>
</TableCell>
Expand Down
6 changes: 3 additions & 3 deletions ui/app/workspace/webhooks/views/webhooksView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
useTestWebhookEndpointMutation,
useUpdateWebhookEndpointMutation,
} from "@/lib/store";
import { WEBHOOK_EVENT_COLORS, WEBHOOK_EVENTS, WebhookEndpoint, WebhookEndpointRequest, WebhookEvent } from "@/lib/types/webhooks";
import { WEBHOOK_EVENTS, WebhookEndpoint, WebhookEndpointRequest, WebhookEvent } from "@/lib/types/webhooks";
import { useDebouncedValue } from "@/hooks/useDebounce";
import { RbacOperation, RbacResource, useRbac } from "@enterprise/lib";
import { ChevronLeft, ChevronRight, MoreHorizontal, PencilIcon, Plus, RotateCcw, Trash2 } from "lucide-react";
Expand Down Expand Up @@ -381,8 +381,8 @@ export default function WebhooksView() {
</TableCell>
<TableCell>
<div className="flex flex-wrap gap-1">
{endpoint.events.map((event) => (
<Badge key={event} variant="outline" className={`font-mono text-xs ${WEBHOOK_EVENT_COLORS[event]}`}>
{[...endpoint.events].sort().map((event) => (
<Badge key={event} variant="outline" className="font-mono text-xs">
{event}
</Badge>
))}
Expand Down
7 changes: 0 additions & 7 deletions ui/lib/types/webhooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,6 @@ export interface RedeliverWebhookResponse {
webhook_id: string;
}

// Soft tints for event badges, matching the delivery-outcome color language
// (green = completed/delivered, red = failed).
export const WEBHOOK_EVENT_COLORS: Record<WebhookEvent, string> = {
"async_job.completed": "bg-green-100 text-green-800",
"async_job.failed": "bg-red-100 text-red-800",
};

// Delivery worker defaults, shown as placeholders for unset (0) knobs.
export const WEBHOOK_TUNING_DEFAULTS = {
max_retries: 4,
Expand Down
Loading