Commit 4369e5d 1 parent 5274097 commit 4369e5d Copy full SHA for 4369e5d
File tree 2 files changed +8
-10
lines changed
front/src/modules/rollingStock
components/RollingStockCard
2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -26,18 +26,16 @@ const RollingStockCardButtons = ({
26
26
const { t } = useTranslation ( [ 'rollingstock' ] ) ;
27
27
const { closeModal } = useContext ( ModalContext ) ;
28
28
29
- const { getRollingStockComfort } = useOsrdConfSelectors ( ) ;
30
- const currentComfortInStore = useSelector ( getRollingStockComfort ) ;
31
- const [ comfort , setComfort ] = useState ( 'STANDARD' ) ;
29
+ const { getRollingStockComfortV2 } = useOsrdConfSelectors ( ) ;
30
+ const currentComfortInStore = useSelector ( getRollingStockComfortV2 ) ;
31
+ const [ comfort , setComfort ] = useState ( currentComfortInStore as string ) ;
32
32
33
33
const { updateRollingStockComfortV2, updateRollingStockID } = useOsrdConfActions ( ) ;
34
34
35
35
const selectRollingStock = ( ) => {
36
36
setOpenedRollingStockCardId ( undefined ) ;
37
37
dispatch ( updateRollingStockID ( id ) ) ;
38
- dispatch (
39
- updateRollingStockComfortV2 ( ( comfort === 'AC' ? 'AIR_CONDITIONING' : comfort ) as Comfort )
40
- ) ;
38
+ dispatch ( updateRollingStockComfortV2 ( comfort as Comfort ) ) ;
41
39
closeModal ( ) ;
42
40
} ;
43
41
@@ -58,7 +56,7 @@ const RollingStockCardButtons = ({
58
56
}
59
57
if ( curvesComfortList . includes ( 'AC' ) ) {
60
58
options . push ( {
61
- value : 'AC ' ,
59
+ value : 'AIR_CONDITIONING ' ,
62
60
label : (
63
61
< span data-testid = "comfort-ac-button" className = "rollingstock-footer-button-with-picto" >
64
62
{ comfort2pictogram ( 'AIR_CONDITIONING' ) } { t ( 'comfortTypes.AIR_CONDITIONING' ) }
Original file line number Diff line number Diff line change 1
- import type { RollingStockComfortType } from 'common/api/osrdEditoastApi' ;
1
+ import type { Comfort , RollingStockComfortType } from 'common/api/osrdEditoastApi' ;
2
2
import { isElectric } from 'modules/rollingStock/helpers/electric' ;
3
3
import type {
4
4
ElectricalProfileByMode ,
@@ -303,9 +303,9 @@ export const CONVERSION_FACTORS_SCHEMA: Partial<
303
303
'kN/(km/h)²' : { 'N/(m/s)²' : 1000 * 3.6 ** 2 , 'N/(km/h)²' : 1000 } ,
304
304
} ;
305
305
306
- const ComfortLevels = {
306
+ export const ComfortLevels : Record < Comfort , Comfort > = {
307
307
STANDARD : 'STANDARD' ,
308
- AC : 'AC ' ,
308
+ AIR_CONDITIONING : 'AIR_CONDITIONING ' ,
309
309
HEATING : 'HEATING' ,
310
310
} ;
311
311
You can’t perform that action at this time.
0 commit comments