Skip to content

Commit a93d5be

Browse files
committed
fix
1 parent f632c82 commit a93d5be

File tree

9 files changed

+339
-665
lines changed

9 files changed

+339
-665
lines changed

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
npx lint-staged
1+
yarn lint --fix

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# ACM @ UIUC Core
2+
This repository is split into two:
3+
* `src/api/` for the API source code
4+
* `src/ui/` for the UI source code
5+
* `src/common/` for common modules between the two (such as types)

cloudformation/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Resources:
8686
Runtime: nodejs20.x
8787
Description: !Sub "${ApplicationFriendlyName} API Lambda"
8888
FunctionName: !Sub ${ApplicationPrefix}-lambda
89-
Handler: api.lambda.handler
89+
Handler: api/lambda.handler
9090
MemorySize: 512
9191
Role: !GetAtt AppSecurityRoles.Outputs.MainFunctionRoleArn
9292
Timeout: 60

package.json

Lines changed: 107 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
2+
"name": "infra-core",
3+
"version": "1.0.0",
24
"private": true,
5+
"type": "module",
36
"workspaces": [
47
"src/api",
58
"src/ui"
@@ -8,7 +11,7 @@
811
"scripts": {
912
"build": "yarn workspaces run build && yarn lockfile-manage",
1013
"dev": "concurrently --names 'api,ui' 'yarn workspace infra-core-api run dev' 'yarn workspace infra-core-ui run dev'",
11-
"lockfile-manage": "synp --with-workspace --source-file yarn.lock && cp package-lock.json dist/ && rm package-lock.json",
14+
"lockfile-manage": "synp --with-workspace --source-file yarn.lock && cp package-lock.json dist/ && cp package.json dist/ && rm package-lock.json",
1215
"prettier": "yarn workspaces run prettier && prettier --check tests/**/*.ts",
1316
"prettier:write": "yarn workspaces run prettier:write && prettier --write tests/**/*.ts",
1417
"lint": "yarn workspaces run lint",
@@ -20,13 +23,114 @@
2023
"test:live": "cross-env APPLICATION_KEY=infra-core-api vitest tests/live",
2124
"test:live-ui": "yarn test:live --ui"
2225
},
26+
"dependencies": {
27+
"@aws-sdk/client-dynamodb": "^3.624.0",
28+
"@aws-sdk/client-secrets-manager": "^3.624.0",
29+
"@aws-sdk/util-dynamodb": "^3.624.0",
30+
"@azure/msal-browser": "^3.20.0",
31+
"@azure/msal-node": "^2.16.1",
32+
"@azure/msal-react": "^2.0.22",
33+
"@fastify/auth": "^5.0.1",
34+
"@fastify/aws-lambda": "^5.0.0",
35+
"@fastify/caching": "^9.0.1",
36+
"@fastify/cors": "^10.0.1",
37+
"@mantine/core": "^7.15.2",
38+
"@mantine/dates": "^7.15.2",
39+
"@mantine/form": "^7.15.2",
40+
"@mantine/hooks": "^7.15.2",
41+
"@mantine/notifications": "^7.15.2",
42+
"@tabler/icons-react": "^3.12.0",
43+
"@touch4it/ical-timezones": "^1.9.0",
44+
"@ungap/with-resolvers": "^0.1.0",
45+
"axios": "^1.7.3",
46+
"dayjs": "^1.11.12",
47+
"discord.js": "^14.15.3",
48+
"dotenv": "^16.4.5",
49+
"fastify": "^5.1.0",
50+
"fastify-plugin": "^4.5.1",
51+
"html5-qrcode": "^2.3.8",
52+
"ical-generator": "^7.2.0",
53+
"jsonwebtoken": "^9.0.2",
54+
"jsqr": "^1.4.0",
55+
"jwks-rsa": "^3.1.0",
56+
"moment": "^2.30.1",
57+
"moment-timezone": "^0.5.45",
58+
"pdfjs-dist": "^4.5.136",
59+
"pluralize": "^8.0.0",
60+
"react": "^18.3.1",
61+
"react-dom": "^18.3.1",
62+
"react-pdf": "^9.1.0",
63+
"react-pdftotext": "^1.3.0",
64+
"react-qr-reader": "^3.0.0-beta-1",
65+
"react-router-dom": "^6.26.0",
66+
"zod": "^3.23.8",
67+
"zod-to-json-schema": "^3.23.2",
68+
"zod-validation-error": "^3.3.1"
69+
},
2370
"devDependencies": {
71+
"@eslint/compat": "^1.1.1",
72+
"@storybook/addon-essentials": "^8.2.8",
73+
"@storybook/addon-interactions": "^8.2.8",
74+
"@storybook/addon-links": "^8.2.8",
75+
"@storybook/blocks": "^8.2.8",
76+
"@storybook/react": "^8.2.8",
77+
"@storybook/react-vite": "^8.2.8",
78+
"@storybook/testing-library": "^0.2.2",
79+
"@testing-library/dom": "^10.4.0",
80+
"@testing-library/jest-dom": "^6.4.8",
81+
"@testing-library/react": "^16.0.0",
82+
"@testing-library/user-event": "^14.5.2",
83+
"@tsconfig/node20": "^20.1.4",
84+
"@types/node": "^22.1.0",
85+
"@types/pluralize": "^0.0.33",
86+
"@types/react": "^18.3.3",
87+
"@types/react-dom": "^18.3.0",
88+
"@types/supertest": "^6.0.2",
89+
"@typescript-eslint/eslint-plugin": "^8.0.1",
90+
"@typescript-eslint/parser": "^8.0.1",
91+
"@vitejs/plugin-react": "^4.3.1",
92+
"@vitest/ui": "^2.0.5",
93+
"aws-sdk-client-mock": "^4.0.1",
2494
"concurrently": "^9.1.2",
2595
"cross-env": "^7.0.3",
96+
"esbuild": "^0.23.0",
97+
"eslint": "^8.57.0",
98+
"eslint-config-airbnb": "^19.0.4",
99+
"eslint-config-airbnb-typescript": "^18.0.0",
100+
"eslint-config-esnext": "^4.1.0",
101+
"eslint-config-mantine": "^3.2.0",
102+
"eslint-config-prettier": "^9.1.0",
103+
"eslint-import-resolver-typescript": "^3.6.1",
104+
"eslint-plugin-import": "^2.29.1",
105+
"eslint-plugin-jsx-a11y": "^6.9.0",
106+
"eslint-plugin-prettier": "^5.2.1",
107+
"eslint-plugin-react": "^7.35.0",
108+
"eslint-plugin-react-hooks": "^4.6.2",
26109
"husky": "^9.1.4",
27-
"lint-staged": "^15.2.8",
110+
"identity-obj-proxy": "^3.0.0",
111+
"jsdom": "^24.1.1",
112+
"node-ical": "^0.18.0",
113+
"postcss": "^8.4.41",
114+
"postcss-preset-mantine": "^1.17.0",
115+
"postcss-simple-vars": "^7.0.1",
28116
"prettier": "^3.3.3",
117+
"prop-types": "^15.8.1",
118+
"request": "^2.88.2",
119+
"storybook": "^8.2.8",
120+
"storybook-dark-mode": "^4.0.2",
121+
"stylelint": "^16.8.1",
122+
"stylelint-config-standard-scss": "^13.1.0",
123+
"supertest": "^7.0.0",
29124
"synp": "^1.9.14",
30-
"eslint": "^8.57.0"
125+
"tsx": "^4.16.5",
126+
"typescript": "^5.5.4",
127+
"typescript-eslint": "^8.0.1",
128+
"vite": "^5.4.0",
129+
"vite-tsconfig-paths": "^5.0.1",
130+
"vitest": "^2.0.5",
131+
"yarn-upgrade-all": "^0.7.4"
132+
},
133+
"resolutions": {
134+
"pdfjs-dist": "4.5.136"
31135
}
32136
}

