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

Merge to prod #160

Merged
merged 43 commits into from
Nov 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
c3592d1
Bump micromatch from 4.0.7 to 4.0.8 (#95)
dependabot[bot] Sep 30, 2024
e8f070d
HMT-92/Remove food tickets for judges and admins (#110)
hannagracec Sep 30, 2024
b9165b2
Admin and judge redirects to dashboard (#109)
burtonjong Oct 2, 2024
037e67d
Hmt 90/hackathon creation (#108)
burtonjong Oct 21, 2024
f59bbc1
Hmt 78/judging schedule (#112)
burtonjong Oct 21, 2024
9266fa4
small fix to reset
burtonjong Oct 21, 2024
3dbe82f
User context loading fix
ideen1 Oct 21, 2024
de65c59
Make Judge lower case, need to use enum later
ideen1 Oct 21, 2024
36cb733
Fix judge scoring load logic
ideen1 Oct 21, 2024
3016bc9
Increase judging table size
ideen1 Oct 21, 2024
500c2e2
Remove succesful tanstack queries
ideen1 Oct 21, 2024
106b84e
Admin UI improvements
ideen1 Oct 21, 2024
e578597
fix join team bug (#121)
justin-phxm Oct 23, 2024
82e537c
update revalidation duration to 10 minutes (#125)
justin-phxm Oct 25, 2024
2fc51a7
Update the landing discriptions
ideen1 Oct 25, 2024
b983fd1
fix for reload/does not show NaN shows loading
burtonjong Oct 25, 2024
acf2605
update nextMealSchedule (#123)
justin-phxm Oct 25, 2024
7039c01
remove apple from service providers
burtonjong Oct 25, 2024
a14035c
refresh user after signup (#133)
justin-phxm Oct 26, 2024
481e60f
fix homepage text cut out and optimize hackathon countdown (#135)
justin-phxm Oct 27, 2024
d97ccf1
update dashboard name (#130)
justin-phxm Oct 27, 2024
f7fc92b
Fix timer in team complete (#134)
justin-phxm Oct 28, 2024
74c388e
updated sponsor text (#139)
justin-phxm Oct 28, 2024
39bda50
136 text is cut off on small screen size (#137)
justin-phxm Oct 31, 2024
18900b1
141 duplicated judging scores (#143)
justin-phxm Oct 31, 2024
ac58c79
no more type assertions (#147)
justin-phxm Nov 2, 2024
ef892ef
fix header join team bug (#149)
justin-phxm Nov 2, 2024
ba05d52
toast error for loading teams on header and user in userprofile
burtonjong Nov 5, 2024
ee628e2
Merge branch 'prod' into main
burtonjong Nov 5, 2024
56af580
Connect ceremony details to contentful natalie (#142)
burtonjong Nov 7, 2024
50508b9
Merge branch 'prod' into main
burtonjong Nov 7, 2024
eef99cf
limit change and graceful load for the user profile
burtonjong Nov 7, 2024
729d40f
css change and background change
burtonjong Nov 7, 2024
d7dabf2
remove console logs and small judging info change
burtonjong Nov 7, 2024
675999d
Merge branch 'prod' into main
burtonjong Nov 7, 2024
25993dc
sev1 fix
burtonjong Nov 8, 2024
eac6231
Merge branch 'prod' into main
burtonjong Nov 8, 2024
23a29e1
119 admin dashboard doesnt show scores (#157)
justin-phxm Nov 9, 2024
3ff07bf
refactor judging components for improved layout and performance (#159)
justin-phxm Nov 9, 2024
605dff4
fix mobile view
burtonjong Nov 9, 2024
262196b
Merge branch 'main' of https://github.com/Code-the-Change-YYC/hackath…
burtonjong Nov 9, 2024
daff537
Merge branch 'prod' into main
burtonjong Nov 9, 2024
752516d
team members loaded and mobile fix
burtonjong Nov 10, 2024
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
7 changes: 6 additions & 1 deletion amplify/data/resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ const schema = a
allow.ownerDefinedIn("profileOwner").to(["read", "create"]),
allow.groups(["Admin"]).to(["read", "update", "create"]),
]),
email: a.string(),
email: a
.string()
.authorization((allow) => [
allow.ownerDefinedIn("profileOwner").to(["read", "create"]),
allow.groups(["Admin"]).to(["read", "create"]),
]),
institution: a.string(),
completedRegistration: a.boolean(),
allergies: a.string(),
Expand Down
26 changes: 26 additions & 0 deletions src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,32 @@ body {
rgb(var(--background-start-rgb));
}

@media (max-width: 768px) {
.text-shadow-outline {
text-shadow:
-2px -2px 0 #7055fd,
2px -2px 0 #7055fd,
-2px 2px 0 #7055fd,
2px 2px 0 #7055fd,
-2px -2px 0 #7055fd,
2px -2px 0 #7055fd,
-2px 2px 0 #7055fd,
2px 2px 0 #7055fd;
}
}

.text-shadow-title {
text-shadow:
-2px -2px 0 #7055fd,
2px -2px 0 #7055fd,
-2px 2px 0 #7055fd,
2px 2px 0 #7055fd,
-2px -2px 0 #7055fd,
2px -2px 0 #7055fd,
-2px 2px 0 #7055fd,
2px 2px 0 #7055fd;
}

.lds-ring,
.lds-ring div {
box-sizing: border-box;
Expand Down
14 changes: 5 additions & 9 deletions src/app/judging/JudgingDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,10 @@ export default async function JudgingDashboard() {
};

return (
<>
<div className={"flex h-screen justify-center text-blackish"}>
<div className={"w-full max-w-[1500px] p-6"}>
<Greetings accentColor="text-dark-pink" />
<h2 className={"py-4 text-xl font-semibold"}>Assigned Teams</h2>
<JudgingTable hackathonData={hackathonData} />
</div>
</div>
</>
<div className="flex w-full flex-1 flex-col items-center p-6 text-blackish">
<Greetings accentColor="text-dark-pink" />
<h2 className="flex w-full py-4 text-xl font-semibold">Assigned Teams</h2>
<JudgingTable hackathonData={hackathonData} />
</div>
);
}
122 changes: 48 additions & 74 deletions src/app/judging/JudgingTable.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"use client";

import { useMemo, useState } from "react";
import { useState } from "react";
import Skeleton from "react-loading-skeleton";

import type { Schema } from "@/amplify/data/resource";
import LoadingRing from "@/components/LoadingRing";
Expand Down Expand Up @@ -48,36 +49,34 @@ export default function JudgingTable({
return teams;
},
});
if (
roomIsFetching ||
teamsForRoomIsFetching ||
!roomData ||
!teamsForRoomData
) {
return <div>Loading...</div>;
const isFetching = roomIsFetching || teamsForRoomIsFetching;
if (isFetching || !roomData || !teamsForRoomData) {
return (
<div className="flex flex-1">
<Skeleton className="h-full" containerClassName="flex-1" />
</div>
);
}

const panelData = useMemo(() => {
return [
{
icon: "/svgs/judging/team_icon.svg",
alt: "Teams assigned icon",
stat: teamsForRoomData.length,
text: `Teams Assigned to ${roomData.name}`,
},
{
icon: "/svgs/judging/teams_left.svg",
alt: "Teams left icon",
stat: teamsForRoomData.filter(
async (team) =>
(await team?.scores())?.data.filter(
(score) => score.judgeId === currentUser.username,
).length === 0,
).length,
text: "Teams Left To Score",
},
];
}, [roomData, teamsForRoomData]);
const panelData = [
{
icon: "/svgs/judging/team_icon.svg",
alt: "Teams assigned icon",
stat: teamsForRoomData.length,
text: `Teams Assigned to ${roomData.name}`,
},
{
icon: "/svgs/judging/teams_left.svg",
alt: "Teams left icon",
stat: teamsForRoomData.filter(
async (team) =>
(await team?.scores())?.data.filter(
(score) => score.judgeId === currentUser.username,
).length === 0,
).length,
text: "Teams Left To Score",
},
];
const handleCreateScoreClick = (teamId: string) => {
setSelectedTeamId(teamId);
};
Expand All @@ -89,57 +88,32 @@ export default function JudgingTable({
setSelectedTeamId("");
};

const isFetching = roomIsFetching || teamsForRoomIsFetching;

const tableHeaders = [
{ columnHeader: "Team Name", className: "w-1/3 rounded-tl-lg" },
...hackathonData.scoringComponents.map((component) => ({
columnHeader: component.friendlyName,
className: "w-fit",
})),
...hackathonData.scoringSidepots.map((component) => ({
columnHeader: (
<div className="flex flex-col">
<p>Sidepot:</p>
{component.friendlyName}
</div>
),
className: "w-fit bg-pastel-pink",
})),
];
return isFetching ? (
<div
className={
"flex h-screen w-full items-center justify-center bg-pastel-pink"
}
>
<div className="flex size-full flex-1 items-center justify-center bg-pastel-pink">
<LoadingRing />
</div>
) : (
<div className={"flex h-screen justify-center text-blackish"}>
<div className="mb-4 flex w-full max-w-[1500px] p-6">
<div className="mr-4 flex w-1/4 flex-col space-y-4">
<>
<div className="flex w-full flex-col justify-center gap-4 py-6 xl:flex-row">
<div className=" flex w-full flex-row gap-4 xl:w-1/4 xl:flex-col">
{panelData.map((item, index) => (
<div key={index} className="h-1/2">
<StatsPanel
icon={item.icon}
alt={item.alt}
stat={item.stat}
subheader={item.text}
/>
</div>
<StatsPanel
key={index}
icon={item.icon}
alt={item.alt}
stat={item.stat}
subheader={item.text}
/>
))}
</div>
<div className="w-3/4">
<ScoresTable
tableHeaders={tableHeaders}
tableData={teamsForRoomData as Schema["Team"]["type"][]}
onCreateScoreClick={handleCreateScoreClick}
onEditScoreClick={handleEditScoreClick}
colorScheme="pink"
entriesPerPage={150}
/>
</div>
<ScoresTable
tableData={teamsForRoomData as Schema["Team"]["type"][]}
onCreateScoreClick={handleCreateScoreClick}
onEditScoreClick={handleEditScoreClick}
colorScheme="pink"
entriesPerPage={150}
hackathonData={hackathonData}
/>
</div>
{selectedTeam !== "" && (
<ModalPopup
Expand All @@ -148,6 +122,6 @@ export default function JudgingTable({
teamId={selectedTeam}
/>
)}
</div>
</>
);
}
2 changes: 1 addition & 1 deletion src/app/judging/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const metadata: Metadata = {
};
export default function Judging() {
return (
<main className="w-full bg-dashboard-grey">
<main className="flex w-full flex-1 flex-col gap-4 bg-dashboard-grey">
<JudgingDashboard />
</main>
);
Expand Down
2 changes: 1 addition & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { enableLandingPage } from "@/featureFlags";
export const revalidate = 600;
const Home = () => {
return (
<main className="">
<main className="w-full">
{enableLandingPage ? (
<PagePlaceholder />
) : (
Expand Down
11 changes: 6 additions & 5 deletions src/components/LandingPage/AboutEventTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ import type { ReactNode } from "react";

import { fetchContent } from "@/app/actions";

const EVENT_DETAILS_SECTION_STYLES = "flex flex-col items-center bg-white";
const EVENT_DETAILS_SECTION_STYLES =
"flex w-full flex-col items-center bg-white";
const EVENT_DETAILS_CONTENT_STYLES =
"bg-pastel-pink border-4 border-dark-pink rounded-3xl my-4 lg:my-8 flex md:flex md:justify-center md:max-w-[1100px] md:shadow-[15px_15px_0px_0px_#FF4D6F]";
"bg-pastel-pink border-4 border-dark-pink rounded-3xl mt-4 mb-8 xl:mt-8 xl:mb-12 flex flex-col xl:flex-row w-4/5 shadow-[15px_15px_0px_0px_#FF4D6F]";
const EVENT_IMAGE_CONTAINER_STYLES =
"bg-blackish rounded-t-20 border-b-4 border-dark-pink w-72 h-64 md:rounded-tr-none md:rounded-l-3xl md:border-b-0 md:border-r-4 md:h-[370px] md:w-[40vw]";
"bg-blackish border-b-4 border-dark-pink size-full xl:size-1/2 rounded-t-2xl xl:rounded-tr-none xl:rounded-l-2xl xl:border-b-0 xl:border-r-4 ";
const EVENT_IMAGE_STYLES =
"w-full h-full object-cover md:rounded-l-2xl md:rounded-tl-2xl md:rounded-t-none rounded-t-2xl";
"w-full h-full object-cover rounded-bl-none rounded-t-2xl xl:rounded-tr-none xl:rounded-l-2xl";
const EVENT_DETAILS_CONTAINER_STYLES =
"flex items-center w-72 h-[370px] rounded-b-20 md:w-[50vw] md:rounded-bl-none md:rounded-r-2xl";
"flex items-center w-full xl:w-1/2 rounded-b-20 md:rounded-bl-none md:rounded-r-2xl";
const EVENT_DETAIL_STYLES = "flex items-center ml-10";
const EVENT_DETAIL_TITLE_STYLES =
"text-lg text-blackish font-extrabold leading-tight";
Expand Down
20 changes: 2 additions & 18 deletions src/components/LandingPage/HeroSectionTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,6 @@ import type { HackathonDetails } from "@/app/contentfulTypes";

import HeroCallToAction from "./HeroCallToAction";

const HERO_HEADER_STYLE = {
textShadow: `
-2px -2px 0 #7055FD,
2px -2px 0 #7055FD,
-2px 2px 0 #7055FD,
2px 2px 0 #7055FD,
-2px -2px 0 #7055FD,
2px -2px 0 #7055FD,
-2px 2px 0 #7055FD,
2px 2px 0 #7055FD
`,
};

const HeroSectionTile = ({
hackathonDetails,
}: {
Expand All @@ -26,13 +13,10 @@ const HeroSectionTile = ({

return (
<div className={"flex flex-col px-4 pt-10 md:items-center md:px-0 "}>
<h1
className="flex-wrap text-5xl font-black text-pastel-green drop-shadow-lg md:text-center md:text-6xl"
style={HERO_HEADER_STYLE}
>
<h1 className="text-shadow-title flex-wrap text-5xl font-black text-pastel-green drop-shadow-lg md:text-center md:text-6xl">
<span className="text-white">{eventName} </span> {" " + eventYear}
</h1>
<strong className="flex w-full max-w-7xl flex-wrap justify-center py-4 text-xl text-awesomer-purple opacity-95 md:text-center md:text-xl">
<strong className="text-shadow-outline flex w-full max-w-7xl flex-wrap justify-center rounded-lg p-2 text-xl text-pastel-green opacity-95 drop-shadow-lg md:py-4 md:text-center md:text-xl md:text-awesomer-purple ">
{eventBlurb}
</strong>
<HeroCallToAction />
Expand Down
4 changes: 2 additions & 2 deletions src/components/LandingPage/JudgingCriteria.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import Image from "next/image";

const judgingCriteriaStyles =
"relative flex -mt-5 justify-between bg-[#BAFBE4] py-20 px-10 md:px-24 lg:px-40 drop-shadow-lg md:drop-shadow-none";
"relative flex -mt-5 justify-between bg-[#BAFBE4] py-20 px-[5%] md:px-24 lg:px-40 drop-shadow-lg md:drop-shadow-none";

const itemStyles =
"flex justify-start p-4 lg:px-10 lg:text-[1.0rem] items-start";
"flex justify-start p-4 lg:px-6 lg:text-[1.0rem] items-start";

const checkMarkSvg = "/svgs/landingPage/check_mark_bkg.svg";

Expand Down
49 changes: 39 additions & 10 deletions src/components/UserProfile/TeamForm.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
"use client";

import { generateClient } from "aws-amplify/api";

import { type Schema } from "@/amplify/data/resource";
import { useQuery } from "@tanstack/react-query";

const INPUT_STYLES =
"rounded-full border-4 placeholder-black border-white bg-[#FFFFFF] bg-white/30 ps-3 py-2 my-2 text-sm md:text-md backdrop-opacity-30";
Expand All @@ -17,7 +22,23 @@ export default function TeamForm({ data, teamMutation }: TeamFormProp) {
teamMutation.mutate(data);
};

const client = generateClient<Schema>();

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { data: teamData, isFetching } = useQuery({
initialData: null,
initialDataUpdatedAt: 0,
queryKey: ["TeamWithMembers"],
queryFn: async () => {
const { data: teamWithMembers } = await client.models.Team.get(
{ id: data.id },
{ selectionSet: ["id", "members.*"] },
);

return teamWithMembers;
},
enabled: !!data,
});

return (
<>
Expand All @@ -40,16 +61,24 @@ export default function TeamForm({ data, teamMutation }: TeamFormProp) {
/>
<label>Team Members</label>
<div className="flex flex-col">
{Array.isArray(data.members) &&
data.members.map((member: Schema["User"]["type"]) => (
<input
key={member.id}
className={INPUT_STYLES}
type="text"
value={`${member.firstName} ${member.lastName}`}
disabled
/>
))}
{isFetching ? (
<h1 className={INPUT_STYLES}>Loading...</h1>
) : (
<>
{Array.isArray(teamData?.members) &&
teamData?.members.map(
(member: Partial<Schema["User"]["type"]>) => (
<input
key={member.id}
className={INPUT_STYLES}
type="text"
value={`${member.firstName} ${member.lastName}`}
disabled
/>
),
)}
</>
)}
</div>
</form>
<div className="mb-10 mt-3 flex justify-end md:mx-10">
Expand Down
Loading
Loading