fix(flow): replace duplicate period dropdown with preset buttons

Period selector had both preset buttons (3/7/30 zile) and a dropdown
with overlapping options. Per plan Commit 6, preset buttons are the
single control: Azi / 3 zile / 7 zile / 30 zile / Custom. Visible
on all screen sizes with horizontal scroll on mobile.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Claude Agent
2026-03-27 13:54:04 +00:00
parent f516bb5756
commit b2745a9a64
4 changed files with 25 additions and 43 deletions

View File

@@ -1039,6 +1039,8 @@ tr.mapping-deleted td {
display: flex;
gap: 2px;
align-items: center;
overflow-x: auto;
flex-shrink: 0;
}
.preset-btn {
background: var(--surface);

View File

@@ -224,19 +224,21 @@ async function loadSchedulerStatus() {
// ── Filter Bar wiring ─────────────────────────────
function wireFilterBar() {
// Period dropdown
document.getElementById('periodSelect')?.addEventListener('change', function () {
document.querySelectorAll('.preset-btn').forEach(b => b.classList.remove('active'));
const matchBtn = document.querySelector(`.preset-btn[data-days="${this.value}"]`);
if (matchBtn) matchBtn.classList.add('active');
const cr = document.getElementById('customRangeInputs');
if (this.value === 'custom') {
cr?.classList.add('visible');
} else {
cr?.classList.remove('visible');
dashPage = 1;
loadDashOrders();
}
// Period preset buttons
document.querySelectorAll('.preset-btn[data-days]').forEach(btn => {
btn.addEventListener('click', function() {
document.querySelectorAll('.preset-btn').forEach(b => b.classList.remove('active'));
this.classList.add('active');
const days = this.dataset.days;
const cr = document.getElementById('customRangeInputs');
if (days === 'custom') {
cr?.classList.add('visible');
} else {
cr?.classList.remove('visible');
dashPage = 1;
loadDashOrders();
}
});
});
// Custom range inputs
@@ -266,20 +268,6 @@ function wireFilterBar() {
loadDashOrders();
}, 300);
});
// Period preset buttons
document.querySelectorAll('.preset-btn[data-days]').forEach(btn => {
btn.addEventListener('click', function() {
document.querySelectorAll('.preset-btn').forEach(b => b.classList.remove('active'));
this.classList.add('active');
const days = this.dataset.days;
const sel = document.getElementById('periodSelect');
if (sel) { sel.value = days; }
document.getElementById('customRangeInputs')?.classList.remove('visible');
dashPage = 1;
loadDashOrders();
});
});
}
// ── Dashboard Orders Table ────────────────────────
@@ -300,7 +288,8 @@ function dashSortBy(col) {
}
async function loadDashOrders() {
const periodVal = document.getElementById('periodSelect')?.value || '7';
const activePreset = document.querySelector('.preset-btn.active');
const periodVal = activePreset?.dataset.days || '3';
const params = new URLSearchParams();
if (periodVal === 'custom') {