mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(editor): Tweak schema view empty state copy and styling (#13819)
This commit is contained in:
@@ -911,7 +911,7 @@ describe('NDV', () => {
|
|||||||
ndv.getters.outputPanel().find('[data-test-id=ndv-search]').click().type('foo');
|
ndv.getters.outputPanel().find('[data-test-id=ndv-search]').click().type('foo');
|
||||||
ndv.getters
|
ndv.getters
|
||||||
.outputPanel()
|
.outputPanel()
|
||||||
.contains('To search field contents rather than just names, use Table or JSON view')
|
.contains('To search field values, switch to table or JSON view.')
|
||||||
.should('exist');
|
.should('exist');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -133,15 +133,16 @@ const isSchemaPreviewEnabled = computed(() =>
|
|||||||
);
|
);
|
||||||
|
|
||||||
const nodeSchema = asyncComputed(async () => {
|
const nodeSchema = asyncComputed(async () => {
|
||||||
|
const search = props.search;
|
||||||
if (props.data.length === 0 && isSchemaPreviewEnabled.value) {
|
if (props.data.length === 0 && isSchemaPreviewEnabled.value) {
|
||||||
const previewSchema = await getSchemaPreview(props.node);
|
const previewSchema = await getSchemaPreview(props.node);
|
||||||
if (previewSchema.ok) {
|
if (previewSchema.ok) {
|
||||||
return filterSchema(getSchemaForJsonSchema(previewSchema.result), props.search);
|
return filterSchema(getSchemaForJsonSchema(previewSchema.result), search);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return filterSchema(getSchemaForExecutionData(props.data), props.search);
|
return filterSchema(getSchemaForExecutionData(props.data), search);
|
||||||
});
|
}, null);
|
||||||
|
|
||||||
async function getSchemaPreview(node: INodeUi | null) {
|
async function getSchemaPreview(node: INodeUi | null) {
|
||||||
if (!node) return createResultError(new Error());
|
if (!node) return createResultError(new Error());
|
||||||
@@ -161,6 +162,7 @@ async function getSchemaPreview(node: INodeUi | null) {
|
|||||||
|
|
||||||
const nodesSchemas = asyncComputed<SchemaNode[]>(async () => {
|
const nodesSchemas = asyncComputed<SchemaNode[]>(async () => {
|
||||||
const result: SchemaNode[] = [];
|
const result: SchemaNode[] = [];
|
||||||
|
const search = props.search;
|
||||||
|
|
||||||
for (const node of props.nodes) {
|
for (const node of props.nodes) {
|
||||||
const fullNode = workflowsStore.getNodeByName(node.name);
|
const fullNode = workflowsStore.getNodeByName(node.name);
|
||||||
@@ -174,7 +176,7 @@ const nodesSchemas = asyncComputed<SchemaNode[]>(async () => {
|
|||||||
node,
|
node,
|
||||||
);
|
);
|
||||||
|
|
||||||
const filteredSchema = filterSchema(schema, props.search);
|
const filteredSchema = filterSchema(schema, search);
|
||||||
|
|
||||||
if (!filteredSchema) continue;
|
if (!filteredSchema) continue;
|
||||||
|
|
||||||
@@ -267,18 +269,14 @@ const onDragEnd = (el: HTMLElement) => {
|
|||||||
<div v-if="noSearchResults" class="no-results">
|
<div v-if="noSearchResults" class="no-results">
|
||||||
<N8nText tag="h3" size="large">{{ i18n.baseText('ndv.search.noNodeMatch.title') }}</N8nText>
|
<N8nText tag="h3" size="large">{{ i18n.baseText('ndv.search.noNodeMatch.title') }}</N8nText>
|
||||||
<N8nText>
|
<N8nText>
|
||||||
<i18n-t keypath="ndv.search.noMatch.description" tag="span">
|
<i18n-t keypath="ndv.search.noMatchSchema.description" tag="span">
|
||||||
<template #link>
|
<template #link>
|
||||||
<a href="#" @click="emit('clear:search')">
|
<a href="#" @click="emit('clear:search')">
|
||||||
{{ i18n.baseText('ndv.search.noMatch.description.link') }}
|
{{ i18n.baseText('ndv.search.noMatchSchema.description.link') }}
|
||||||
</a>
|
</a>
|
||||||
</template>
|
</template>
|
||||||
</i18n-t>
|
</i18n-t>
|
||||||
</N8nText>
|
</N8nText>
|
||||||
|
|
||||||
<N8nText v-if="paneType === 'output'">
|
|
||||||
{{ i18n.baseText('ndv.search.noMatchSchema.description') }}
|
|
||||||
</N8nText>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Draggable
|
<Draggable
|
||||||
@@ -338,6 +336,7 @@ const onDragEnd = (el: HTMLElement) => {
|
|||||||
.full-height {
|
.full-height {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.run-data-schema {
|
.run-data-schema {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
@@ -348,7 +347,13 @@ const onDragEnd = (el: HTMLElement) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.no-results {
|
.no-results {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
height: 100%;
|
||||||
|
gap: var(--spacing-2xs);
|
||||||
padding: var(--spacing-s) var(--spacing-s) var(--spacing-xl) var(--spacing-s);
|
padding: var(--spacing-s) var(--spacing-s) var(--spacing-xl) var(--spacing-s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2209,10 +2209,11 @@
|
|||||||
"ndv.search.placeholder.input": "Search selected node",
|
"ndv.search.placeholder.input": "Search selected node",
|
||||||
"ndv.search.placeholder.input.schema": "Search previous nodes' fields",
|
"ndv.search.placeholder.input.schema": "Search previous nodes' fields",
|
||||||
"ndv.search.noMatch.title": "No matching items",
|
"ndv.search.noMatch.title": "No matching items",
|
||||||
"ndv.search.noNodeMatch.title": "No matching nodes",
|
"ndv.search.noNodeMatch.title": "No matching fields",
|
||||||
"ndv.search.noMatch.description": "Try changing or {link} the filter to see more",
|
"ndv.search.noMatch.description": "Try changing or {link} the filter to see more",
|
||||||
"ndv.search.noMatchSchema.description": "To search field contents rather than just names, use Table or JSON view",
|
|
||||||
"ndv.search.noMatch.description.link": "clearing",
|
"ndv.search.noMatch.description.link": "clearing",
|
||||||
|
"ndv.search.noMatchSchema.description": "To search field values, switch to table or JSON view. {link}",
|
||||||
|
"ndv.search.noMatchSchema.description.link": "Clear filter",
|
||||||
"ndv.search.items": "{matched} of {total} item | {matched} of {total} items",
|
"ndv.search.items": "{matched} of {total} item | {matched} of {total} items",
|
||||||
"updatesPanel.andIs": "and is",
|
"updatesPanel.andIs": "and is",
|
||||||
"updatesPanel.behindTheLatest": "behind the latest and greatest n8n",
|
"updatesPanel.behindTheLatest": "behind the latest and greatest n8n",
|
||||||
|
|||||||
Reference in New Issue
Block a user