Telegraf plugins alphabetized in the sidebar

pull/10616/head
Palak Bhojani 2018-12-18 13:21:30 -08:00
parent b033bd2ed8
commit f4a291d1ff
2 changed files with 8 additions and 5 deletions

View File

@ -361,9 +361,9 @@ describe('dataLoader reducer', () => {
const expected = {
...INITIAL_STATE,
telegrafPlugins: [
redisTelegrafPlugin,
diskTelegrafPlugin,
cpuTelegrafPlugin,
diskTelegrafPlugin,
redisTelegrafPlugin,
],
}

View File

@ -78,9 +78,12 @@ export default (state = INITIAL_STATE, action: Action): DataLoadersState => {
case 'ADD_TELEGRAF_PLUGINS':
return {
...state,
telegrafPlugins: _.uniqBy(
[...state.telegrafPlugins, ...action.payload.telegrafPlugins],
'name'
telegrafPlugins: _.sortBy(
_.uniqBy(
[...state.telegrafPlugins, ...action.payload.telegrafPlugins],
'name'
),
['name']
),
}
case 'UPDATE_TELEGRAF_PLUGIN':