mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 06:34:05 -08:00
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:
parent
c3422b1f84
commit
56951e83c0
|
@ -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: {
|
||||
|
|
Loading…
Reference in a new issue