From eeb43fa5e7c1c8ef45bc6528f697f8ed068dd9d9 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Tue, 19 Nov 2024 11:59:43 -0500 Subject: [PATCH] Drop console errors and warnings around NodeOutput.test.ts. --- .../components/Workflow/Editor/NodeOutput.test.ts | 3 +++ client/src/composables/useMagicKeys.js | 15 +++++++++++++++ client/src/stores/workflowEditorToolbarStore.ts | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 client/src/composables/useMagicKeys.js diff --git a/client/src/components/Workflow/Editor/NodeOutput.test.ts b/client/src/components/Workflow/Editor/NodeOutput.test.ts index 414ebd7e42f3..db7f46221b85 100644 --- a/client/src/components/Workflow/Editor/NodeOutput.test.ts +++ b/client/src/components/Workflow/Editor/NodeOutput.test.ts @@ -37,6 +37,9 @@ function propsForStep(step: Step) { scroll: { x: ref(0), y: ref(0) }, scale: 1, datatypesMapper: testDatatypesMapper, + parentNode: null, + readonly: true, + blank: false, }; } diff --git a/client/src/composables/useMagicKeys.js b/client/src/composables/useMagicKeys.js new file mode 100644 index 000000000000..b3b5cf6137a4 --- /dev/null +++ b/client/src/composables/useMagicKeys.js @@ -0,0 +1,15 @@ +import Vue from "vue"; +import { useMagicKeys as wrappedUseMagicKeys } from "@vueuse/core"; + +export function useMagicKeys() { + // a version of useMagicKeys from vueuse/core that doesn't console.error the + // the message [Vue warn]: Vue 2 does not support reactive collection types such as Map or Set. + // in all our tests. This can be dropped after the migration to Vue3. + const oldSlientConfig = Vue.config.silent; + try { + Vue.config.silent = true; + return wrappedUseMagicKeys(); + } finally { + Vue.config.silent = oldSlientConfig; + } +} diff --git a/client/src/stores/workflowEditorToolbarStore.ts b/client/src/stores/workflowEditorToolbarStore.ts index 3bb36ea75cda..901a823943b8 100644 --- a/client/src/stores/workflowEditorToolbarStore.ts +++ b/client/src/stores/workflowEditorToolbarStore.ts @@ -1,7 +1,7 @@ -import { useMagicKeys } from "@vueuse/core"; import { computed, onScopeDispose, reactive, ref, watch } from "vue"; import { type Rectangle } from "@/components/Workflow/Editor/modules/geometry"; +import { useMagicKeys } from "@/composables/useMagicKeys"; import { useUserLocalStorage } from "@/composables/userLocalStorage"; import { defineScopedStore } from "./scopedStore";