From d41a6ba3b439c042ff0d27efd93a39cdb00d0536 Mon Sep 17 00:00:00 2001 From: Pranav Puranam Date: Wed, 8 May 2024 11:52:43 -0700 Subject: [PATCH 1/7] use spreadsheet data instead of hardcoded --- next.config.js | 7 +++++++ pages/about.js | 24 +++++++++++++++++++++--- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/next.config.js b/next.config.js index c4f4e9d4..29fa2c53 100644 --- a/next.config.js +++ b/next.config.js @@ -15,6 +15,13 @@ module.exports = { 'jcfp.site', 'photos.google.com', 'photos.app.goo.gl', + 't4.ftcdn.net', + 'ca.slack-edge.com', + 'www.acmcyber.com', + 'www.bliu.tech', + 'r2dev2.github.io', + 'media.licdn.com', + 'github.com', ], }, target: 'serverless', diff --git a/pages/about.js b/pages/about.js index b0a91693..20bb7950 100644 --- a/pages/about.js +++ b/pages/about.js @@ -6,17 +6,35 @@ import React from 'react'; import Banner from '../components/Banner'; import Layout from '../components/Layout'; import Officers from '../components/OfficerCard'; +// import Officers from '../components/Officers/OfficerCard'; import SocialMedia from '../components/SocialMedia'; -import data from '../data'; import acmCommittees from '../public/images/acm_committees.png'; import boardcollage from '../public/images/boardcollage.png'; import acmHowToJoin from '../public/images/how-to-join.png'; import initiative from '../public/images/initiative.png'; import styles from '../styles/pages/About.module.scss'; +import newData from '../scripts/offoutput.json'; + +// should filter both the names for about along with put data in the right format +function extractContent(officerContent) { + const includedOfficers = ['Nyla Zia', 'Meryl Mathew', 'Larry Zhi', 'Jenna Wang', 'Shiyu Ye', 'Gregor MacDonald', 'Maxine Wu', 'Nemi Desai', + 'Sananshi Pidyar', 'William Zhao', 'Joanna Liu', 'Aaron Kwan', 'Jason An', 'Savannah Alanis', 'Leroy Betterton Gage', + 'Vera Peker', 'Natalie Lord', 'Tiffany Zheng', 'Edward Ng']; + const convertedData = officerContent.map(officer => ({ + name: officer.name, + pronouns: officer.pronouns, + position: officer.role, + committee: officer.committee, + major: officer.major, + year: officer.year, + img: officer.photo, + })).filter(officer => includedOfficers.includes(officer.name)); + return convertedData; +} function About() { - const { leadership } = data; + const convD = extractContent(newData); return ( Our President and Internal/External Vice Presidents support the entire ACM community while our committee presidents foster the growth of their committee.

- +
From 6e7ad474f510691d3f48c7da3c31dd588fc2c5de Mon Sep 17 00:00:00 2001 From: Pranav Puranam Date: Wed, 8 May 2024 18:47:31 -0700 Subject: [PATCH 2/7] filter by officer name --- pages/about.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pages/about.js b/pages/about.js index 20bb7950..2ae8501c 100644 --- a/pages/about.js +++ b/pages/about.js @@ -14,12 +14,11 @@ import boardcollage from '../public/images/boardcollage.png'; import acmHowToJoin from '../public/images/how-to-join.png'; import initiative from '../public/images/initiative.png'; import styles from '../styles/pages/About.module.scss'; -import newData from '../scripts/offoutput.json'; +import data from '../scripts/offoutput.json'; -// should filter both the names for about along with put data in the right format function extractContent(officerContent) { const includedOfficers = ['Nyla Zia', 'Meryl Mathew', 'Larry Zhi', 'Jenna Wang', 'Shiyu Ye', 'Gregor MacDonald', 'Maxine Wu', 'Nemi Desai', - 'Sananshi Pidyar', 'William Zhao', 'Joanna Liu', 'Aaron Kwan', 'Jason An', 'Savannah Alanis', 'Leroy Betterton Gage', + 'Sananshi Pidyar', 'William Zhao', 'Joanna Liu', 'Aaron Kwan', 'Jason An', 'Savannah Alanis', 'Leroy Betterton Gage', 'Vera Peker', 'Natalie Lord', 'Tiffany Zheng', 'Edward Ng']; const convertedData = officerContent.map(officer => ({ name: officer.name, @@ -34,7 +33,7 @@ function extractContent(officerContent) { } function About() { - const convD = extractContent(newData); + const convD = extractContent(data); return ( Date: Wed, 29 May 2024 16:02:46 -0700 Subject: [PATCH 3/7] modified about page to use parser script --- next.config.js | 3 --- pages/about.js | 8 +++----- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/next.config.js b/next.config.js index 29fa2c53..609e627d 100644 --- a/next.config.js +++ b/next.config.js @@ -16,10 +16,7 @@ module.exports = { 'photos.google.com', 'photos.app.goo.gl', 't4.ftcdn.net', - 'ca.slack-edge.com', 'www.acmcyber.com', - 'www.bliu.tech', - 'r2dev2.github.io', 'media.licdn.com', 'github.com', ], diff --git a/pages/about.js b/pages/about.js index 2ae8501c..41ae4817 100644 --- a/pages/about.js +++ b/pages/about.js @@ -14,21 +14,19 @@ import boardcollage from '../public/images/boardcollage.png'; import acmHowToJoin from '../public/images/how-to-join.png'; import initiative from '../public/images/initiative.png'; import styles from '../styles/pages/About.module.scss'; + import data from '../scripts/offoutput.json'; function extractContent(officerContent) { - const includedOfficers = ['Nyla Zia', 'Meryl Mathew', 'Larry Zhi', 'Jenna Wang', 'Shiyu Ye', 'Gregor MacDonald', 'Maxine Wu', 'Nemi Desai', - 'Sananshi Pidyar', 'William Zhao', 'Joanna Liu', 'Aaron Kwan', 'Jason An', 'Savannah Alanis', 'Leroy Betterton Gage', - 'Vera Peker', 'Natalie Lord', 'Tiffany Zheng', 'Edward Ng']; const convertedData = officerContent.map(officer => ({ name: officer.name, pronouns: officer.pronouns, - position: officer.role, + position: (officer.role === officer.committee ? officer.role : officer.role + ', ' + officer.committee), committee: officer.committee, major: officer.major, year: officer.year, img: officer.photo, - })).filter(officer => includedOfficers.includes(officer.name)); + })).filter(officer => officer.position.includes('President')); return convertedData; } From 5edbbd1a10e3d3823043aac56393da8befa73fa4 Mon Sep 17 00:00:00 2001 From: Pranav Puranam Date: Wed, 29 May 2024 16:24:13 -0700 Subject: [PATCH 4/7] modify import path --- pages/about.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/about.js b/pages/about.js index 41ae4817..7c8b9ee8 100644 --- a/pages/about.js +++ b/pages/about.js @@ -8,6 +8,7 @@ import Layout from '../components/Layout'; import Officers from '../components/OfficerCard'; // import Officers from '../components/Officers/OfficerCard'; import SocialMedia from '../components/SocialMedia'; +import data from '../offoutput.json'; import acmCommittees from '../public/images/acm_committees.png'; import boardcollage from '../public/images/boardcollage.png'; @@ -15,7 +16,6 @@ import acmHowToJoin from '../public/images/how-to-join.png'; import initiative from '../public/images/initiative.png'; import styles from '../styles/pages/About.module.scss'; -import data from '../scripts/offoutput.json'; function extractContent(officerContent) { const convertedData = officerContent.map(officer => ({ From f901aa25d145199e7a7812aedd0c57a2812b7876 Mon Sep 17 00:00:00 2001 From: Pranav Puranam Date: Wed, 29 May 2024 16:26:36 -0700 Subject: [PATCH 5/7] modify data import path --- pages/about.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/about.js b/pages/about.js index 7c8b9ee8..72471dd6 100644 --- a/pages/about.js +++ b/pages/about.js @@ -8,8 +8,8 @@ import Layout from '../components/Layout'; import Officers from '../components/OfficerCard'; // import Officers from '../components/Officers/OfficerCard'; import SocialMedia from '../components/SocialMedia'; -import data from '../offoutput.json'; +import data from '../offoutput.json'; import acmCommittees from '../public/images/acm_committees.png'; import boardcollage from '../public/images/boardcollage.png'; import acmHowToJoin from '../public/images/how-to-join.png'; From f95981ad2a3a0c0666e76f6b41ae3b33311a721e Mon Sep 17 00:00:00 2001 From: Pranav Puranam Date: Wed, 29 May 2024 16:28:11 -0700 Subject: [PATCH 6/7] modify import path --- pages/about.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/about.js b/pages/about.js index 72471dd6..7c8b9ee8 100644 --- a/pages/about.js +++ b/pages/about.js @@ -8,8 +8,8 @@ import Layout from '../components/Layout'; import Officers from '../components/OfficerCard'; // import Officers from '../components/Officers/OfficerCard'; import SocialMedia from '../components/SocialMedia'; - import data from '../offoutput.json'; + import acmCommittees from '../public/images/acm_committees.png'; import boardcollage from '../public/images/boardcollage.png'; import acmHowToJoin from '../public/images/how-to-join.png'; From b91bf96ccb60cd643180f38df285e63cdcabaad9 Mon Sep 17 00:00:00 2001 From: Pranav Puranam Date: Wed, 29 May 2024 19:22:13 -0700 Subject: [PATCH 7/7] better variable name --- pages/about.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/about.js b/pages/about.js index 7c8b9ee8..ed11fda0 100644 --- a/pages/about.js +++ b/pages/about.js @@ -31,7 +31,7 @@ function extractContent(officerContent) { } function About() { - const convD = extractContent(data); + const filteredOfficers = extractContent(data); return ( Our President and Internal/External Vice Presidents support the entire ACM community while our committee presidents foster the growth of their committee.

- +