diff --git a/src/ui/src/components/shared/SharedJsonViewer/SharedJsonViewer.vue b/src/ui/src/components/shared/SharedJsonViewer/SharedJsonViewer.vue index 8c3587018..8913c00c5 100644 --- a/src/ui/src/components/shared/SharedJsonViewer/SharedJsonViewer.vue +++ b/src/ui/src/components/shared/SharedJsonViewer/SharedJsonViewer.vue @@ -58,7 +58,14 @@ import SharedControlBar from "../SharedControlBar.vue"; const props = defineProps({ data: { - type: Object as PropType, + type: [ + String, + Number, + Boolean, + Object, + Array, + null, + ] as PropType, required: true, }, path: { @@ -77,5 +84,8 @@ const isRoot = computed(() => props.path.length === 0); const isRootOpen = computed( () => props.initialDepth === -1 || props.initialDepth > 0, ); -const dataAsString = computed(() => JSON.stringify(props.data ?? "{}")); +const dataAsString = computed(() => { + if (props.data === undefined) return JSON.stringify(null); + return JSON.stringify(props.data); +}); diff --git a/src/ui/src/components/shared/SharedJsonViewer/SharedJsonViewerChildrenCounter.vue b/src/ui/src/components/shared/SharedJsonViewer/SharedJsonViewerChildrenCounter.vue index 8f9f9cc7a..5e81252c9 100644 --- a/src/ui/src/components/shared/SharedJsonViewer/SharedJsonViewerChildrenCounter.vue +++ b/src/ui/src/components/shared/SharedJsonViewer/SharedJsonViewerChildrenCounter.vue @@ -13,7 +13,14 @@ import type { JsonData } from "./SharedJsonViewer.vue"; const props = defineProps({ data: { - type: Object as PropType, + type: [ + String, + Number, + Boolean, + Object, + Array, + null, + ] as PropType, required: true, }, }); diff --git a/src/ui/src/components/shared/SharedJsonViewer/SharedJsonViewerCollapsible.vue b/src/ui/src/components/shared/SharedJsonViewer/SharedJsonViewerCollapsible.vue index d2235345c..9c837d910 100644 --- a/src/ui/src/components/shared/SharedJsonViewer/SharedJsonViewerCollapsible.vue +++ b/src/ui/src/components/shared/SharedJsonViewer/SharedJsonViewerCollapsible.vue @@ -29,7 +29,14 @@ defineProps({ disabled: { type: Boolean, required: false }, title: { type: String, required: false, default: undefined }, data: { - type: [Object, Array] as PropType, + type: [ + String, + Number, + Boolean, + Object, + Array, + null, + ] as PropType, required: false, default: undefined, }, diff --git a/src/ui/src/components/shared/SharedJsonViewer/SharedJsonViewerObject.vue b/src/ui/src/components/shared/SharedJsonViewer/SharedJsonViewerObject.vue index 063655299..515b226b4 100644 --- a/src/ui/src/components/shared/SharedJsonViewer/SharedJsonViewerObject.vue +++ b/src/ui/src/components/shared/SharedJsonViewer/SharedJsonViewerObject.vue @@ -47,7 +47,7 @@ import SharedJsonViewerValue from "./SharedJsonViewerValue.vue"; const props = defineProps({ data: { - type: Object as PropType<{ [x: string]: JsonData } | JsonData>, + type: [Object, Array] as PropType, required: true, }, path: { diff --git a/src/ui/src/components/shared/SharedJsonViewer/SharedJsonViewerValue.vue b/src/ui/src/components/shared/SharedJsonViewer/SharedJsonViewerValue.vue index 5e726bc08..926e8ca1c 100644 --- a/src/ui/src/components/shared/SharedJsonViewer/SharedJsonViewerValue.vue +++ b/src/ui/src/components/shared/SharedJsonViewer/SharedJsonViewerValue.vue @@ -4,11 +4,18 @@