Skip to content

Added multi admin support for event creation and editing#2114

Merged
maernest04 merged 2 commits into
devfrom
ernest_ma/allow_admin_editing
May 2, 2026
Merged

Added multi admin support for event creation and editing#2114
maernest04 merged 2 commits into
devfrom
ernest_ma/allow_admin_editing

Conversation

@maernest04

@maernest04 maernest04 commented Apr 29, 2026

Copy link
Copy Markdown
Collaborator

PR for #2113

Problem

For SCEvents, event creation allowed admins to create and edit their own events but there was no way for other admins to be able to edit events they didn't create. There should be a way for the event's original creator to add and remove admins who can edit their event.

Solution

Added a multi-admin picker UI to both the Create Event and Edit Event pages. Admins can search for other admins by name or email and add/remove them from the event. A new backend endpoint POST /api/User/admins/validate resolves stored admin IDs into user objects so the edit page can display names and emails instead of raw IDs.

Files Changed

File Change
src/Pages/Events/CreateEventPage.js Multi-admin picker UI, sends admins array in payload
src/Pages/Events/EditEventPage.js Multi-admin picker UI, admin ID resolution, self-removal warning
src/APIFunctions/User.js validateEventAdmins frontend API function
api/main_endpoints/routes/User.js POST /admins/validate endpoint
test/api/User.js Tests for /admins/validate

Screenshots

Event Admin section of event creation and editing

Screenshot 2026-04-28 at 9 30 35 PM

Searching for any person to add as an event admin (admin and officers only, there's multiple users with the email test but only the admin shows up

Screenshot 2026-04-28 at 9 30 43 PM

Warning when attempting to remove every event admin, including themselves

Screenshot 2026-04-28 at 9 31 20 PM

Warning when attempting to save changes after removing themselves as event admin

Screenshot 2026-04-28 at 9 31 33 PM

Adding every officer and admin as an event admin

Screenshot 2026-05-01 at 11 52 57 PM

@steeevin88 steeevin88 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. can you add some screenshots to show what the UI looks like?
  2. CI is failing, let's fix this
  3. from my (albeit brief) understanding, this code only allows us to add Clark admins as event admins, but realistically, we should allow... any person? how much more complicated would this be, i know admins is already a lot of code 😅 thought this would be a simpler change apologies

Comment thread api/main_endpoints/routes/User.js
Comment thread api/main_endpoints/routes/User.js
Comment thread api/main_endpoints/routes/User.js Outdated
Comment thread src/Pages/Events/EditEventPage.js Outdated
Comment thread src/Routes.js
Comment thread src/APIFunctions/User.js Outdated

@steeevin88 steeevin88 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some more small stuff

Comment thread src/Pages/Events/EditEventPage.js Outdated
Comment thread src/Pages/Events/CreateEventPage.js Outdated
Comment thread src/Routes.js
Comment thread src/Routes.js
@maernest04 maernest04 force-pushed the ernest_ma/allow_admin_editing branch from ff9adb6 to eb8a0ba Compare May 2, 2026 06:25
- Added ability to add and remove admins from access to editing an event
- Added admin search to search through all available admins
- Added endpoints to check admin IDs
- Added warnings when adding or removing admins, including removing themselves

Added ability to add any user as event admin

- Changed route to allow any authenticated user to edit avents
- User search and admin validation now support any user like non officer users (members or non members)
- Removed site wide admin / officer role checks for the event management UI

Fixed admin validate test

Changed event admin to officers and admins

- Modified events page behind officer or admin routes (should change when SCEvents becomes public)
- added officers only parameter when searching for event admins to add
- Fixed issue where officers were removed from the list of event admins

Fixed admin validation test

Changed officers only boolean flag with a min role flag

Added a 'give edit perms' button to event creation and editing

- Add SCEvents field : when true,  stays empty and officers/site admins may edit
@maernest04 maernest04 force-pushed the ernest_ma/allow_admin_editing branch from eb8a0ba to a6de346 Compare May 2, 2026 07:00

@steeevin88 steeevin88 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small nit but loks fine, thanks!

Comment thread src/Pages/Events/CalendarView.js Outdated

function getRegistrationCta(event) {
const registrationStatus = event?.registration_status || 'none';
function getRegistrationStatus(event) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need this helper, let's just write it inline

@c1ndytat c1ndytat left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wordle wordle wordle

@maernest04 maernest04 merged commit bf52b4a into dev May 2, 2026
4 checks passed
@maernest04 maernest04 deleted the ernest_ma/allow_admin_editing branch May 2, 2026 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants