From 1be1031c79d455d5f6fd64994fd2f42b7dfbf0b3 Mon Sep 17 00:00:00 2001 From: midhun-sadanand <128321084+midhun-sadanand@users.noreply.github.com> Date: Sun, 28 Jul 2024 18:50:17 +0100 Subject: [PATCH 1/4] Temporary commit with initial Onboard UI edits --- backend/main.py | 8 +- firebase.json | 2 +- frontend/src/pages/Onboard/Onboard.module.css | 112 +++++-- frontend/src/pages/Onboard/Onboard.tsx | 285 +++++++++--------- 4 files changed, 247 insertions(+), 160 deletions(-) diff --git a/backend/main.py b/backend/main.py index 563f15b..287809a 100644 --- a/backend/main.py +++ b/backend/main.py @@ -31,12 +31,12 @@ # Ryan from course import * -cred = credentials.Certificate(r'secrets/majoraudit-firebase-adminsdk-bc6kc-6e9544580c.json') +cred = credentials.Certificate(r'secrets/majoraudit-firebase-adminsdk-bc6kc-2898e677ae.json') app = firebase_admin.initialize_app(cred) db = firestore.client() -allowed_CORS_origins=['http://127.0.0.1:3000', 'http://127.0.0.1:3000/graduation', 'http://127.0.0.1:3000/courses', 'http://127.0.0.1:3000/onboard', 'http://127.0.0.1:5000'] +allowed_CORS_origins=['http://127.0.0.1:5000', 'http://127.0.0.1:5000/graduation', 'http://127.0.0.1:5000/login', 'http://127.0.0.1:5000/courses', 'http://127.0.0.1:5000/onboard', 'http://127.0.0.1:5000'] class User: def __init__(self, netID, onboard, name, degrees, studentCourses, language): @@ -60,7 +60,7 @@ def login(): cookies={} if 'NETID' in session: - redirect_url = 'http://127.0.0.1:3000' + redirect_url = 'http://127.0.0.1:5000' current_app.logger.info(f'Redirecting: {redirect_url}') resp = make_response(redirect(redirect_url)) @@ -96,7 +96,7 @@ def login(): ) db.collection("Users").document(netID).set(new_user.__dict__) - redirect_url = 'http://127.0.0.1:3000' + redirect_url = 'http://127.0.0.1:5000' else: token=session['CAS_TOKEN'] diff --git a/firebase.json b/firebase.json index 2817460..8b088da 100644 --- a/firebase.json +++ b/firebase.json @@ -47,7 +47,7 @@ "port": 9000 }, "hosting": { - "port": 3000 + "port": 5000 }, "pubsub": { "port": 8085 diff --git a/frontend/src/pages/Onboard/Onboard.module.css b/frontend/src/pages/Onboard/Onboard.module.css index e970dfe..c0f01ef 100644 --- a/frontend/src/pages/Onboard/Onboard.module.css +++ b/frontend/src/pages/Onboard/Onboard.module.css @@ -1,26 +1,104 @@ +@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap'); - -.Row { - display: flex; - flex-direction: row; +/* UTIL */ +.row { + display: flex; + flex-direction: row; + gap: 20px; + margin-top: 20px; } -.Column { - display: flex; - flex-direction: column; +.column { + display: flex; + flex-direction: column; } +/* CONTAIN */ .OnboardContainer { - position: absolute; - top: 75px; - - display: flex; - flex-direction: column; + position: absolute; + top: 75px; + display: flex; + flex-direction: column; + align-items: center; + width: 100%; + padding-top: 50px; + padding-bottom: 500px; + background-color: #f0f0f0; + font-family: 'Open Sans', sans-serif; +} - align-items: center; +.CourseDisplayBox { + border: 1px solid green; + padding: 10px; + background-color: white; + border-radius: 8px; + height: 400px; + overflow-y: scroll; +} - width: 100%; +.courseBox { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + width: 425px; + height: 36px; + border-radius: 16px; + margin-bottom: 5px; + padding-left: 10px; + padding-right: 10px; + background-color: #F5F5F5; + transition: filter 0.4s ease; +} - padding-top: 50px; - padding-bottom: 500px; -} \ No newline at end of file +.courseBox:hover { + cursor: pointer; + filter: brightness(95%); +} + +.courseCode, +.courseCredits, +.courseStatus { + flex: 1; +} + +.YearHeader { + font-weight: 600; + font-size: 25px; + margin-bottom: 10px; +} + +.TabButtons { + display: flex; + gap: 10px; + margin-bottom: 10px; +} + +.TabButton { + background: none; + border: none; + cursor: pointer; + padding: 5px; +} + +.TabContent { + border: 1px solid black; + border-radius: 8px; + padding: 10px; + background-color: white; + width: 450px; + height: 400px; + overflow-y: auto; +} + +.ResultsContainer { + border: 1px solid green; + padding: 10px; + background-color: white; + border-radius: 8px; + width: 500px; + height: 500px; + display: flex; + flex-direction: column; + align-items: flex-start; +} diff --git a/frontend/src/pages/Onboard/Onboard.tsx b/frontend/src/pages/Onboard/Onboard.tsx index 350d58e..4f57bb5 100644 --- a/frontend/src/pages/Onboard/Onboard.tsx +++ b/frontend/src/pages/Onboard/Onboard.tsx @@ -1,4 +1,3 @@ - import { useState } from "react"; import { syncData } from "../../api/api"; @@ -7,175 +6,185 @@ import LogoMA from "./../../commons/images/ma_logo.png"; import Style from "./Onboard.module.css"; - type DACourse = { - code: string; - credits: string; - term: string; - status: string; + code: string; + credits: string; + term: string; + status: string; }; -function NavBar(){ - return( +function NavBar() { + return (
- {JSON.stringify(parsedData, null, 2)} --
+ {JSON.stringify(props.parsedData, null, 2)} ++
Yi`mK!n&kw@wV K9!MjUBdixK_dR&_xnX#1J;
zufip89E7z8p61Qd_DFq8Fy<{qJeOp`%q{kQ!BmvqtFJzFcSry8kg7v& {dnKS`Q&JwQmv8qZ~IA>x^3z`bUKKG$5KLg+>d@>
z0Yi}04MD{e8q$|HWX2~r8AZWeon;F_S%yzBepUs5cF_O;0{{R6001CA?z~H`O;m3(
zMr*X1VZ6*^$OI4_g3so6(|b1)zj74Co^OjkCK{EUCCsp5{{I44QA%FIQ?mP~jE01E
z?=R0zX6qKTXE~u;b)ISFoem3E&U;3{?+V mdwW)HS2OWhhbk68JU8UI;sOQ-80NnYzO8G8s^i7O
znl?KA<7
S~1EvzM@K*2OIspnsR0!H;
zoztLb`cXWa&Ef#U7QrKP3AWR>aY~r_(j`F`g@&8`z1PCTXwkYNHx>$YRgJ8g`+SAU
z0p)=A`Fm(Gbhd2^L=u|V6{h&VSwj9+4ozl2C7$|Hbo!_a