Skip to content

Commit

Permalink
Add special events team
Browse files Browse the repository at this point in the history
Welcome, Special Events team!
  • Loading branch information
EthanThatOneKid committed Nov 1, 2022
1 parent 1585bec commit da7f644
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 4 deletions.
6 changes: 6 additions & 0 deletions src/lib/public/board/data/teams.json
Expand Up @@ -23,6 +23,12 @@
"picture": "/assets/badges/ai-team.svg",
"color": "var(--acm-emerald)"
},
{
"title": "Special Events",
"id": "special-events",
"picture": "/assets/badges/special-events-team.svg",
"color": "var(--acm-yellow)"
},
{
"title": "General",
"id": "general",
Expand Down
34 changes: 30 additions & 4 deletions src/lib/server/events/ical.ts
Expand Up @@ -346,12 +346,38 @@ export function makeClubEvent(

const summary = produceSummary(title, description, selfLink);

const rawAcmPath = variables.get('ACM_PATH')?.toLowerCase();
/**
* Team ID hosting the event is stored in the description. If it's not there,
* it's a "general" event.
*
* We check the variable name `ACM_TEAM` first, then fall back to `ACM_PATH` which is deprecated.
* We expect new events to use `ACM_TEAM` and ancient events to use `ACM_PATH`.
*/
const teamId = (variables.get('ACM_TEAM') ?? variables.get('ACM_PATH'))?.toLowerCase().trim();

let team = TEAMS.general;
if (rawAcmPath === TEAMS.algo.id) team = TEAMS.algo;
else if (rawAcmPath === TEAMS.design.id) team = TEAMS.design;
else if (rawAcmPath === TEAMS.dev.id) team = TEAMS.dev;
switch (teamId) {
case 'ai': {
team = TEAMS.ai;
break;
}
case 'algo': {
team = TEAMS.algo;
break;
}
case 'design': {
team = TEAMS.design;
break;
}
case 'dev': {
team = TEAMS.dev;
break;
}
case 'special-events': {
team = TEAMS['special-events'];
break;
}
}

const thirdPartyCalendarLocation = location === 'Discord' ? selfLink : location;
const thirdPartyCalendarArgs = [
Expand Down
4 changes: 4 additions & 0 deletions static/assets/badges/special-events-team.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit da7f644

Please sign in to comment.