File tree Expand file tree Collapse file tree
Frontend/src/features/team-stats/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,7 +42,13 @@ const TeamStatsSidebar = ({
4242 < div className = "sidebar-section" >
4343 < label className = "sidebar-label" > Team</ label >
4444 < select className = "sidebar-select" value = { selectedTeam } onChange = { ( e ) => setSelectedTeam ( e . target . value ) } >
45- { TEAMS . map ( ( t , index ) => < option key = { `team-${ index } ` } value = { t } > { t } </ option > ) }
45+ { [ ...TEAMS ]
46+ . sort ( ( a , b ) => a . localeCompare ( b ) ) // Sort alphabetically
47+ . map ( ( t , index ) => (
48+ < option key = { `team-${ index } ` } value = { t } >
49+ { t }
50+ </ option >
51+ ) ) }
4652 </ select >
4753 </ div >
4854 ) }
@@ -59,7 +65,20 @@ const TeamStatsSidebar = ({
5965 setSelectedUser ( "all" ) ;
6066 } }
6167 >
62- { TEAMS . map ( ( t , index ) => < option key = { `repo-${ index } ` } value = { t } > { t } </ option > ) }
68+ { [ ...TEAMS ]
69+ . sort ( ( a , b ) => {
70+ // Keeping "All Teams" at the top
71+ if ( a === "All Teams" ) return - 1 ;
72+ if ( b === "All Teams" ) return 1 ;
73+
74+ // Sort the rest alphabetically
75+ return a . localeCompare ( b ) ;
76+ } )
77+ . map ( ( t , index ) => (
78+ < option key = { `repo-${ index } ` } value = { t } >
79+ { t }
80+ </ option >
81+ ) ) }
6382 </ select >
6483 </ div >
6584
You can’t perform that action at this time.
0 commit comments