Skip to content

fix: render queue log filters as a static panel [WTEL-10353] - #1496

Open
dlohvinov wants to merge 1 commit into
mainfrom
fix/WTEL-10353/queue-logs-static-filters
Open

dlohvinov wants to merge 1 commit into
mainfrom
fix/WTEL-10353/queue-logs-static-filters

Conversation

@dlohvinov

@dlohvinov dlohvinov commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Why

WTEL-10353 — QA reports that the Queues registries show their filters as chips instead of plain controls, that the default date range is not visible, and that the red "filters applied" indicator behaves wrongly.

This PR covers the Logs registry only. The Queues registry and the Members registry are deliberately left for a follow-up; the ticket stays open for them.

The log was already on Pinia + @webitel/ui-datalist, so this is not a datalist migration — it is switching its existing panel to the SDK's static-mode and fixing the indicator.

What

Static panel. the-queue-logs-filters.vue passes static-mode, and all seven filters in configs/filtersOptions.ts are wrapped in createFilterConfig({ … showFilterName: true }) so each control is labelled with its own name rather than a shared "Values". A 3-column grid override replaces the panel's default 4, which read badly with three tall date fields.

Every existing filter is preserved — same names, same order, nothing added or removed: joinedAt, agent, bucket, leavingAt, offeringAt, result, duration, plus the action bar's search. A filter's name is its request param, so the existing filtersOptions.spec.ts contract test still passes unchanged. Note this keeps bucket / leavingAt / offeringAt, which the ticket describes as "extra" — that was a deliberate call, since they are filters the log genuinely supports.

The default date range is now relative. configs/defaultFilters.ts seeds joinedAt with RelativeDatetimeValue.Today instead of an absolute { from: startOfToday(), to: endOfToday() }. normalizeDatetimeRange in @webitel/api-services already expands relative values into joined_at.from / .to, so the request is identical, but a bookmarked or shared url keeps meaning "today" rather than freezing on the day it was copied — and the static panel preselects the Today preset, which is what makes the default visible at all. The initial seed and resetFilters() share the one helper.

The red indicator actually works now. opened-queue-logs.vue bound <wt-badge :hidden="!filtersManager.hasFilters">, but FiltersManager has no hasFilters getter — only hasFilter(name) — so !undefined was always true and the badge never appeared. It now tests the filters the panel offers (excluding the action bar's search, mirroring the SDK's listSelectedFilters), counting the seeded notDeletable default. That satisfies both ticket rules: nothing applied → hidden; a default applied → always shown.

Depends on

webitel/webitel-ui-sdk#1765 — the static-mode field fixes. Without it the date fields seed themselves on mount, so leavingAt and offeringAt silently apply and send leaving_at.* / offering_at.*, and every empty field shows a red required error. This PR should not be merged before that one is released and picked up. No version bump is included here: client pins @webitel/ui-datalist at ~26.8, so a patch on the 26.8 train is picked up by the lockfile alone.

Tests

  • configs/__tests__/defaultFilters.spec.ts (new) — the default filters on the start date, is relative rather than a frozen range, and still resolves to today when the request is built.
  • configs/__tests__/filtersOptions.spec.ts — a new case asserting every logs filter opts into showFilterName, since they are all on screen at once.

npm run typecheck clean, biome clean, vitest run 37 files / 154 tests passed.

There is no component test for the-queue-logs-filters.vue: this app runs @vue/compat MODE 2, where vue-test-utils stubbing has no effect, so the real SDK panel always renders and dies in compat's renderSlot. The behaviour it would have covered is tested in the SDK instead, and the wiring was checked in the browser.

Verified in the browser

Against test.webitel.me, client linked to the SDK branch, queue → Logs:

  • filters render as plain controls — no chips, no "add filter" action, no close button (static mode drops it; the action-bar icon still toggles the panel);
  • Joined at preselects Today; Leaving at and Offering at are empty;
  • Agent, Bucket, Result, Duration: From/To all labelled by name, none showing a validation error;
  • request on load carries joined_at.from / joined_at.to and no leaving_at.* / offering_at.*;
  • picking Today under Offering at adds offering_at.from / .to and persists as offeringAt_val in the url;
  • clear-all drops offeringAt and re-seeds joinedAt to rdt_today; the red badge stays lit throughout;
  • switching Joined at to Custom date range labels the pickers "Joined at: From" / "Joined at: To".

Known gap

The ticket names the log's date filters "Start: From" / "Start: To", matching the table's column headers. They currently read "Joined at", because src/app/plugins/webitel/ui-sdk.ts:30 merges the ui-sdk locale after the app's, and mergeLocaleMessage overwrites — so the app's entire webitelUI.filters override block is dead for any key ui-sdk also defines (the pre-existing tags / result / duration overrides there are equally ineffective). Fixing the wording means either changing that merge precedence app-wide or teaching createFilterConfig to carry a per-filter label; both are bigger than this PR and neither is a regression from it, so it is left as a separate decision.

🤖 Generated with Claude Code

…webitel.atlassian.net/browse/WTEL-10353)

The log's filters panel rendered in the dynamic chip mode: filters had to be
added one chip at a time, and the seeded date range was not legible as a
control. It now renders in `static-mode`, with every filter labelled by its
own name.

All seven filters are kept, in the same order and under the same names — the
names are the request params.

The date range is seeded with the relative `rdt_today` rather than an absolute
`{ from, to }`. `normalizeDatetimeRange` expands it per request, so a shared
url keeps meaning "today" instead of freezing on the day it was copied, and
the static panel preselects the Today preset. The seed moves to
`configs/defaultFilters.ts` so the initial seed and the reset share it.

The red indicator was bound to `filtersManager.hasFilters`, which does not
exist on `FiltersManager` — `!undefined` is always true, so the badge never
showed. It now tracks the filters the panel actually offers, counting the
seeded default, so it is lit whenever a filter is applied.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant