Commit 8157f4c
authored
fix(plugin-multi-tenant): modal container blocks clicks on create-first-user page (#15973)
# Overview
Fixes the `@faceless-ui/modal` container blocking clicks on the
`/admin/create-first-user` page when the multi-tenant plugin is active.
Also guards against the admin users collection being listed in
`pluginConfig.collections`.
## Key Changes
- Gate `openModal` behind `showField` and early-return in
`debug`/`isEditManyModalOpen` modes — modal only opens when there are
tenant options to display
- Skip Pass 2 for the admin users collection if listed in
`pluginConfig.collections`, with a `console.warn` — prevents double
access control, conflicting tenant fields, and validation errors on user
creation
- Exclude admin users slug from `collectionSlugs` upfront to suppress
the spurious missing-collections warning
## Design Decisions
`(!value && !selectedTenantID)` had no `showField` guard, so `openModal`
fired even with zero tenants. On `create-first-user` this left the modal
container active with `pointer-events: all` and no content, blocking
form clicks.
`users: {}` in `pluginConfig.collections` is always a misconfiguration —
Pass 1 already handles users via `tenantsArrayField`. Pass 2 processing
them again adds a conflicting `tenantField` and breaks user creation.
Warn-and-skip was chosen over a hard throw to stay non-breaking.
Fixes #152881 parent f89e736 commit 8157f4c
2 files changed
Lines changed: 24 additions & 3 deletions
Lines changed: 14 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
119 | 130 | | |
120 | 131 | | |
121 | 132 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
138 | 141 | | |
139 | 142 | | |
140 | 143 | | |
| |||
336 | 339 | | |
337 | 340 | | |
338 | 341 | | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
339 | 349 | | |
340 | 350 | | |
341 | 351 | | |
| |||
0 commit comments