fix(ui/events): frame the Map and Bind steps as cards

Both steps drew their actions in a bare row above a bare empty state, so
they looked like nothing else on the page. Each is now one card with its
actions in the header, and the Installed playbooks link is a button
rather than a stray underline beside one.
This commit is contained in:
sam committed 2026-11-26 03:47:57 +11:00
1 parent fa4a078a34
commit e4663c22c0
4 files changed
+89 -96

No files matched your search

+24 -23
View File
@@ -5,6 +5,7 @@ import { onMounted, ref } from "vue";
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
import { Button } from "@/components/ui/button";
import { Section } from "@/components/ui/section";
import { useLiveResource } from "@/stores/session";
import BindingEditor from "./BindingEditor.vue";
import BindingsTable from "./BindingsTable.vue";
@@ -72,31 +73,31 @@ async function handleDelete(binding: Binding): Promise<void> {
<template>
<div>
<!-- The tab owns the actions that belong to it. The page's header names the
page, not this panel, so nothing here repeats "Events". -->
<div class="mb-4 flex flex-wrap items-center justify-end gap-2">
<Button v-if="!failure" @click="startCreate">
<Plus data-icon="inline-start" />
New binding</Button>
</div>
<Section>
<template #action>
<Button v-if="!failure" size="sm" @click="startCreate">
<Plus data-icon="inline-start" />
New binding</Button>
</template>
<!-- A mutation that failed leaves the list on screen accurate, so its
failure sits beside the list rather than replacing it. -->
<Alert v-if="actionFailure" variant="destructive" class="mb-4">
<AlertTitle>{{ errors.bindings.page.actionNotApplied }}</AlertTitle>
<AlertDescription>{{ actionFailure.message }}</AlertDescription>
</Alert>
<!-- A mutation that failed leaves the list on screen accurate, so its
failure sits beside the list rather than replacing it. -->
<Alert v-if="actionFailure" variant="destructive" class="mb-4">
<AlertTitle>{{ errors.bindings.page.actionNotApplied }}</AlertTitle>
<AlertDescription>{{ actionFailure.message }}</AlertDescription>
</Alert>
<BindingsTable
:bindings="bindings"
:event-types="eventTypes"
:failure="failure"
@edit="startEdit"
@approve="approve"
@pause="pause"
@resume="resume"
@delete="deleting = $event"
/>
<BindingsTable
:bindings="bindings"
:event-types="eventTypes"
:failure="failure"
@edit="startEdit"
@approve="approve"
@pause="pause"
@resume="resume"
@delete="deleting = $event"
/>
</Section>
<BindingEditor
v-model:open="editorOpen"
+33 -36
View File
@@ -2,7 +2,6 @@
import { computed } from "vue";
import { errors } from "@/copy/errors";
import { Section } from "@/components/ui/section";
import {
Empty,
EmptyDescription,
@@ -66,39 +65,37 @@ const failureTitle = computed(() =>
</EmptyHeader>
</Empty>
<Section v-else>
<Table>
<TableHeader>
<TableRow>
<TableHead>Name</TableHead>
<TableHead>Event type</TableHead>
<TableHead>Workflow</TableHead>
<TableHead>Status</TableHead>
<TableHead />
</TableRow>
</TableHeader>
<TableBody>
<template v-if="loading">
<TableRow v-for="row in 3" :key="row">
<TableCell v-for="col in 5" :key="col"
><Skeleton class="h-4 w-full"
/></TableCell>
</TableRow>
</template>
<template v-else>
<BindingRow
v-for="binding in rows"
:key="binding.id"
:binding="binding"
:event-types="props.eventTypes"
@edit="emit('edit', $event)"
@approve="emit('approve', $event)"
@pause="emit('pause', $event)"
@resume="emit('resume', $event)"
@delete="emit('delete', $event)"
/>
</template>
</TableBody>
</Table>
</Section>
<Table v-else>
<TableHeader>
<TableRow>
<TableHead>Name</TableHead>
<TableHead>Event type</TableHead>
<TableHead>Workflow</TableHead>
<TableHead>Status</TableHead>
<TableHead />
</TableRow>
</TableHeader>
<TableBody>
<template v-if="loading">
<TableRow v-for="row in 3" :key="row">
<TableCell v-for="col in 5" :key="col"
><Skeleton class="h-4 w-full"
/></TableCell>
</TableRow>
</template>
<template v-else>
<BindingRow
v-for="binding in rows"
:key="binding.id"
:binding="binding"
:event-types="props.eventTypes"
@edit="emit('edit', $event)"
@approve="emit('approve', $event)"
@pause="emit('pause', $event)"
@resume="emit('resume', $event)"
@delete="emit('delete', $event)"
/>
</template>
</TableBody>
</Table>
</template>
+11 -13
View File
@@ -3,6 +3,7 @@ import { Plus } from "@lucide/vue";
import { onMounted } from "vue";
import { Button } from "@/components/ui/button";
import { Section } from "@/components/ui/section";
import MappingActionError from "./MappingActionError.vue";
import MappingDeleteDialog from "./MappingDeleteDialog.vue";
import MappingEditorDialog from "./MappingEditorDialog.vue";
@@ -22,21 +23,18 @@ onMounted(loadMappings);
<template>
<div>
<!-- The tab owns its own action row; the page header names the page. -->
<div class="mb-4 flex flex-wrap items-center justify-end gap-2">
<RouterLink to="/org/playbooks" class="text-label underline">Installed playbooks</RouterLink>
<Button @click="startCreate">
<Plus data-icon="inline-start" />
New mapping</Button>
</div>
<Section>
<template #action>
<div class="flex flex-wrap items-center justify-end gap-2">
<Button as-child size="sm" variant="outline"><RouterLink to="/org/playbooks">Installed playbooks</RouterLink></Button>
<Button size="sm" @click="startCreate"><Plus data-icon="inline-start" />New mapping</Button>
</div>
</template>
<MappingActionError
v-if="actionError"
class="mb-4"
:failure="actionError"
/>
<MappingActionError v-if="actionError" class="mb-4" :failure="actionError" />
<MappingsTable />
<MappingsTable />
</Section>
<MappingEditorDialog />
<MappingDeleteDialog />
+21 -24
View File
@@ -1,6 +1,5 @@
<script setup lang="ts">
import { errors } from "@/copy/errors";
import { Section } from "@/components/ui/section";
import {
Empty,
EmptyDescription,
@@ -51,27 +50,25 @@ import {
</EmptyHeader>
</Empty>
<Section v-else>
<Table>
<TableHeader>
<TableRow>
<TableHead>Name</TableHead>
<TableHead>Event type</TableHead>
<TableHead>Fields</TableHead>
<TableHead>Matched</TableHead>
<TableHead>Last match</TableHead>
<TableHead><span class="sr-only">Actions</span></TableHead>
</TableRow>
</TableHeader>
<TableBody>
<MappingRow
v-for="mapping in mappings"
:key="mapping.id"
:mapping="mapping"
@edit="startEdit"
@delete="requestDelete"
/>
</TableBody>
</Table>
</Section>
<Table v-else>
<TableHeader>
<TableRow>
<TableHead>Name</TableHead>
<TableHead>Event type</TableHead>
<TableHead>Fields</TableHead>
<TableHead>Matched</TableHead>
<TableHead>Last match</TableHead>
<TableHead><span class="sr-only">Actions</span></TableHead>
</TableRow>
</TableHeader>
<TableBody>
<MappingRow
v-for="mapping in mappings"
:key="mapping.id"
:mapping="mapping"
@edit="startEdit"
@delete="requestDelete"
/>
</TableBody>
</Table>
</template>