Sort handlers dropdown so that enabled ones are at top
parent
1bea21f274
commit
3aeeae1bb8
|
@ -133,9 +133,14 @@ class RuleHandlers extends Component {
|
||||||
} = this.props
|
} = this.props
|
||||||
const {handlersOnThisAlert, selectedHandler} = this.state
|
const {handlersOnThisAlert, selectedHandler} = this.state
|
||||||
|
|
||||||
const handlers = _.map([...DEFAULT_HANDLERS, ...handlersFromConfig], h => {
|
const handlers = _.reverse(
|
||||||
|
_.sortBy(
|
||||||
|
_.map([...DEFAULT_HANDLERS, ...handlersFromConfig], h => {
|
||||||
return {...h, text: h.type}
|
return {...h, text: h.type}
|
||||||
})
|
}),
|
||||||
|
['enabled']
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
const dropdownLabel = handlersOnThisAlert.length
|
const dropdownLabel = handlersOnThisAlert.length
|
||||||
? 'Add another Handler'
|
? 'Add another Handler'
|
||||||
|
|
Loading…
Reference in New Issue