2.4 KiB
2.4 KiB
name, description
| name | description |
|---|---|
| dyolink-lab-tasks | Lab Tasks tab — list, sort, filters, case grouping, prosthesis colors, step-completed filter. Use when changing TasksPage, tasks API, or lab task list UX. |
Lab Tasks
Main UI: frontend/src/components/ui/lab/TasksPage.tsx
Backend: backend/src/modules/tasks/
Default sort (backend)
sortBy=date + sortDir=desc:
labCase.sentAtdesc (newest case first)labCaseId,treatmentDetailId,prosthesisTypeCodeasc (stable grouping)stepOrderasc (steps 1→N within prosthesis group)idasc
Other sorts use flat list on the frontend; stepOrder asc is still a tiebreaker.
Case grouping (frontend)
sortBy === 'date'→ grouped view viataskListGrouping.ts: case header → prosthesis sub-header → task rows.- Other sorts → flat list; show muted hint (
groupingOff*i18n keys). Each row keeps clinic/patient/teeth context.
Components: TaskCaseGroupHeader, TaskProsthesisGroupHeader, TaskRow.
Prosthesis colors
- Map:
catalog-type-colors.ts→PROSTHESIS_TYPE_COLORS(one hex per catalog code). - Resolve with
prosthesisTypeDisplay.ts— useprosthesisTypeBadgeStyleFromCatalog(code, catalog), not list row index. - Load catalog via
prosthesisCatalogApi.list()on Tasks/Cases/Today dashboard.
Filters
| Param | API | UI |
|---|---|---|
q, clinicOrganizationId, status |
GET /tasks |
Search, clinic, status |
stepCompleted |
GET /tasks |
Workflow step dropdown |
| Clinics + steps options | GET /tasks/filter-options |
Populates dropdowns (not from current page) |
Step completed filter: Restricts to prosthesis groups (labCaseId, treatmentDetailId, prosthesisTypeCode) where that workflowStepCode task is COMPLETED. Combined with status=IN_PROGRESS, returns only in-progress tasks in those groups (completed step row hidden).
APIs
GET /tasks— paginated flat task list (grouping is client-side whensortBy=date)PATCH /tasks/:taskId— update statusGET /tasks/filter-options— clinics + workflow steps (localized)
List items include caseSentAt for case headers.
Permissions
TAB_TASKS_READ / TAB_TASKS_EDIT; LabOrgGuard on all task routes.