@@ -18,7 +18,7 @@ import {
18
18
CircularProgress
19
19
} from '@material-ui/core' ;
20
20
21
- import _ from 'lodash' ;
21
+ import _ , { lowerCase } from 'lodash' ;
22
22
import SearchBar from './components/SearchBar' ;
23
23
import { formatPhoneNumber } from "../../../utils/utils" ;
24
24
import Grid from "@material-ui/core/Grid" ;
@@ -104,14 +104,24 @@ class Search360 extends Component {
104
104
} )
105
105
}
106
106
107
+ namesToLowerCase ( participant ) {
108
+ let first_name = participant . first_name
109
+ let last_name = participant . last_name
110
+
111
+ return {
112
+ ...participant ,
113
+ lower_first_name : lowerCase ( first_name ) ,
114
+ lower_last_name : lowerCase ( last_name )
115
+ }
116
+ }
117
+
107
118
renderParticipantsTable ( ) {
108
119
const { classes} = this . props ;
109
120
const tableRowColors = [ classes . tableRowEven , classes . tableRowOdd ]
110
121
111
- let participantListGrouped = _ . groupBy ( this . state . participantList , "matching_id" ) ;
112
- participantListGrouped = _ . reverse ( _ . sortBy ( participantListGrouped , matching_group => {
113
- return _ . size ( matching_group ) ;
114
- } ) ) ;
122
+ let participantListGrouped = _ . map ( this . state . participantList , this . namesToLowerCase )
123
+ participantListGrouped = _ . groupBy ( participantListGrouped , "matching_id" ) ;
124
+ participantListGrouped = _ . orderBy ( participantListGrouped , [ '0.lower_last_name' , '0.lower_first_name' ] ) ;
115
125
116
126
return (
117
127
< Grid container direction = { "column" } justify = { "center" } >
0 commit comments