mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(editor): Schema view shows checkbox in case of empty data (#4889)
* fix(editor): Schema view show nothing in case of empty data * fix(editor): Schema view test for empty data
This commit is contained in:
@@ -8,7 +8,7 @@ import { useWebhooksStore } from "@/stores/webhooks";
|
||||
import { runExternalHook } from "@/mixins/externalHooks";
|
||||
import { telemetry } from "@/plugins/telemetry";
|
||||
import { IDataObject } from "n8n-workflow";
|
||||
import { getSchema, mergeDeep } from "@/utils";
|
||||
import { getSchema, isEmpty, mergeDeep } from "@/utils";
|
||||
|
||||
type Props = {
|
||||
data: IDataObject[]
|
||||
@@ -32,6 +32,10 @@ const schema = computed<Schema>(() => {
|
||||
return getSchema(mergeDeep([head, ...tail, head]));
|
||||
});
|
||||
|
||||
const isDataEmpty = computed(() => {
|
||||
return isEmpty(props.data);
|
||||
});
|
||||
|
||||
const onDragStart = (el: HTMLElement) => {
|
||||
if (el && el.dataset?.path) {
|
||||
draggingPath.value = el.dataset.path;
|
||||
@@ -67,7 +71,9 @@ const onDragEnd = (el: HTMLElement) => {
|
||||
|
||||
<template>
|
||||
<div :class="$style.schemaWrapper">
|
||||
<div v-if="isDataEmpty" />
|
||||
<draggable
|
||||
v-else
|
||||
type="mapping"
|
||||
targetDataKey="mappable"
|
||||
:disabled="!mappingEnabled"
|
||||
|
||||
Reference in New Issue
Block a user