Commit 28bb644
committed
Resolves #6645 (FR-2553)
Part of FR-2209 Project Admin Management stack (PR-1b).
Stacks on #6653.
## Summary
- In admin mode, when a project-admin user selects a project they are not an admin of in the header `ProjectSelect`, a confirm modal asks before exiting admin mode
- Confirm modal content includes the target project name (new `{{projectName}}` placeholder in `header.SwitchOutOfAdminConfirmContent`)
- While the modal is open, the selector optimistically shows the target project with a loading state; cancel reverts to the current project, confirm commits and navigates back to the last-visited general page
- Fix sider "go back" button silently doing nothing on admin category pages (e.g. `/project-admin-users`) for users whose effective admin role filters the page out of their admin menu — superadmin visiting via URL, or a project-admin whose current project lacks admin rights. Added a role-independent `isCurrentPathAdminCategory` flag (derived from `ALL_ADMIN_PAGE_KEYS` + `PROJECT_ADMIN_PAGE_KEY_SET` + `storage-settings`) and used it to guard `goBackPath` writes, so an admin path is never stored as the "last visited general page"
- Simplify `useCurrentUserProjectRoles`: drop `isProjectAdminForId`/`deriveProjectAdminIds` helpers, `MyRolesAssignmentNode` shape, and `rawAssignments`. `projectAdminIds` now contains full project UUIDs sourced from `role.scopes` (new backend schema), so call sites use plain `Array.includes` against `useCurrentProject().id`. `useEffectiveAdminRole` correctly compares `currentProjectId` against this simplified list.
- Translate the two new `header.*` keys into all 19 target languages
- Regenerate `data/schema.graphql` against core 26.4.1 (adds `AddRevisionOptions` and updates version annotations)
## Verification
- `bash scripts/verify.sh` → `=== ALL PASS ===`
## Test plan
- [ ] As a project-admin user, enter admin mode and switch the header project selector to a project where you are not an admin → confirm modal appears with the target project name
- [ ] Cancel the modal → selector reverts to the previously selected project, no navigation occurs
- [ ] Confirm the modal → project switches, admin mode exits, UI navigates to the last-visited general page
- [ ] Repeat for superadmin and domain admin: the selector remains visible and switching does not trigger the modal (no regression)
- [ ] On `/project-admin-users` as a project admin, click the sider "go back" button → navigates to the previously visited general page (not the same admin page)
- [ ] Visit `/project-admin-users` as a superadmin via URL, navigate to `/session`, then enter admin mode and use "go back" → returns to `/session` (not `/project-admin-users`)
1 parent 780db50 commit 28bb644
28 files changed
Lines changed: 855 additions & 786 deletions
File tree
- data
- react/src
- components
- MainLayout
- hooks
- __tests__
- resources/i18n
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
13 | 19 | | |
14 | 20 | | |
15 | 21 | | |
16 | 22 | | |
17 | 23 | | |
18 | 24 | | |
19 | 25 | | |
20 | | - | |
| 26 | + | |
| 27 | + | |
21 | 28 | | |
22 | 29 | | |
23 | 30 | | |
| |||
48 | 55 | | |
49 | 56 | | |
50 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
51 | 69 | | |
52 | 70 | | |
53 | 71 | | |
54 | 72 | | |
55 | 73 | | |
56 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
57 | 95 | | |
58 | 96 | | |
59 | 97 | | |
| |||
107 | 145 | | |
108 | 146 | | |
109 | 147 | | |
110 | | - | |
111 | | - | |
| 148 | + | |
| 149 | + | |
112 | 150 | | |
113 | 151 | | |
114 | 152 | | |
115 | | - | |
116 | | - | |
117 | | - | |
| 153 | + | |
118 | 154 | | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
| 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 | + | |
123 | 197 | | |
124 | 198 | | |
125 | 199 | | |
| |||
163 | 237 | | |
164 | 238 | | |
165 | 239 | | |
| 240 | + | |
166 | 241 | | |
167 | 242 | | |
168 | 243 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| |||
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
85 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
86 | 94 | | |
87 | | - | |
| 95 | + | |
88 | 96 | | |
89 | 97 | | |
90 | | - | |
| 98 | + | |
91 | 99 | | |
92 | 100 | | |
93 | 101 | | |
| |||
222 | 230 | | |
223 | 231 | | |
224 | 232 | | |
225 | | - | |
| 233 | + | |
226 | 234 | | |
227 | 235 | | |
228 | 236 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
| 9 | + | |
13 | 10 | | |
14 | 11 | | |
15 | 12 | | |
| |||
132 | 129 | | |
133 | 130 | | |
134 | 131 | | |
135 | | - | |
| 132 | + | |
| 133 | + | |
136 | 134 | | |
137 | 135 | | |
138 | 136 | | |
| |||
0 commit comments