mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
feat(editor): Schema preview UI updates (#13578)
This commit is contained in:
@@ -261,7 +261,14 @@ export type RenderHeader = {
|
||||
preview?: boolean;
|
||||
};
|
||||
|
||||
type Renders = RenderHeader | RenderItem;
|
||||
export type RenderIcon = {
|
||||
id: string;
|
||||
type: 'icon';
|
||||
icon: string;
|
||||
tooltip: string;
|
||||
};
|
||||
|
||||
type Renders = RenderHeader | RenderItem | RenderIcon;
|
||||
|
||||
const icons = {
|
||||
object: 'cube',
|
||||
@@ -285,13 +292,11 @@ const emptyItem = (): RenderItem => ({
|
||||
type: 'item',
|
||||
});
|
||||
|
||||
const dummyItem = (): RenderItem => ({
|
||||
id: `dummy-${window.crypto.randomUUID()}`,
|
||||
icon: '',
|
||||
level: 1,
|
||||
title: '...',
|
||||
type: 'item',
|
||||
preview: true,
|
||||
const moreFieldsItem = (): RenderIcon => ({
|
||||
id: `moreFields-${window.crypto.randomUUID()}`,
|
||||
type: 'icon',
|
||||
icon: 'ellipsis-h',
|
||||
tooltip: useI18n().baseText('dataMapping.schemaView.previewExtraFields'),
|
||||
});
|
||||
|
||||
const isDataEmpty = (schema: Schema) => {
|
||||
@@ -445,7 +450,7 @@ export const useFlattenSchema = () => {
|
||||
acc.push(...flattenSchema(item));
|
||||
|
||||
if (item.preview) {
|
||||
acc.push(dummyItem());
|
||||
acc.push(moreFieldsItem());
|
||||
}
|
||||
|
||||
return acc;
|
||||
|
||||
Reference in New Issue
Block a user