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

a #531

Merged
merged 3 commits into from
Mar 24, 2023
Merged

a #531

Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 10 additions & 1 deletion public/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ main {
color: var(--gray);
font-weight: normal;
font-size: 1rem;
max-width: 30vw;
}

#intro img, #plan img {
Expand Down Expand Up @@ -220,7 +221,11 @@ button {

#intro h1 {
font-size: 2.5rem;
max-width: 300px;
max-width: 400px;
}

#intro h3 {
max-width: 400px;
}

#intro > div {
Expand Down Expand Up @@ -376,6 +381,10 @@ section:nth-child(odd) {
margin-top: 3vh;
}

.team:not(.active) {
display: none;
}

.hidden {
display: none;
}
Expand Down
62 changes: 32 additions & 30 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<div>
<h2>Navigate your degree with ease</h2>
<h1>Launch Your Degree Plan with Nebula Planner</h1>
<h3>Blast off your academic journey to the moon with Nebula <br/> Labs Planner - the ultimate tool for customizing your <br/> four-year degree.</h3>
<h3>Blast off your academic journey to the moon with Nebula Labs Planner - the ultimate tool for customizing your four-year degree.</h3>
<div class="buttons">
<button><a href="/auth/login" class="login button">Get Started</a></button>
<button><a href="#features" class="button">Learn More</a></button>
Expand Down Expand Up @@ -69,35 +69,6 @@ <h4>Save Time</h4>
<button><a href="/auth/login" class="login button">Get Started</a></button>
</section>
<section id="team">
<script>
function showDesign() {
document.getElementById("designTeam").style.display = "grid";
document.getElementById("engineeringTeam").style.display = "none";
document.getElementById("productTeam").style.display = "none";

document.getElementById("designSelection").classList.add("selectedTeam");
document.getElementById("engineeringSelection").classList.remove("selectedTeam");
document.getElementById("productSelection").classList.remove("selectedTeam");
}
function showEngineering() {
document.getElementById("designTeam").style.display = "none";
document.getElementById("engineeringTeam").style.display = "grid";
document.getElementById("productTeam").style.display = "none";

document.getElementById("designSelection").classList.remove("selectedTeam");
document.getElementById("engineeringSelection").classList.add("selectedTeam");
document.getElementById("productSelection").classList.remove("selectedTeam");
}
function showProduct() {
document.getElementById("designTeam").style.display = "none";
document.getElementById("engineeringTeam").style.display = "none";
document.getElementById("productTeam").style.display = "grid";

document.getElementById("designSelection").classList.remove("selectedTeam");
document.getElementById("engineeringSelection").classList.remove("selectedTeam");
document.getElementById("productSelection").classList.add("selectedTeam");
}
</script>
<h2>Meet the team</h2>
<ul>
<a href="#team" style="cursor: pointer; color: var(--gray)" id="designSelection" onclick="showDesign()"><li>Design</li></a>
Expand Down Expand Up @@ -236,5 +207,36 @@ <h1>planner.</h1>
<hr>
<p>Copyright © 2023. All rights reserved</p>
</footer>
<script>
function showDesign() {
document.getElementById("designTeam").classList.add("active");
document.getElementById("engineeringTeam").classList.remove("active");
document.getElementById("productTeam").classList.remove("active");

document.getElementById("designSelection").classList.add("selectedTeam");
document.getElementById("engineeringSelection").classList.remove("selectedTeam");
document.getElementById("productSelection").classList.remove("selectedTeam");
}
function showEngineering() {
document.getElementById("designTeam").classList.remove("active");
document.getElementById("engineeringTeam").classList.add("active");
document.getElementById("productTeam").classList.remove("active");

document.getElementById("designSelection").classList.remove("selectedTeam");
document.getElementById("engineeringSelection").classList.add("selectedTeam");
document.getElementById("productSelection").classList.remove("selectedTeam");
}
function showProduct() {
document.getElementById("designTeam").classList.remove("active");
document.getElementById("engineeringTeam").classList.remove("active");
document.getElementById("productTeam").classList.add("active");

document.getElementById("designSelection").classList.remove("selectedTeam");
document.getElementById("engineeringSelection").classList.remove("selectedTeam");
document.getElementById("productSelection").classList.add("selectedTeam");
}

showDesign();
</script>
</body>
</html>
10 changes: 8 additions & 2 deletions src/components/home/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,19 @@ import { useRouter } from 'next/router';
*/
export default function PlansPage(): JSX.Element {
const [openTemplateModal, setOpenTemplateModal] = useState(false);
const userPlanQuery = trpc.plan.getUserPlans.useQuery();
const userPlanQuery = trpc.plan.getUserPlans.useQuery(undefined, {
staleTime: Infinity,
cacheTime: Infinity,
});
const updateSeenHomeOnboarding = trpc.user.seenHomeOnboarding.useMutation({
async onSuccess() {
await utils.user.getUser.invalidate();
},
});
const { data: userData, isLoading } = trpc.user.getUser.useQuery(undefined, { staleTime: 0 });
const { data: userData, isLoading } = trpc.user.getUser.useQuery(undefined, {
staleTime: Infinity,
cacheTime: Infinity,
});

const { data } = userPlanQuery;
const [planPage, setPlanPage] = useState<0 | 1>(1);
Expand Down
13 changes: 13 additions & 0 deletions src/components/planner/Sidebar/RecursiveRequirement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React, { useMemo } from 'react';
import DraggableSidebarCourseItem from './SidebarCourseItem';
import { CourseRequirement, RequirementTypes } from './types';
import Accordion from './Accordion';
import { trpc } from '@/utils/trpc';

/**
* Group of requirements that's recursive?
Expand Down Expand Up @@ -166,6 +167,17 @@ function CourseRequirementComponent({
validCourses: { [key: string]: number };
}) {
const id = useMemo(() => new ObjectID(), []);
const courseQuery = trpc.courses.publicGetAllCourses.useQuery(undefined, {
staleTime: Infinity,
cacheTime: Infinity,
});
const { data, isLoading } = courseQuery;

let title = '';
if (data && !isLoading) {
const course = data.find((c) => `${c.subject_prefix} ${c.course_number}` === req.course);
title = course ? course.title : '';
}

return (
<DraggableSidebarCourseItem
Expand All @@ -178,6 +190,7 @@ function CourseRequirementComponent({
hours: validCourses[req.course],
locked: false,
prereqOveridden: false,
title,
}}
dragId={id.toString()}
/>
Expand Down
8 changes: 5 additions & 3 deletions src/components/planner/Sidebar/SidebarCourseItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,12 @@ export const SidebarCourseItem = React.memo(
side="left"
title={title || ''}
>
<div className="flex w-full flex-row justify-between">
<span className="text-sm text-[#1C2A6D]">
<div className="flex w-full flex-row items-center justify-between">
<span className="flex w-full flex-row items-center overflow-hidden text-sm text-[#1C2A6D]">
<DragIndicatorIcon fontSize="inherit" className="mr-3 text-[16px] text-[#D4D4D4]" />
{course.code}
<div className="mr-4 w-full overflow-hidden text-ellipsis whitespace-nowrap">
{course.code} - {course.title}
</div>
</span>
<div className="flex flex-row items-center gap-x-2">
{course.hours && course.hours < getSemesterHourFromCourseCode(course.code)! && (
Expand Down
4 changes: 1 addition & 3 deletions src/components/planner/Tiles/SemesterCourseItemDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ const SemesterCourseItemDropdown: FC<SemesterTileDropdownProps> = ({

<DropdownMenu.Item className={itemClasses} onClick={onPrereqOverrideChange}>
<UnfilledWarningIcon />
<span>
{prereqOverriden ? 'Remove Pre-reqs Override' : 'Override Pre-reqs Warning'}
</span>
<span>{prereqOverriden ? 'Show Pre-reqs Warning' : 'Dismiss Pre-reqs Warning'}</span>
</DropdownMenu.Item>
<DropdownMenu.Item
className={!semesterLocked ? itemClasses : itemClasses + ' ' + disabledClasses}
Expand Down
2 changes: 1 addition & 1 deletion src/server/trpc/router/validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export const validatorRouter = router({
}
}
} else if (option.type === 'collection') {
const coreq = checkForCoRecursive(option, semester);
const coreq = checkForCoOrPreRecursive(option, semester);
if (coreq.length > 0) {
coreqNotMet.push(...coreq);
} else {
Expand Down