Is your feature request related to a problem? Please describe.
Reported by Nate Shoobs, OSU Mollusks sorts determinations by date descending, with the current determination and most recent determinations first. This is done using the following form XML:
<row>
<cell type="subview" viewname="Determination" id="66" name="determinations" colspan="14" rows="5" initialize="sortfield=-DeterminedDate"/>
</row>
A problem arises when determinations do not have a known determinedDate. The null value sorts at the beginning of the set of determinations, even in front of the one marked "Current". OSU frequently adds prior determinations from old labels that don't have dates associated, and each addition without a date jumps to the top ahead of the current determination.
Describe the solution you'd like
We could add an explicit null check at the top of both sortFunction and multiSortFunction in specifyweb/frontend/js_src/lib/utils/utils.ts so that empty values always sort to the end of the list (SQL's NULLS LAST semantics), regardless of ascending or descending direction.
Reported By
Nate Shoobs — Ohio State University (OSU) on the Speciforum
Is your feature request related to a problem? Please describe.
Reported by Nate Shoobs, OSU Mollusks sorts determinations by date descending, with the current determination and most recent determinations first. This is done using the following form XML:
A problem arises when determinations do not have a known
determinedDate. The null value sorts at the beginning of the set of determinations, even in front of the one marked "Current". OSU frequently adds prior determinations from old labels that don't have dates associated, and each addition without a date jumps to the top ahead of the current determination.Describe the solution you'd like
We could add an explicit
nullcheck at the top of bothsortFunctionandmultiSortFunctioninspecifyweb/frontend/js_src/lib/utils/utils.tsso that empty values always sort to the end of the list (SQL'sNULLS LASTsemantics), regardless of ascending or descending direction.Reported By
Nate Shoobs — Ohio State University (OSU) on the Speciforum