Skip to content

AO3-4930 Remove Invited collection participant role - #6007

Open
pmonfort wants to merge 1 commit into
otwcode:masterfrom
pmonfort:AO3-4930
Open

AO3-4930 Remove Invited collection participant role#6007
pmonfort wants to merge 1 commit into
otwcode:masterfrom
pmonfort:AO3-4930

Conversation

@pmonfort

Copy link
Copy Markdown
Contributor

Pull Request Checklist

Issue

https://otwarchive.atlassian.net/browse/AO3-4930

Purpose

Removes the "Invited" collection participant role, which had no real purpose.

The only code path that acted on it was CollectionParticipantsController#join a participant with the Invited role who clicked "Join" was promoted to Member. In practice this almost never happened, because nothing in the codebase ever assigns the Invited role, adding someone from the participants page already creates them directly as a Member. The only way to reach the flow was for a maintainer to add a user and then manually change their role to "Invited" in the dropdown.

Changes:

  • CollectionParticipant: remove the INVITED constant, the "Invited" option from the role dropdown, and is_invited?.
  • Collection#invited and User#invited_collections: re
  • CollectionParticipantsController#join: remove the branch that accepted invitations. Joining a collection you already participate in now always shows "You have already joined (or applied to) this collection."
  • Add the After:remove_invited_collection_participant_role task to convert any existing Invited rows to None ("applied to join").
  • Remove the "preapprove a user" Cucumber scenario and the controller spec for the invited path; add specs for the after task and for "Invited" no longer being a valid role.

After Deploy Steps

  1. Run the after task before deploying the code:

    bundle exec rake After:remove_invited_collection_parti

It converts any remaining Invited collection participants to None and prints the number of rows updated. It is idempotent and safe to re-run.

  1. Ordering matters: once the new code is live, Invited is no longer an allowed participant_role. Any leftover row would fail validation ("That is not a valid participant role.") when a maintainer edits that participant, and the role dropdown on the participants page would have no selected option for them.

  2. No schema change, no index change, no reindex needed. Safe to include in a regular release.

  3. Rollback: revert the code only. Converted rows stay as None, which is a valid role in both versions.

Testing Instructions

  1. As a collection owner, go to the collection's Participants page.
  2. Check the role dropdown for any participant: it should list None, Member, Moderator and Owner only.
  3. Add a new participant via the "participants_to_invite" field: they should be added as a Member, as before.
  4. As a user who has already applied to (or is a member of) a moderated collection, press "Join" on the collection page: you should see "You have already joined (or applied to) this collection."
  5. As a user who is not yet a participant, press "Join": you should see "You have applied to join …", as before.

Credit

Pablo Monfort (he/him)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants