From 3e350527a54358b15968fe0903a50dea7174dbf6 Mon Sep 17 00:00:00 2001
From: Debanshu Kundu <debanshu.kundu@joshtechnologygroup.com>
Date: Wed, 14 Dec 2016 20:02:38 +0530
Subject: PLT-4907 Sorting team name for user's teams and other teams in
 ascending order of display name on team list page. (#4757)

---
 webapp/components/select_team/select_team.jsx | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

(limited to 'webapp/components/select_team/select_team.jsx')

diff --git a/webapp/components/select_team/select_team.jsx b/webapp/components/select_team/select_team.jsx
index 283299b37..133e9d581 100644
--- a/webapp/components/select_team/select_team.jsx
+++ b/webapp/components/select_team/select_team.jsx
@@ -56,6 +56,10 @@ export default class SelectTeam extends React.Component {
         this.setState({loadingTeamId: team.id});
     }
 
+    teamContentsCompare(teamItemA, teamItemB) {
+        return teamItemA.props.team.display_name.localeCompare(teamItemB.props.team.display_name);
+    }
+
     render() {
         let content = null;
         let teamContents = [];
@@ -133,7 +137,7 @@ export default class SelectTeam extends React.Component {
                         />
                     </h4>
                     <div className='signup-team-all'>
-                        {teamContents}
+                        {teamContents.sort(this.teamContentsCompare)}
                     </div>
                 </div>
             );
@@ -150,7 +154,7 @@ export default class SelectTeam extends React.Component {
                         />
                     </h4>
                     <div className='signup-team-all'>
-                        {openTeamContents}
+                        {openTeamContents.sort(this.teamContentsCompare)}
                     </div>
                 </div>
             );
-- 
cgit v1.2.3-1-g7c22

