Skip to content

Commit

Permalink
Do not render zeros in place of omitted content (#852)
Browse files Browse the repository at this point in the history
By relying on the "truthiness" of Number values to short-circuit boolean
expressions, some rendering logic produced the text "0" instead of
omitting any markup at all.

Replace the expressions whose value could be coerced to booleans with
expressions which directly evaluate to "fallback" values that do not
produce markup (i.e. `false` or an empty array).
  • Loading branch information
jugglinmike authored Dec 5, 2023
1 parent 7783342 commit 703b01f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion client/components/TestQueueRow/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ const TestQueueRow = ({
{isAdmin && renderOpenAsDropdown()}
{isAdmin && renderDeleteMenu()}
{(!isAdmin &&
currentUserTestPlanRun.testResultsLength && (
currentUserTestPlanRun.testResultsLength > 0 && (
<Button
ref={deleteTesterResultsButtonRef}
variant="danger"
Expand Down
3 changes: 1 addition & 2 deletions client/components/common/BasicThemedModal/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ const BasicThemedModal = ({
{closeLabel}
</Button>
)}
{actionButtons.length &&
actionButtons.map(({ action, text }) => (
{actionButtons.map(({ action, text }) => (
<Button
key={text}
variant={
Expand Down

0 comments on commit 703b01f

Please sign in to comment.