Prevent rendering of empty UL tag
parent
6d7307cdd4
commit
5bec42cc03
|
@ -56,6 +56,7 @@ class RuleMessage extends Component {
|
|||
|
||||
render() {
|
||||
const {rule, actions, enabledAlerts} = this.props
|
||||
const {endpointsOnThisAlert} = this.state
|
||||
const defaultAlertEndpoints = DEFAULT_ALERTS.map(text => {
|
||||
return {text, kind: text, ruleID: rule.id}
|
||||
})
|
||||
|
@ -75,9 +76,12 @@ class RuleMessage extends Component {
|
|||
<div className="rule-section--body">
|
||||
<div className="rule-section--row rule-section--row-first rule-section--border-bottom">
|
||||
<p>Send this Alert to:</p>
|
||||
<ul className="nav nav-tablist nav-tablist-sm nav-tablist-malachite">
|
||||
{this.state.endpointsOnThisAlert
|
||||
.filter(alert => _.get(RULE_ALERT_OPTIONS, alert.kind, false)) // / TODO this looks like a problem
|
||||
{endpointsOnThisAlert.length
|
||||
? <ul className="nav nav-tablist nav-tablist-sm nav-tablist-malachite">
|
||||
{endpointsOnThisAlert
|
||||
.filter(alert =>
|
||||
_.get(RULE_ALERT_OPTIONS, alert.kind, false)
|
||||
) // / TODO this looks like a problem
|
||||
.map(alert =>
|
||||
<li
|
||||
key={uuid.v4()}
|
||||
|
@ -91,6 +95,7 @@ class RuleMessage extends Component {
|
|||
</li>
|
||||
)}
|
||||
</ul>
|
||||
: null}
|
||||
<Dropdown
|
||||
items={alerts}
|
||||
menuClass="dropdown-malachite"
|
||||
|
|
Loading…
Reference in New Issue