1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

Use short circuit operator in favor of ternary conditional

This commit is contained in:
Marliana Lara 2019-11-25 11:17:37 -05:00
parent faa0802d97
commit 1b50895738
No known key found for this signature in database
GPG Key ID: 38C73B40DFA809EE

View File

@ -165,12 +165,12 @@ function InventoryHosts({ i18n, location, match }) {
itemsToDelete={selected} itemsToDelete={selected}
pluralizedItemName={i18n._(t`Hosts`)} pluralizedItemName={i18n._(t`Hosts`)}
/>, />,
canAdd ? ( canAdd && (
<ToolbarAddButton <ToolbarAddButton
key="add" key="add"
linkTo={`/inventories/inventory/${match.params.id}/hosts/add`} linkTo={`/inventories/inventory/${match.params.id}/hosts/add`}
/> />
) : null, ),
]} ]}
/> />
)} )}
@ -186,12 +186,12 @@ function InventoryHosts({ i18n, location, match }) {
/> />
)} )}
emptyStateControls={ emptyStateControls={
canAdd ? ( canAdd && (
<ToolbarAddButton <ToolbarAddButton
key="add" key="add"
linkTo={`/inventories/inventory/${match.params.id}/add`} linkTo={`/inventories/inventory/${match.params.id}/add`}
/> />
) : null )
} }
/> />