refactor(ui): build settings, org, task, workflow and dashboard pages from the shared components
This commit is contained in:
77 files changed
+505
-744
No files matched your search
@@ -1,13 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { Alert, AlertDescription } from "@/components/ui/alert";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardFooter,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "@/components/ui/card";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
@@ -53,29 +47,16 @@ function onOpenChange(open: boolean) {
|
||||
}}</DialogTitle>
|
||||
</DialogHeader>
|
||||
|
||||
<Card>
|
||||
<CardContent>
|
||||
<MappingForm />
|
||||
</CardContent>
|
||||
</Card>
|
||||
<Section class="mb-0">
|
||||
<MappingForm />
|
||||
</Section>
|
||||
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>Bound fields</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<MappingFieldsTable />
|
||||
</CardContent>
|
||||
<CardFooter>
|
||||
<Button variant="outline" @click="runPreview">Preview</Button>
|
||||
</CardFooter>
|
||||
</Card>
|
||||
<Section title="Bound fields" class="mb-0">
|
||||
<MappingFieldsTable />
|
||||
<Button variant="outline" class="mt-4" @click="runPreview">Preview</Button>
|
||||
</Section>
|
||||
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>Payload</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<Section title="Payload" class="mb-0">
|
||||
<Alert v-if="draft.payloadError" variant="destructive">
|
||||
<AlertDescription>{{ draft.payloadError }}</AlertDescription>
|
||||
</Alert>
|
||||
@@ -85,8 +66,7 @@ function onOpenChange(open: boolean) {
|
||||
@pick="addField"
|
||||
/>
|
||||
<p v-else class="text-sm text-fg-muted">No event selected.</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Section>
|
||||
|
||||
<!-- Beside the buttons, not at the top: the dialog scrolls, and Save is
|
||||
clicked at the bottom, where a refusal must be seen. -->
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { TableCell, TableRow } from "@/components/ui/table";
|
||||
import { eventTypeLabel } from "@/captures/event-types";
|
||||
import { ago } from "@/lib/format";
|
||||
import { Timestamp } from "@/components/ui/timestamp";
|
||||
import { matchCountLabel } from "./match-count";
|
||||
import { eventTypes, type Mapping } from "./state";
|
||||
|
||||
@@ -25,9 +25,7 @@ const emit = defineEmits<{
|
||||
mapping.fields?.length ?? 0
|
||||
}}</TableCell>
|
||||
<TableCell class="tabular-nums">{{ matchCountLabel(mapping) }}</TableCell>
|
||||
<TableCell class="text-fg-muted">{{
|
||||
mapping.match_count ? ago(mapping.last_matched_at) : "–"
|
||||
}}</TableCell>
|
||||
<TableCell class="text-fg-muted"><Timestamp :at="mapping.match_count ? mapping.last_matched_at : null" /></TableCell>
|
||||
<TableCell>
|
||||
<div class="flex justify-end gap-2">
|
||||
<Button variant="outline" size="xs" @click="emit('edit', mapping)"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import {
|
||||
Empty,
|
||||
EmptyDescription,
|
||||
@@ -50,8 +50,7 @@ import {
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
|
||||
<Card v-else>
|
||||
<CardContent>
|
||||
<Section v-else>
|
||||
<Table>
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
@@ -73,6 +72,5 @@ import {
|
||||
/>
|
||||
</TableBody>
|
||||
</Table>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Section>
|
||||
</template>
|
||||
Reference in new issue
Block a user