mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
feat(editor): Improve schema view empty state when node has binary data (#14044)
This commit is contained in:
@@ -233,6 +233,7 @@ export type SchemaNode = {
|
||||
itemsCount: number;
|
||||
schema: Schema;
|
||||
preview: boolean;
|
||||
hasBinary: boolean;
|
||||
};
|
||||
|
||||
export type RenderItem = {
|
||||
@@ -295,10 +296,12 @@ const icons = {
|
||||
|
||||
const getIconBySchemaType = (type: Schema['type']): string => icons[type];
|
||||
|
||||
const emptyItem = (): RenderItem => ({
|
||||
const emptyItem = (
|
||||
message = useI18n().baseText('dataMapping.schemaView.emptyData'),
|
||||
): RenderItem => ({
|
||||
id: `empty-${window.crypto.randomUUID()}`,
|
||||
icon: '',
|
||||
value: useI18n().baseText('dataMapping.schemaView.emptyData'),
|
||||
value: message,
|
||||
type: 'item',
|
||||
});
|
||||
|
||||
@@ -457,7 +460,12 @@ export const useFlattenSchema = () => {
|
||||
}
|
||||
|
||||
if (isDataEmpty(item.schema)) {
|
||||
acc.push(emptyItem());
|
||||
const message = useI18n().baseText(
|
||||
item.hasBinary
|
||||
? 'dataMapping.schemaView.emptyDataWithBinary'
|
||||
: 'dataMapping.schemaView.emptyData',
|
||||
);
|
||||
acc.push(emptyItem(message));
|
||||
return acc;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user