From c9be9375c6918d60d69171dc076ad8d63b0b47c2 Mon Sep 17 00:00:00 2001 From: phroggster Date: Mon, 10 Feb 2025 17:18:25 -0600 Subject: [PATCH 1/2] fix: Empty Conditionals Had Empty Displays - String comparisons in eval() contexts weren't equating "" to null. - So add explicit empty string checks in four places. - This adds back "[Not Set]" to display of conditional effects. --- .../conditional-effect/conditionDisplay.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/gui/app/directives/conditional-effect/conditionDisplay.js b/src/gui/app/directives/conditional-effect/conditionDisplay.js index 18b0362c9..05243cf8b 100644 --- a/src/gui/app/directives/conditional-effect/conditionDisplay.js +++ b/src/gui/app/directives/conditional-effect/conditionDisplay.js @@ -47,7 +47,7 @@ function getRightSideValueDisplay() { return $q(async resolve => { - if ($ctrl.condition == null || $ctrl.condition.rightSideValue == null) { + if ($ctrl.condition == null || $ctrl.condition.rightSideValue == null || $ctrl.condition.rightSideValue === "") { resolve("[Not Set]"); } else { const value = await $injector.invoke($ctrl.conditionType.getRightSideValueDisplay, {}, { @@ -60,7 +60,7 @@ function getLeftSideValueDisplay() { return $q(async resolve => { - if ($ctrl.condition == null || $ctrl.condition.leftSideValue == null) { + if ($ctrl.condition == null || $ctrl.condition.leftSideValue == null || $ctrl.condition.leftSideValue === "") { resolve("[Not Set]"); } else { const value = await $injector.invoke($ctrl.conditionType.getLeftSideValueDisplay, {}, { @@ -73,19 +73,19 @@ $ctrl.$onInit = function() { getRightSideValueDisplay().then(value => { - $ctrl.rightSideValueDisplay = value; + $ctrl.rightSideValueDisplay = value || "[Not Set]"; }); getLeftSideValueDisplay().then(value => { - $ctrl.leftSideValueDisplay = value; + $ctrl.leftSideValueDisplay = value || "[Not Set]"; }); }; $ctrl.$onChanges = function() { - getRightSideValueDisplay().then(value => { - $ctrl.rightSideValueDisplay = value; + getRightSideValueDisplay().then((value) => { + $ctrl.rightSideValueDisplay = value || "[Not Set]"; }); - getLeftSideValueDisplay().then(value => { - $ctrl.leftSideValueDisplay = value; + getLeftSideValueDisplay().then((value) => { + $ctrl.leftSideValueDisplay = value || "[Not Set]"; }); }; } From bc933abab3202c37c028e09aef244f04da0257ca Mon Sep 17 00:00:00 2001 From: phroggster Date: Mon, 10 Feb 2025 17:22:14 -0600 Subject: [PATCH 2/2] chore: ... and fixup some arrow-parens --- .../app/directives/conditional-effect/conditionDisplay.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/app/directives/conditional-effect/conditionDisplay.js b/src/gui/app/directives/conditional-effect/conditionDisplay.js index 05243cf8b..5e3fc4757 100644 --- a/src/gui/app/directives/conditional-effect/conditionDisplay.js +++ b/src/gui/app/directives/conditional-effect/conditionDisplay.js @@ -46,7 +46,7 @@ $ctrl.leftSideValueDisplay = "[Not Set]"; function getRightSideValueDisplay() { - return $q(async resolve => { + return $q(async (resolve) => { if ($ctrl.condition == null || $ctrl.condition.rightSideValue == null || $ctrl.condition.rightSideValue === "") { resolve("[Not Set]"); } else { @@ -59,7 +59,7 @@ } function getLeftSideValueDisplay() { - return $q(async resolve => { + return $q(async (resolve) => { if ($ctrl.condition == null || $ctrl.condition.leftSideValue == null || $ctrl.condition.leftSideValue === "") { resolve("[Not Set]"); } else { @@ -72,10 +72,10 @@ } $ctrl.$onInit = function() { - getRightSideValueDisplay().then(value => { + getRightSideValueDisplay().then((value) => { $ctrl.rightSideValueDisplay = value || "[Not Set]"; }); - getLeftSideValueDisplay().then(value => { + getLeftSideValueDisplay().then((value) => { $ctrl.leftSideValueDisplay = value || "[Not Set]"; }); };