Sort handlers dropdown so that enabled ones are at top

pull/10616/head
deniz kusefoglu 2018-01-02 11:21:13 -08:00
parent 1bea21f274
commit 3aeeae1bb8
1 changed files with 8 additions and 3 deletions

View File

@ -133,9 +133,14 @@ class RuleHandlers extends Component {
} = this.props
const {handlersOnThisAlert, selectedHandler} = this.state
const handlers = _.map([...DEFAULT_HANDLERS, ...handlersFromConfig], h => {
return {...h, text: h.type}
})
const handlers = _.reverse(
_.sortBy(
_.map([...DEFAULT_HANDLERS, ...handlersFromConfig], h => {
return {...h, text: h.type}
}),
['enabled']
)
)
const dropdownLabel = handlersOnThisAlert.length
? 'Add another Handler'