Skip to content

Commit

Permalink
Merge pull request #167 from CWolfs/bugfix/CT-166-fixed-viewable-logi…
Browse files Browse the repository at this point in the history
…c-empty-viewlabel-showing-value

Fixed empty viewLabel showing value instead of nothing
  • Loading branch information
CWolfs authored Jun 5, 2023
2 parents 4d7ac68 + edb715d commit 3135882
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions app/src/components/ViewableLogic/ViewableLogic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,15 @@ function ViewableLogic({ logic }: Props) {

const { value: valueFromArg } = argValue;
let displayValue = valueFromArg;
if (viewLabel) {

if (viewLabel != null) {
if (viewLabel.includes('{value}')) {
if (!displayValue) {
return displayValue;
}
displayValue = viewLabel.replace('{value}', displayValue.toString());
} else {
displayValue = viewLabel;
displayValue = viewLabel.trim();
}
}

Expand All @@ -73,12 +74,14 @@ function ViewableLogic({ logic }: Props) {

if (inputVal) {
displayValue = inputVal.text;
if (inputVal.viewLabel) {

if (inputVal.viewLabel != null) {
const inputValueViewLabel = inputVal.viewLabel;

if (inputValueViewLabel.includes('{value}')) {
displayValue = inputValueViewLabel.replace('{value}', displayValue);
} else {
displayValue = inputVal.viewLabel;
displayValue = inputVal.viewLabel.trim();
}
}
}
Expand Down

0 comments on commit 3135882

Please sign in to comment.