Skip to content

Commit 0bef64d

Browse files
author
Mateo
committed
ISSUE-7677: Display late penalty selection
1 parent 299cf67 commit 0bef64d

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

app/javascript/Components/groups_manager.jsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff 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) {

0 commit comments

Comments
 (0)