feat: add reset action for integration watches (#1381)

This commit is contained in:
Carlos Florêncio
2026-06-15 18:54:16 +01:00
committed by GitHub
parent 214a8f5cce
commit 61acc82b74
60 changed files with 3158 additions and 193 deletions
@@ -1,6 +1,12 @@
"use client";
import { IconTrash, IconRefresh, IconPlayerPlay, IconPlayerPause } from "@tabler/icons-react";
import {
IconTrash,
IconRefresh,
IconPlayerPlay,
IconPlayerPause,
IconRestore,
} from "@tabler/icons-react";
import { Button } from "@kandev/ui/button";
import { Badge } from "@kandev/ui/badge";
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@kandev/ui/table";
@@ -16,6 +22,7 @@ type SentryIssueWatchTableProps = {
onEdit: (watch: SentryIssueWatch) => void;
onDelete: (id: string, workspaceId: string) => void;
onTrigger: (id: string, workspaceId: string) => void;
onReset: (id: string, workspaceId: string) => void;
onToggleEnabled: (watch: SentryIssueWatch) => void;
};
@@ -55,11 +62,13 @@ function WatchActions({
watch,
onToggleEnabled,
onTrigger,
onReset,
onDelete,
}: {
watch: SentryIssueWatch;
onToggleEnabled: (watch: SentryIssueWatch) => void;
onTrigger: (id: string, workspaceId: string) => void;
onReset: (id: string, workspaceId: string) => void;
onDelete: (id: string, workspaceId: string) => void;
}) {
return (
@@ -100,6 +109,24 @@ function WatchActions({
</TooltipTrigger>
<TooltipContent>Check now</TooltipContent>
</Tooltip>
<Tooltip>
<TooltipTrigger asChild>
<Button
variant="ghost"
size="sm"
className="h-7 w-7 p-0 cursor-pointer"
data-testid="watch-reset-button"
aria-label="Reset watch"
onClick={(e) => {
e.stopPropagation();
onReset(watch.id, watch.workspaceId);
}}
>
<IconRestore className="h-3.5 w-3.5" />
</Button>
</TooltipTrigger>
<TooltipContent>Reset</TooltipContent>
</Tooltip>
<Tooltip>
<TooltipTrigger asChild>
<Button
@@ -126,6 +153,7 @@ export function SentryIssueWatchTable({
onEdit,
onDelete,
onTrigger,
onReset,
onToggleEnabled,
}: SentryIssueWatchTableProps) {
const workspaces = useAppStore((s) => s.workspaces.items);
@@ -181,6 +209,7 @@ export function SentryIssueWatchTable({
watch={watch}
onToggleEnabled={onToggleEnabled}
onTrigger={onTrigger}
onReset={onReset}
onDelete={onDelete}
/>
</TableCell>