Add Edit button to the standalone prop page#134
Merged
Conversation
The standalone prop page (/props/[propId]) — used for props whose forecasting window is closed — already had a Resolve affordance but no way to edit. Mirror the Resolve pattern: add an Edit button that opens the existing PropEditDialog, gated on a canEdit check that covers system admins, competition admins (when the prop belongs to a competition), and personal-prop owners.
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.
Summary
Follow-up to #133 — adds an Edit button to the standalone prop page at
/props/[propId], which is used when forecasting on a prop is closed. That page already had aResolvebutton but no way to edit, so competition admins still couldn't edit closed props from the UI.Changes
app/props/[propId]/prop-page-header.tsx— accept a newcanEditprop and render an Edit button (mirroring the existing Resolve button) that opens the existingPropEditDialog.app/props/[propId]/page.tsx— computecanEditto match the RLS policy: system admin OR competition admin (when the prop belongs to a competition) OR the prop's owner. Looks up the user's competition role viagetCurrentUserRoleonly when the prop has acompetition_id.Test plan
npx tsc --noEmitcleannpm run lint— no new errorsnpx vitest run— 192 tests passhttps://claude.ai/code/session_013LjY2hYrqzHmZi4fmYxyTz
Generated by Claude Code