wcz-layout 9.7.0 → 10.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/dist/AggregatedCell-C7nAQyMO.mjs +510 -0
  2. package/dist/AggregatedCell-C7nAQyMO.mjs.map +1 -0
  3. package/dist/Approval-C-hF4jbT.mjs.map +1 -1
  4. package/dist/DialogsContext-DLqA8RJ_.mjs.map +1 -1
  5. package/dist/Email-BzQQkbe9.mjs.map +1 -1
  6. package/dist/FileMeta-DDqUju1Y.mjs.map +1 -1
  7. package/dist/LayoutTable-BkrjgpW_.d.mts +758 -0
  8. package/dist/{QueryClientParam-Cbb0MIKg.d.mts → QueryClientParam-JcH0mJWl.d.mts} +2 -2
  9. package/dist/RouterListItemButton-ULMlaQh6.mjs.map +1 -1
  10. package/dist/{User-1gKoYJvW.d.mts → User-D4__w1I1.d.mts} +4 -2
  11. package/dist/approval-BYryxFOW.mjs +84 -0
  12. package/dist/approval-BYryxFOW.mjs.map +1 -0
  13. package/dist/auth.d.mts +21 -11
  14. package/dist/auth.mjs +43 -26
  15. package/dist/auth.mjs.map +1 -1
  16. package/dist/components.d.mts +22 -30
  17. package/dist/components.mjs +813 -140
  18. package/dist/components.mjs.map +1 -1
  19. package/dist/createApi-DGJJ4I_R.mjs +27 -0
  20. package/dist/createApi-DGJJ4I_R.mjs.map +1 -0
  21. package/dist/data/client.d.mts +690 -1176
  22. package/dist/data/client.mjs +4 -3
  23. package/dist/data/client.mjs.map +1 -1
  24. package/dist/data/server.d.mts +3 -3
  25. package/dist/data/server.mjs +4 -2
  26. package/dist/data/server.mjs.map +1 -1
  27. package/dist/{file-DimNsRly.mjs → file-C14fhUeg.mjs} +6 -7
  28. package/dist/file-C14fhUeg.mjs.map +1 -0
  29. package/dist/{file-BWcNzq55.mjs → file-C5BOj1q8.mjs} +5 -24
  30. package/dist/file-C5BOj1q8.mjs.map +1 -0
  31. package/dist/hooks.d.mts +7 -46
  32. package/dist/hooks.mjs +2587 -239
  33. package/dist/hooks.mjs.map +1 -1
  34. package/dist/index.d.mts +28 -9
  35. package/dist/index.mjs +1248 -500
  36. package/dist/index.mjs.map +1 -1
  37. package/dist/middleware.d.mts +20 -19
  38. package/dist/middleware.mjs +47 -2
  39. package/dist/middleware.mjs.map +1 -1
  40. package/dist/models.d.mts +17 -10
  41. package/dist/models.mjs.map +1 -1
  42. package/dist/{peoplesoft-CskGsqd6.d.mts → peoplesoft-BY_75WTS.d.mts} +2 -2
  43. package/dist/{peoplesoft-DTPGpN2h.mjs → peoplesoft-BkJMCcHb.mjs} +24 -81
  44. package/dist/peoplesoft-BkJMCcHb.mjs.map +1 -0
  45. package/dist/providers-DrairEO2.mjs +74 -0
  46. package/dist/providers-DrairEO2.mjs.map +1 -0
  47. package/dist/tokens-BLRreL1j.mjs +143 -0
  48. package/dist/tokens-BLRreL1j.mjs.map +1 -0
  49. package/dist/{utils-DjdexspV.mjs → utils-BUpDoqme.mjs} +73 -51
  50. package/dist/utils-BUpDoqme.mjs.map +1 -0
  51. package/dist/{utils-5x4uNxsX.d.mts → utils-Bhi0KiBx.d.mts} +18 -6
  52. package/dist/utils.d.mts +2 -2
  53. package/dist/utils.mjs +2 -2
  54. package/dist/vite.d.mts +1 -2
  55. package/dist/vite.mjs +3 -3
  56. package/dist/vite.mjs.map +1 -1
  57. package/package.json +130 -128
  58. package/skills/client-db/SKILL.md +104 -96
  59. package/skills/db-schema/SKILL.md +46 -33
  60. package/skills/dialogs/SKILL.md +21 -27
  61. package/skills/forms/SKILL.md +60 -39
  62. package/skills/general/SKILL.md +122 -94
  63. package/skills/general/references/exports.md +106 -0
  64. package/skills/migrations/SKILL.md +53 -2
  65. package/skills/migrations/versions/migrate-v9-to-v10.md +582 -0
  66. package/skills/routing/SKILL.md +50 -60
  67. package/skills/server-functions/SKILL.md +36 -56
  68. package/skills/services/SKILL.md +7 -4
  69. package/skills/services/docs/approval.md +2 -2
  70. package/skills/services/docs/peoplesoft.md +114 -110
  71. package/skills/start/SKILL.md +9 -5
  72. package/skills/start/steps/05-database-setup.md +52 -52
  73. package/skills/start/steps/06-entra-setup.md +1 -1
  74. package/skills/start/steps/07-vault-setup.md +5 -12
  75. package/skills/table/SKILL.md +263 -0
  76. package/skills/unslop/SKILL.md +80 -0
  77. package/dist/NotificationContext-CgwUOeW0.mjs +0 -7
  78. package/dist/NotificationContext-CgwUOeW0.mjs.map +0 -1
  79. package/dist/authMiddleware-DPly0b_T.mjs +0 -48
  80. package/dist/authMiddleware-DPly0b_T.mjs.map +0 -1
  81. package/dist/entra-CJSyeQsx.mjs +0 -109
  82. package/dist/entra-CJSyeQsx.mjs.map +0 -1
  83. package/dist/file-BWcNzq55.mjs.map +0 -1
  84. package/dist/file-DimNsRly.mjs.map +0 -1
  85. package/dist/msalServer-DLwA7_ta.mjs +0 -30
  86. package/dist/msalServer-DLwA7_ta.mjs.map +0 -1
  87. package/dist/peoplesoft-DTPGpN2h.mjs.map +0 -1
  88. package/dist/useDialogs-BUzVrTSP.mjs +0 -248
  89. package/dist/useDialogs-BUzVrTSP.mjs.map +0 -1
  90. package/dist/user-Dzv0N9fj.d.mts +0 -16
  91. package/dist/utils-DjdexspV.mjs.map +0 -1
  92. package/skills/data-grid/SKILL.md +0 -142
  93. package/skills/migrations/versions/migrate-v9-to-v10.tsx +0 -9
@@ -0,0 +1,582 @@
1
+ # Migrate wcz-layout v9 to v10
2
+
3
+ Two headline changes:
4
+
5
+ 1. Login moves to a `/login` page where the user picks a provider. AWS Cognito joins
6
+ Entra. Entra-only apps behave as before, apart from the new page.
7
+ 2. Every paid MUI X package is gone. `LayoutTable` (TanStack Table v9) replaces
8
+ `DataGridPremium`, pickers move to the free `@mui/x-date-pickers`, and there is no
9
+ licence key any more.
10
+
11
+ Work through the steps in order.
12
+
13
+ Commit the migration edits before running `vp check --fix`. On a repo not already
14
+ formatted to the current config it rewrites hundreds of unrelated files, and the
15
+ middleware arrays you need to eyeball vanish into the churn.
16
+
17
+ ## 1. Dependencies
18
+
19
+ | Action | Package | Version |
20
+ | ------- | ---------------------------------- | ----------- |
21
+ | Install | `@tanstack/react-table` | 9.x |
22
+ | Install | `@tanstack/react-virtual` | 3.x |
23
+ | Install | `@tanstack/react-hotkeys` | 0.x |
24
+ | Install | `@tanstack/react-pacer` | 0.x |
25
+ | Install | `@mui/x-date-pickers` | 9.x |
26
+ | Upgrade | `@tanstack/react-query` | **≥ 5.102** |
27
+ | Upgrade | `@tanstack/react-router-ssr-query` | latest 1.x |
28
+ | Delete | `@mui/x-data-grid-premium` | — |
29
+ | Delete | `@mui/x-date-pickers-pro` | — |
30
+
31
+ ```bash
32
+ npm install @tanstack/react-table@9 @tanstack/react-virtual@3 @tanstack/react-hotkeys@0 @tanstack/react-pacer@0 @mui/x-date-pickers@9
33
+ npm install @tanstack/react-query@latest @tanstack/react-router-ssr-query@latest
34
+ npm uninstall @mui/x-data-grid-premium @mui/x-date-pickers-pro
35
+ ```
36
+
37
+ **Both query upgrades are mandatory** and neither failure names a version:
38
+
39
+ - react-query below 5.102 lacks `QueryKeyWithDataTag`, which v10's `.d.mts` reference.
40
+ Every `wcz-layout/data/client` export then resolves to `unknown`, surfacing as
41
+ `TS18046: 'x' is of type 'unknown'` scattered through your own components.
42
+ - ssr-query below 1.167.2 hydrates against the pre-5.102 shape and throws
43
+ `Cannot read properties of undefined (reading 'mutations')` in the browser. No type
44
+ error, so `vp check` passes and the page silently falls back to client rendering.
45
+
46
+ If `@mui/material` is pinned to an exact version — common, to match the pinned MUI X
47
+ Pro packages — loosen it to a caret range, or the install fails `ERESOLVE` against a
48
+ newer `@mui/icons-material`.
49
+
50
+ Then: rewrite every `@mui/x-date-pickers-pro` reference to `@mui/x-date-pickers`,
51
+ including the `/// <reference types="@mui/x-date-pickers-pro/themeAugmentation" />`
52
+ line atop `src/hooks/useTheme.ts` — not an import, so grepping for one misses it.
53
+ Delete every `@mui/x-license` import from `src/router.tsx` and what it feeds —
54
+ `LicenseInfo.setLicenseKey`, plus `muiXTelemetrySettings.disableTelemetry()` where it
55
+ is used. Drop `VITE_MUI_LICENSE_KEY` from `src/env.ts` and `.env*`, and remove it
56
+ from Vault. If that empties the `client` block, delete `clientEnv` and its
57
+ import in `src/router.tsx`; delete any `.env*` file left empty.
58
+
59
+ The range pickers were Pro-only, so `DateRangePicker`, `TimeRangePicker` and
60
+ `DateTimeRangePicker` are gone from `useLayoutForm`. Replace each with two adjacent
61
+ single-value fields, validate the ordering in the form schema, and delete the
62
+ `MuiDateRangePicker` / `MuiDateTimeRangePicker` entries from `useTheme.ts`.
63
+
64
+ ## 2. Renamed auth exports
65
+
66
+ | v9 | v10 | From |
67
+ | ---------------------------------------------- | ----------------------- | ----------------------- |
68
+ | `requirePermission("key")` | `requireAuth("key")` | `wcz-layout/utils` |
69
+ | `requirePermission("all")` | `requireAuth()` | `wcz-layout/utils` |
70
+ | `authorizationMiddleware("key")` | `authMiddleware("key")` | `wcz-layout/middleware` |
71
+ | `authorizationMiddleware("all")` | `authMiddleware()` | `wcz-layout/middleware` |
72
+ | `authenticationMiddleware()` | `authMiddleware()` | `wcz-layout/middleware` |
73
+ | `authenticationMiddleware({ optional: true })` | dropped, see step 6 | |
74
+
75
+ **The "any employee" key must go.** v9 apps carried a key listing the company-wide
76
+ employee groups (`wcz-all-employees`, `wscz-all-employees`) to mean "anyone signed
77
+ in". v10 says that with no key at all. Delete the entry from `permissions.ts` —
78
+ leaving it breaks AWS, whose sessions carry no groups, so a key-checked guard rejects
79
+ every Cognito user.
80
+
81
+ **Find it by its groups, not its name.** It is usually called `all`, but not always —
82
+ one app named it `tester`. Read `permissions.ts` and pick the key whose value is the
83
+ company-wide employee groups; that is the one to translate and delete, whatever it is
84
+ called. Keys naming a real group (`admin` and friends) stay. Replace any
85
+ `hasPermission(user, <that key>)` with `!!user`.
86
+
87
+ New: `LoginForm` (`wcz-layout/components`), `loginProvidersQueryOptions`
88
+ (`wcz-layout`), `Permissions` and `Scopes` types (`wcz-layout/models`), and
89
+ `userMiddleware` (`wcz-layout/middleware`) — puts the caller in `context.user`,
90
+ `null` when anonymous, requires nobody.
91
+
92
+ Unchanged: `hasPermission`, `getUser`, `getAccessToken`, `getAppToken`,
93
+ `handleLogin`, `handleCallback`, `handleLogout`, `csrfMiddleware`,
94
+ `validationMiddleware`. `User` gains an additive `provider` field.
95
+
96
+ Removed from `wcz-layout/components`: `RouterGridActionsCellItem` and
97
+ `EditableColumnHeader` (grid wrappers — row actions now live in a `display` column),
98
+ and `TypographyWithIcon` (inline a `Stack direction="row"` with the icon and a
99
+ `Typography`).
100
+
101
+ ## 3. src/lib/auth/permissions.ts
102
+
103
+ ```ts
104
+ import type { Permissions } from "wcz-layout/models";
105
+
106
+ export const permissions = {
107
+ admin: ["wcz-developers"],
108
+ } as const satisfies Permissions;
109
+ ```
110
+
111
+ ## 4. src/lib/auth/scopes.ts
112
+
113
+ Arrays become strings, one scope per key. The object form is only for an API an AWS
114
+ session must reach.
115
+
116
+ ```ts
117
+ import type { Scopes } from "wcz-layout/models";
118
+
119
+ export const scopes = {
120
+ graph: "User.Read",
121
+ api: "api://wistron.com/project-name/access_as_user",
122
+ // reachable by both providers:
123
+ // file: { entra: "api://…/access_as_user", aws: "https://…/access_as_user" },
124
+ } as const satisfies Scopes;
125
+ ```
126
+
127
+ Keep `as const satisfies` on both files — `as const` is what keeps
128
+ `requireAuth("admin")` and `getAccessToken("file")` type-checked.
129
+
130
+ ## 5. src/routes/login.tsx, new and required
131
+
132
+ `requireAuth` redirects unauthenticated users to `/login`; without this file they 404.
133
+
134
+ ```tsx
135
+ import { createFileRoute } from "@tanstack/react-router";
136
+ import { loginProvidersQueryOptions } from "wcz-layout";
137
+ import { LoginForm } from "wcz-layout/components";
138
+
139
+ export const Route = createFileRoute("/login")({
140
+ loader: ({ context }) => context.queryClient.query(loginProvidersQueryOptions),
141
+ component: LoginForm,
142
+ });
143
+ ```
144
+
145
+ The loader makes the buttons server-render. `LoginForm` takes no props; it reads
146
+ `?returnTo` itself and shows one button per configured provider.
147
+
148
+ `tsc` will report `'"/login"' is not assignable to 'keyof FileRoutesByPath'` until the
149
+ route tree regenerates — run `vp check` before chasing it.
150
+
151
+ ## 6. src/server/middleware/databaseMiddleware.ts
152
+
153
+ Only if the app has one. The change is one line — swap its auth dependency:
154
+
155
+ ```diff
156
+ - .middleware([authenticationMiddleware({ optional: true })]) // or authenticationMiddleware()
157
+ + .middleware([userMiddleware])
158
+ ```
159
+
160
+ Keep the shape the app already has. If it is a plain exported middleware object, it
161
+ stays one. If it is a factory that existed only to carry an `optional` flag, the
162
+ generic factory, the pre-built instances and the overloads all go — there is one
163
+ signature now.
164
+
165
+ ### Did it authenticate on its own?
166
+
167
+ Check what the v9 middleware composed before touching any call site:
168
+
169
+ - `authenticationMiddleware({ optional: true })` — required nobody. Nothing opens up.
170
+ - `authenticationMiddleware()` — **required a signed-in user**, and every call site
171
+ that stood alone inherited that. `userMiddleware` requires nobody, so each of those
172
+ now serves anonymous callers unless you add `authMiddleware()` yourself.
173
+
174
+ | v9 call site | v9 meaning | v10 |
175
+ | ---------------------------------------------------------- | ------------------- | -------------------------------------------------- |
176
+ | `databaseMiddleware({ optional: true })` | anonymous allowed | `[databaseMiddleware()]` |
177
+ | `databaseMiddleware()` over `authenticationMiddleware()` | user required | `[databaseMiddleware(), authMiddleware()]` |
178
+ | `[authorizationMiddleware("admin"), databaseMiddleware()]` | permission required | `[databaseMiddleware(), authMiddleware("admin")]` |
179
+
180
+ Grep the middleware name, not `createServerFn` — route `server.middleware` arrays
181
+ count too, and job, cron and webhook endpoints are where a lone `databaseMiddleware`
182
+ hides. Those are the worst ones to leave anonymous.
183
+
184
+ ### Order: `databaseMiddleware` first
185
+
186
+ Middleware context merges left to right and the later entry wins, so the order
187
+ decides whether `context.user` is nullable in the handler. `databaseMiddleware`
188
+ declares `userMiddleware` and contributes `user: User | null`; `authMiddleware`
189
+ contributes `user: User`. Put the database one first and the narrowed type survives:
190
+
191
+ ```ts
192
+ .middleware([databaseMiddleware(), authMiddleware("admin")])
193
+ .handler(({ context }) => context.user.name) // User, no narrowing needed
194
+ ```
195
+
196
+ v9 arrays are usually written the other way round, so reorder them as you go. Any
197
+ `validationMiddleware` in a REST route still goes **after** `authMiddleware`, or an
198
+ unauthenticated caller gets their body parsed and your validation errors back:
199
+ `[databaseMiddleware(), authMiddleware("admin"), validationMiddleware(Schema)]`.
200
+
201
+ ## 7. src/start.ts
202
+
203
+ v10 apps need no `src/start.ts` just for CSRF. When the file is absent, TanStack Start
204
+ installs its own default request middleware,
205
+ `createCsrfMiddleware({ filter: (ctx) => ctx.handlerType === "serverFn" })` — exactly
206
+ what `csrfMiddleware` from `wcz-layout/middleware` is.
207
+
208
+ Open the file and read what `createStart` returns:
209
+
210
+ - **Only `requestMiddleware: [csrfMiddleware]`**, with `csrfMiddleware` imported from
211
+ `wcz-layout/middleware` and no other option → delete `src/start.ts` completely.
212
+ - **Anything else** — a second entry in `requestMiddleware`, a `functionMiddleware`
213
+ array, any other option, or a `createCsrfMiddleware` of the app's own with a
214
+ different filter → keep the file as it is.
215
+
216
+ After deleting, `src/routeTree.gen.ts` still imports `startInstance` from `./start.ts`
217
+ until the route tree regenerates — run `vp check` before chasing it. Nothing else
218
+ should import `startInstance`; grep to confirm.
219
+
220
+ ## 8. Locales
221
+
222
+ The app owns every string — the vite plugin builds i18next resources from the app's
223
+ `src/lib/locales/*.json`, so a key the library renders but the app does not define
224
+ comes out raw. The package does not ship its locale files: the complete v10 `Layout`
225
+ block for `en` and `cs` is at the end of this guide, under
226
+ [Appendix: v10 Layout locales](#appendix-v10-layout-locales).
227
+
228
+ v10 adds the whole `Layout.Table` namespace plus `Layout.ContinueWith` and
229
+ `Layout.TestEnvironment`. Take only the `Layout` key; nothing else in the app's
230
+ locale files is the library's.
231
+
232
+ **Merge it into the app's `Layout`, do not replace the block.** Apps add their own
233
+ keys inside that namespace (`Layout.Loading`, `Layout.NotProvided` in one app), and a
234
+ wholesale replace silently deletes them — which *does* break the build, because
235
+ `src/types/i18next.d.ts` types `t()` from `en.json` and the app's own
236
+ `t("Layout.Loading")` calls stop compiling. So: overlay the library's keys on top of
237
+ the app's, then look at what is left over. A leftover key the app's own code
238
+ references is the app's — keep it. One nothing references is a v9 library key v10
239
+ dropped — remove it, or it lingers forever because it passes every check.
240
+
241
+ **Use the block from the guide of the major you are migrating to.** Do this step
242
+ again in every major's pass: `Layout` keys change between majors, and each guide's
243
+ appendix holds its own major's set. A v9 → v11 upgrade runs the v10 pass with this
244
+ appendix and the v11 pass with the v11 guide's. Carrying v10's block into a v11 app
245
+ leaves the wrong key set.
246
+
247
+ **A library key the app never calls can go missing without failing the build.**
248
+ `t()` is typed from the app's `en.json`, so it catches the app's own calls and nothing
249
+ else — the library's are compiled already. A `Layout.Table.*` key the app never
250
+ references therefore survives `vp check` and surfaces only as a raw key string on
251
+ screen. Verify deliberately: compare the app's `Layout` key set against the appendix,
252
+ and look at the login card and the table toolbar, where a miss shows first.
253
+
254
+ **Every language the app ships needs the new keys, not just the two.** The appendix
255
+ covers `en` and `cs`; an app may have any number of files in `src/lib/locales/`. For
256
+ every other file (`de.json`, `pl.json`, `zh.json`, …), take the **English** block and
257
+ translate it into that file's language yourself, as part of this step — do not ask,
258
+ do not leave English values in place, do not skip the file. Nobody else will, and the
259
+ gap is invisible until someone switches language.
260
+
261
+ - Merge the same way as above: keys the app already translated keep their existing
262
+ values; translate only the keys the file is missing.
263
+ - Translate values only. Keys, `{{provider}}` / `{{name}}` / `{{count}}`
264
+ interpolations and the `<env>` tag stay byte-for-byte.
265
+ - Emit the plural suffixes the target language needs, not English's. English has
266
+ `_one` / `_other`, Czech adds `_few`, Polish needs `_one` / `_few` / `_many` /
267
+ `_other`, and Chinese or Japanese only `_other`. When unsure, check
268
+ `new Intl.PluralRules("<lang>").resolvedOptions().pluralCategories`; a category
269
+ that only applies to fractions (Czech `many`) can be left out, `count` is whole.
270
+ - Match the tone of the file's existing strings (formal vs. informal address).
271
+
272
+ `Layout.TestEnvironment` holds an `<env>` tag the mascot renders through `Trans` —
273
+ keep the tag in every language, it colours the word.
274
+
275
+ ## 9. Replace the grid
276
+
277
+ **Only where `DataGridPremium` is used.** A table already built on TanStack Table
278
+ stays exactly as written — do not convert it to `LayoutTable`. This step exists
279
+ because the paid grid is gone, not because `LayoutTable` is the house table for
280
+ everything. Grep for `DataGridPremium`; anything else is out of scope.
281
+
282
+ Read the `table` skill before writing any columns — it documents the API. This is
283
+ only the mapping.
284
+
285
+ Delete `src/components/DataGridToolbar.tsx`; `LayoutTable` renders the toolbar,
286
+ quick filter, columns panel and filter panel itself. In `useTheme.ts`, drop
287
+ `import { csCZ, enUS } from "@mui/x-data-grid/locales"` and its two entries.
288
+
289
+ | DataGridPremium | LayoutTable |
290
+ | --------------------------------------------------- | ------------------------------------------------------------- |
291
+ | `Array<GridColDef<Row>>` | `columnHelper.columns([...])` from `createLayoutColumnHelper` |
292
+ | `field` / `headerName` | the accessor key / `header` |
293
+ | `width`, `flex`, `minWidth` | `size` |
294
+ | `renderCell` | `cell: ({ cell }) => <cell.ValueCell />` |
295
+ | `valueGetter: (_v, row) => row.x.y` | `columnHelper.accessor((row) => row.x.y, { id: "..." })` |
296
+ | `align` / `headerAlign` | `meta: { align }` |
297
+ | `initialState.pinnedColumns.left` / `.right` | `initialState.columnPinning.start` / `.end` |
298
+ | `initialState.sorting.sortModel` `{field, sort}` | `initialState.sorting` `[{ id, desc }]` |
299
+ | `valueFormatter` on a date column | `cell.DateCell` or `cell.DateTimeCell` |
300
+ | `valueFormatter` with an `Intl.NumberFormat` | `cell.NumberCell options={...}`, same options object |
301
+ | `type: "singleSelect"` with `valueOptions` | `meta: { variant: "select", options }` |
302
+ | `type: "number"` / `"date"` / `"boolean"` | `meta: { variant: "number" \| "date" \| "boolean" }` |
303
+ | `rows` and `columns` props | `useLayoutTable({ data, columns })`, then `table={table}` |
304
+ | `showToolbar` with `slots.toolbar` | `showToolbar` with `title` and `actions` on `LayoutTable` |
305
+ | `ignoreDiacritics` | always on |
306
+ | `rowSelectionModel` state | `table.getSelectedRowIds()`, `table.resetRowSelection()` |
307
+ | `cellSelection` | always on, `Mod+C` copies the range as TSV |
308
+ | `GridActionsCellItem` in a `type: "actions"` column | a `display` column rendering `cell.ActionsCell`, `showInMenu` kept |
309
+
310
+ **Every row needs an `id`.** `getRowId` is not an option — the library hardcodes
311
+ `row.id`. A table over a view or a natural-key table without an `id` column must add
312
+ one where the rows are built (`id: row.cpn`), and the row type gains `id: string`.
313
+
314
+ **Dropped with no replacement**, so decide per case whether to rebuild or drop:
315
+ `getRowClassName` and `cellClassName` (style inside the cell instead — a `sx` on
316
+ `cell.NumberCell` colours the text, nothing reaches the row), `rowHeight`, the
317
+ Excel export button, and `localeText` overrides such as `footerTotalRows`. Any `sx`
318
+ block targeting `.MuiDataGrid-*` classes is dead: delete it rather than translating
319
+ it, LayoutTable's DOM is unrelated.
320
+
321
+ **State persistence changes shape.** `apiRef.exportState()` / `restoreState()` and the
322
+ per-change callbacks (`onSortModelChange`, `onPinnedColumnsChange`, …) are gone.
323
+ Restore by passing `initialState` read from storage before first render, and persist
324
+ with one effect on `table.state`. There is no `onStateChange` option.
325
+
326
+ **Shared generic column factories do not port.** A v9 helper like
327
+ `actionColumn<T>(): GridColDef<T>` reused across pages cannot be rewritten as
328
+ `(helper: ColumnHelper<T>) => ...` — `createLayoutColumnHelper` is invariant in its row
329
+ type, so a concrete helper will not satisfy a generic parameter. Share the *contents*
330
+ instead: a function returning `Array<RowAction<T>>` (that type is generic-friendly) or
331
+ a plain predicate, and let each page write its own five-line `display` column.
332
+
333
+ **Inline editing has no equivalent.** No `editMode`, no `processRowUpdate`, no
334
+ editable columns, and `EditableColumnHeader` is gone. A page built on
335
+ `editMode="row"` is a redesign, not a column mapping: move create and edit into a
336
+ dialog with a `useLayoutForm` and leave the table read-only. Usually the largest item
337
+ in the whole migration. It also retires `rowModesModel`, the `isNew` row flag and any
338
+ "turn the Zod error into a string for the grid" helper — delete them, the form renders
339
+ field errors itself.
340
+
341
+ **Bulk actions need a selection column.** A v9 page driving actions off
342
+ `Object.keys(cellSelectionModel)` has nothing to map onto: cell selection is always on
343
+ in v10 but exists for `Mod+C`. `table.getSelectedRowIds()` reads *row* selection,
344
+ which renders only if the columns start with a `select` display column
345
+ (`header.SelectAllCell` / `cell.SelectCell`, `size: 50`, `enableResizing: false`,
346
+ `enableCellSelection: false`). Ids come back as plain strings, so the `id.toString()`
347
+ that `GridRowId` forced can go.
348
+
349
+ Two behaviours that catch people out. `meta.variant: "select"` and `"multi-select"`
350
+ read options from the column's faceted unique values, so pass `meta.options` only when
351
+ the label differs from the stored value — a translated database enum, derived from
352
+ `enumValues`. And grouping shows a value only for the grouping column and columns that
353
+ resolve an aggregation function (a number or `Date`, unless the column sets
354
+ `aggregationFn`); others stay blank in a group row.
355
+
356
+ ## 10. useNotification
357
+
358
+ `useNotification` is gone, along with its snackbar and the `snackbarOrigin` layout
359
+ option. Replace every call with something the page renders itself — a success
360
+ animation, a non-dismissing alert dialog for errors. Match whatever the app already
361
+ does for feedback rather than introducing a new pattern.
362
+
363
+ Two things to check:
364
+
365
+ - A `notify(..., { severity: "error" })` sitting next to an `alert(error.message)`
366
+ from `useDialogs` is redundant. Delete the `notify`, keep the `alert`.
367
+ - A success `notify` that fires **after** a `navigate` cannot become a component on
368
+ the page it was called from — that page has already unmounted. Invert it: render
369
+ the feedback, and navigate when it finishes.
370
+
371
+ ## 11. AWS Cognito, optional
372
+
373
+ Skip for Entra-only apps. To offer AWS, add to the `server` block of `src/env.ts`:
374
+
375
+ ```ts
376
+ AWS_ISSUER: z.url().optional(), // https://cognito-idp.<region>.amazonaws.com/<poolId>
377
+ AWS_DOMAIN: z.url().optional(), // https://<prefix>.auth.<region>.amazoncognito.com
378
+ AWS_CLIENT_ID: z.string().min(1).optional(),
379
+ AWS_CLIENT_SECRET: z.string().min(1).optional(),
380
+ ```
381
+
382
+ Set all four in `.env.local`; the second button appears only when all are present.
383
+ The Cognito app client must be confidential, use the authorization-code grant, and
384
+ list `<origin>/auth/callback` as callback and `<origin>/` as sign-out URL.
385
+
386
+ An AWS session requests OIDC scopes only, so it cannot mint a delegated API token.
387
+ Cognito cannot widen scopes after login, so adding a downstream API means requesting
388
+ every `aws` scope in `scopes.ts` at login, and an unregistered one fails the whole
389
+ sign-in — register them all on the app client first. Downstream APIs must also accept
390
+ the Cognito JWKS and authorize on the token's `scope` claim, since Cognito access
391
+ tokens carry no `aud`.
392
+
393
+ ## Appendix: v10 Layout locales
394
+
395
+ The complete `Layout` block wcz-layout v10 renders, for step 8. Merge it into the
396
+ app's `src/lib/locales/en.json` and `cs.json` as that step describes — do not paste
397
+ it over the app's block. For any other language, translate the English block.
398
+
399
+ ### en.json
400
+
401
+ ```json
402
+ {
403
+ "Layout": {
404
+ "LogIn": "Log In",
405
+ "ContinueWith": "Continue with {{provider}}",
406
+ "Logout": "Logout",
407
+ "Language": "Language",
408
+ "Appearance": "Appearance",
409
+ "Light": "Light",
410
+ "Dark": "Dark",
411
+ "System": "System",
412
+ "ThisPageCouldNotBeFound": "This page could not be found.",
413
+ "Settings": "Settings",
414
+ "Unauthorized": "Unauthorized",
415
+ "TestEnvironment": "You’re in the <env>TEST</env> environment",
416
+ "Dialog": {
417
+ "Confirm": "Confirm",
418
+ "Cancel": "Cancel",
419
+ "Alert": "Alert"
420
+ },
421
+ "File": {
422
+ "AreYouSureYouWantToDelete": "Are you sure you want to delete {{name}}?",
423
+ "DragSomeFilesHereOrClickToSelectThem": "Drag some files here or click to select them",
424
+ "Delete": "Delete",
425
+ "Download": "Download"
426
+ },
427
+ "Table": {
428
+ "Search": "Search",
429
+ "ClearSearch": "Clear search",
430
+ "ColumnMenu": "Column menu",
431
+ "Filters": "Filters",
432
+ "AddFilter": "Add filter",
433
+ "RemoveFilter": "Remove filter",
434
+ "ClearFilters": "Clear filters",
435
+ "And": "and",
436
+ "Or": "or",
437
+ "Field": "Field",
438
+ "Operator": "Operator",
439
+ "Value": "Value",
440
+ "NoValueRequired": "No value required",
441
+ "From": "From",
442
+ "To": "To",
443
+ "DaysFromToday": "Days from today",
444
+ "NoRows": "No rows",
445
+ "SortAscending": "Sort ascending",
446
+ "SortDescending": "Sort descending",
447
+ "ClearSort": "Clear sort",
448
+ "PinStart": "Pin to start",
449
+ "PinEnd": "Pin to end",
450
+ "Unpin": "Unpin",
451
+ "GroupBy": "Group by this column",
452
+ "Ungroup": "Stop grouping",
453
+ "RowActions": "Row actions",
454
+ "SelectedCount_one": "{{count}} selected",
455
+ "SelectedCount_other": "{{count}} selected",
456
+ "MoveLeft": "Move left",
457
+ "MoveRight": "Move right",
458
+ "All": "All",
459
+ "Columns": "Columns",
460
+ "ShowHideAll": "Show/Hide all",
461
+ "HideColumn": "Hide column",
462
+ "Operators": {
463
+ "includesString": "contains",
464
+ "notIncludesString": "does not contain",
465
+ "equalsString": "is",
466
+ "notEqualsString": "is not",
467
+ "startsWith": "starts with",
468
+ "endsWith": "ends with",
469
+ "isEmpty": "is empty",
470
+ "isNotEmpty": "is not empty",
471
+ "equals": "is",
472
+ "notEquals": "is not",
473
+ "greaterThan": "is greater than",
474
+ "greaterThanOrEqualTo": "is greater than or equal to",
475
+ "lessThan": "is less than",
476
+ "lessThanOrEqualTo": "is less than or equal to",
477
+ "inRange": "is between",
478
+ "isRelativeToToday": "is relative to today",
479
+ "Date": {
480
+ "lessThan": "is before",
481
+ "lessThanOrEqualTo": "is on or before",
482
+ "greaterThan": "is after",
483
+ "greaterThanOrEqualTo": "is on or after"
484
+ }
485
+ }
486
+ }
487
+ }
488
+ }
489
+ ```
490
+
491
+ ### cs.json
492
+
493
+ ```json
494
+ {
495
+ "Layout": {
496
+ "LogIn": "Přihlásit se",
497
+ "ContinueWith": "Pokračovat přes {{provider}}",
498
+ "Logout": "Odhlásit se",
499
+ "Language": "Jazyk",
500
+ "Appearance": "Vzhled",
501
+ "Light": "Světlý",
502
+ "Dark": "Tmavý",
503
+ "System": "Systém",
504
+ "ThisPageCouldNotBeFound": "Tato stránka nebyla nalezena.",
505
+ "Settings": "Nastavení",
506
+ "Unauthorized": "Neoprávněný",
507
+ "TestEnvironment": "Jste v <env>TESTOVACÍM</env> prostředí",
508
+ "Dialog": {
509
+ "Confirm": "Potvrdit",
510
+ "Cancel": "Zrušit",
511
+ "Alert": "Upozornění"
512
+ },
513
+ "File": {
514
+ "AreYouSureYouWantToDelete": "Opravdu chcete smazat {{name}}?",
515
+ "DragSomeFilesHereOrClickToSelectThem": "Přetáhněte sem některé soubory nebo je vyberte kliknutím",
516
+ "Delete": "Smazat",
517
+ "Download": "Stáhnout"
518
+ },
519
+ "Table": {
520
+ "Search": "Hledat",
521
+ "ClearSearch": "Zrušit hledání",
522
+ "ColumnMenu": "Nabídka sloupce",
523
+ "Filters": "Filtry",
524
+ "AddFilter": "Přidat filtr",
525
+ "RemoveFilter": "Odebrat filtr",
526
+ "ClearFilters": "Zrušit filtry",
527
+ "And": "a",
528
+ "Or": "nebo",
529
+ "Field": "Pole",
530
+ "Operator": "Operátor",
531
+ "Value": "Hodnota",
532
+ "NoValueRequired": "Hodnota není potřeba",
533
+ "From": "Od",
534
+ "To": "Do",
535
+ "DaysFromToday": "Dnů od dneška",
536
+ "NoRows": "Žádné řádky",
537
+ "SortAscending": "Seřadit vzestupně",
538
+ "SortDescending": "Seřadit sestupně",
539
+ "ClearSort": "Zrušit řazení",
540
+ "PinStart": "Připnout na začátek",
541
+ "PinEnd": "Připnout na konec",
542
+ "Unpin": "Odepnout",
543
+ "GroupBy": "Seskupit podle sloupce",
544
+ "Ungroup": "Zrušit seskupení",
545
+ "RowActions": "Akce řádku",
546
+ "SelectedCount_one": "{{count}} vybraný",
547
+ "SelectedCount_few": "{{count}} vybrané",
548
+ "SelectedCount_other": "{{count}} vybraných",
549
+ "MoveLeft": "Posunout doleva",
550
+ "MoveRight": "Posunout doprava",
551
+ "All": "Vše",
552
+ "Columns": "Sloupce",
553
+ "ShowHideAll": "Zobrazit/skrýt vše",
554
+ "HideColumn": "Skrýt sloupec",
555
+ "Operators": {
556
+ "includesString": "obsahuje",
557
+ "notIncludesString": "neobsahuje",
558
+ "equalsString": "je",
559
+ "notEqualsString": "není",
560
+ "startsWith": "začíná na",
561
+ "endsWith": "končí na",
562
+ "isEmpty": "je prázdné",
563
+ "isNotEmpty": "není prázdné",
564
+ "equals": "je",
565
+ "notEquals": "není",
566
+ "greaterThan": "je větší než",
567
+ "greaterThanOrEqualTo": "je větší nebo rovno",
568
+ "lessThan": "je menší než",
569
+ "lessThanOrEqualTo": "je menší nebo rovno",
570
+ "inRange": "je mezi",
571
+ "isRelativeToToday": "je relativní ke dnešku",
572
+ "Date": {
573
+ "lessThan": "je před",
574
+ "lessThanOrEqualTo": "je nejpozději",
575
+ "greaterThan": "je po",
576
+ "greaterThanOrEqualTo": "je nejdříve"
577
+ }
578
+ }
579
+ }
580
+ }
581
+ }
582
+ ```