Skip to content

Conversation

@axu-1
Copy link
Collaborator

@axu-1 axu-1 commented Jun 30, 2025

This PR adds the frontend interface to support the organization roster feature, with backend previously reviewed/tested in #712.

User stories for this pull request:

Students:

  • Can view an organization and its join type from the organizations page.
  • Can join or apply using the button found on the detailed info card.
  • Can view the roster and search for members using the search field unless the roster is empty, in which case the roster will not appear.
  • Can view exec board members in the details card (those with non "Member" titles).
  • Can leave.
  • Can view event cards for an organization right below details.

Admin:

  • Can change the join type of an application between open, apply and close, which will auto reject/accept if it changes from apply to another mode.
  • Can accept or reject applications in an admin only view tab of the roster, which will update the roster instantly.
  • Can edit the title or admin privilege of a member. Edit view opens a dialog to make the changes, but they are not saved until the user hits save to prevent mistaken operations.
  • Can create events that are then visible from the event card.

Major changes (frontend)

Added an organization roster service which handles the HTTP CRUD requests of memberships.
Added an organization roster widget which uses the service and includes logic for accept/reject/update/delete memberships.
All dirty state is managed internally, only the final save button sends the service request to the backend.
Added a dialog to support the editor interface.
Injected the roster service into the organization detail card to support joining, leaving and viewing exec of an organization.
Added an event carousel component to display the events of an organization.

What is not supported:

Functional avatars and navigating to profiles
Batch membership updates for titles or admin perms
Batch accepts or rejects (can be possible with small change)
Granular permissions and/or premade types of club positions
Editing or using the term of the membership for any additional logic (don't have a good user story defined for what a user would want to/should do with it)

This PR was the combined work of Anika Ahmed, Alex Feng, Amy Xu, Alanna Zhang during FA24 COMP423 and SP25. I have added as much attribution as I remember, but it can be changed depending on the guidelines for credit. I apologize for the delay in getting this PR open!

alfeng22 and others added 30 commits November 11, 2024 17:01
* Fix Queue Sort Order (#640)

* Added sort to queued tickets by start time

* Fix sorted order for students view

* Replace login icon, show "Sign In" text on mobile over icon (#637)

Replaces the "login" icon with "account_circle" on all devices, and
hides the icon on mobile/thin screens (width < 766px).
Also includes multiple toolbar changes to account for the width.

* Update dependencies to avoid broken build (#642)

This commit updates angular to latest security releases.
It also updates dompurify, for markdown, to not use latest version
which breaks the build.

* Prepare TA Applications for Spring 2025 (#641)

* Work on Spring 2025 TA Applications (#643)

* Prepare TA Applications for Spring 2025

* Fix Another Date Field

* Add Application Date Start / End Editor for Terms (#644)

* Prepare TA Applications for Spring 2025

* Fix Another Date Field

* Add Application Start / End Editing

---------

Co-authored-by: Ajay Gandecha <[email protected]>
Co-authored-by: Andy Chan <[email protected]>
Co-authored-by: Kris Jordan <[email protected]>
* Create design_doc.md

* Update design_doc.md

* Update design_doc.md
* Create organization member entity and pydantic models

* Fix relationship between Organization and User entities

* Create organization roster widget

* Add organization api calls

* Rename OrganizationMember to OrganizationMembership for clarity

* Updated roster display based on current organization

* Add GET API for organization roster
Adds OrganizationMembership JS object to represent a single membership and creates a GET method to get a list of memberships, representing a roster for a club.

* Add OrganizationMembership model and entity to init files

* Update add_member_to_org backend api path

* Import user profile models and adjust resolver model to support members field

* Remove dummy data for WIP roster display

* Add organization roster resolver to access service methods

* Add fake test data and fix add_member

* Update membership model to reflect backend no longer passing entire org object

* Test for getting organization roster

* Change add_member endpoint ResponseModel

* Link resolver to TS component

---------

Co-authored-by: anikaahmed114 <[email protected]>
Co-authored-by: axfng <[email protected]>
Co-authored-by: Amy Xu <[email protected]>
* Fix Queue Sort Order (#640)

* Added sort to queued tickets by start time

* Fix sorted order for students view

* Replace login icon, show "Sign In" text on mobile over icon (#637)

Replaces the "login" icon with "account_circle" on all devices, and
hides the icon on mobile/thin screens (width < 766px).
Also includes multiple toolbar changes to account for the width.

* Update dependencies to avoid broken build (#642)

This commit updates angular to latest security releases.
It also updates dompurify, for markdown, to not use latest version
which breaks the build.

* Prepare TA Applications for Spring 2025 (#641)

* Work on Spring 2025 TA Applications (#643)

* Prepare TA Applications for Spring 2025

* Fix Another Date Field

* Add Application Date Start / End Editor for Terms (#644)

* Prepare TA Applications for Spring 2025

* Fix Another Date Field

* Add Application Start / End Editing

* Update Office Hours pre-reservation policy (#645)

Shifting hours for a TA and fixing a miscoded reservation.

* Remove Comma That Broke Everything (#646)

* Pin all versions to minor releases (#648)

---------

Co-authored-by: Ajay Gandecha <[email protected]>
Co-authored-by: Andy Chan <[email protected]>
Co-authored-by: Kris Jordan <[email protected]>
* Updated roster styling and membership role display

* Refactor API into separate organization roster service

Instead of placing organization roster management in the same code as organization details, it will be moved into its own service and injected in separately. This makes it easier to modify and expand to add filtering/editing logic and decouples it from the responsibility of fetching org metadata, which is fairly static and unrelated.

This involves refactoring roster API methods into a separate OrganizationRoster service file.

The details widget now passes org/user info and the service into the roster so that it can filter/perform operations within itself.

The roster must still be fetched in the parent in case we eventually want to display membership on the details card or not render the roster for empty/non-rostered clubs (CS Dept). The service must also be present so we can join from the details page.

* Add POST membership API method

Fix backend API route to not include member_id

* Add join button linked to API calls

Add a join button that when clicked will add the current user to the roster. This does not yet refresh the view.

* Add Body to backend imports to support request body parameters

* Add error-trapping for add and remove member endpoints

* Test all organization membership service functions

* Add temporary user-facing error to frontend for joining an already joined organization

---------

Co-authored-by: anikaahmed114 <[email protected]>
Co-authored-by: Alanna423 <[email protected]>
* Add initial tech specs document
Add a work-in-progress edition of the tech specs

* Update tech specs document

* Edit org roster's getting started for backend files

---------

Co-authored-by: Alanna423 <[email protected]>
* Add DELETE API and methods to remove one or more members from an organization

* Create api and service to change member role

* Added editable roster interface

* Update organization entity and model, create join type model, update demo data

* Create pending status for organization role, update add member service call to support different organization join types

* Refactor join status into MembershipRole and update tests

* Accept membership requests

* Change organization join type

* Fix organization tests

* Create and implement roster filter pipe

* Added member request view

* Af/backend update member role 23 (#29)

* Create api and service to change member role

* Update organization entity and model, create join type model, update demo data

* Create pending status for organization role, update add member service call to support different organization join types

* Refactor join status into MembershipRole and update tests

* Accept membership requests

* Change organization join type

* Fix organization tests

* Create and implement roster filter pipe

---------

Co-authored-by: axfng <[email protected]>
Co-authored-by: Alanna423 <[email protected]>

* Created organization join request page

* Added edit join type UI

* Af/backend update member role 23 (#30)

* Create api and service to change member role

* Update organization entity and model, create join type model, update demo data

* Create pending status for organization role, update add member service call to support different organization join types

* Refactor join status into MembershipRole and update tests

* Accept membership requests

* Change organization join type

* Fix organization tests

* Create and implement roster filter pipe

---------

Co-authored-by: axfng <[email protected]>
Co-authored-by: Alanna423 <[email protected]>

* Link delete API to frontend UI

* Add update API and link to frontend
Fix backend enum definition to accept roles as strings

* Add join type editing functionality

* Authorization backend

* Admin permissions frontend

---------

Co-authored-by: Amy Xu <[email protected]>
Co-authored-by: axfng <[email protected]>
Co-authored-by: anikaahmed114 <[email protected]>
Co-authored-by: Alexander Feng <[email protected]>
* Add DELETE API and methods to remove one or more members from an organization

* Create api and service to change member role

* Added editable roster interface

* Update organization entity and model, create join type model, update demo data

* Create pending status for organization role, update add member service call to support different organization join types

* Refactor join status into MembershipRole and update tests

* Accept membership requests

* Change organization join type

* Fix organization tests

* Create and implement roster filter pipe

* Added member request view

* Af/backend update member role 23 (#29)

* Create api and service to change member role

* Update organization entity and model, create join type model, update demo data

* Create pending status for organization role, update add member service call to support different organization join types

* Refactor join status into MembershipRole and update tests

* Accept membership requests

* Change organization join type

* Fix organization tests

* Create and implement roster filter pipe

---------

Co-authored-by: axfng <[email protected]>
Co-authored-by: Alanna423 <[email protected]>

* Created organization join request page

* Added edit join type UI

* Af/backend update member role 23 (#30)

* Create api and service to change member role

* Update organization entity and model, create join type model, update demo data

* Create pending status for organization role, update add member service call to support different organization join types

* Refactor join status into MembershipRole and update tests

* Accept membership requests

* Change organization join type

* Fix organization tests

* Create and implement roster filter pipe

---------

Co-authored-by: axfng <[email protected]>
Co-authored-by: Alanna423 <[email protected]>

* Link delete API to frontend UI

* Add update API and link to frontend
Fix backend enum definition to accept roles as strings

* Add join type editing functionality

* Authorization backend

* Admin permissions frontend

* View roster's edit button only with admin permissions

* Update tech spec document for SP02

* Fix roster button disabled/initial states for better user flow
Disable save/remove buttons unless form is dirty
Initialize chip with current role

* Refactor update membership to only update memberships that have been changed

* Show accepted requests on roster tab without refreshing

* Auto accept/reject existing requests when join type is changed
No longer display pending members in roster tab

* Edit profile interface to add organizations field

* Update user details to return names of organizations joined

* Edited join button type

* Added button for closed organization join type

* Join button immediately reflects changes of joining/applying

* Update demo data

* Join button only disables if the user successfully joins/applies

* Revert demo data

* Use first letter of name for roster

---------

Co-authored-by: axfng <[email protected]>
Co-authored-by: anikaahmed114 <[email protected]>
Co-authored-by: Alanna423 <[email protected]>
Co-authored-by: Alexander Feng <[email protected]>
* Fix Queue Sort Order (#640)

* Added sort to queued tickets by start time

* Fix sorted order for students view

* Replace login icon, show "Sign In" text on mobile over icon (#637)

Replaces the "login" icon with "account_circle" on all devices, and
hides the icon on mobile/thin screens (width < 766px).
Also includes multiple toolbar changes to account for the width.

* Update dependencies to avoid broken build (#642)

This commit updates angular to latest security releases.
It also updates dompurify, for markdown, to not use latest version
which breaks the build.

* Prepare TA Applications for Spring 2025 (#641)

* Work on Spring 2025 TA Applications (#643)

* Prepare TA Applications for Spring 2025

* Fix Another Date Field

* Add Application Date Start / End Editor for Terms (#644)

* Prepare TA Applications for Spring 2025

* Fix Another Date Field

* Add Application Start / End Editing

* Update Office Hours pre-reservation policy (#645)

Shifting hours for a TA and fixing a miscoded reservation.

* Remove Comma That Broke Everything (#646)

* Pin all versions to minor releases (#648)

---------

Co-authored-by: Ajay Gandecha <[email protected]>
Co-authored-by: Andy Chan <[email protected]>
Co-authored-by: Kris Jordan <[email protected]>
Use custom titles and admin toggle instead of discrete roles and permissions
Move service one level higher to reflect shared use across components
Add modal dialog to be used when editing memberships
axu-1 added 6 commits June 29, 2025 20:20
Add joining and leaving methods and buttons to access them
Change membership editing logic in widget to reflect new schema
Added for files that did not exist prior, or to which roster related business logic was added.
@axu-1 axu-1 linked an issue Jun 30, 2025 that may be closed by this pull request
8 tasks
@axu-1 axu-1 requested a review from KrisJordan June 30, 2025 01:21
@ItIsAndrewL ItIsAndrewL self-requested a review August 5, 2025 18:48
@ItIsAndrewL
Copy link
Collaborator

So sorry I'm just now seeing this you all! I'll put a reminder to review this PR by the end of this weekend! Thanks for finishing this!

@ItIsAndrewL ItIsAndrewL added the feature New feature or request label Aug 5, 2025
@ajaygandecha ajaygandecha changed the title Organization Memberships and Roster Management feat(community): organization memberships and roster management Aug 17, 2025
@ajaygandecha
Copy link
Member

@ItIsAndrewL / @axu-1 apologies for the delay here, we are pausing this PR for now due to larger refactors!

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

Labels

feature New feature or request REQUIRES MIGRATION

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Organization Memberships to the CSXL Site

8 participants