ui: ajustes de layout em automações e checklist
- Reorganiza header da página de automações (título/descrição em cima, filtros embaixo) - Aumenta espaçamento da badge "quando" na tabela - Ajusta largura do input de checklist nos tickets para melhor distribuição 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
e0fcd5bf7c
commit
06388b3688
2 changed files with 43 additions and 39 deletions
|
|
@ -11,7 +11,7 @@ import { useAuth } from "@/lib/auth-client"
|
||||||
import { DEFAULT_TENANT_ID } from "@/lib/constants"
|
import { DEFAULT_TENANT_ID } from "@/lib/constants"
|
||||||
import { Badge } from "@/components/ui/badge"
|
import { Badge } from "@/components/ui/badge"
|
||||||
import { Button } from "@/components/ui/button"
|
import { Button } from "@/components/ui/button"
|
||||||
import { Card, CardAction, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
|
||||||
import { Dialog, DialogTrigger } from "@/components/ui/dialog"
|
import { Dialog, DialogTrigger } from "@/components/ui/dialog"
|
||||||
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@/components/ui/dropdown-menu"
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@/components/ui/dropdown-menu"
|
||||||
import { Input } from "@/components/ui/input"
|
import { Input } from "@/components/ui/input"
|
||||||
|
|
@ -152,21 +152,23 @@ export function AutomationsManager() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card className="border-slate-200">
|
<Card className="border-slate-200">
|
||||||
<CardHeader>
|
<CardHeader className="space-y-4">
|
||||||
<CardTitle className="text-lg font-semibold text-neutral-900">Automações</CardTitle>
|
<div>
|
||||||
<CardDescription className="text-neutral-600">
|
<CardTitle className="text-lg font-semibold text-neutral-900">Automações</CardTitle>
|
||||||
Crie gatilhos para executar ações automáticas.
|
<CardDescription className="mt-1 text-neutral-600">
|
||||||
</CardDescription>
|
Crie gatilhos para executar ações automáticas nos tickets.
|
||||||
<CardAction>
|
</CardDescription>
|
||||||
|
</div>
|
||||||
|
<div className="flex flex-col items-stretch gap-2 sm:flex-row sm:items-center sm:justify-between">
|
||||||
<div className="flex flex-col items-stretch gap-2 sm:flex-row sm:items-center">
|
<div className="flex flex-col items-stretch gap-2 sm:flex-row sm:items-center">
|
||||||
<Input
|
<Input
|
||||||
value={queryText}
|
value={queryText}
|
||||||
onChange={(e) => setQueryText(e.target.value)}
|
onChange={(e) => setQueryText(e.target.value)}
|
||||||
placeholder="Buscar automação..."
|
placeholder="Buscar automação..."
|
||||||
className="h-8 w-full text-sm sm:w-64"
|
className="h-8 w-full text-sm sm:w-56"
|
||||||
/>
|
/>
|
||||||
<Select value={triggerFilter} onValueChange={setTriggerFilter}>
|
<Select value={triggerFilter} onValueChange={setTriggerFilter}>
|
||||||
<SelectTrigger size="sm" className="w-full sm:w-52">
|
<SelectTrigger size="sm" className="w-full sm:w-48">
|
||||||
<span className="truncate">
|
<span className="truncate">
|
||||||
<span className="text-neutral-500">Quando:</span> <SelectValue />
|
<span className="text-neutral-500">Quando:</span> <SelectValue />
|
||||||
</span>
|
</span>
|
||||||
|
|
@ -182,7 +184,7 @@ export function AutomationsManager() {
|
||||||
</SelectContent>
|
</SelectContent>
|
||||||
</Select>
|
</Select>
|
||||||
<Select value={statusFilter} onValueChange={setStatusFilter}>
|
<Select value={statusFilter} onValueChange={setStatusFilter}>
|
||||||
<SelectTrigger size="sm" className="w-full sm:w-44">
|
<SelectTrigger size="sm" className="w-full sm:w-40">
|
||||||
<span className="truncate">
|
<span className="truncate">
|
||||||
<span className="text-neutral-500">Ativação:</span> <SelectValue />
|
<span className="text-neutral-500">Ativação:</span> <SelectValue />
|
||||||
</span>
|
</span>
|
||||||
|
|
@ -193,20 +195,20 @@ export function AutomationsManager() {
|
||||||
<SelectItem value="inactive">Inativas</SelectItem>
|
<SelectItem value="inactive">Inativas</SelectItem>
|
||||||
</SelectContent>
|
</SelectContent>
|
||||||
</Select>
|
</Select>
|
||||||
<Dialog open={editorOpen} onOpenChange={setEditorOpen}>
|
|
||||||
<DialogTrigger asChild>
|
|
||||||
<Button size="sm" onClick={handleNew} className="gap-2">
|
|
||||||
<Plus className="size-4" />
|
|
||||||
Nova automação
|
|
||||||
</Button>
|
|
||||||
</DialogTrigger>
|
|
||||||
<AutomationEditorDialog
|
|
||||||
automation={editing}
|
|
||||||
onClose={() => setEditorOpen(false)}
|
|
||||||
/>
|
|
||||||
</Dialog>
|
|
||||||
</div>
|
</div>
|
||||||
</CardAction>
|
<Dialog open={editorOpen} onOpenChange={setEditorOpen}>
|
||||||
|
<DialogTrigger asChild>
|
||||||
|
<Button size="sm" onClick={handleNew} className="gap-2">
|
||||||
|
<Plus className="size-4" />
|
||||||
|
Nova automação
|
||||||
|
</Button>
|
||||||
|
</DialogTrigger>
|
||||||
|
<AutomationEditorDialog
|
||||||
|
automation={editing}
|
||||||
|
onClose={() => setEditorOpen(false)}
|
||||||
|
/>
|
||||||
|
</Dialog>
|
||||||
|
</div>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent>
|
<CardContent>
|
||||||
<Dialog
|
<Dialog
|
||||||
|
|
@ -240,11 +242,11 @@ export function AutomationsManager() {
|
||||||
<div className="rounded-3xl border border-slate-200 bg-white/90 shadow-sm overflow-hidden">
|
<div className="rounded-3xl border border-slate-200 bg-white/90 shadow-sm overflow-hidden">
|
||||||
<Table className="w-full table-fixed">
|
<Table className="w-full table-fixed">
|
||||||
<colgroup>
|
<colgroup>
|
||||||
<col style={{ width: "22%" }} />
|
<col style={{ width: "20%" }} />
|
||||||
<col style={{ width: "15%" }} />
|
<col style={{ width: "18%" }} />
|
||||||
<col style={{ width: "10%" }} />
|
<col style={{ width: "10%" }} />
|
||||||
<col style={{ width: "7%" }} />
|
<col style={{ width: "7%" }} />
|
||||||
<col style={{ width: "11%" }} />
|
<col style={{ width: "10%" }} />
|
||||||
<col style={{ width: "14%" }} />
|
<col style={{ width: "14%" }} />
|
||||||
<col style={{ width: "14%" }} />
|
<col style={{ width: "14%" }} />
|
||||||
<col style={{ width: "7%" }} />
|
<col style={{ width: "7%" }} />
|
||||||
|
|
@ -285,13 +287,13 @@ export function AutomationsManager() {
|
||||||
<TableCell className="text-center font-semibold text-neutral-900 truncate" title={row.name}>
|
<TableCell className="text-center font-semibold text-neutral-900 truncate" title={row.name}>
|
||||||
{row.name}
|
{row.name}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell className="text-center">
|
<TableCell className="text-center px-2">
|
||||||
<div className="flex items-center justify-center gap-2">
|
<div className="flex items-center justify-center gap-2">
|
||||||
<Badge variant="secondary" className="rounded-full max-w-full truncate">
|
<Badge variant="secondary" className="rounded-full px-3 max-w-full truncate">
|
||||||
{triggerLabel(row.trigger)}
|
{triggerLabel(row.trigger)}
|
||||||
</Badge>
|
</Badge>
|
||||||
{row.timing === "DELAYED" && row.delayMs ? (
|
{row.timing === "DELAYED" && row.delayMs ? (
|
||||||
<Badge variant="outline" className="rounded-full">
|
<Badge variant="outline" className="rounded-full px-2.5">
|
||||||
+{Math.round(row.delayMs / 60000)}m
|
+{Math.round(row.delayMs / 60000)}m
|
||||||
</Badge>
|
</Badge>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
|
||||||
|
|
@ -428,12 +428,12 @@ export function TicketChecklistCard({
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{canEdit && !isResolved ? (
|
{canEdit && !isResolved ? (
|
||||||
<div className="flex flex-col gap-2 rounded-xl border border-slate-200 bg-slate-50 p-3 sm:flex-row sm:items-center">
|
<div className="flex flex-col gap-2 rounded-xl border border-slate-200 bg-slate-50 p-3 sm:flex-row sm:items-center sm:justify-between">
|
||||||
<Input
|
<Input
|
||||||
value={newText}
|
value={newText}
|
||||||
onChange={(e) => setNewText(e.target.value)}
|
onChange={(e) => setNewText(e.target.value)}
|
||||||
placeholder="Adicionar item do checklist..."
|
placeholder="Adicionar item do checklist..."
|
||||||
className="h-8 flex-1 bg-white"
|
className="h-8 w-full bg-white sm:max-w-md"
|
||||||
onKeyDown={(e) => {
|
onKeyDown={(e) => {
|
||||||
if (e.key === "Enter") {
|
if (e.key === "Enter") {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
|
@ -441,14 +441,16 @@ export function TicketChecklistCard({
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<label className="flex h-8 items-center gap-2 text-sm text-neutral-700">
|
<div className="flex items-center gap-4">
|
||||||
<Checkbox checked={newRequired} onCheckedChange={(checked) => setNewRequired(Boolean(checked))} />
|
<label className="flex h-8 items-center gap-2 text-sm text-neutral-700">
|
||||||
Obrigatório
|
<Checkbox checked={newRequired} onCheckedChange={(checked) => setNewRequired(Boolean(checked))} />
|
||||||
</label>
|
Obrigatório
|
||||||
<Button type="button" size="sm" onClick={handleAdd} disabled={adding} className="gap-2">
|
</label>
|
||||||
<Plus className="size-4" />
|
<Button type="button" size="sm" onClick={handleAdd} disabled={adding} className="gap-2">
|
||||||
Adicionar
|
<Plus className="size-4" />
|
||||||
</Button>
|
Adicionar
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
</CardContent>
|
</CardContent>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue