mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-12 05:17:28 -08:00
fix(editor): Do not break NDV for version-less nodes (#8714)
This commit is contained in:
parent
246f8cfcc3
commit
8a88d15684
|
@ -517,6 +517,11 @@ describe('NDV', () => {
|
||||||
ndv.getters.nodeVersion().should('have.text', 'Edit Fields (Set) node version 3.3 (Latest)');
|
ndv.getters.nodeVersion().should('have.text', 'Edit Fields (Set) node version 3.3 (Latest)');
|
||||||
ndv.actions.close();
|
ndv.actions.close();
|
||||||
|
|
||||||
|
workflowPage.actions.openNode('Edit Fields (no typeVersion)');
|
||||||
|
ndv.actions.openSettings();
|
||||||
|
ndv.getters.nodeVersion().should('have.text', 'Edit Fields (Set) node version 3.3 (Latest)');
|
||||||
|
ndv.actions.close();
|
||||||
|
|
||||||
workflowPage.actions.openNode('Function');
|
workflowPage.actions.openNode('Function');
|
||||||
ndv.actions.openSettings();
|
ndv.actions.openSettings();
|
||||||
ndv.getters.nodeVersion().should('have.text', 'Function node version 1 (Deprecated)');
|
ndv.getters.nodeVersion().should('have.text', 'Function node version 1 (Deprecated)');
|
||||||
|
|
|
@ -1,49 +1,41 @@
|
||||||
{
|
{
|
||||||
"name": "Node versions",
|
"name": "Node versions",
|
||||||
"nodes": [
|
"nodes": [
|
||||||
{
|
{
|
||||||
"parameters": {},
|
"id": "2acca986-10a6-451e-b20a-86e95b50e627",
|
||||||
"id": "aadaed66-84ed-4cf8-bf21-082e9a65db76",
|
"name": "When clicking \"Test workflow\"",
|
||||||
"name": "When clicking \"Test workflow\"",
|
"type": "n8n-nodes-base.manualTrigger",
|
||||||
"type": "n8n-nodes-base.manualTrigger",
|
"typeVersion": 1,
|
||||||
"typeVersion": 1,
|
"position": [460, 460]
|
||||||
"position": [
|
},
|
||||||
1540,
|
{
|
||||||
780
|
"id": "1ea0a87c-3395-4bd9-84fb-cf8b0f769cc4",
|
||||||
]
|
"name": "Function",
|
||||||
},
|
"type": "n8n-nodes-base.function",
|
||||||
{
|
"typeVersion": 1,
|
||||||
"parameters": {},
|
"position": [960, 460]
|
||||||
"id": "93d73a85-82f0-4380-a032-713d5dc82b32",
|
},
|
||||||
"name": "Function",
|
{
|
||||||
"type": "n8n-nodes-base.function",
|
"id": "30bb9fab-bc89-4309-b42b-0fc586519c76",
|
||||||
"typeVersion": 1,
|
"name": "Edit Fields (old)",
|
||||||
"position": [
|
"type": "n8n-nodes-base.set",
|
||||||
2040,
|
"typeVersion": 2,
|
||||||
780
|
"position": [800, 460]
|
||||||
]
|
},
|
||||||
},
|
{
|
||||||
{
|
"id": "a266b96c-3539-4034-b24c-c86c6d0ca31e",
|
||||||
"id": "50f322d9-c622-4dd0-8d38-e851502739dd",
|
"name": "Edit Fields (no typeVersion)",
|
||||||
"name": "Edit Fields (old)",
|
"type": "n8n-nodes-base.set",
|
||||||
"type": "n8n-nodes-base.set",
|
"position": [1120, 460]
|
||||||
"typeVersion": 2,
|
},
|
||||||
"position": [
|
{
|
||||||
1880,
|
"id": "273f60c9-08e7-457e-b01d-31e16c565171",
|
||||||
780
|
"name": "Edit Fields (latest)",
|
||||||
]
|
"type": "n8n-nodes-base.set",
|
||||||
},
|
"typeVersion": 3.3,
|
||||||
{
|
"position": [640, 460]
|
||||||
"id": "93aaadac-55fe-4618-b1eb-f63e61d1446a",
|
}
|
||||||
"name": "Edit Fields (latest)",
|
|
||||||
"type": "n8n-nodes-base.set",
|
|
||||||
"typeVersion": 3.3,
|
|
||||||
"position": [
|
|
||||||
1720,
|
|
||||||
780
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
],
|
||||||
"pinData": {},
|
"connections": {},
|
||||||
"connections": {}
|
"pinData": {}
|
||||||
}
|
}
|
||||||
|
|
|
@ -157,7 +157,7 @@
|
||||||
$locale.baseText('nodeSettings.nodeVersion', {
|
$locale.baseText('nodeSettings.nodeVersion', {
|
||||||
interpolate: {
|
interpolate: {
|
||||||
node: nodeType?.displayName as string,
|
node: nodeType?.displayName as string,
|
||||||
version: node.typeVersion.toString(),
|
version: (node.typeVersion ?? latestVersion).toString(),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}}
|
}}
|
||||||
|
@ -284,7 +284,7 @@ export default defineComponent({
|
||||||
return Math.max(...this.nodeTypeVersions);
|
return Math.max(...this.nodeTypeVersions);
|
||||||
},
|
},
|
||||||
isLatestNodeVersion(): boolean {
|
isLatestNodeVersion(): boolean {
|
||||||
return this.latestVersion === this.node?.typeVersion;
|
return !this.node?.typeVersion || this.latestVersion === this.node.typeVersion;
|
||||||
},
|
},
|
||||||
nodeVersionTag(): string {
|
nodeVersionTag(): string {
|
||||||
if (!this.nodeType || this.nodeType.hidden) {
|
if (!this.nodeType || this.nodeType.hidden) {
|
||||||
|
|
Loading…
Reference in a new issue