@@ -168,21 +168,25 @@ export default function LineTypesCatalogSelectorDialog({
168
168
return [ ] ;
169
169
}
170
170
171
- const uniqueAreas = [ ...new Set ( limitsData . map ( ( limit ) => limit . area ) ) ] ;
172
- return uniqueAreas . map ( ( area ) => ( { id : area , label : area } ) ) ;
171
+ return [ ...new Set ( limitsData . map ( ( limit ) => limit . area ) ) ]
172
+ . toSorted ( ( a , b ) => a . localeCompare ( b , undefined , { numeric : true } ) )
173
+ . map ( ( area ) => ( { id : area , label : area } ) ) ;
173
174
} ;
174
175
175
176
const createOptionsFromTemperatures = ( limitsData ?: CurrentLimitsInfo [ ] ) => {
176
177
if ( ! limitsData ?. length ) {
177
178
return [ ] ;
178
179
}
179
180
180
- const uniqueTemperatures = [ ...new Set ( limitsData . map ( ( limit ) => limit . temperature ) ) ] ;
181
- return uniqueTemperatures . map ( ( temp ) => ( { id : temp , label : temp } ) ) ;
181
+ return [ ...new Set ( limitsData . map ( ( limit ) => limit . temperature ) ) ]
182
+ . toSorted ( ( a , b ) => a . localeCompare ( b , undefined , { numeric : true } ) )
183
+ . map ( ( temp ) => ( { id : temp , label : temp } ) ) ;
182
184
} ;
183
185
184
186
const createOptionsFromUndergroundShapeFactors = ( lineInfo : LineTypeInfo ) : Option [ ] => {
185
- return lineInfo . shapeFactors . map ( ( shapeFactor ) => ( { id : String ( shapeFactor ) , label : String ( shapeFactor ) } ) ) ;
187
+ return lineInfo . shapeFactors
188
+ . toSorted ( ( a , b ) => a - b )
189
+ . map ( ( shapeFactor ) => ( { id : String ( shapeFactor ) , label : String ( shapeFactor ) } ) ) ;
186
190
} ;
187
191
188
192
const handleSelectedRowData = useCallback (
0 commit comments