fix(admin): fix sort toggle in grouped summary tables
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions

The sort direction check was done AFTER clearing all sort classes,
so it always read false and defaulted to descending. Now reads the
current state before clearing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Maciej Pienczyn 2026-03-18 09:03:01 +01:00
parent 17d640a375
commit 233cbb667d

View File

@ -482,10 +482,11 @@
renderSummary(summaryData, 'count', -1);
function sortSummary(th) {
summaryHeader.querySelectorAll('th').forEach(function(h) { h.classList.remove('sort-asc','sort-desc'); });
var key = th.dataset.skey;
var type = th.dataset.stype;
var desc = !th.classList.contains('sort-desc');
var wasDesc = th.classList.contains('sort-desc');
summaryHeader.querySelectorAll('th').forEach(function(h) { h.classList.remove('sort-asc','sort-desc'); });
var desc = !wasDesc;
th.classList.add(desc ? 'sort-desc' : 'sort-asc');
var dir = desc ? -1 : 1;
renderSummary(summaryData, key, dir);