Fix: show descending sort arrow on Document Manager "Observed" column#159
Open
LiamStanziani wants to merge 1 commit into
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR fixes a typo in the DataTables configuration for the Document Manager / eDoc documents table so that the Observed column correctly displays the descending sort arrow while preserving the existing newest-first sort behavior. Sequence diagram for DataTables initialization and Observed column sort arrowsequenceDiagram
participant Browser
participant DocumentManager
participant DataTables
Browser->>DocumentManager: load documentReport.jsp
DocumentManager->>DataTables: initialize DataTable(order [[6, desc]])
DataTables->>DataTables: apply column 6 sort(desc)
DataTables->>Browser: render rows(descending Observed)
DataTables->>Browser: set header class(sorting_desc on Observed)
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Document Manager table (patient Document Manager and the provider eDoc tab) is configured to default-sort by the Observed (observation date) column, newest-first. The rows do render in the correct descending order, but the column header never shows the descending (down) arrow — it displays the neutral "unsorted" up/down glyph instead. This makes it look like the table isn't sorted by Observed date at all.
The cause is a one-character typo in the DataTables initialization: the sort direction was written as
'dsc'instead of'desc'. This change corrects it.Original PR: openo-beta#2486
Problem
src/main/webapp/documentManager/documentReport.jspinitializes the documents table with:'dsc'is not a valid DataTables direction (the valid values are'asc'/'desc'). Because of how DataTables 1.13.4 handles the value, the three pieces of "sorted" state diverge:'dsc'dir === 'asc'; anything else is treated as descending.aria-sortattribute"descending"_fnSortAriausesdir == 'asc' ? 'ascending' : 'descending'.sorting(no arrow)dir == 'asc' ? sSortAsc : dir == 'desc' ? sSortDesc : <neutral>.'dsc'matches neither branch, so the column falls back to the neutral glyph instead ofsorting_desc.So users see correctly-ordered rows but no visual indicator that the Observed column is the active (descending) sort.
The typo originates from commit
d87797cb45("fix order grouping in document manager ordered by obs date desc"), which introduced theorderoption to fix an earlier "defaults to first column" bug. That commit fixed the data ordering but shipped the'dsc'typo, leaving this residual cosmetic bug. It is present on bothdevelopandrelease/2026-03-17, and affects both the patient Document Manager (function=demographic) and the provider eDoc tab (function=providers).Solution
Change the DataTables sort direction from the invalid
'dsc'to the correct'desc'indocumentReport.jsp:(Actual change:
'dsc'→'desc'on theorder:line.)This is a one-character, behavior-preserving fix: the data was already sorting descending, and now the header correctly renders the
sorting_desc(down-arrow) class so the Observed column visibly shows it is the active descending sort.UI Before:
UI After:
Verification
Verified live in the running app (logged in, demographic 1 + provider eDoc tab):
'dsc'): Observed header class =sorting(neutral, no arrow); rows ordered descending.'desc'): Observed header class =sorting sorting_desc(down arrow shown); rows ordered descending — identical data order, only the indicator changes.Confirmed on both tables of the provider eDoc view (private
tblDocs0and publishedtblDocs1).Summary by Sourcery
Bug Fixes: