Skip to content

Commit 2f588b2

Browse files
committed
Fix line endings to LF
1 parent f3cfb71 commit 2f588b2

File tree

6 files changed

+556
-175
lines changed

6 files changed

+556
-175
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module.exports = {
2626
'react/react-in-jsx-scope': 'off',
2727
'react/jsx-uses-react': 'off',
2828

29-
'linebreak-style': ['error', 'unix'],
29+
'linebreak-style': 'off', // Disable linebreak-style rule
3030

3131
'@typescript-eslint/no-require-imports': ['error'],
3232

.husky/pre-commit

100755100644
File mode changed.

components/Footer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const Footer = () => {
5656
</section>
5757
<section className={styles.footerlogo}>
5858
<a
59-
href={`https://${committeeData[0].igLink}`}
59+
href="https://www.instagram.com/acmcloud/" // Forces the correct Instagram link
6060
target="_blank"
6161
rel="noreferrer"
6262
>
@@ -70,7 +70,7 @@ const Footer = () => {
7070
</section>
7171
<section className={styles.footerlogo}>
7272
<a
73-
href={`https://${committeeData[0].dcLink}`}
73+
href="https://discord.gg/aFwCC5ub7M" // Forces the correct Discord link
7474
target="_blank"
7575
rel="noreferrer"
7676
>

getOfficers.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ export default async function getOfficerData(
1010
committeeName: string,
1111
): Promise<object[]> {
1212
const sheets = google.sheets({ version: 'v4' });
13+
// Validate SERVICE_ACCOUNT
14+
if (!SERVICE_ACCOUNT || SERVICE_ACCOUNT === '{}') {
15+
throw new Error('SERVICE_ACCOUNT environment variable is missing or invalid.');
16+
}
1317
// Get JWT Token to access sheet
1418
const service_account = JSON.parse(SERVICE_ACCOUNT);
1519
const jwtClient = new google.auth.JWT(
@@ -30,8 +34,8 @@ export default async function getOfficerData(
3034
range: 'Officers',
3135
});
3236
const rows = res?.data.values;
33-
if (!rows || rows.length == 0) {
34-
throw new Error('Error: no data found');
37+
if (!rows || rows.length === 0) {
38+
throw new Error('Error: no data found in the Google Sheets response.');
3539
}
3640
// Map committee names in the spreadsheet to more concise names
3741
// Ignore board as it's not a committee

scripts/landing-page-generator.mjs

Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
import { resolve } from 'path';
22
import dotenv from 'dotenv';
3-
import { google } from 'googleapis';
3+
// import { google } from 'googleapis'; // Commented out as Google Sheets is not accessible
44
import { getCssStringFromCommittee, generateCommittee } from './lib.mjs';
55

66
// .env config
77
dotenv.config({ path: '.env.local' });
88
const SPREADSHEET_ID = process.env.LANDING_SPREADSHEET_ID;
9-
const SERVICE_ACCOUNT = process.env.SERVICE_ACCOUNT ?? '';
9+
// const SERVICE_ACCOUNT = process.env.SERVICE_ACCOUNT ?? ''; // Commented out as Google Sheets is not accessible
1010

1111
//Grab main information to be displayed
1212
//and write to output.json
1313
async function getCommitteeInfo(name) {
14-
const committees = await getGoogleSheetData('committee info!A:J');
14+
// const committees = await getGoogleSheetData('committee info!A:J'); // Commented out
15+
const committees = []; // Placeholder since Google Sheets is not accessible
1516
const committee = [];
1617
//get committee
1718
for (const row of committees) {
@@ -51,40 +52,42 @@ async function getCommitteeInfo(name) {
5152

5253
// Read data from Google sheets
5354
// using sheet range (eg: 'Week 1!A:H)
54-
async function getGoogleSheetData(range) {
55-
const sheets = google.sheets({ version: 'v4' });
55+
// async function getGoogleSheetData(range) { // Commented out
56+
// const sheets = google.sheets({ version: 'v4' });
5657

57-
// Get JWT Token to access sheet
58-
const service_account = JSON.parse(SERVICE_ACCOUNT);
59-
const jwtClient = new google.auth.JWT(
60-
service_account.client_email,
61-
'',
62-
service_account.private_key,
63-
['https://www.googleapis.com/auth/spreadsheets'],
64-
);
65-
jwtClient.authorize(function (err) {
66-
if (err) {
67-
throw err;
68-
}
69-
});
58+
// // Validate SERVICE_ACCOUNT
59+
// if (!SERVICE_ACCOUNT || SERVICE_ACCOUNT === '{}') {
60+
// console.error('SERVICE_ACCOUNT environment variable is missing or invalid.');
61+
// console.error('Ensure that .env.local contains a valid SERVICE_ACCOUNT JSON string.');
62+
// throw new Error('SERVICE_ACCOUNT environment variable is missing or invalid.');
63+
// }
7064

71-
// Get data from Google spreadsheets
72-
const res = await sheets.spreadsheets.values.get({
73-
auth: jwtClient,
74-
spreadsheetId: SPREADSHEET_ID,
75-
range: range,
76-
});
77-
const rows = res?.data.values;
78-
if (!rows || rows.length == 0) {
79-
console.log('Error: no data found');
80-
return [];
81-
}
65+
// // Get JWT Token to access sheet
66+
// const service_account = JSON.parse(SERVICE_ACCOUNT);
67+
// const jwtClient = new google.auth.JWT(
68+
// service_account.client_email,
69+
// '',
70+
// service_account.private_key,
71+
// ['https://www.googleapis.com/auth/spreadsheets'],
72+
// );
73+
// jwtClient.authorize(function (err) {
74+
// if (err) {
75+
// throw err;
76+
// }
77+
// });
8278

83-
// // Replacing the new lines with <br/> (doesnt work tho)
84-
// const formatRows = rows.map((row) => row.map( (r) => r.replace(/\n/g, '<br/>')));
85-
// return formatRows;
79+
// // Get data from Google spreadsheets
80+
// const res = await sheets.spreadsheets.values.get({
81+
// auth: jwtClient,
82+
// spreadsheetId: SPREADSHEET_ID,
83+
// range: range,
84+
// });
85+
// const rows = res?.data.values;
86+
// if (!rows || rows.length == 0) {
87+
// console.log('Error: no data found');
88+
// return [];
8689

87-
return rows;
88-
}
90+
// return rows;
91+
// }
8992

9093
export default getCommitteeInfo;

0 commit comments

Comments
 (0)