From cba92c10b4a466bdc4ead97c96733687d33db52c Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Mon, 16 Oct 2023 17:02:37 -0300 Subject: [PATCH] fix(typesContext.tsx): prevent wrong overwriting of component template by a group of the same type refactor(reactflowUtils.ts): remove unused code that was causing a syntax error --- src/frontend/package-lock.json | 12 ++++++------ src/frontend/src/contexts/typesContext.tsx | 3 ++- src/frontend/src/utils/reactflowUtils.ts | 1 - 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/frontend/package-lock.json b/src/frontend/package-lock.json index 06b850a7c..d3913e768 100644 --- a/src/frontend/package-lock.json +++ b/src/frontend/package-lock.json @@ -5236,9 +5236,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.554", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.554.tgz", - "integrity": "sha512-Q0umzPJjfBrrj8unkONTgbKQXzXRrH7sVV7D9ea2yBV3Oaogz991yhbpfvo2LMNkJItmruXTEzVpP9cp7vaIiQ==" + "version": "1.4.555", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.555.tgz", + "integrity": "sha512-k1wGC7UXDTyCWcONkEMRG/w6Jvrxi+SVEU+IeqUKUKjv2lGJ1b+jf1mqrloyxVTG5WYYjNQ+F6+Cb1fGrLvNcA==" }, "node_modules/emoji-regex": { "version": "8.0.0", @@ -14749,9 +14749,9 @@ } }, "electron-to-chromium": { - "version": "1.4.554", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.554.tgz", - "integrity": "sha512-Q0umzPJjfBrrj8unkONTgbKQXzXRrH7sVV7D9ea2yBV3Oaogz991yhbpfvo2LMNkJItmruXTEzVpP9cp7vaIiQ==" + "version": "1.4.555", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.555.tgz", + "integrity": "sha512-k1wGC7UXDTyCWcONkEMRG/w6Jvrxi+SVEU+IeqUKUKjv2lGJ1b+jf1mqrloyxVTG5WYYjNQ+F6+Cb1fGrLvNcA==" }, "emoji-regex": { "version": "8.0.0", diff --git a/src/frontend/src/contexts/typesContext.tsx b/src/frontend/src/contexts/typesContext.tsx index 1062559f2..f3c48c31e 100644 --- a/src/frontend/src/contexts/typesContext.tsx +++ b/src/frontend/src/contexts/typesContext.tsx @@ -85,7 +85,8 @@ export function TypesProvider({ children }: { children: ReactNode }) { setTemplates( Object.keys(data).reduce((acc, curr) => { Object.keys(data[curr]).forEach((c: keyof APIKindType) => { - acc[c] = data[curr][c]; + //prevent wrong overwriting of the component template by a group of the same type + if (!data[curr][c].flow) acc[c] = data[curr][c]; }); return acc; }, {}) diff --git a/src/frontend/src/utils/reactflowUtils.ts b/src/frontend/src/utils/reactflowUtils.ts index 20f4e3e50..1bb3ac1a0 100644 --- a/src/frontend/src/utils/reactflowUtils.ts +++ b/src/frontend/src/utils/reactflowUtils.ts @@ -703,7 +703,6 @@ function isHandleConnected( /* this function receives a flow and a handleId and check if there is a connection with this handle */ - scapedJSONStringfy({ type: field.type, fieldName: key, id: nodeId }); if (field.proxy) { if ( edges.some(