mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-09 22:24:05 -08:00
fix(editor): Fix configurable node width in new canvas (no-changelog) (#10600)
This commit is contained in:
parent
aa37c32f26
commit
3af3c6bd60
|
@ -56,9 +56,9 @@ const classes = computed(() => {
|
||||||
const styles = computed(() => {
|
const styles = computed(() => {
|
||||||
const stylesObject: Record<string, string | number> = {};
|
const stylesObject: Record<string, string | number> = {};
|
||||||
|
|
||||||
if (renderOptions.value.configurable && requiredNonMainInputs.value.length > 0) {
|
if (renderOptions.value.configurable) {
|
||||||
let spacerCount = 0;
|
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 requiredNonMainInputsCount = requiredNonMainInputs.value.length;
|
||||||
const optionalNonMainInputsCount = nonMainInputs.value.length - requiredNonMainInputsCount;
|
const optionalNonMainInputsCount = nonMainInputs.value.length - requiredNonMainInputsCount;
|
||||||
spacerCount = requiredNonMainInputsCount > 0 && optionalNonMainInputsCount > 0 ? 1 : 0;
|
spacerCount = requiredNonMainInputsCount > 0 && optionalNonMainInputsCount > 0 ? 1 : 0;
|
||||||
|
@ -167,7 +167,7 @@ function openContextMenu(event: MouseEvent) {
|
||||||
&.configurable {
|
&.configurable {
|
||||||
--canvas-node--height: 100px;
|
--canvas-node--height: 100px;
|
||||||
--canvas-node--width: calc(
|
--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)
|
var(--configurable-node--input-width)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ exports[`CanvasNodeDefault > configurable > should render configurable node corr
|
||||||
<div
|
<div
|
||||||
class="node configurable"
|
class="node configurable"
|
||||||
data-test-id="canvas-configurable-node"
|
data-test-id="canvas-configurable-node"
|
||||||
style="--canvas-node--main-input-count: 0; --canvas-node--main-output-count: 0;"
|
style="--configurable-node--input-count: 0; --canvas-node--main-input-count: 0; --canvas-node--main-output-count: 0;"
|
||||||
>
|
>
|
||||||
|
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ exports[`CanvasNodeDefault > configuration > should render configurable configur
|
||||||
<div
|
<div
|
||||||
class="node configurable configuration"
|
class="node configurable configuration"
|
||||||
data-test-id="canvas-configurable-node"
|
data-test-id="canvas-configurable-node"
|
||||||
style="--canvas-node--main-input-count: 0; --canvas-node--main-output-count: 0;"
|
style="--configurable-node--input-count: 0; --canvas-node--main-input-count: 0; --canvas-node--main-output-count: 0;"
|
||||||
>
|
>
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue