Add organization pages #28
Labels
No labels
bug
chore
data
feature
frontend
good first issue
intermediate
needs/docs
needs/research
needs/upstream
type/bug
type/external
type/feature
type/refactor
urgency
high
urgency
immediate
urgency
low
urgency
medium
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ScottyLabs/cal#28
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Clubs have no home on CMUCal. Add
/orgs/[id]pages with the club's name, description, and upcoming events, and make club names on event cards link there.What you'll learn
A full-stack feature: a Flask route with a SQLAlchemy query, and a Next.js page that calls it.
Resources
Where to start
api/app/api/organizations.py,get_organization_data(GET /api/organizations/org/<id>,@public): returns name, type, categories, and every occurrence grouped by category, but no description and no date filter. Reuse its active-calendar-source filter.GET /api/organizations/<int:org_id>/summary, marked@public, returningname,description,type, and the next 20EventOccurrencerows withstart_datetime >= now, ordered by start, filtered and limited in SQL.api/app/api/events.py,get_all_events: Explore results only haveorg_id. AddOrganization.nameasorg_name(the query already joinsEvent.org).web/src/app/orgs/[id]/page.tsx: new page. Add a client helper inweb/src/app/utils/api/organizations.ts.web/src/app/components/SearchResultSidebar.tsxandEventPopover.tsx: link the org name withnext/link.Done when
/orgs/<id>shows name, description, and upcoming events, with an empty state when there are noneNotes
Do not reuse
GET /api/events/by_org/<id>. It readsev.all_dayandev.updated_at, which do not exist onEvent, so it fails whenever an org has events. With the tag filter,get_all_eventsgroups byEvent.id, so addOrganization.idto thatgroup_bywhen you select the name.