Merge pull request #6401 from ggazzo/fix-5722

sort admin menu by translated name
pull/5788/head^2
Gabriel Engel 9 years ago committed by GitHub
commit ec084b22cd
  1. 15
      packages/rocketchat-ui-admin/client/adminFlex.coffee

@ -6,6 +6,8 @@ Template.adminFlex.onCreated ->
RocketChat.settings.collectionPrivate = RocketChat.settings.cachedCollectionPrivate.collection
RocketChat.settings.cachedCollectionPrivate.init()
label = ->
return TAPi18n.__(@i18nLabel or @_id)
Template.adminFlex.helpers
groups: ->
@ -27,11 +29,14 @@ Template.adminFlex.helpers
if groups.length > 0
query._id =
$in: groups
return RocketChat.settings.collectionPrivate.find(query, { sort: { sort: 1, i18nLabel: 1 } }).fetch()
label: ->
return TAPi18n.__(@i18nLabel or @_id)
RocketChat.settings.collectionPrivate.find(query).fetch()
.map (el) =>
el.label = label.apply(el)
return el
.sort (a, b) =>
if a.label.toLowerCase() >= b.label.toLowerCase() then 1 else -1
label: label
adminBoxOptions: ->
return RocketChat.AdminBox.getOptions()

Loading…
Cancel
Save