fix(editor): fix performance issues when opening node or editing code node with a lot of data (#4388)

* debounce clicks

* debounce correctly

* debounce resize

* if initialized avoid

* set watcher fixes

* add deboucne for setting values

* increase debounce

* reset workspace for memory issues

* address comment

* decrease debounce time

* decrease debounce time

* clean up

* revert back to trailing

* support dbl
This commit is contained in:
Mutasem Aldmour
2022-10-20 15:45:58 +02:00
committed by GitHub
parent e83b9bd983
commit 356a42a187
4 changed files with 45 additions and 8 deletions

View File

@@ -73,7 +73,7 @@
:mode="node.parameters.mode"
:jsCode="node.parameters.jsCode"
:isReadOnly="isReadOnly"
@valueChanged="valueChanged"
@valueChanged="valueChangedDebounced"
/>
<div v-else-if="isEditor === true" class="code-edit clickable ph-no-capture" @click="displayEditDialog()">
@@ -336,12 +336,14 @@ import { CUSTOM_API_CALL_KEY } from '@/constants';
import { mapGetters } from 'vuex';
import { CODE_NODE_TYPE } from '@/constants';
import { PropType } from 'vue';
import { debounceHelper } from './mixins/debounce';
export default mixins(
externalHooks,
nodeHelpers,
showMessage,
workflowHelpers,
debounceHelper,
)
.extend({
name: 'parameter-input',
@@ -922,6 +924,9 @@ export default mixins(
this.$emit('textInput', parameterData);
},
valueChangedDebounced (value: NodeParameterValueType | {} | Date) {
this.callDebounced('valueChanged', { debounceTime: 100 }, value);
},
valueChanged (value: NodeParameterValueType | {} | Date) {
if (this.parameter.name === 'nodeCredentialType') {
this.activeCredentialType = value as string;