From d7cb2385424cea0351f32168d53fa09a6705201a Mon Sep 17 00:00:00 2001 From: Jules BOURDAIS <58701261+judebourlay@users.noreply.github.com> Date: Fri, 5 Jan 2024 09:56:22 +0100 Subject: [PATCH] fix(vue3): remove console logging (#19) --- .../src/components/Simput/script.js | 16 ++------- .../src/components/SimputItem/script.js | 33 ------------------- vue3-components/src/core/utils.js | 5 ++- 3 files changed, 4 insertions(+), 50 deletions(-) diff --git a/vue3-components/src/components/Simput/script.js b/vue3-components/src/components/Simput/script.js index f0bbd9e..41ad31b 100644 --- a/vue3-components/src/components/Simput/script.js +++ b/vue3-components/src/components/Simput/script.js @@ -24,11 +24,6 @@ export default { setup(props, { emit }) { const trame = inject("trame"); - console.log({ - trame, - props, - }); - const manager = ref(null); const managerId = ref(null); @@ -54,25 +49,18 @@ export default { manager.value.disconnectBus(simputChannel); } - console.log("Simput - updateManager"); - managerId.value = trame.state.get(`${props.namespace}Id`); - console.log({ - managerId: managerId.value, - }); + manager.value = getSimputManager( managerId.value, props.namespace, client.value ); - console.log({ - manager: manager.value, - }); + manager.value.connectBus(simputChannel); }; onMounted(() => { - console.log("Simput - onMounted"); updateManager(); }); diff --git a/vue3-components/src/components/SimputItem/script.js b/vue3-components/src/components/SimputItem/script.js index 456a675..7786252 100644 --- a/vue3-components/src/components/SimputItem/script.js +++ b/vue3-components/src/components/SimputItem/script.js @@ -36,28 +36,14 @@ export default { const update = function update() { if (proxyId.value && getSimput()) { - console.log("SimputItem - update"); - console.log({ - proxyId: proxyId.value, - }); data.value = getSimput().getData(proxyId.value); domains.value = getSimput().getDomains(proxyId.value); - console.log({ - data: data.value, - domains: domains.value, - computedType: computedType.value, - }); - if (computedType.value) { ui.value = getSimput().getUI(computedType.value); - console.log({ - ui: ui.value, - }); } simputChannel.pushQuery(); } else { - console.log("SimputItem - update: reset data and ui") data.value = null; ui.value = null; } @@ -70,13 +56,8 @@ export default { const onChange = function onChange({ id, type }) { /* eslint-disable eqeqeq */ if (id && proxyId.value == id) { - console.log("SimputItem - onChange"); data.value = getSimput().getData(id); domains.value = getSimput().getDomains(id); - console.log({ - data: data.value, - domains: domains.value, - }); } if (type && computedType.value === type) { ui.value = getSimput().getUI(computedType.value); @@ -84,31 +65,18 @@ export default { if (!type && computedType.value && !ui.value) { ui.value = getSimput().getUI(computedType.value); } - console.log({ - ui: ui.value, - }); }; const onReload = function onReload(name) { - console.log("SimputItem - onReload"); if (name === "data") { data.value = getSimput().getData(proxyId.value, true); - console.log({ - data: data.value, - }); } if (name === "ui") { ui.value = getSimput().getUI(proxyId.value, true); - console.log({ - ui: ui.value, - }); } if (name === "domain") { getSimput().resetDomains(); domains.value = getSimput().getDomains(proxyId.value, true); - console.log({ - domains: domains.value, - }); } }; @@ -116,7 +84,6 @@ export default { simputChannel.$on("connect", onConnect); simputChannel.$on("change", onChange); simputChannel.$on("reload", onReload); - console.log("SimputItem - onMounted"); update(); }); diff --git a/vue3-components/src/core/utils.js b/vue3-components/src/core/utils.js index 4a780c1..c1ded76 100644 --- a/vue3-components/src/core/utils.js +++ b/vue3-components/src/core/utils.js @@ -299,13 +299,12 @@ export class DataManager { if ((!data || forceFetch) && !this.pendingData[id]) { // console.log(' > fetch data', id, forceFetch); this.pendingData[id] = true; - console.log("utils.js - triggering SimputFetch"); + this.wsClient .getRemote() .Trame.trigger(`${this.namespace}Fetch`, [], { id }); } - console.log("utils.js - return"); - console.log({ data }); + return data; }