fix(editor): Drop outgoing connections on order changed event for nodes with dynamic outputs (#9055)
This commit is contained in:
@@ -254,6 +254,7 @@ export default defineComponent({
|
||||
const parameterData = {
|
||||
name: this.getPropertyPath(optionName),
|
||||
value: this.mutableValues[optionName],
|
||||
type: 'optionsOrderChanged',
|
||||
};
|
||||
|
||||
this.$emit('valueChanged', parameterData);
|
||||
@@ -270,6 +271,7 @@ export default defineComponent({
|
||||
const parameterData = {
|
||||
name: this.getPropertyPath(optionName),
|
||||
value: this.mutableValues[optionName],
|
||||
type: 'optionsOrderChanged',
|
||||
};
|
||||
|
||||
this.$emit('valueChanged', parameterData);
|
||||
|
||||
@@ -200,6 +200,7 @@ import {
|
||||
CUSTOM_NODES_DOCS_URL,
|
||||
MAIN_NODE_PANEL_WIDTH,
|
||||
IMPORT_CURL_MODAL_KEY,
|
||||
SHOULD_CLEAR_NODE_OUTPUTS,
|
||||
} from '@/constants';
|
||||
|
||||
import NodeTitle from '@/components/NodeTitle.vue';
|
||||
@@ -223,6 +224,7 @@ import { useCredentialsStore } from '@/stores/credentials.store';
|
||||
import type { EventBus } from 'n8n-design-system';
|
||||
import { useExternalHooks } from '@/composables/useExternalHooks';
|
||||
import { useNodeHelpers } from '@/composables/useNodeHelpers';
|
||||
import { useToast } from '@/composables/useToast';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'NodeSettings',
|
||||
@@ -238,10 +240,12 @@ export default defineComponent({
|
||||
setup() {
|
||||
const nodeHelpers = useNodeHelpers();
|
||||
const externalHooks = useExternalHooks();
|
||||
const { showMessage } = useToast();
|
||||
|
||||
return {
|
||||
externalHooks,
|
||||
nodeHelpers,
|
||||
showMessage,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -853,6 +857,20 @@ export default defineComponent({
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
parameterData.type &&
|
||||
this.workflowsStore.nodeHasOutputConnection(node.name) &&
|
||||
SHOULD_CLEAR_NODE_OUTPUTS[nodeType.name]?.eventTypes.includes(parameterData.type) &&
|
||||
SHOULD_CLEAR_NODE_OUTPUTS[nodeType.name]?.parameterPaths.includes(parameterData.name)
|
||||
) {
|
||||
this.workflowsStore.removeAllNodeConnection(node, { preserveInputConnections: true });
|
||||
this.showMessage({
|
||||
type: 'warning',
|
||||
title: this.$locale.baseText('nodeSettings.outputCleared.title'),
|
||||
message: this.$locale.baseText('nodeSettings.outputCleared.message'),
|
||||
});
|
||||
}
|
||||
|
||||
// Get only the parameters which are different to the defaults
|
||||
let nodeParameters = NodeHelpers.getNodeParameters(
|
||||
nodeType.properties,
|
||||
|
||||
Reference in New Issue
Block a user