Skip to content

Commit

Permalink
do descending sort order on FRs to attach to incident
Browse files Browse the repository at this point in the history
This seems like a more useful ordering, since most of the time,
the user will be wanting to attach a recently-made FR, rather
than the oldest ones.
  • Loading branch information
srabraham committed Nov 22, 2024
1 parent b4b9ae8 commit 9633111
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ims/element/static/incident.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,10 @@ function loadUnattachedIncidentReports(success) {
for (const d of data) {
_unattachedIncidentReports.push(d);
}
// apply an ascending sort based on the field report number,
// apply a descending sort based on the field report number,
// being cautious about field report number being null
_unattachedIncidentReports.sort(function (a, b) {
return (a.number ?? -1) - (b.number ?? -1);
return (b.number ?? -1) - (a.number ?? -1);
})
unattachedIncidentReports = _unattachedIncidentReports;

Expand Down

0 comments on commit 9633111

Please sign in to comment.