Skip to content

Commit

Permalink
fix(xo-web/render-xo-item/PIF): hide parenthesis if no info inside (#…
Browse files Browse the repository at this point in the history
…7022)

See Zammad#17381
  • Loading branch information
pdonias authored and ByScripts committed Sep 14, 2023
1 parent 4ad8e38 commit 8d82236
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions packages/xo-web/src/common/render-xo-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -563,14 +563,20 @@ const xoItemToRender = {
// PIF.
PIF: ({ carrier, device, deviceName, vlan }) => (
<span>
<Icon icon='network' color={carrier ? 'text-success' : 'text-danger'} /> {device} ({deviceName}
{deviceName !== '' && vlan !== -1 && ' - '}
{vlan !== -1 &&
_('keyValue', {
key: _('pifVlanLabel'),
value: vlan,
})}
)
<Icon icon='network' color={carrier ? 'text-success' : 'text-danger'} /> {device}
{(deviceName !== '' || vlan !== -1) && (
<span>
{' '}
({deviceName}
{deviceName !== '' && vlan !== -1 && ' - '}
{vlan !== -1 &&
_('keyValue', {
key: _('pifVlanLabel'),
value: vlan,
})}
)
</span>
)}
</span>
),
// Tags.
Expand Down

0 comments on commit 8d82236

Please sign in to comment.