fix(editor): Prevent updating node parameter value if it hasn't changed (#9535)

This commit is contained in:
Milorad FIlipović
2024-05-29 16:13:54 +02:00
committed by GitHub
parent f914c97d11
commit 63990f14e3
6 changed files with 178 additions and 74 deletions

View File

@@ -1,6 +1,6 @@
<template>
<div :class="$style.editor">
<div ref="htmlEditor"></div>
<div ref="htmlEditor" data-test-id="html-editor-container"></div>
<slot name="suffix" />
</div>
</template>
@@ -244,7 +244,6 @@ onMounted(() => {
onBeforeUnmount(() => {
htmlEditorEventBus.off('format-html', formatHtml);
emit('update:model-value', readEditorValue());
});
</script>

View File

@@ -1189,6 +1189,13 @@ function valueChanged(value: NodeParameterValueType | {} | Date) {
if (remoteParameterOptionsLoading.value) {
return;
}
// Only update the value if it has changed
const oldValue = node.value?.parameters
? nodeHelpers.getParameterValue(node.value?.parameters, props.parameter.name, '')
: undefined;
if (oldValue !== undefined && oldValue === value) {
return;
}
if (props.parameter.name === 'nodeCredentialType') {
activeCredentialType.value = value as string;

View File

@@ -163,7 +163,6 @@ onMounted(() => {
onBeforeUnmount(() => {
codeNodeEditorEventBus.off('error-line-number', highlightLine);
emit('update:model-value', readEditorValue());
});
function line(lineNumber: number): Line | null {