From 3af3c6bd605212994c7a1ac63bed5bd4af31e417 Mon Sep 17 00:00:00 2001 From: Alex Grozav Date: Thu, 5 Sep 2024 10:44:07 +0300 Subject: [PATCH] fix(editor): Fix configurable node width in new canvas (no-changelog) (#10600) --- .../elements/nodes/render-types/CanvasNodeDefault.vue | 6 +++--- .../__snapshots__/CanvasNodeDefault.spec.ts.snap | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/editor-ui/src/components/canvas/elements/nodes/render-types/CanvasNodeDefault.vue b/packages/editor-ui/src/components/canvas/elements/nodes/render-types/CanvasNodeDefault.vue index 35ed5bfc08..85d8dedad7 100644 --- a/packages/editor-ui/src/components/canvas/elements/nodes/render-types/CanvasNodeDefault.vue +++ b/packages/editor-ui/src/components/canvas/elements/nodes/render-types/CanvasNodeDefault.vue @@ -56,9 +56,9 @@ const classes = computed(() => { const styles = computed(() => { const stylesObject: Record = {}; - if (renderOptions.value.configurable && requiredNonMainInputs.value.length > 0) { + if (renderOptions.value.configurable) { let spacerCount = 0; - if (NODE_INSERT_SPACER_BETWEEN_INPUT_GROUPS) { + if (NODE_INSERT_SPACER_BETWEEN_INPUT_GROUPS && requiredNonMainInputs.value.length > 0) { const requiredNonMainInputsCount = requiredNonMainInputs.value.length; const optionalNonMainInputsCount = nonMainInputs.value.length - requiredNonMainInputsCount; spacerCount = requiredNonMainInputsCount > 0 && optionalNonMainInputsCount > 0 ? 1 : 0; @@ -167,7 +167,7 @@ function openContextMenu(event: MouseEvent) { &.configurable { --canvas-node--height: 100px; --canvas-node--width: calc( - max(var(--configurable-node--input-count, 5), var(--configurable-node--min-input-count)) * + max(var(--configurable-node--input-count, 4), var(--configurable-node--min-input-count)) * var(--configurable-node--input-width) ); diff --git a/packages/editor-ui/src/components/canvas/elements/nodes/render-types/__snapshots__/CanvasNodeDefault.spec.ts.snap b/packages/editor-ui/src/components/canvas/elements/nodes/render-types/__snapshots__/CanvasNodeDefault.spec.ts.snap index b4874f9669..386a3c5982 100644 --- a/packages/editor-ui/src/components/canvas/elements/nodes/render-types/__snapshots__/CanvasNodeDefault.spec.ts.snap +++ b/packages/editor-ui/src/components/canvas/elements/nodes/render-types/__snapshots__/CanvasNodeDefault.spec.ts.snap @@ -4,7 +4,7 @@ exports[`CanvasNodeDefault > configurable > should render configurable node corr
@@ -33,7 +33,7 @@ exports[`CanvasNodeDefault > configuration > should render configurable configur