File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
app/javascript/Components Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -602,6 +602,31 @@ class RawGroupsTable extends React.Component {
602602 filterable : false ,
603603 sortMethod : durationSort ,
604604 } ,
605+ {
606+ Header : "Penalty" ,
607+ id : "late_penalty_applied" ,
608+ accessor : "extension" ,
609+ Cell : row => {
610+ return row . original . extension . apply_penalty ? (
611+ < FontAwesomeIcon icon = "fa-solid fa-square-check" />
612+ ) : (
613+ < FontAwesomeIcon icon = "fa-solid fa-xmark" />
614+ ) ;
615+ } ,
616+ minWidth : 30 ,
617+ filterable : false ,
618+ sortMethod : ( a , b ) => {
619+ // Primary sort: boolean property (true first)
620+ if ( a . apply_penalty && ! b . apply_penalty ) {
621+ return - 1 ; // a (true) comes before b (false)
622+ }
623+ if ( ! a . apply_penalty && b . apply_penalty ) {
624+ return 1 ; // a (false) comes after b (true)
625+ }
626+ // Secondary sort: numeric property (ascending) if boolean properties are equal
627+ return durationSort ( a , b ) ;
628+ } ,
629+ } ,
605630 ] ;
606631
607632 static getDerivedStateFromProps ( props , state ) {
You can’t perform that action at this time.
0 commit comments