Northeastern-Electric-Racing / Northeastern-Electric-Racing/FinishLine
[Maintenance] - Lead Calendar
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 36
- Forks
- 9
- Avg merge
- 4d 21h
- Merged PRs (30d)
- 11
Description
Description
Create a Lead Only calendar named "Lead" where Leads and above can see the calendar and only Admins and above can schedule events of type "Lead".
This is a complex ticket.
Acceptance Criteria
- All roles lead and above can see the calendar
- Only Admins+ can add the "Lead" event type (The event type is not expected to be created, only the schema preset. Admins will create it on Finishline)
Proposed Solution
- Start with changing the
Calendarschema to includeisLeadCalendar
isLeadCalendar Boolean @default(false)
- Next add
onlyAdminsOrAboveForEventCreationto theEvent_Typeschema
onlyAdminsOrAboveForEventCreation Boolean
- In
calendar.service.ts, add a gate filter in thegetAllCalendarsfunction to check forisLeadCalendarand return that calendar only if the user is a lead - In
AdminToolsScheduleConfig.tsx, add the isLeadCalendar within the TableCells similar to this:
<TableCell align="center">
{calendar.isNewMemberCalendar && <CheckIcon fontSize="small" color="success" />}
</TableCell>
- In
EventTypeFormModal.tsxensure to includeonlyAdminsOrAboveindefaultValuesas well to add it to any shared types for the event types/form values - In
CalendarModal.tsx, make sure to add inisLeadCalendarto the Calendar shared type and form values. Also add it generally anywhere you seeisNewMemberCalendar. Use discretion. - In
createEventTypewithincalendar.service.tsas well, add the paramonlyAdminsOrAbove. Look for any other references of this being used throughout the codebase and make sure they are accounted for. - In
getFilteredEventswithincalendar.service.ts, make sure to filtereventTypeIdsto exclude any event type ids withonlyAdminsOrAboveto only be returned if the member is lead or above (This sounds very counterintuitive but I have a plan for an epic later that will fix this problem) - Make sure to add
isLeadCalendarto the calendar transformer andonlyAdminsOrAbove(or whatever you choose to name it consistently) to the event type transformer (You should have already added them to the types in shared earlier on - In
EventModal.tsx, make sure to filterallowedEventTypesthe same asonlyHeadsOrAboveForEventCreationfilters it - In
createEventwithincalendar.service.ts, makes sure to copy all logic gates foronlyHeadsOrAboveForEventCreationwithonlyAdminsOrAboveForEventCreation.
No response
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the existing onlyHeadsOrAboveForEventCreation handling in calendar.service.ts, EventModal.tsx, and the shared calendar and event-type types. Then review the schema changes and the listed CalendarModal.tsx, AdminToolsScheduleConfig.tsx, and transformer paths. Done means Lead visibility and Admin-only event creation are enforced consistently across the stated acceptance criteria.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend, databases, frontend, full-stack
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100