feat(editor): Migrate debounce mixin to useDebounce composable (no-changelog) (#8244)

This commit is contained in:
Alex Grozav
2024-01-08 14:00:49 +02:00
committed by GitHub
parent 8affdf680d
commit 8c8caac4e8
19 changed files with 136 additions and 106 deletions

View File

@@ -508,7 +508,6 @@ import { isResourceLocatorValue } from '@/utils/typeGuards';
import { CUSTOM_API_CALL_KEY, HTML_NODE_TYPE, NODES_USING_CODE_NODE_EDITOR } from '@/constants';
import type { PropType } from 'vue';
import { debounceHelper } from '@/mixins/debounce';
import { useWorkflowsStore } from '@/stores/workflows.store';
import { useNDVStore } from '@/stores/ndv.store';
import { useNodeTypesStore } from '@/stores/nodeTypes.store';
@@ -522,6 +521,7 @@ import { useI18n } from '@/composables/useI18n';
import type { N8nInput } from 'n8n-design-system';
import { isCredentialOnlyNodeType } from '@/utils/credentialOnlyNodes';
import { useExternalHooks } from '@/composables/useExternalHooks';
import { useDebounce } from '@/composables/useDebounce';
type Picker = { $emit: (arg0: string, arg1: Date) => void };
@@ -540,7 +540,7 @@ export default defineComponent({
ResourceLocator,
TextEdit,
},
mixins: [workflowHelpers, debounceHelper],
mixins: [workflowHelpers],
props: {
additionalExpressionData: {
type: Object as PropType<IDataObject>,
@@ -612,11 +612,13 @@ export default defineComponent({
const externalHooks = useExternalHooks();
const i18n = useI18n();
const nodeHelpers = useNodeHelpers();
const { callDebounced } = useDebounce();
return {
externalHooks,
i18n,
nodeHelpers,
callDebounced,
};
},
data() {
@@ -1243,7 +1245,7 @@ export default defineComponent({
this.$emit('textInput', parameterData);
},
valueChangedDebounced(value: NodeParameterValueType | {} | Date) {
void this.callDebounced('valueChanged', { debounceTime: 100 }, value);
void this.callDebounced(this.valueChanged, { debounceTime: 100 }, value);
},
onUpdateTextInput(value: string) {
this.valueChanged(value);