Conversation
What was broken The earlier PM-4988 fix hid project edit affordances in the projects list and blocked the edit route, but copilot users could still see the pencil edit link in project-scoped page headers such as Challenges, Users, and Assets. Root cause Those header title actions still used the broader project management permission check. Copilot project membership is allowed by that helper for other write flows, but project detail editing requires the narrower Full Access edit check. What was changed Updated the project header edit links on the Challenges, Users, and Assets tabs to render only when the loaded project passes checkCanEditProjectDetails. Kept the existing broader manage permission for non-detail workflows such as member, asset, challenge, and billing notice behavior. Any added/updated tests Added page coverage for hiding the project header edit link when a copilot can manage the project but cannot edit project details, and for keeping the link visible when detail editing is allowed.
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 was broken
The earlier PM-4988 fix hid project edit affordances in the projects list and blocked the edit route, but copilot users could still see the pencil edit link in project-scoped page headers such as Challenges, Users, and Assets.
Root cause
Those header title actions still used the broader project management permission check. Copilot project membership is allowed by that helper for other write flows, but project detail editing requires the narrower Full Access edit check.
What was changed
Updated the project header edit links on the Challenges, Users, and Assets tabs to render only when the loaded project passes checkCanEditProjectDetails. Kept the existing broader manage permission for non-detail workflows such as member, asset, challenge, and billing notice behavior.
Any added/updated tests
Added page coverage for hiding the project header edit link when a copilot can manage the project but cannot edit project details, and for keeping the link visible when detail editing is allowed.
Validation run
PASS: yarn test:no-watch src/apps/work/src/pages/challenges/ChallengesListPage/ChallengesListPage.spec.tsx src/apps/work/src/pages/assets/ProjectAssetsPage/ProjectAssetsPage.spec.tsx src/apps/work/src/pages/users/UsersManagementPage/UsersManagementPage.spec.tsx
PASS: yarn lint
PASS: yarn run build
FAIL: yarn test:no-watch still fails in the existing src/apps/work/src/pages/challenges/ChallengeEditorPage/components/ChallengeEditorForm.spec.tsx suite. The repeated failures are budget-approval launch expectations, for example launch tests now receive "Challenge launch is blocked until budget approval is Approved." instead of calling patchChallenge or returning the older billing/AI workflow messages. This suite also fails when run by itself and is outside the PM-4988 project header edit scope.