fix(editor): Disable data pinning on multiple output node types (#5111)
* fix: Disable data pinning on Compare Datasets node * feat: update pin data mixin to automatically determine if multiple outputs node * fix: remove unused node type constant
This commit is contained in:
@@ -141,12 +141,7 @@ export const NON_ACTIVATABLE_TRIGGER_NODE_TYPES = [
|
||||
EXECUTE_WORKFLOW_TRIGGER_NODE_TYPE,
|
||||
];
|
||||
|
||||
export const MULTIPLE_OUTPUT_NODE_TYPES = [IF_NODE_TYPE, SWITCH_NODE_TYPE];
|
||||
|
||||
export const PIN_DATA_NODE_TYPES_DENYLIST = [
|
||||
...MULTIPLE_OUTPUT_NODE_TYPES,
|
||||
SPLIT_IN_BATCHES_NODE_TYPE,
|
||||
];
|
||||
export const PIN_DATA_NODE_TYPES_DENYLIST = [SPLIT_IN_BATCHES_NODE_TYPE];
|
||||
|
||||
// Node creator
|
||||
export const CORE_NODES_CATEGORY = 'Core Nodes';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Vue from 'vue';
|
||||
import { INodeUi } from '@/Interface';
|
||||
import { IPinData } from 'n8n-workflow';
|
||||
import { INodeTypeDescription, IPinData } from 'n8n-workflow';
|
||||
import { stringSizeInBytes } from '@/utils';
|
||||
import { MAX_WORKFLOW_PINNED_DATA_SIZE, PIN_DATA_NODE_TYPES_DENYLIST } from '@/constants';
|
||||
import { mapStores } from 'pinia';
|
||||
@@ -8,6 +8,7 @@ import { useWorkflowsStore } from '@/stores/workflows';
|
||||
|
||||
export interface IPinDataContext {
|
||||
node: INodeUi;
|
||||
nodeType: INodeTypeDescription;
|
||||
$showError(error: Error, title: string): void;
|
||||
}
|
||||
|
||||
@@ -21,7 +22,14 @@ export const pinData = (Vue as Vue.VueConstructor<Vue & IPinDataContext>).extend
|
||||
return !!this.node && typeof this.pinData !== 'undefined';
|
||||
},
|
||||
isPinDataNodeType(): boolean {
|
||||
return !!this.node && !PIN_DATA_NODE_TYPES_DENYLIST.includes(this.node.type);
|
||||
return (
|
||||
!!this.node &&
|
||||
!this.isMultipleOutputsNodeType &&
|
||||
!PIN_DATA_NODE_TYPES_DENYLIST.includes(this.node.type)
|
||||
);
|
||||
},
|
||||
isMultipleOutputsNodeType(): boolean {
|
||||
return this.nodeType?.outputs.length > 1;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
||||
Reference in New Issue
Block a user