Commit 42645b0
authored
Staff list controls: pagination, sorting & search (Services, Agreements, Submissions, Team) (#39)
* feat(platform): pagination, sorting & search on the staff Services list
Shared, URL-synced list controls (initiative staff-list-query, wave 1) plus
the Services surface wired up end-to-end.
platform-web:
- lib/list-search.ts: useListSearch hook + listSearchValidator (bind
page/sort/order/q to TanStack Router search) + Paginated<T> envelope type
- components/console/list/: SortableHeader, debounced ListSearchInput,
ListPagination (offset pager, hidden when it fits one page)
- Services page: search box, sortable headers, pager; keepPreviousData
platform-api:
- ServicesService.list: { workspaceId, q, sort, order, limit, offset } ->
{ items, total, limit, offset }; ILIKE over title/description; sortable by
title/updated/status (derived status precedence subquery); count(*)::int
total; page derived fields batched (no N+1)
- add updatedAt to the service response DTO
Tests: validator, primitives, behavioral search/sort, page-query schema,
e2e 400s for out-of-range paging/unknown sort.
* feat(platform): pagination, sorting & search on the staff Service Agreements list
Initiative staff-list-query, wave 2. Reuses the wave-1 list primitives.
platform-api:
- new paginated ServiceAgreementsService.listPage + GET /v1/service-agreements/page:
{ workspaceId?, q, sort, order, limit, offset } -> { items, total, limit, offset };
ILIKE on title; sortable title/updated/status (derived status precedence);
published-only; workspace scope lists the workspace's OWN agreements (globals
excluded server-side, feature 150), admin scope lists globals; batched status
- the existing unpaginated GET / is untouched: it still feeds the attach/default
pickers, which need the full workspace + global set
- add updatedAt to the agreement response DTO
platform-web:
- shared AgreementsList (workspace + admin) uses agreementsPageQueryOptions + the
wave-1 primitives; drops the client-side !isGlobal filter (server does it now)
- validateSearch on both service-agreements index routes
- useListSearch gains an optional defaultSort so the shared component is correct
on any host route
Tests: page-query schema, e2e 401/403/400, behavioral search+sort, updated the
console mock to the /page envelope.
* feat(platform): pagination, sorting & search on the staff Submissions queue
Initiative staff-list-query, wave 3 — the biggest rework.
platform-api:
- SubmissionsService.list rewritten from fetch-all + per-row toSummary N+1 to
ONE SQL query (+ a count): joins the latest submission version (max-version
correlated subquery, the (submission_id, version) pair is unique), applicant
(users), and service (correlated subqueries on document_references)
- ILIKE search over applicant name, service title, and the computed reference
(YYYYMMDD-XXXX, UTC); draft exclusion (feature 151) + the status tab enforced
in SQL; sortable by submitted/updated/status
- { q, sort, order, limit, offset, status } -> { items, total, limit, offset }
platform-web:
- Submissions page: search + sortable headers (status/submitted/updated) +
pagination via the wave-1 primitives; the status tab is now URL-synced too
- useListSearch gains setFilter (arbitrary URL filter params, e.g. the status
tab); route validateSearch composes the list params + status
Verified against live Postgres (raw SQL + an ephemeral SubmissionsService.list
probe: base/search/status/draft-exclusion/sort/paging all correct).
Tests: query-schema DTO, e2e 400s (paging/sort/status), behavioral tab+search+
sort, updated the console mock to the paginated envelope.
* feat(platform): pagination, sorting & search on the staff Team list
Initiative staff-list-query, wave 4 (final) — the Teams (members) surface.
platform-api:
- new paginated WorkspacesService.listMembersPage + GET /v1/workspaces/:id/members/page:
{ q, sort, order, limit, offset } -> { items, total, limit, offset }; ILIKE on
display name/email; sortable name/role/joined (every sort tiebreaks on name);
sort=role (default) keeps the admins-first ordering
- the unpaginated GET /:id/members is untouched: it still feeds the member-detail
lookup, which resolves one member out of the full list
platform-web:
- Team page: search + sortable headers (Member/Role/Joined) + pagination via the
wave-1 primitives; URL-synced
- useListSearch gains defaultOrder so the admins-first (role, asc) default is
self-contained on the route
Verified against live Postgres (raw SQL + an ephemeral listMembersPage probe:
base/sorts/search/no-match all correct).
Tests: query-schema DTO, e2e 401/400, behavioral search+sort team-list test;
updated the add-member mock to serve the /members/page envelope.
* style(platform-web): right-align list search boxes, stack New/Add buttons above them
Across the staff list pages (Services, Service Agreements, Team): the search box
now sits on the right, with the New/Add action button on its own row above it,
right-aligned. The Team 'Add member' button is now the primary (bcgov blue)
variant at the same size as the other lists' New buttons (was an outline button).
Submissions is unchanged (search already right; no create action).1 parent 080eeae commit 42645b0
45 files changed
Lines changed: 1802 additions & 238 deletions
File tree
- apps
- platform-api
- src/modules
- service-agreements
- controllers
- dtos
- services
- services
- controllers
- dtos
- services
- submissions
- controllers
- dtos
- services
- workspaces
- controllers
- dtos
- services
- test
- platform-web
- src
- components/console
- list
- pages
- service-agreements
- services
- lib
- routes
- test
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
38 | 49 | | |
39 | 50 | | |
40 | 51 | | |
| |||
Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
32 | 49 | | |
33 | 50 | | |
34 | 51 | | |
| |||
38 | 55 | | |
39 | 56 | | |
40 | 57 | | |
| 58 | + | |
41 | 59 | | |
42 | 60 | | |
43 | 61 | | |
| |||
97 | 115 | | |
98 | 116 | | |
99 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
100 | 128 | | |
101 | 129 | | |
102 | 130 | | |
| |||
106 | 134 | | |
107 | 135 | | |
108 | 136 | | |
| 137 | + | |
109 | 138 | | |
110 | 139 | | |
111 | 140 | | |
| |||
Lines changed: 78 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| |||
136 | 138 | | |
137 | 139 | | |
138 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
139 | 216 | | |
140 | 217 | | |
141 | 218 | | |
| |||
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
33 | | - | |
34 | | - | |
| 34 | + | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
Lines changed: 28 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
51 | 68 | | |
52 | 69 | | |
53 | 70 | | |
| |||
81 | 98 | | |
82 | 99 | | |
83 | 100 | | |
| 101 | + | |
84 | 102 | | |
85 | 103 | | |
86 | 104 | | |
| |||
107 | 125 | | |
108 | 126 | | |
109 | 127 | | |
110 | | - | |
111 | | - | |
112 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
113 | 137 | | |
114 | 138 | | |
115 | 139 | | |
| |||
150 | 174 | | |
151 | 175 | | |
152 | 176 | | |
| 177 | + | |
153 | 178 | | |
154 | 179 | | |
155 | 180 | | |
| |||
Lines changed: 95 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
129 | 130 | | |
130 | 131 | | |
131 | 132 | | |
132 | | - | |
133 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
134 | 139 | | |
135 | 140 | | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
154 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
155 | 228 | | |
156 | 229 | | |
157 | 230 | | |
| |||
0 commit comments