Skip to content

Commit 763181b

Browse files
author
Mateo
committed
ISSUE-7677: Display late penalty selection
1 parent e76cbc7 commit 763181b

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
@@ -563,6 +563,31 @@ class RawGroupsTable extends React.Component {
563563
filterable: false,
564564
sortMethod: durationSort,
565565
},
566+
{
567+
Header: "Penalty",
568+
id: "late_penalty_applied",
569+
accessor: "extension",
570+
Cell: row => {
571+
return row.original.extension.apply_penalty ? (
572+
<FontAwesomeIcon icon="fa-solid fa-square-check" />
573+
) : (
574+
<FontAwesomeIcon icon="fa-solid fa-xmark" />
575+
);
576+
},
577+
minWidth: 30,
578+
filterable: false,
579+
sortMethod: (a, b) => {
580+
// Primary sort: boolean property (true first)
581+
if (a.apply_penalty && !b.apply_penalty) {
582+
return -1; // a (true) comes before b (false)
583+
}
584+
if (!a.apply_penalty && b.apply_penalty) {
585+
return 1; // a (false) comes after b (true)
586+
}
587+
// Secondary sort: numeric property (ascending) if boolean properties are equal
588+
return durationSort(a, b);
589+
},
590+
},
566591
];
567592

568593
static getDerivedStateFromProps(props, state) {

0 commit comments

Comments
 (0)