Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multiple positions per term per officer #996

Merged
merged 5 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,175 changes: 226 additions & 949 deletions src/lib/public/board/data/officers.json

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions src/lib/public/board/data/teams.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"title": "General",
"description": "General ACM team member.",
"logoSrc": "/assets/badges/general-badge.svg",
"oldLogoSrc": "/assets/badges/old-badges/general-old.svg",
"color": "var(--acm-blue)",
"tiers": [0, 1, 2, 3, 4, 5, 6, 7, 31]
},
Expand All @@ -20,6 +21,7 @@
"title": "Algo",
"description": "Algo team member.",
"logoSrc": "/assets/badges/logo/algo-logo.svg",
"oldLogoSrc": "/assets/badges/old-badges/algo-badge-old.svg",
"color": "var(--acm-purple)",
"tiers": [11, 12]
},
Expand All @@ -28,6 +30,7 @@
"title": "Design",
"description": "Design team member.",
"logoSrc": "/assets/badges/logo/design-logo.svg",
"oldLogoSrc": "/assets/badges/old-badges/create-badge-old.svg",
"color": "var(--acm-pink)",
"tiers": [13, 14, 15, 16]
},
Expand All @@ -36,14 +39,15 @@
"title": "Dev",
"description": "Dev team member.",
"logoSrc": "/assets/badges/logo/dev-logo.svg",
"oldLogoSrc": "/assets/badges/old-badges/dev-badge-old.svg",
"color": "var(--acm-bluer)",
"tiers": [17, 18, 19]
},
{
"id": "gamedev",
"title": "Game Dev",
"description": "Game Dev team member.",
"logoSrc": "/assets/badges/gamedev-badge.svg",
"logoSrc": "/assets/badges/logo/gamedev-logo.svg",
"color": "var(--acm-red)",
"tiers": [22, 23]
},
Expand All @@ -69,13 +73,13 @@
"description": "Open Source Software team member. We create and maintain open source projects pertaining to ACM at CSUF.",
"logoSrc": "/assets/badges/logo/oss-logo.svg",
"color": "var(--acm-turquoise)",
"tiers": []
"tiers": [32, 33]
},
{
"id": "special-events",
"title": "Special Events",
"description": "Special Events team member.",
"logoSrc": "/assets/badges/special-events-badge.svg",
"logoSrc": "/assets/badges/logo/special-events-logo.svg",
"color": "var(--acm-lemon)",
"tiers": [24, 25]
},
Expand Down
4 changes: 3 additions & 1 deletion src/lib/public/board/data/tiers.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,7 @@
"Workshop Manager": { "id": 28, "index": 1450 },
"Intern Program Manager": { "id": 29, "index": 1500 },
"Community Manager": { "id": 30, "index": 1550 },
"ICC Representative": { "id": 31, "index": 1600 }
"ICC Representative": { "id": 31, "index": 1600 },
"Open Source Software Team Lead": { "id": 32, "index": 1650 },
"Open Source Software Officer": { "id": 33, "index": 1700 }
}
3 changes: 2 additions & 1 deletion src/lib/public/board/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export interface Officer {
fullName: string;
picture?: string;
positions: {
[key in Term]?: Position;
[key in Term]?: Position[];
};
socials?: {
[key in Social]?: string;
Expand All @@ -82,5 +82,6 @@ export interface Team {
description?: string;
color: string;
logoSrc: string;
oldLogoSrc?: string;
tiers?: number[];
}
18 changes: 13 additions & 5 deletions src/lib/public/board/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,24 @@

return members
.filter((member) => {
const position = member.positions[term];
if (!position) {
const positions = member.positions[term];
if (!positions) {
return false;
}

return tierIDs.some((tierID) => tierID === position.tier);
return tierIDs.some((tierID) => positions.some((position) => position.tier === tierID));
})
.sort((a, b) => {
const aTier = getTierByID(a.positions[term]!.tier)!;
const bTier = getTierByID(b.positions[term]!.tier)!;
const aTier = getTierByID(
Math.min(
...a.positions[term]!.map(({ tier }) => tier).filter((tier) => tierIDs.includes(tier))

Check warning on line 49 in src/lib/public/board/utils.ts

View workflow job for this annotation

GitHub Actions / website_check (16.x)

Forbidden non-null assertion
)
) || { index: 0 };
const bTier = getTierByID(
Math.min(
...b.positions[term]!.map(({ tier }) => tier).filter((tier) => tierIDs.includes(tier))

Check warning on line 54 in src/lib/public/board/utils.ts

View workflow job for this annotation

GitHub Actions / website_check (16.x)

Forbidden non-null assertion
)
) || { index: 0 };
return aTier.index - bTier.index;
});
}
Expand Down
45 changes: 27 additions & 18 deletions src/routes/(site)/6/teams/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import { TEAMS } from '$lib/public/board/data';
import { VISIBLE_TERMS } from '$lib/public/board/data/terms';
import { termIndex } from '$lib/public/board/utils';
import { TextAlignment } from '$lib/public/text-alignment/text-alignment';
import Spacing from '$lib/public/legacy/spacing.svelte';
import TeamSection from './team-section.svelte';
import Select from '$lib/components/select/select.svelte';
Expand Down Expand Up @@ -42,7 +41,7 @@
<Spacing --min="100px" --med="125px" --max="125px" />
</section>

<TeamSection info={TEAMS.general} textAlign={TextAlignment.RIGHT} term={VISIBLE_TERMS[$termIndex]}>
<TeamSection info={TEAMS.general} term={VISIBLE_TERMS[$termIndex]}>
<p slot="content" class="size-md">
The ACM <span class="brand-blue brand-em">general</span> team is a dynamic group of individuals
driving the success of our organization. ACM <span class="brand-blue brand-em">General</span>
Expand All @@ -51,11 +50,7 @@
</p>
</TeamSection>

<TeamSection
info={TEAMS.marketing}
textAlign={TextAlignment.RIGHT}
term={VISIBLE_TERMS[$termIndex]}
>
<TeamSection info={TEAMS.marketing} term={VISIBLE_TERMS[$termIndex]}>
<p slot="content" class="size-md">
The <span class="brand-blush brand-em">marketing</span> team has a strong passion towards
advertising and spreading word on all our ACM events.
Expand All @@ -64,7 +59,7 @@
</p>
</TeamSection>

<TeamSection info={TEAMS.algo} textAlign={TextAlignment.RIGHT} term={VISIBLE_TERMS[$termIndex]}>
<TeamSection info={TEAMS.algo} term={VISIBLE_TERMS[$termIndex]}>
<p slot="content" class="size-md">
The <span class="brand-purple brand-em">algorithm</span> team is dedicated to building
programming fundamentals within students. <span class="brand-purple brand-em">Algo</span> focuses
Expand All @@ -73,7 +68,7 @@
</p>
</TeamSection>

<TeamSection info={TEAMS.design} textAlign={TextAlignment.RIGHT} term={VISIBLE_TERMS[$termIndex]}>
<TeamSection info={TEAMS.design} term={VISIBLE_TERMS[$termIndex]}>
<p slot="content" class="size-md">
The <span class="brand-pink brand-em">design</span> team is dedicated to emphasizing the
importance of product design and product management in the tech industry.
Expand All @@ -82,7 +77,7 @@
</p>
</TeamSection>

<TeamSection info={TEAMS.dev} textAlign={TextAlignment.RIGHT} term={VISIBLE_TERMS[$termIndex]}>
<TeamSection info={TEAMS.dev} term={VISIBLE_TERMS[$termIndex]}>
<p slot="content" class="size-md">
The <span class="brand-bluer brand-em">development</span> team is dedicated to giving students
the opportunity to explore tech via hands-on projects and activities.
Expand All @@ -91,20 +86,33 @@
</p>
</TeamSection>

<TeamSection info={TEAMS.ai} textAlign={TextAlignment.RIGHT} term={VISIBLE_TERMS[$termIndex]}>
<TeamSection info={TEAMS.ai} term={VISIBLE_TERMS[$termIndex]}>
<p slot="content" class="size-md">
The <span class="brand-emerald brand-em">artificial intelligence</span> is dedicated to
The <span class="brand-emerald brand-em">artificial intelligence</span> team is dedicated to
providing accessible information about artificial intelligence and machine learning to all.
<span class="brand-emerald brand-em">AI</span> focuses on fun projects geared towards beginners in
the field.
</p>
</TeamSection>

<!-- TODO: GameDev -->
<TeamSection info={TEAMS['gamedev']} term={VISIBLE_TERMS[$termIndex]}>
<p slot="content" class="size-md">
The <span class="brand-red brand-em">game development</span> team is dedicated to teaching the
basics of programming in the gaming industry. <span class="brand-red brand-em">Gamedev</span> focuses
on educating students about design principles, design tools, and the development process of a project.
</p>
</TeamSection>

<!-- TODO: Special Events -->
<TeamSection info={TEAMS['special-events']} term={VISIBLE_TERMS[$termIndex]}>
<p slot="content" class="size-md">
The <span class="brand-lemon brand-em">special events</span> team is all about creating
unforgettable moments and experiences. <span class="brand-lemon brand-em">Special Events</span> plan
and execute ex citing events that bring our community together, fostering connections and celebrating
shared passions.
</p>
</TeamSection>

<TeamSection info={TEAMS.nodebuds} textAlign={TextAlignment.RIGHT} term={VISIBLE_TERMS[$termIndex]}>
<TeamSection info={TEAMS.nodebuds} term={VISIBLE_TERMS[$termIndex]}>
<p slot="content" class="size-md">
Personalized for your success, <span class="brand-red brand-em">node buds</span> is our exclusive
program in partnership with ACM-W that exposes students to various opportunities that encourage connection,
Expand All @@ -114,8 +122,7 @@
</p>
</TeamSection>

<!-- TODO: ICPC? -->
<TeamSection info={TEAMS.icpc} textAlign={TextAlignment.RIGHT} term={VISIBLE_TERMS[$termIndex]}>
<TeamSection info={TEAMS.icpc} term={VISIBLE_TERMS[$termIndex]}>
<p slot="content" class="size-md">
The <span class="brand-orange brand-em"
>Intercollegiate Competitive Programming Competition</span
Expand All @@ -126,7 +133,7 @@
</p>
</TeamSection>

<TeamSection info={TEAMS.oss} textAlign={TextAlignment.RIGHT} term={VISIBLE_TERMS[$termIndex]}>
<TeamSection info={TEAMS.oss} term={VISIBLE_TERMS[$termIndex]}>
<p slot="content" class="size-md">
The <span class="brand-turquoise brand-em">open source software</span> team is committed to
fostering collaboration and innovation in the tech community.
Expand All @@ -135,6 +142,8 @@
</p>
</TeamSection>

<Spacing --min="100px" --med="125px" --max="125px" />

<style>
p {
align-self: start;
Expand Down
13 changes: 3 additions & 10 deletions src/routes/(site)/6/teams/members.svelte
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
<script lang="ts">
import type { Team, Term } from '$lib/public/board';
import { OFFICERS_JSON } from '$lib/public/board/data';
import { getMembers } from '$lib/public/board';
import type { Officer, Term } from '$lib/public/board';
import OfficerProfile from '../../about/officer-profile.svelte';

export let data: {
term: Term;
team: Team;
};

$: members = getMembers(OFFICERS_JSON, data.term, data.team.tiers);
export let data: { members: Officer[]; term: Term };
</script>

<section class="team">
<ul>
{#each members as member (member.fullName + data.term)}
{#each data.members as member (member.fullName + data.term)}
<li>
<OfficerProfile info={member} />
</li>
Expand Down
Loading
Loading