mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-20 21:18:13 +02:00
chore: linting
This commit is contained in:
parent
0a012dbc79
commit
ce952d2ad1
127 changed files with 821 additions and 517 deletions
|
|
@ -89,13 +89,7 @@ export function AutomationDefinitionSection({ definition }: AutomationDefinition
|
|||
);
|
||||
}
|
||||
|
||||
function Field({
|
||||
label,
|
||||
children,
|
||||
}: {
|
||||
label: React.ReactNode;
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
function Field({ label, children }: { label: React.ReactNode; children: React.ReactNode }) {
|
||||
return (
|
||||
<div className="space-y-2">
|
||||
<div className="text-sm font-medium text-muted-foreground">{label}</div>
|
||||
|
|
|
|||
|
|
@ -101,12 +101,21 @@ export function AutomationDetailHeader({
|
|||
disabled={updating}
|
||||
className="relative justify-start rounded-md bg-muted px-3 hover:bg-accent"
|
||||
>
|
||||
<span className={updating ? "inline-flex items-center whitespace-nowrap opacity-0" : "inline-flex items-center whitespace-nowrap"}>
|
||||
<span
|
||||
className={
|
||||
updating
|
||||
? "inline-flex items-center whitespace-nowrap opacity-0"
|
||||
: "inline-flex items-center whitespace-nowrap"
|
||||
}
|
||||
>
|
||||
<PauseIcon className="mr-1 h-4 w-4" />
|
||||
{pauseLabel}
|
||||
</span>
|
||||
{updating && (
|
||||
<Spinner size="xs" className="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2" />
|
||||
<Spinner
|
||||
size="xs"
|
||||
className="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2"
|
||||
/>
|
||||
)}
|
||||
</Button>
|
||||
)}
|
||||
|
|
|
|||
|
|
@ -26,9 +26,7 @@ export function AutomationTriggersSection({
|
|||
<Card className="border-border/60 bg-accent">
|
||||
<CardHeader className="pb-4">
|
||||
<CardTitle className="text-base font-semibold">Triggers</CardTitle>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
When this automation runs
|
||||
</p>
|
||||
<p className="text-xs text-muted-foreground">When this automation runs</p>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
{triggers.length === 0 ? (
|
||||
|
|
|
|||
|
|
@ -77,8 +77,10 @@ function getStepDetails(step: PlanStep): { label: string; value: string }[] {
|
|||
|
||||
if (step.when) details.push({ label: "Runs when", value: step.when });
|
||||
if (step.output_as) details.push({ label: "Saves output as", value: step.output_as });
|
||||
if (step.max_retries != null) details.push({ label: "Max retries", value: String(step.max_retries) });
|
||||
if (step.timeout_seconds != null) details.push({ label: "Timeout", value: `${step.timeout_seconds}s` });
|
||||
if (step.max_retries != null)
|
||||
details.push({ label: "Max retries", value: String(step.max_retries) });
|
||||
if (step.timeout_seconds != null)
|
||||
details.push({ label: "Timeout", value: `${step.timeout_seconds}s` });
|
||||
|
||||
return details;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,13 +23,13 @@ import { Spinner } from "@/components/ui/spinner";
|
|||
import { Switch } from "@/components/ui/switch";
|
||||
import { type Trigger, triggerUpdateRequest } from "@/contracts/types/automation.types";
|
||||
import { describeCron } from "@/lib/automations/describe-cron";
|
||||
import { formatRelativeFutureDate } from "@/lib/format-date";
|
||||
import {
|
||||
DEFAULT_SCHEDULE,
|
||||
fromCron,
|
||||
type ScheduleFrequency,
|
||||
toCron,
|
||||
} from "@/lib/automations/schedule-builder";
|
||||
import { formatRelativeFutureDate } from "@/lib/format-date";
|
||||
import { TimezoneCombobox } from "../../components/builder/timezone-combobox";
|
||||
import { DeleteTriggerDialog } from "./delete-trigger-dialog";
|
||||
|
||||
|
|
@ -277,7 +277,10 @@ export function TriggerCard({ trigger, automationId, canUpdate, canDelete }: Tri
|
|||
</div>
|
||||
) : draft.frequency !== "custom" ? (
|
||||
<div className="space-y-1.5">
|
||||
<label className="text-xs font-medium text-muted-foreground" htmlFor="trigger-time">
|
||||
<label
|
||||
className="text-xs font-medium text-muted-foreground"
|
||||
htmlFor="trigger-time"
|
||||
>
|
||||
Time
|
||||
</label>
|
||||
<Input
|
||||
|
|
@ -296,7 +299,10 @@ export function TriggerCard({ trigger, automationId, canUpdate, canDelete }: Tri
|
|||
</div>
|
||||
) : (
|
||||
<div className="space-y-1.5">
|
||||
<label className="text-xs font-medium text-muted-foreground" htmlFor="trigger-cron">
|
||||
<label
|
||||
className="text-xs font-medium text-muted-foreground"
|
||||
htmlFor="trigger-cron"
|
||||
>
|
||||
Schedule expression
|
||||
</label>
|
||||
<Input
|
||||
|
|
|
|||
|
|
@ -8,19 +8,14 @@ interface AutomationStatusBadgeProps {
|
|||
}
|
||||
|
||||
// Small borderless status pills, matching model-selector badges.
|
||||
const STATUS_STYLES: Record<
|
||||
AutomationStatus,
|
||||
{ label: string; classes: string }
|
||||
> = {
|
||||
const STATUS_STYLES: Record<AutomationStatus, { label: string; classes: string }> = {
|
||||
active: {
|
||||
label: "Active",
|
||||
classes:
|
||||
"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/50 dark:text-emerald-300",
|
||||
classes: "bg-emerald-100 text-emerald-700 dark:bg-emerald-900/50 dark:text-emerald-300",
|
||||
},
|
||||
paused: {
|
||||
label: "Paused",
|
||||
classes:
|
||||
"bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300",
|
||||
classes: "bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300",
|
||||
},
|
||||
archived: {
|
||||
label: "Archived",
|
||||
|
|
|
|||
|
|
@ -65,13 +65,7 @@ export function BuilderSummary({ form }: BuilderSummaryProps) {
|
|||
);
|
||||
}
|
||||
|
||||
function SummaryRow({
|
||||
label,
|
||||
children,
|
||||
}: {
|
||||
label: string;
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
function SummaryRow({ label, children }: { label: string; children: React.ReactNode }) {
|
||||
return (
|
||||
<div className="flex flex-col gap-1 text-xs">
|
||||
<div className="font-medium text-muted-foreground">{label}</div>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,7 @@
|
|||
"use client";
|
||||
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
||||
import { ChevronDown, ChevronRight, ChevronUp, Trash2 } from "lucide-react";
|
||||
import {
|
||||
Accordion,
|
||||
AccordionContent,
|
||||
AccordionItem,
|
||||
} from "@/components/ui/accordion";
|
||||
import { Accordion, AccordionContent, AccordionItem } from "@/components/ui/accordion";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import type { BuilderTask } from "@/lib/automations/builder-schema";
|
||||
|
|
@ -105,7 +101,7 @@ export function TaskItem({
|
|||
<AccordionItem value="advanced" className="border-b-0">
|
||||
<AccordionPrimitive.Header className="flex">
|
||||
<AccordionPrimitive.Trigger className="group flex flex-1 items-center justify-between rounded-md py-1.5 text-left text-xs font-medium text-muted-foreground outline-none transition-all focus-visible:ring-[3px] focus-visible:ring-ring/50">
|
||||
Advanced
|
||||
Advanced
|
||||
<ChevronRight className="pointer-events-none size-4 shrink-0 transition-transform duration-200 group-data-[state=open]:rotate-90" />
|
||||
</AccordionPrimitive.Trigger>
|
||||
</AccordionPrimitive.Header>
|
||||
|
|
|
|||
|
|
@ -51,11 +51,7 @@ export function TaskList({ tasks, errors, searchSpaceId, onChange }: TaskListPro
|
|||
|
||||
{errors.tasks && <p className="text-xs text-destructive">{errors.tasks}</p>}
|
||||
|
||||
<Button
|
||||
type="button"
|
||||
size="sm"
|
||||
onClick={() => onChange([...tasks, emptyTask()])}
|
||||
>
|
||||
<Button type="button" size="sm" onClick={() => onChange([...tasks, emptyTask()])}>
|
||||
<Plus className="h-4 w-4" />
|
||||
Add task
|
||||
</Button>
|
||||
|
|
|
|||
|
|
@ -32,7 +32,9 @@ export function AutomationNewHeader({ searchSpaceId, modeSwitcher }: AutomationN
|
|||
Configure the task, schedule, and execution settings for this automation.
|
||||
</p>
|
||||
</div>
|
||||
{modeSwitcher ? <div className="ml-auto hidden shrink-0 md:block">{modeSwitcher}</div> : null}
|
||||
{modeSwitcher ? (
|
||||
<div className="ml-auto hidden shrink-0 md:block">{modeSwitcher}</div>
|
||||
) : null}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -3,4 +3,3 @@ import { MessagingChannelsContent } from "../components/MessagingChannelsContent
|
|||
export default function Page() {
|
||||
return <MessagingChannelsContent />;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue