fix(xo-web/render-xo-item/PIF): hide parenthesis if no info inside (#7022)

See Zammad#17381
This commit is contained in:
Pierre Donias 2023-09-08 10:45:28 +02:00 committed by GitHub
parent d992a4cb87
commit 1c9d1049e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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.