Skip to content

Commit

Permalink
Fixing an issue where falsey values where masked by the GDS UI
Browse files Browse the repository at this point in the history
  • Loading branch information
LeStarch committed Oct 4, 2023
1 parent 89a28c8 commit f2f7fd1
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,13 @@ Vue.component("channel-render", {
* @returns: display text of item/child item
*/
displayText() {
return this.item?.display_text || this.item?.val || this.val || "";
let possibles = [this.item?.display_text, this.item?.val, this.val];
for (let i = 0; i < possibles.length; i++) {
if (typeof(possibles[i]) !== "undefined" && possibles[i] !== null) {
return possibles[i];
}
}
return "";
}

}
Expand All @@ -120,4 +126,4 @@ let channel_row_data = {
/**
* channel-row replaces fp-row in display template only.
*/
Vue.component("channel-row", channel_row_data);
Vue.component("channel-row", channel_row_data);

0 comments on commit f2f7fd1

Please sign in to comment.