Files
archie/ui/src/mappings/MappingsPage.vue
T

43 lines
1.4 KiB
Vue

<script setup lang="ts">
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";
import MappingsTable from "./MappingsTable.vue";
import { actionError, loadMappings, startCreate } from "./state";
/**
* Payload field mapping: bind named fields to JSON paths inside a real captured
* event, preview the resolution before saving, and manage saved mappings. See
* docs/prds/payload-field-mapping.md. Binding a mapping to a workflow happens
* on the Bindings tab.
*
* Composes the list and the two overlays; it holds no state of its own.
*/
onMounted(loadMappings);
</script>
<template>
<div>
<Section>
<template #action>
<div class="flex flex-wrap items-center justify-end gap-2">
<Button as-child size="sm" variant="outline"><RouterLink to="/workflows">Workflows</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" />
<MappingsTable />
</Section>
<MappingEditorDialog />
<MappingDeleteDialog />
</div>
</template>