Skip to content

Analytics overview configurable metrics #766

@JaanikaTalvistu

Description

@JaanikaTalvistu

AS AN admin
I WANT to toggle which components are shown on the analytics Overview and apply my selection
SO THAT the Overview shows only the metrics and widgets that matter most to me

Under the analytics module, the Overview page the admin can choose which components are displayed. The existing card behaviour (like trend icon, percentage and previous-period comparison) must be preserved on every metric card.

Figma:
https://www.figma.com/design/JYnmhsKixyUSCSUXXfwTAA/B%C3%BCrokratt?node-id=12243-37612&t=4TZp2BeH2oA5WhwV-0

Acceptance criteria

  • When testing, check that the layout matches the Figma design.
  • Date selection (Day/Week/Month + range) and the "Today" / "Täna" button works the same way and applies to all visible components.

Edit control & modal

  • An "Edit" / "Muuda" button is available at the top left.
  • Clicking it opens the "Edit overview" / "Muuda ülevaadet" modal.
  • The modal shows the helper text: "Lülita vajalikud komponendid sisse või välja, et näha konkreetseid mõõdikuid." / "Toggle the components on or off to see metric specific details."
  • The modal lists all Overview components as checkboxes (see component list below).
  • "Total number of chats" / "Vestluste koguarv" is always enabled and cannot be toggled off (checkbox disabled and checked).
  • Checking a component marks it to be shown.
  • Unchecking a component marks it to be hidden.
  • "Cancel" / "Tühista" closes the modal without applying any changes.
  • "Apply" / "Salvesta" applies the selection and closes the modal.

Result on the Overview

  • After applying, only the selected components are shown and deselected components are removed.
  • Components fill the layout with no empty gaps (KPI cards resize to fill the row width).
  • The selected metrics persist across page reloads or sessions.

Preserved metric-card behaviour

  • Each visible metric card keeps:
    • Metric title
    • Current value in a larger size, based on the selected date range
    • Bottom row reflecting the previous period:
      • Starts with a trend icon (descending or ascending)
      • Percentage = ((current metric result - previous metric result) / previous metric result) x 100
      • A dot separator before the label
      • Label depends on date selection: Last day / Eelnev päev, Last week / Eelnev nädal, Last month / Eelnev kuu
      • Previous-period value shown at the end

Overview components (modal order)

  • Total number of chats / Vestluste koguarv — KPI card, always on (cannot be removed)
  • Average waiting time / Keskmine ooteaeg — KPI card
  • Average feedback rating / Keskmine hinnang — KPI card
  • Bürokratt answered / Vastas Bürokratt — KPI card
  • CSA answered / Vastas nõustaja — KPI card
  • Redirected / Edasi suunatud — KPI card
  • Left without an answer / Lahkus vastuseta — KPI card
  • Total number of chats as a graph / Vestluste koguarv graafikuna — bar chart
  • Positive feedback / Positiivne tagasiside — feedback rating widget
  • Response quality / Vastuste kvaliteet — list
  • Most popular themes in period / Populaarsemad teemad perioodil — list
  • Top after-actions / Järeltegevuste top — list

Reminders!

  • Metric and graph calculations are unchanged from the Overview metrics task (#<overview-task>); this task only governs which components are shown.
  • No changes to data architecture or database logic — out of scope.
  • Toggling components must not affect the date range, the "Today" button, or the calculations.
  • Component order in the modal and on the Overview is fixed — show/hide only, no reordering.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    To Groom

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions