Skip to content

Commit

Permalink
Finegrained roles per team
Browse files Browse the repository at this point in the history
  • Loading branch information
julianweng committed May 15, 2024
1 parent 4a133a0 commit 042614d
Show file tree
Hide file tree
Showing 160 changed files with 1,321 additions and 811 deletions.
40 changes: 29 additions & 11 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,21 +74,34 @@ const createPostPages = (posts, createPage) => {
* @param {import("gatsby/index.d.ts").CreateSchemaCustomizationArgs}
*/
exports.createSchemaCustomization = ({ actions, schema }) => {
const { createTypes } = actions
const { createTypes } = actions;
const typeDefs = `
type MembersJson implements Node {
team: [TeamsJson] @link(by: "name")
teamRoles: [TeamRole]
posts: [MarkdownRemark] @link(by: "frontmatter.authors.pennkey", from: "pennkey")
}
type AlumniJson implements Node {
teamRoles: [TeamRole]
posts: [MarkdownRemark] @link(by: "frontmatter.authors.pennkey", from: "pennkey")
}
type TeamRole {
team: TeamsJson @link(by: "name", from: "team")
roles: [String]
}
type MarkdownRemark implements Node {
frontmatter: Frontmatter
}
type Frontmatter {
authors: [MembersJson] @link(by: "pennkey")
customExcerpt: String
publishedAt: Date @dateformat(formatString: "YYYY-MM-DD")
draft: Boolean
}`
}`;

const teamsJson = schema.buildObjectType({
name: 'TeamsJson',
interfaces: ['Node'],
Expand All @@ -98,22 +111,27 @@ exports.createSchemaCustomization = ({ actions, schema }) => {
},
members: {
type: '[MembersJson]',
resolve: (source, args, context, info) => {
return context.nodeModel.runQuery({
resolve: async (source, args, context, info) => {
const members = await context.nodeModel.runQuery({
type: 'MembersJson',
query: {
filter: {
team: { elemMatch: { name: { eq: source.name } } },
teamRoles: { elemMatch: { team: { name: { eq: source.name } } } },
},
},
})
});
return members.map(member => ({
...member,
roles: member.teamRoles.filter(role => role.team === source.name)[0].roles,
}));
},
},
},
})
createTypes(typeDefs)
createTypes([teamsJson])
}
});

createTypes(typeDefs);
createTypes([teamsJson]);
};

exports.createPages = async ({ graphql, actions, reporter }) => {
const { createPage, createRedirect } = actions
Expand Down
13 changes: 4 additions & 9 deletions src/components/Team/TeamMemberPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,8 @@ const Image = styled(BackgroundImage)`
border-radius: ${BORDER_RADIUS};
`

export const TeamMemberPreview = ({
name,
roles,
pennkey,
localImage,
semester_joined: semesterJoined,
alumnus,
}: IMember) => (
export const TeamMemberPreview = ({ name, roles, pennkey, localImage, semesterJoined}: IMember): React.ReactElement => {
return (
<Col margin={M2} sm={12} md={6} lg={3} key={pennkey}>
<StyledLink to={TEAM_MEMBER_ROUTE(pennkey)}>
{
Expand All @@ -68,4 +62,5 @@ export const TeamMemberPreview = ({
)}
</StyledLink>
</Col>
)
)
}
6 changes: 3 additions & 3 deletions src/components/Team/Teams.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { ITeam, IMember } from '../../types'
import { ITeam, IMember, ITeamMember } from '../../types'
import { Fade, Section, H2, Row, Col, P } from '../../shared'
import { M2 } from '../../constants/measurements'
import { TeamMemberPreview } from './TeamMemberPreview'
Expand All @@ -10,7 +10,7 @@ interface ITeams {

const TEAM_LEAD = 'Team Lead'

const leadsFirst = (members: IMember[]): IMember[] => {
const leadsFirst = (members: ITeamMember[]): ITeamMember[] => {
if (!members) return []

return members.sort((m1, m2): number => {
Expand Down Expand Up @@ -39,7 +39,7 @@ export const Teams = ({ teams }: ITeams) => (
</Row>

<Row margin={M2}>
{leadsFirst(members).map((props: IMember) => (
{leadsFirst(members).map((props: ITeamMember) => (
<TeamMemberPreview key={props.pennkey} {...props} />
))}
</Row>
Expand Down
8 changes: 5 additions & 3 deletions src/json/alumni/aanten.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
"school": "College of Arts & Sciences",
"bio": "Hi! I'm a sophomore studying math & CS in the college and an avid proponent of Buffalo Wild Wings.",
"hometown": "Long Island, NY",
"team": "Penn Mobile",
"roles": [
"iOS Mobile Engineer"
"teamRoles": [
{
"team": "Penn Mobile",
"roles": ["iOS Mobile Engineer"]
}
],
"photo": "https://i.imgur.com/i271XGY.jpg",
"linkedin": "https://www.linkedin.com/in/andrew-antenberg/",
Expand Down
9 changes: 6 additions & 3 deletions src/json/alumni/anagwekar.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@
"school": "Engineering",
"bio": "Hey! My name is Ansh Nagwekar, and I am a freshman studying NETS at Penn. Outside the lab, you can probably find me hiking up a mountain, playing spikeball, eating Airheads, or overanalyzing song lyrics!",
"hometown": "San Jose, California",
"team": "Penn Courses",
"roles": ["Backend Engineer"],
"teamRoles": [
{
"team": "Penn Courses",
"roles": ["Backend Engineer"]
}
],
"photo": "https://i.imgur.com/LITbDoC.jpg?1",
"linkedin": "https://www.linkedin.com/in/ansh-nagwekar/",
"website": "",
Expand All @@ -16,4 +20,3 @@
"graduation_year": 2025,
"job": null
}

10 changes: 6 additions & 4 deletions src/json/alumni/annajg.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
"school": "Engineering",
"bio": "My holy trinity consists of painting, pasta, and Percy Jackson. Also a VSCO HB2 enthusiast :)",
"hometown": "Edison, NJ",
"team": "Penn Mobile",
"roles": [
"Designer"
"teamRoles": [
{
"team": "Penn Mobile",
"roles": ["Designer"]
}
],
"photo": "https://i.imgur.com/acetToI.jpg",
"linkedin": "https://www.linkedin.com/in/annasjiang/",
Expand All @@ -17,4 +19,4 @@
"alumnus": true,
"graduation_year": 2023,
"job": null
}
}
10 changes: 6 additions & 4 deletions src/json/alumni/annawang.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
"school": "Engineering",
"bio": "former wii fit user",
"hometown": "Saratoga, CA",
"team": "Penn Mobile",
"roles": [
"Designer"
"teamRoles": [
{
"team": "Penn Mobile",
"roles": ["Designer"]
}
],
"photo": "https://i.imgur.com/QAXyuBW.jpg",
"linkedin": "https://www.linkedin.com/in/annalinwang/",
Expand All @@ -17,4 +19,4 @@
"alumnus": true,
"graduation_year": 2023,
"job": null
}
}
30 changes: 16 additions & 14 deletions src/json/alumni/annipan.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
{
"name": "Anni Pan",
"pennkey": "annipan",
"major": "Computer Science + Mathematics",
"name": "Anna Wang",
"pennkey": "annawang",
"major": "Digital Media Design",
"school": "Engineering",
"bio": "Hi there! I'm a sophomore at Penn studying CIS + MATH. In my free time I can be found playing with my cat, practicing guitar, reading or sleeping ;)",
"hometown": "Nanjing, China",
"team": "Penn Mobile",
"roles": [
"Backend Engineer"
"bio": "former wii fit user",
"hometown": "Saratoga, CA",
"teamRoles": [
{
"team": "Penn Mobile",
"roles": ["Designer"]
}
],
"photo": "https://i.imgur.com/S1kfAT4.jpg",
"linkedin": "https://www.linkedin.com/in/anni-pan-17b95b179/",
"website": "https://annypan.github.io/personal_website/",
"github": "https://github.com/annypan",
"semester_joined": "2021A",
"photo": "https://i.imgur.com/QAXyuBW.jpg",
"linkedin": "https://www.linkedin.com/in/annalinwang/",
"website": "http://annalinwang.com/",
"github": "https://github.com/annalinwang",
"semester_joined": "2019C",
"alumnus": true,
"graduation_year": 2023,
"job": null
}
}
8 changes: 6 additions & 2 deletions src/json/alumni/armaant.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@
"pennkey": "armaant",
"bio": "Hi, I'm Armaan! I'm studying computer science and finance and am the Team Lead for [Platform](https://platform.pennlabs.org/). I'm super interested in Sysadmin and DevOps. If you want to know more about me or any of my recent projects, check out [my website](https://armaan.tobaccowalla.com/)!",
"hometown": "Upper Saddle River, NJ",
"team": "Platform",
"roles": ["Director Emeritus", "Team Lead", "Backend Engineer", "DevOps"],
"teamRoles": [
{
"team": "Platform",
"roles": ["Director Emeritus", "Team Lead", "Backend Engineer", "DevOps"]
}
],
"photo": "https://i.imgur.com/wDkP3rs.jpg",
"linkedin": "https://www.linkedin.com/in/tobaccowallaa/",
"website": "https://armaan.tobaccowalla.com",
Expand Down
10 changes: 6 additions & 4 deletions src/json/alumni/astrike.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
"school": "Engineering",
"bio": "Backend Dev on Penn mobile, CIS Major 2023 :)",
"hometown": "Johannesburg, South Africa",
"team": "Penn Mobile",
"roles": [
"Backend Engineer"
"teamRoles": [
{
"team": "Penn Mobile",
"roles": ["Backend Engineer"]
}
],
"photo": "https://i.imgur.com/lXMeM7y.jpg",
"linkedin": null,
Expand All @@ -17,4 +19,4 @@
"alumnus": true,
"graduation_year": 2023,
"job": null
}
}
10 changes: 6 additions & 4 deletions src/json/alumni/avnia.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
"school": "Engineering",
"bio": "I'm a sophomore studying Comp + Cog Sci and hopefully minoring in Creative Writing. I love movies, food, and playing obscure board games with my siblings :)",
"hometown": "New York City",
"team": "Penn Courses",
"roles": [
"Designer"
"teamRoles": [
{
"team": "Penn Courses",
"roles": ["Designer"]
}
],
"photo": "https://i.imgur.com/V4RclNb.png",
"linkedin": null,
Expand All @@ -17,4 +19,4 @@
"alumnus": true,
"graduation_year": 2022,
"job": null
}
}
9 changes: 6 additions & 3 deletions src/json/alumni/bqle.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@
"school": "Engineering",
"bio": "Hi! I'm a freshman from Vietnam and I'm a backend engineer for OHQ. In my freetime, I like to watch movie summaries and take long walks",
"hometown": "Ho Chi Minh City, Vietnam",
"team": "Office Hours Queue",
"roles": ["Backend Engineer"],
"teamRoles": [
{
"team": "Office Hours Queue",
"roles": ["Backend Engineer"]
}
],
"photo": "https://i.imgur.com/RfPYyuL.jpg",
"linkedin": "https://www.linkedin.com/in/bqle/",
"website": "",
Expand All @@ -16,4 +20,3 @@
"graduation_year": 2025,
"job": null
}

8 changes: 6 additions & 2 deletions src/json/alumni/brandw.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@
"school": "Engineering & Wharton",
"bio": "Hi y’all, I’m Brandon! I’m a freshman studying M&T, and I’m working on DevOps this year. I also love hiking, tennis, and playing Avalon and Catan with friends!",
"hometown": "Plano, TX",
"team": "Platform",
"roles": ["DevOps"],
"teamRoles": [
{
"team": "Platform",
"roles": ["DevOps"]
}
],
"photo": "https://i.imgur.com/x0Qowwv.jpg",
"linkedin": "https://www.linkedin.com/in/brandonzwang/",
"website": "https://www.brandonwang.com/",
Expand Down
35 changes: 18 additions & 17 deletions src/json/alumni/cbaile.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
{
"name": "Baile Chen",
"major": "Computer Science",
"school": "Engineering",
"pennkey": "cbaile",
"bio": "Hi,I am Peter studying Computer Science.",
"hometown": "Hong Kong",
"team": "Office Hours Queue",
"roles": [
"Backend Engineer",
"Frontend Engineer"
"name": "Brandon Wang",
"pennkey": "brandw",
"major": "Computer Science + Finance",
"school": "Engineering & Wharton",
"bio": "Hi y’all, I’m Brandon! I’m a freshman studying M&T, and I’m working on DevOps this year. I also love hiking, tennis, and playing Avalon and Catan with friends!",
"hometown": "Plano, TX",
"teamRoles": [
{
"team": "Platform",
"roles": ["DevOps"]
}
],
"photo": "https://i.imgur.com/LLPmYNK.jpg",
"linkedin": "https://www.linkedin.com/in/peter-chen-ba7847153/",
"website": null,
"github": "https://github.com/peterbaile",
"semester_joined": "2019A",
"photo": "https://i.imgur.com/x0Qowwv.jpg",
"linkedin": "https://www.linkedin.com/in/brandonzwang/",
"website": "https://www.brandonwang.com/",
"github": "https://github.com/brandonwang1/",
"semester_joined": "2020C",
"alumnus": true,
"graduation_year": null,
"graduation_year": 2024,
"job": null
}
}
Loading

0 comments on commit 042614d

Please sign in to comment.