diff --git a/frontend/src/modules/events/composables/useEventExample.ts b/frontend/src/modules/events/composables/useEventExample.ts
deleted file mode 100644
index 350d354..0000000
--- a/frontend/src/modules/events/composables/useEventExample.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import type { Field, JsonValue } from '@/modules/fields/types'
-import { FieldType } from '@/modules/fields/types'
-import { computed } from 'vue'
-
-const fallbackExamples: Record
= {
- [FieldType.STRING]: '',
- [FieldType.INTEGER]: 0,
- [FieldType.NUMBER]: 0.0,
- [FieldType.BOOLEAN]: true,
- [FieldType.ARRAY]: [],
- [FieldType.OBJECT]: {},
-}
-
-export function useEventExample(fields: Field[]) {
- return computed(() => {
- const example: Record = {}
- for (const field of fields) {
- example[field.name] = field.example ?? fallbackExamples[field.field_type]
- }
- return example
- })
-}
diff --git a/frontend/src/modules/fields/components/FieldDetailsCard.vue b/frontend/src/modules/fields/components/FieldDetailsCard.vue
index d2d5166..d92f824 100644
--- a/frontend/src/modules/fields/components/FieldDetailsCard.vue
+++ b/frontend/src/modules/fields/components/FieldDetailsCard.vue
@@ -2,7 +2,6 @@
import type { Field } from '@/modules/fields/types'
import { Button } from '@/shared/ui/button'
import { Icon } from '@iconify/vue'
-import JsonPreview from '@/shared/components/JsonPreview.vue'
import DetailsCardLayout from '@/shared/components/layout/DetailsCardLayout.vue'
import DetailsCardAttribute from '@/shared/components/layout/DetailsCardAttribute.vue'
import FieldTypeBadge from '@/modules/fields/components/FieldTypeBadge.vue'
@@ -34,12 +33,6 @@ const emit = defineEmits(['edit-clicked', 'delete-clicked'])
-
-
-
-
-
-
{{ `${field.event_count || 0} events` }}
diff --git a/frontend/src/modules/fields/types.ts b/frontend/src/modules/fields/types.ts
index b66951c..41a738e 100644
--- a/frontend/src/modules/fields/types.ts
+++ b/frontend/src/modules/fields/types.ts
@@ -7,29 +7,11 @@ export enum FieldType {
OBJECT = 'object',
}
-type FieldExampleMap = {
- [FieldType.STRING]: string
- [FieldType.INTEGER]: number
- [FieldType.NUMBER]: number
- [FieldType.BOOLEAN]: boolean
- [FieldType.ARRAY]: unknown[]
- [FieldType.OBJECT]: Record
-}
-
-export type JsonValue =
- | string
- | number
- | boolean
- | null
- | JsonValue[]
- | { [key: string]: JsonValue }
-
export type Field = {
id: number
name: string
description: string | null
field_type: FieldType
- example: JsonValue
created_at: string
updated_at: string
event_count?: number
@@ -39,12 +21,10 @@ export type FieldFormData = {
name: string
description?: string | null
field_type: FieldType
- example?: FieldExampleMap[FieldType]
}
export type FieldValidationErrors = {
name?: string[]
description?: string[]
field_type?: string[]
- example?: string[]
}
diff --git a/frontend/src/modules/fields/validation/fieldSchema.ts b/frontend/src/modules/fields/validation/fieldSchema.ts
index 17656cb..be231fe 100644
--- a/frontend/src/modules/fields/validation/fieldSchema.ts
+++ b/frontend/src/modules/fields/validation/fieldSchema.ts
@@ -11,19 +11,6 @@ export const fieldSchema = z.object({
.nullable(),
field_type: z.nativeEnum(FieldType),
-
- example: z
- .custom(val => {
- if (val === null || val === undefined) return true
- try {
- if (typeof val === 'string') JSON.parse(val)
- return true
- } catch {
- return false
- }
- }, 'Example must be valid JSON')
- .optional()
- .nullable(),
})
// Inferred TypeScript type from schema
diff --git a/frontend/src/modules/switchboard/types.ts b/frontend/src/modules/switchboard/types.ts
index cbc8fc1..4ac99c5 100644
--- a/frontend/src/modules/switchboard/types.ts
+++ b/frontend/src/modules/switchboard/types.ts
@@ -9,8 +9,7 @@ export interface ImportBundle {
fields: {
name: string
description?: string | null
- field_type: string // could use enum if available
- example?: unknown
+ field_type: string
}[]
events: {
diff --git a/frontend/src/shared/components/JsonPreview.vue b/frontend/src/shared/components/JsonPreview.vue
deleted file mode 100644
index 92692c0..0000000
--- a/frontend/src/shared/components/JsonPreview.vue
+++ /dev/null
@@ -1,96 +0,0 @@
-
-
-
-
-
-
- {{ truncatedPreview }}
-
-
-
-
- {{ prettyJson }}
-
-
-
-
-