Northeastern-Electric-Racing / Northeastern-Electric-Racing/FinishLine

[Maintenance] - Lead Calendar

Open
#4,519 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

maintenance
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 Calendar schema to include isLeadCalendar
isLeadCalendar      Boolean      @default(false)
  • Next add onlyAdminsOrAboveForEventCreation to the Event_Type schema
onlyAdminsOrAboveForEventCreation Boolean
  • In calendar.service.ts, add a gate filter in the getAllCalendarsfunction to check for isLeadCalendar and 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.tsx ensure to include onlyAdminsOrAbove in defaultValues as well to add it to any shared types for the event types/form values
  • In CalendarModal.tsx, make sure to add in isLeadCalendar to the Calendar shared type and form values. Also add it generally anywhere you see isNewMemberCalendar. Use discretion.
  • In createEventType within calendar.service.ts as well, add the param onlyAdminsOrAbove. Look for any other references of this being used throughout the codebase and make sure they are accounted for.
  • In getFilteredEvents within calendar.service.ts, make sure to filter eventTypeIds to exclude any event type ids with onlyAdminsOrAbove to 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 isLeadCalendar to the calendar transformer and onlyAdminsOrAbove (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 filter allowedEventTypes the same as onlyHeadsOrAboveForEventCreation filters it
  • In createEvent within calendar.service.ts, makes sure to copy all logic gates for onlyHeadsOrAboveForEventCreation with onlyAdminsOrAboveForEventCreation.
    No response

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.