Repository navigation
feat(frontend): proposer edits projects - #399
Merged
Merged
Conversation
…ts review ProjectService.Delete let a proposer delete their project at any status, through the project-scoped Owner role Propose grants them, which nothing ever revokes. Once an organiser has approved or rejected a project, it is the hackathon's: its proposer may still edit it, but no longer delete it. Delete now checks the organiser's hackathon-level project:write first, which still passes at any status, and only then falls back to the proposer's project role, refusing it with PermissionDenied unless the project is still proposed. Edit is unchanged and already lets the proposer edit at every status. New specs pin that down for an approved and a rejected project, alongside the two that refuse the proposer's delete.
A proposer could edit their project only while it awaited review. Once an organiser approved or rejected it, the edit page answered 403 and the Projects page offered no Edit. The backend never had that rule: ProjectService.Edit accepts the proposer's project role at every status. projectEditData now lets the proposer through whatever the status, which drops the TODO waiting on the backend, and the Projects page offers Edit on every row the viewer proposed: each of their proposals, and their own approved projects. On a proposal row, Edit sits beside More Info instead of replacing it, since a rejected row's page is where the reason is read. Editing does not change a project's status.
A proposer had no steady way back to their own projects. Their proposals sat in a group on the Projects page that disappears once the owners stop taking proposals, and an approved project of theirs was just one row among the others. The hackathon sidebar now offers "My projects" right under Projects to a confirmed participant who proposed at least one project. It leads to a page listing every one of them, at any status, newest first, each with More Info and Edit. Neither the entry nor the page depends on the phase or on the propose capability. One helper, myProjects, decides both, so the entry never leads to an empty page. It goes through the participant row rather than the role: an owner who proposed without joining as a participant gets no entry, and manages their proposals from Manage Projects. The layout counts off the projects hackathon.get already returns, so this adds no backend call.
Reverts 421619a. Who may delete a project after review is a backend decision, and it is now tracked as its own ticket rather than made here. This pull request stays frontend-only: it relies on ProjectService.Edit accepting the proposer at any status, which main already does. Also drops the line in projectEdit.ts that described the reverted rule.
The Projects page offered Edit in two places: on each of the viewer's proposals, and on their own approved projects. With My projects now listing all of them at every status, Edit there was a second way to reach the same form, offered on some rows of a shared list and not on others. Edit now lives on My projects alone, and an owner edits from Manage Projects. The Projects page keeps the proposals group as a read-only list, and drops the isMine row flag that only gated the button.
A project card named its author only when that person was still in the member list. An organiser who proposed without joining their own hackathon holds no member row, so their projects showed no author on the Projects page and on the project's own page. My projects left the author out on purpose. The Projects page and both project detail pages now find names among the owners as well as the members, as Manage Projects already did, and My projects passes the author too, so every card reads the same. ProjectCard's creator and ProjectDetail's proposer are now required, so no future list can forget them. Where an author cannot be found at all, the card says "Unknown author" instead of leaving the line out.
"More Info" undersold the page it opens, which holds the full description and, for a rejected project, the organiser's reason. On My projects it also sat oddly beside Edit. The link on every project card now reads View; Manage Projects keeps its own "Review". Only the text changes. ProjectCard's moreInfoHref and moreInfoLabel props keep their names.
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.
A participant finds and edits their own projects in one place
Before: Participants who proposed a project had no reliable way back to it. A participant could edit a proposal only until an organiser reviewed it.
Now the hackathon menu offers them My projects, a page listing everything they proposed, at any status, each with View and Edit.
Every project card and project page now shows its author, including organisers. who never joined their own hackathon. The card link reads View instead of "More Info".
What changed where
/my/hackathon/[id]/projects/mine/my/hackathon/[id]/projectsmain, the viewer's pending proposals had an Edit link in place of More Info). Organisers who never joined are named as authors. Link reads View.…/projects/[projectId]/editmainthis returned a 403.…/projects/[projectId]…/projects/manage…/projects/manage/[projectId]Docs: new participant guide
member-my-projects.md, added to the participant index.member-projects.mdno longer mentions Edit and points to My projects instead.Notes
backend ticket. The docs screenshot of the Projects page is out of date.