src/api/package.json

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -13,51 +13,5 @@
1313
"lint": "eslint . --ext .ts --cache",
1414
"prettier": "prettier --check *.ts **/*.ts",
1515
"prettier:write": "prettier --write *.ts **/*.ts"
16-
},
17-
"devDependencies": {
18-
"@tsconfig/node20": "^20.1.4",
19-
"@types/node": "^22.1.0",
20-
"@types/supertest": "^6.0.2",
21-
"@typescript-eslint/eslint-plugin": "^8.0.1",
22-
"@typescript-eslint/parser": "^8.0.1",
23-
"@vitest/ui": "^2.0.5",
24-
"aws-sdk-client-mock": "^4.0.1",
25-
"cross-env": "^7.0.3",
26-
"esbuild": "^0.23.0",
27-
"eslint-config-esnext": "^4.1.0",
28-
"eslint-config-prettier": "^9.1.0",
29-
"eslint-import-resolver-typescript": "^3.6.1",
30-
"eslint-plugin-import": "^2.29.1",
31-
"eslint-plugin-prettier": "^5.2.1",
32-
"node-ical": "^0.18.0",
33-
"prettier": "^3.3.3",
34-
"request": "^2.88.2",
35-
"supertest": "^7.0.0",
36-
"tsx": "^4.16.5",
37-
"typescript": "^5.5.4",
38-
"vitest": "^2.0.5"
39-
},
40-
"dependencies": {
41-
"@aws-sdk/client-dynamodb": "^3.624.0",
42-
"@aws-sdk/client-secrets-manager": "^3.624.0",
43-
"@aws-sdk/util-dynamodb": "^3.624.0",
44-
"@azure/msal-node": "^2.16.1",
45-
"@fastify/auth": "^5.0.1",
46-
"@fastify/aws-lambda": "^5.0.0",
47-
"@fastify/caching": "^9.0.1",
48-
"@fastify/cors": "^10.0.1",
49-
"@touch4it/ical-timezones": "^1.9.0",
50-
"discord.js": "^14.15.3",
51-
"dotenv": "^16.4.5",
52-
"fastify": "^5.1.0",
53-
"fastify-plugin": "^4.5.1",
54-
"ical-generator": "^7.2.0",
55-
"jsonwebtoken": "^9.0.2",
56-
"jwks-rsa": "^3.1.0",
57-
"moment": "^2.30.1",
58-
"moment-timezone": "^0.5.45",
59-
"zod": "^3.23.8",
60-
"zod-to-json-schema": "^3.23.2",
61-
"zod-validation-error": "^3.3.1"
6216
}
6317
}

src/common/orgs.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,3 @@ export const CommitteeList = [
2828
"Marketing Committee",
2929
] as const;
3030
export const OrganizationList = ["ACM", ...SIGList, ...CommitteeList];
31-
32-
//. thing

src/ui/package.json

Lines changed: 0 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -16,76 +16,5 @@
1616
"test": "npm run typecheck && npm run prettier && npm run lint && npm run vitest && npm run build",
1717
"storybook": "storybook dev -p 6006",
1818
"storybook:build": "storybook build"
19-
},
20-
"dependencies": {
21-
"@azure/msal-browser": "^3.20.0",
22-
"@azure/msal-react": "^2.0.22",
23-
"@mantine/core": "^7.12.0",
24-
"@mantine/dates": "^7.12.0",
25-
"@mantine/form": "^7.12.0",
26-
"@mantine/hooks": "^7.12.0",
27-
"@mantine/notifications": "^7.12.0",
28-
"@tabler/icons-react": "^3.12.0",
29-
"@ungap/with-resolvers": "^0.1.0",
30-
"axios": "^1.7.3",
31-
"dayjs": "^1.11.12",
32-
"dotenv": "^16.4.5",
33-
"html5-qrcode": "^2.3.8",
34-
"jsqr": "^1.4.0",
35-
"pdfjs-dist": "^4.5.136",
36-
"pluralize": "^8.0.0",
37-
"react": "^18.3.1",
38-
"react-dom": "^18.3.1",
39-
"react-pdf": "^9.1.0",
40-
"react-pdftotext": "^1.3.0",
41-
"react-qr-reader": "^3.0.0-beta-1",
42-
"react-router-dom": "^6.26.0",
43-
"zod": "^3.23.8"
44-
},
45-
"devDependencies": {
46-
"@eslint/compat": "^1.1.1",
47-
"@storybook/addon-essentials": "^8.2.8",
48-
"@storybook/addon-interactions": "^8.2.8",
49-
"@storybook/addon-links": "^8.2.8",
50-
"@storybook/blocks": "^8.2.8",
51-
"@storybook/react": "^8.2.8",
52-
"@storybook/react-vite": "^8.2.8",
53-
"@storybook/testing-library": "^0.2.2",
54-
"@testing-library/dom": "^10.4.0",
55-
"@testing-library/jest-dom": "^6.4.8",
56-
"@testing-library/react": "^16.0.0",
57-
"@testing-library/user-event": "^14.5.2",
58-
"@types/pluralize": "^0.0.33",
59-
"@types/react": "^18.3.3",
60-
"@types/react-dom": "^18.3.0",
61-
"@typescript-eslint/eslint-plugin": "^8.0.1",
62-
"@typescript-eslint/parser": "^8.0.1",
63-
"@vitejs/plugin-react": "^4.3.1",
64-
"eslint-config-airbnb": "^19.0.4",
65-
"eslint-config-airbnb-typescript": "^18.0.0",
66-
"eslint-config-mantine": "^3.2.0",
67-
"eslint-plugin-import": "^2.29.1",
68-
"eslint-plugin-jsx-a11y": "^6.9.0",
69-
"eslint-plugin-react": "^7.35.0",
70-
"eslint-plugin-react-hooks": "^4.6.2",
71-
"identity-obj-proxy": "^3.0.0",
72-
"jsdom": "^24.1.1",
73-
"postcss": "^8.4.41",
74-
"postcss-preset-mantine": "^1.17.0",
75-
"postcss-simple-vars": "^7.0.1",
76-
"prop-types": "^15.8.1",
77-
"storybook": "^8.2.8",
78-
"storybook-dark-mode": "^4.0.2",
79-
"stylelint": "^16.8.1",
80-
"stylelint-config-standard-scss": "^13.1.0",
81-
"typescript": "^5.5.4",
82-
"typescript-eslint": "^8.0.1",
83-
"vite": "^5.4.0",
84-
"vite-tsconfig-paths": "^5.0.1",
85-
"vitest": "^2.0.5",
86-
"yarn-upgrade-all": "^0.7.4"
87-
},
88-
"resolutions": {
89-
"pdfjs-dist": "4.5.136"
9019
}
9120
}

