--- title: Add league-event nav links for SuperAdmin & Coordinator ---
Add league-event nav links for SuperAdmin & Coordinator
Goal
Surface per-league-event tools in the sidebar for SuperAdmin and Coordinator personas (and Referee where relevant). Today the "League" group only exposes top-level pages (League Admin, Coordinator, Schedule, Leaderboard, Referee Console/Courts, Athletes & Parents, Dashboard, Parents Guide). The per-event surfaces — League Hub (), Welcome Invites (), Schedule Print, Leaderboard Print, Reactions (), and Live View () — are reachable only via deep links. SuperAdmin/Coordinator should be able to jump to them straight from the sidebar once a league is selected.
Scope of work
1. Active-league hook (mirrors pattern). - Add to state. Source it from a new server endpoint OR (cheaper) from a client-side query on that picks the most-recent in-progress league the user is a coordinator/superadmin on. - Persist the SuperAdmin/Coordinator's last selected league in localStorage so the chosen league survives reloads. - Add a flag to analogous to . The filter hides items with this flag when no active league is set. - URL templating: extend the substitution in to also substitute and (from ) so the registry can store canonical templated paths.
2. Add the new league-event nav items to .
| key | title | url | personas | flags | |-----|-------|-----|----------|-------| | | League Hub | | SUPERADMIN, COORDINATOR | requiresActiveLeague | | | Welcome Invites | | SUPERADMIN, COORDINATOR | — | | | Reactions | | SUPERADMIN, COORDINATOR | requiresActiveLeague | | | Schedule (Print) | | SUPERADMIN, COORDINATOR | — | | | Leaderboard (Print) | | SUPERADMIN, COORDINATOR | — | | | Live View | | SUPERADMIN, COORDINATOR, REFEREE | requiresActiveLeague |
All items belong to the existing group with , so they appear on the league host AND under the sub-tree on the academy host (the league-prefix-stripping logic already handles both contexts).
3. Active-league picker UI in the sidebar (SuperAdmin/Coordinator only). - Small at the top of the "League" group listing the user's leagues (from filtered by their coordinator/superadmin access). Selecting a league sets and triggers the nav re-render so items unlock. - Default selection: most-recently-modified league the user has access to.
4. Tests. - Extend with cases for (visible when set, hidden when null). - Extend to assert that flows through from the API mock. - Update the sidebar fixture renderer to substitute so the resolved URL of becomes .
5. Verification. - Manual smoke on both academy host (sidebar shows League group with new items under ) and league host (links resolve to unprefixed routes via the existing prefix-strip logic in ). - Run .
Files to touch
flag to interface.
add localStorage persistence, optional query.
- — extend URL templating for and
; render the active-league above the League group; apply the filter. - -
Out of scope
- New backend endpoints. We reuse the existing GET. If a
dedicated "active league for current user" endpoint is preferred, raise a follow-up task.
- Coach/Athlete/Parent personas — the user explicitly asked for SuperAdmin
and Coordinator. keeps Referee because that page is already used by the referee console flow.
Acceptance
- SuperAdmin and Coordinator both see the 6 new items in the League group
on the league domain (and under on academy domain).
- Items flagged are hidden until a league is
selected via the new picker.
- Selecting a league populates (and for
) in the rendered sidebar links.
- All existing nav tests still pass; new test cases for
and resolution pass.
No comments:
Post a Comment