The SENAITE dashboard lives at /senaite-dashboard. It’s a
distinct view from the samples listing (that’s the filterable
table you interact with all day). The dashboard is what you
look at when you want a shape of the work: how many samples
are in each state, how many worksheets are open, and how those
numbers moved over the last week or month.
The three tiers
The dashboard code (senaite.core.browser.dashboard) renders in
three tiers.
Greeting and status cards. Your name, the current date and
time, and a small set of permission-gated cards showing high-
level counts (samples to receive, worksheets to verify, that
kind of thing). Each card checks a specific permission
(TransitionReceiveSample, TransitionVerify, EditResults,
AddAnalysisRequest, ManageBika) before it appears, so users
only see cards they can act on.
Quick action links. Role-aware shortcuts: Register Samples, Worksheets, Verify, Publish, Setup. Same role-based visibility as the status cards.
Statistics sections. The rich part. Three panels (Samples,
Analyses, Worksheets), each with a count per workflow state
plus a bar chart of evolution over time. This section is
gated by senaite.core: View Dashboard, granted by default to
LabClerk, LabManager, and Manager.
What the sample panel actually shows
For each workflow state that a sample can be in, one tile with a count and a click-through to the pre-filtered listing:
- Reception pending (
sample_due) - Results pending (
sample_received) - To be verified
- Verified
- Published
If the sampling workflow is enabled, three extra tiles appear above: To be sampled, To be preserved, Sampling scheduled. If the printing workflow is enabled, an extra “To be printed” tile joins the row.
Below the count tiles sits the Evolution of Samples chart. Bar chart, one bar per time bucket (day, week, month depending on periodicity), colour-coded by workflow state. That chart is the whole reason to open the dashboard: it shows whether the work is piling up, flushing through, or holding steady.
The analyses and worksheets panels
Same shape. Analyses has its own workflow-state tiles and its own Evolution of Analyses chart. Worksheets is smaller: Results pending, To be verified, Verified, and Evolution of Worksheets.
Each panel queries its own catalog (SAMPLE_CATALOG,
ANALYSIS_CATALOG, WORKSHEET_CATALOG) and each evolution
chart pulls counts per workflow state per period.
The async loading trick
The dashboard page skeleton (greeting, quick links, section
headings) renders immediately, without database queries. Every
count and every chart is fetched asynchronously from a
JSON endpoint (@@senaite-dashboard-data).
Each section fetches independently. A slow catalog on one section (say, an unusual Worksheet query) doesn’t block the other sections from filling in. That’s the reason the dashboard feels snappy even on databases with hundreds of thousands of samples.
Caching
Counts are cached with @ram.cache for 5 minutes, shared
across users. The cache key includes the full query and the
catalog name, so different filters (“mine” vs “all”) get
separate cache entries.
Evolution chart data is cached for 2 hours. That’s a deliberate choice: the chart shape doesn’t change meaningfully minute-by-minute, and rebuilding it hits the catalog with per-bucket queries, which is not free.
Filters that shape the view
The “mine” vs “all” filter on each panel is a cookie-backed switch that adds a filter to the base query. “Mine” narrows to work assigned to the logged-in user. “All” shows the whole lab. Managers usually park on “all”; analysts flip to “mine” during their shift.
Periodicity (day / week / month) changes the bucket size on the evolution chart. A lab with 500 samples a day picks daily buckets and sees a fine-grained trend. A lab with 30 samples a week picks weekly buckets so the bars aren’t all zero.
The habit worth building
Open the dashboard first thing. Look at the evolution charts, not just the count tiles. A rising “to be verified” trend over the last two weeks is a signal that verification capacity is slipping. A jagged “sample received” pattern is a signal that reception is bursty and could use load-levelling. The counts tell you the current state; the charts tell you the trajectory.
Neither number appears in a listing. That’s what the dashboard is for.