summaryrefslogtreecommitdiffstats
path: root/webapp/components/admin_console/admin_sidebar.jsx
diff options
context:
space:
mode:
authorSaturnino Abril <saturnino.abril@gmail.com>2017-02-01 08:57:16 +0900
committerenahum <nahumhbl@gmail.com>2017-01-31 20:57:16 -0300
commit9ba968ce3354b1a8ab307ecc4cc785bdee16f914 (patch)
tree1180a7913c326ed66191555d5a21d0643e932b8a /webapp/components/admin_console/admin_sidebar.jsx
parent9369cab56c82629d505d44d572f273df1d396972 (diff)
downloadchat-9ba968ce3354b1a8ab307ecc4cc785bdee16f914.tar.gz
chat-9ba968ce3354b1a8ab307ecc4cc785bdee16f914.tar.bz2
chat-9ba968ce3354b1a8ab307ecc4cc785bdee16f914.zip
Use consistent Display Name sorting code throughout the webapp #5159 (#5213)
* Use consistent Display Name sorting code throughout the webapp #5159 * fixed broken sorting of teams and channels
Diffstat (limited to 'webapp/components/admin_console/admin_sidebar.jsx')
-rw-r--r--webapp/components/admin_console/admin_sidebar.jsx17
1 files changed, 2 insertions, 15 deletions
diff --git a/webapp/components/admin_console/admin_sidebar.jsx b/webapp/components/admin_console/admin_sidebar.jsx
index e8303ea0c..952fe9ff4 100644
--- a/webapp/components/admin_console/admin_sidebar.jsx
+++ b/webapp/components/admin_console/admin_sidebar.jsx
@@ -114,19 +114,6 @@ export default class AdminSidebar extends React.Component {
document.title = Utils.localizeMessage('sidebar_right_menu.console', 'System Console') + ' - ' + currentSiteName;
}
- sortTeams(a, b) {
- const teamA = a.display_name.toLowerCase();
- const teamB = b.display_name.toLowerCase();
-
- if (teamA < teamB) {
- return -1;
- }
- if (teamA > teamB) {
- return 1;
- }
- return 0;
- }
-
renderAddTeamButton() {
const addTeamTooltip = (
<Tooltip id='add-team-tooltip'>
@@ -159,7 +146,7 @@ export default class AdminSidebar extends React.Component {
renderTeams() {
const teams = [];
- const teamsArray = [];
+ let teamsArray = [];
Reflect.ownKeys(this.state.selectedTeams).forEach((key) => {
if (this.state.teams[key]) {
@@ -167,7 +154,7 @@ export default class AdminSidebar extends React.Component {
}
});
- teamsArray.sort(this.sortTeams);
+ teamsArray = teamsArray.sort(Utils.sortTeamsByDisplayName);
for (let i = 0; i < teamsArray.length; i++) {
const team = teamsArray[i];