feat: Update /admin to list/add/edit Organizers. Add "Change Organizer" to Events Dashboard. Clarify when "Overview" sidebar heading relates to Events -v- Organizer 🤖#1187
Open
mrjbj wants to merge 2 commits intoHiEventsDev:developfrom
Conversation
…nagement - Event organizer is now editable post-creation via a Select in Event Settings and a "Change Organizer" button on the event layout (next to "Share Event"), routed through a new ChangeEventOrganizerModal - New /admin/organizers superadmin page lists organizers across all accounts with search, click-through to the organizer dashboard, and a Create Organizer button - Sidebar group headings disambiguated: "Overview" -> "Event Overview" / "Organizer Overview" - Backend: UpdateEventDTO/Handler/Request now accept organizer_id; same-account validation enforced via OrganizerFetchService, with 422 returned when the target organizer belongs to another account - New GET /admin/organizers endpoint (SUPERADMIN-gated) plus AdminOrganizerResource, repository method, and handler/DTO - 4 new unit tests cover reassignment, no-op when omitted, no-op when unchanged, and cross-account rejection - Translations added for 14 new strings across all 14 supported non-Russian locales Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The event settings form binds to eventQuery.data.organizer_id, but the API only returned the nested organizer relationship — so the Organizer Select did not restore the saved value on refresh. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
What changes I've made
1. Events Page: Reassign organizer
Two entry points, both end-user-facing (no superadmin needed):
SwitchOrganizerModalbut performs anUpdateEventmutation instead of navigating.2. Superadmin /admin/organizers page
New entry in the admin sidebar between Users and Events, modelled directly on the existing admin Users page:
/manage/organizer/{id}so the superadmin can use the existing organizer dashboard / settings flow to editCreateOrganizerModal. An info banner clarifies that creation is scoped to the superadmin's own account; to create in another account, impersonate a user there first.3. Sidebar disambiguation
The sidebar group header
Overviewappeared identically on both the event sidebar and the organizer sidebar, with no visual cue of which scope you were in. Renamed:Overview→Event OverviewOverview→Organizer OverviewBackend changes
Services/Application/Handlers/Event/DTO/UpdateEventDTO.php?int $organizer_id = nullHttp/Request/Event/UpdateEventRequest.phpunset-ingorganizer_id; now['sometimes', 'integer']Services/Application/Handlers/Event/UpdateEventHandler.phporganizer_idis set and differs from current, callsOrganizerFetchService::fetchOrganizer($id, $accountId)(existing service, same pattern asCreateEventHandler); throwsOrganizerNotFoundExceptionif cross-accountHttp/Actions/Events/UpdateEventAction.phpOrganizerNotFoundException→ returns clean 422 withorganizer_idfield errorModels/Organizer.phpaccount()belongsTo relationshipRepository/Eloquent/OrganizerRepository.php+ interfacegetAllOrganizersForAdmin(?string $search, int $perPage): LengthAwarePaginator, eager-loadsaccountandorganizer_settings, search by name/email/account nameHttp/Actions/Admin/Organizers/GetAllOrganizersAction.php(new)Role::SUPERADMINgated, identical structure toGetAllUsersActionServices/Application/Handlers/Admin/GetAllOrganizersHandler.php+ DTO (new)Resources/Organizer/AdminOrganizerResource.php(new)routes/api.phpGET /admin/organizersrouteWhy I've made these changes
Today an event's
organizer_idis set at creation and cannot be changed. There is no UI or API path to move an event between organizer brands within the same account.I hit this in practice: I created an event while impersonating another user in my account, but the event landed under the default organizer (the one tied to my own user) rather than the organizer associated with the impersonated user's brand. The event's public page therefore showed the wrong brand. The only way to fix it was a direct DB update.
Separately, organizer management has poor discoverability — organizers only appear inside
SwitchOrganizerModal, never as a dedicated page, and superadmins have no cross-account view of organizers analogous to the existing Users / Accounts / Events admin pages.How I've tested these changes
Tests
backend/tests/Unit/Services/Application/Handlers/Event/UpdateEventHandlerTest.php(new) — 4 cases:reassigns_organizer_when_organizer_id_provided_and_differentdoes_not_include_organizer_id_when_omitted(regression guard for previous behavior)does_not_reassign_when_organizer_id_matches_current(no wasted writes)rejects_cross_account_organizer(security boundary)Full Unit suite: 357 passed, 0 failures (only the existing 1 deprecated + 1 skipped). Pint clean on all new files.
Translations
14 new strings, translated into 14 locales: de, es, fr, hu, it, nl, pl, pt, pt-br, se, tr, vi, zh-cn, zh-hk. ru intentionally untouched (matches existing project convention — that catalog is largely empty and the project does not require ru parity).
Checklist
(https://github.com/HiEventsDev/hi.events/blob/develop/CONTRIBUTING.md) and if this PR template is left unedited.