@@ -28,6 +28,7 @@ import { fetchAvailableFilterEnumValues } from '../../../services/study';
28
28
import { ComputingType } from '@gridsuite/commons-ui' ;
29
29
import { useSelector } from 'react-redux' ;
30
30
import { AppState } from 'redux/reducer' ;
31
+ import { UNDEFINED_ACCEPTABLE_DURATION } from '../../utils/utils' ;
31
32
import RunningStatus from 'components/utils/running-status' ;
32
33
import type { SecurityAnalysisFilterEnumsType } from './use-security-analysis-column-defs' ;
33
34
import { CustomAggridComparatorFilter } from '../../custom-aggrid/custom-aggrid-filters/custom-aggrid-comparator-filter' ;
@@ -215,12 +216,9 @@ const makeAgGridDurationColumn = (
215
216
sortParams : ColumnContext [ 'sortParams' ]
216
217
) => {
217
218
return {
218
- headerName : intl . formatMessage ( {
219
- id : intlId ,
220
- } ) ,
219
+ headerName : intl . formatMessage ( { id : intlId } ) ,
221
220
colId : fieldId ,
222
221
field : fieldId ,
223
- valueFormatter : ( param : ValueFormatterParams ) => convertDuration ( param . value ) ,
224
222
context : {
225
223
sortParams,
226
224
filterComponent : CustomAggridDurationFilter ,
@@ -232,6 +230,17 @@ const makeAgGridDurationColumn = (
232
230
} ,
233
231
} ,
234
232
} ,
233
+ valueGetter : ( param : ValueGetterParams ) => {
234
+ if (
235
+ param . data . limitType !== intl . formatMessage ( { id : 'CURRENT' } ) ||
236
+ param . data [ fieldId ] === UNDEFINED_ACCEPTABLE_DURATION
237
+ ) {
238
+ return ' ' ;
239
+ } else if ( param . data [ fieldId ] === null ) {
240
+ return intl . formatMessage ( { id : 'NoneUpcomingOverload' } ) ;
241
+ }
242
+ return convertDuration ( param . data [ fieldId ] ) ;
243
+ } ,
235
244
} ;
236
245
} ;
237
246
@@ -252,7 +261,7 @@ export const securityAnalysisTableNColumnsDefinition = (
252
261
updateFilterCallback : onFilter ,
253
262
} ;
254
263
return [
255
- makeAgGridCustomHeaderColumn ( makeAgGridStringColumn ( 'Equipment' , 'locationId ' , intl , filterParams , sortParams ) ) ,
264
+ makeAgGridCustomHeaderColumn ( makeAgGridStringColumn ( 'Equipment' , 'subjectId ' , intl , filterParams , sortParams ) ) ,
256
265
makeAgGridCustomHeaderColumn ( {
257
266
headerName : intl . formatMessage ( { id : 'ViolationType' } ) ,
258
267
colId : 'limitType' ,
@@ -270,22 +279,48 @@ export const securityAnalysisTableNColumnsDefinition = (
270
279
} ,
271
280
} ,
272
281
} ) ,
282
+ makeAgGridCustomHeaderColumn ( makeAgGridStringColumn ( 'Bus' , 'locationId' , intl , filterParams , sortParams ) ) ,
273
283
makeAgGridCustomHeaderColumn ( {
274
284
...makeAgGridStringColumn ( 'LimitNameCurrentViolation' , 'limitName' , intl , filterParams , sortParams , [
275
285
FILTER_TEXT_COMPARATORS . EQUALS ,
276
286
] ) ,
277
287
valueFormatter : ( params : ValueFormatterParams ) => formatNAValue ( params . value , intl ) ,
278
288
} ) ,
279
- makeAgGridCustomHeaderColumn ( makeAgGridFloatColumn ( 'LimitLabelAOrKv' , 'limit' , intl , filterParams , sortParams ) ) ,
280
-
281
- makeAgGridCustomHeaderColumn ( makeAgGridFloatColumn ( 'CalculatedValue' , 'value' , intl , filterParams , sortParams ) ) ,
282
-
283
289
makeAgGridCustomHeaderColumn ( makeAgGridFloatColumn ( 'LimitLoading' , 'loading' , intl , filterParams , sortParams ) ) ,
290
+ makeAgGridCustomHeaderColumn (
291
+ makeAgGridFloatColumn ( 'PatlLoading' , 'patlLoading' , intl , filterParams , sortParams )
292
+ ) ,
293
+ makeAgGridCustomHeaderColumn (
294
+ makeAgGridDurationColumn ( 'actualOverloadDuration' , 'acceptableDuration' , intl , filterParams , sortParams )
295
+ ) ,
296
+ makeAgGridCustomHeaderColumn (
297
+ makeAgGridDurationColumn (
298
+ 'upComingOverloadDuration' ,
299
+ 'upcomingAcceptableDuration' ,
300
+ intl ,
301
+ filterParams ,
302
+ sortParams
303
+ )
304
+ ) ,
305
+ makeAgGridCustomHeaderColumn ( {
306
+ ...makeAgGridStringColumn (
307
+ 'NextLimitNameCurrentViolation' ,
308
+ 'nextLimitName' ,
309
+ intl ,
310
+ filterParams ,
311
+ sortParams ,
312
+ [ FILTER_TEXT_COMPARATORS . EQUALS ]
313
+ ) ,
314
+ valueFormatter : ( params : ValueFormatterParams ) => formatNAValue ( params . value , intl ) ,
315
+ } ) ,
284
316
317
+ makeAgGridCustomHeaderColumn ( makeAgGridFloatColumn ( 'LimitLabelAOrKv' , 'limit' , intl , filterParams , sortParams ) ) ,
285
318
makeAgGridCustomHeaderColumn (
286
- makeAgGridDurationColumn ( 'Overload ', 'acceptableDuration ' , intl , filterParams , sortParams )
319
+ makeAgGridFloatColumn ( 'PatlLimitValue ', 'patlLimit ' , intl , filterParams , sortParams )
287
320
) ,
288
321
322
+ makeAgGridCustomHeaderColumn ( makeAgGridFloatColumn ( 'CalculatedValue' , 'value' , intl , filterParams , sortParams ) ) ,
323
+
289
324
makeAgGridCustomHeaderColumn ( {
290
325
headerName : intl . formatMessage ( { id : 'LimitSide' } ) ,
291
326
colId : 'side' ,
@@ -776,8 +811,11 @@ export const FROM_COLUMN_TO_FIELD_N: Record<string, string> = {
776
811
side : 'side' ,
777
812
acceptableDuration : 'acceptableDuration' ,
778
813
limit : 'limit' ,
814
+ patlLimit : 'patlLimit' ,
779
815
value : 'value' ,
780
816
loading : 'loading' ,
817
+ patlLoading : 'patlLoading' ,
818
+ upcomingAcceptableDuration : 'upcomingAcceptableDuration' ,
781
819
} ;
782
820
783
821
export const FROM_COLUMN_TO_FIELD_NMK_CONTINGENCIES : Record < string , string > = {
0 commit comments