aglinxinyuan opened a new issue, #7824:
URL: https://github.com/apache/texera/issues/7824

   ### Describe the bug
   
   Six sortable columns in the admin user table render backwards relative to 
the caret they light.
   
   `frontend/src/app/dashboard/component/admin/user/admin-user.component.ts` — 
`sortByName`, `sortByEmail`, `sortByAffiliation`, `sortByJoiningReason`, 
`sortByComment` and `sortByRole` all compare with reversed operands, e.g. 
`(b.name || "").localeCompare(a.name || "")`.
   
   ng-zorro uses an `NzTableSortFn`'s result **as-is** for `ascend` and negates 
it for `descend` (`ng-zorro-antd-table.mjs`, around line 822), and the `<th>` 
click handler cycles `getNextSortDirection`. Every one of these six headers 
declares `nzSortDirections="['ascend','descend']"` — with no `null` member — so 
**the first click is always `ascend`**. A reversed comparator therefore renders 
Z→A under a lit up-caret.
   
   Two corroborations inside the same file: the tie-breaker in all six is the 
contract-correct ascending `a.uid - b.uid`, and `sortByAccountCreation` (line 
268, same header shape) already uses ascending `(a…) - (b…)`.
   
   An identical defect was just fixed in `user-quota.component.ts`'s 
`sortBySize` (#7806), with the same signature — caret assertions passing while 
the rows came out reversed.
   
   Note the existing spec was **cementing** this: its "column sort comparators" 
block asserted things like `sortByName(Alice, Bob) > 0`.
   
   ### How to reproduce?
   
   Open the admin user table and click any of the six headers once. The 
up-caret lights and the column reads Z→A.
   
   ### Version/Branch
   
   main
   
   ### Task Type
   
   - [ ] Refactor / Cleanup
   - [ ] DevOps / Deployment / CI
   - [ ] Testing / QA
   - [ ] Documentation
   - [ ] Performance
   - [x] Other
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to