refractor: Make TeamPage settings tabs and admin-access extensible#2374
Draft
teeohhem wants to merge 1 commit into
Draft
refractor: Make TeamPage settings tabs and admin-access extensible#2374teeohhem wants to merge 1 commit into
teeohhem wants to merge 1 commit into
Conversation
Extract two small extension points out of TeamPage into @/extensions/teamSettings: - useTeamSettingsTabs(baseTabs): transforms the settings tab/section list before render (default: identity). - useTeamAdminAccess(): whether the current user can administer the team, gating the team-name edit affordance (default: always allowed). TeamPage builds its base tabs and passes them through the transform, and reads admin access via the hook. No behavior change — the defaults preserve current behavior. This makes the team-settings page composable and testable without editing the page itself. No resolution plumbing needed: @/extensions/* already resolves to src/extensions/* via the existing tsconfig/jest/next config.
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
E2E Test Results✅ All tests passed • 189 passed • 3 skipped • 1255s
Tests ran across 4 shards in parallel. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Extracts two small extension points out of
TeamPageinto@/extensions/teamSettings:useTeamSettingsTabs(baseTabs)— transforms the settings tab/section list before render (default: identity).useTeamAdminAccess()— whether the current user can administer the team, gating the team-name edit affordance (default: always allowed).TeamPagebuilds its base tabs, passes them through the transform, and reads admin access via the hook.Why
The team-settings page is a single component that mixes tab composition, admin gating, and rendering. Pulling the composition + admin-access decisions behind small, well-typed seams makes the page composable and testable without editing it directly, and keeps future tab/section additions out of the page body.
Behavior
No behavior change. The default implementations (identity transform, always-allowed admin) preserve current behavior exactly. No resolution plumbing needed —
@/extensions/*already resolves tosrc/extensions/*via the existing tsconfig/jest/next config.Validation
yarn ci:lint✅ (lint + tsc + stylelint)yarn ci:unit✅ (1752 passed)Draft for review.