src/ui/pages/events/ManageEvent.page.tsx

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ import dayjs from 'dayjs';
66
import React, { useEffect, useState } from 'react';
77
import { useNavigate, useParams } from 'react-router-dom';
88
import { z } from 'zod';
9-
10-
import FullScreenLoader from '@ui/components/AuthContext/LoadingScreen';
119
import { AuthGuard } from '@ui/components/AuthGuard';
1210
import { getRunEnvironmentConfig } from '@ui/config';
1311
import { useApi } from '@ui/util/api';
12+
import { OrganizationList as orgList } from '@common/orgs';
1413

1514
export function capitalizeFirstLetter(string: string) {
1615
return string.charAt(0).toUpperCase() + string.slice(1);
@@ -50,7 +49,6 @@ const requestBodySchema = baseBodySchema
5049
type EventPostRequest = z.infer<typeof requestBodySchema>;
5150

5251
export const ManageEventPage: React.FC = () => {
53-
const [orgList, setOrgList] = useState<null | string[]>(null);
5452
const [isSubmitting, setIsSubmitting] = useState<boolean>(false);
5553
const navigate = useNavigate();
5654
const api = useApi('core');
@@ -59,14 +57,6 @@ export const ManageEventPage: React.FC = () => {
5957

6058
const isEditing = eventId !== undefined;
6159

62-
useEffect(() => {
63-
const getOrgs = async () => {
64-
const response = await api.get('/api/v1/organizations');
65-
setOrgList(response.data);
66-
};
67-
getOrgs();
68-
}, []);
69-
7060
useEffect(() => {
7161
if (!isEditing) {
7262
return;
@@ -162,10 +152,6 @@ export const ManageEventPage: React.FC = () => {
162152
}
163153
};
164154

165-
if (orgList === null) {
166-
return <FullScreenLoader />;
167-
}
168-
169155
return (
170156
<AuthGuard resourceDef={{ service: 'core', validRoles: ['manage:events'] }}>
171157
<Title order={2}>{isEditing ? `Edit` : `Add`} Event</Title>

0 commit comments

Comments
 (0)