Skip to content

Commit fccb706

Browse files
committed
Merge branch 'main' into release/1.2
2 parents 5a910a8 + 6def085 commit fccb706

File tree

12 files changed

+591
-26
lines changed

12 files changed

+591
-26
lines changed

course-matrix/backend/src/controllers/departmentsController.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default {
3030
res.status(200).json(departments);
3131
} catch (error) {
3232
console.error(error);
33-
res.status(500).json({ message: "Internal Server Error" });
33+
res.status(500).json({message: 'Internal Server Error'});
3434
}
3535
}),
36-
};
36+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import express from 'express';
2+
3+
import {handleAuthCode} from '../controllers/authentication'
4+
import {login, logout, session, signUp} from '../controllers/userController'
5+
6+
export const usersRouter = express.Router();
7+
8+
usersRouter.post('/signup', signUp);
9+
usersRouter.post('/login', login);
10+
usersRouter.post('/logout', logout);
11+
usersRouter.get('/confirm', handleAuthCode);
12+
usersRouter.get('/session', session);
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import { AppSidebar } from "@/components/app-sidebar"
2+
import {
3+
Breadcrumb,
4+
BreadcrumbItem,
5+
BreadcrumbLink,
6+
BreadcrumbList,
7+
BreadcrumbPage,
8+
BreadcrumbSeparator,
9+
} from "@/components/ui/breadcrumb"
10+
import { Separator } from "@/components/ui/separator"
11+
import {
12+
SidebarInset,
13+
SidebarProvider,
14+
SidebarTrigger,
15+
} from "@/components/ui/sidebar"
16+
17+
export default function Page() {
18+
return (
19+
<SidebarProvider>
20+
<AppSidebar />
21+
<SidebarInset>
22+
<header className="flex h-16 shrink-0 items-center gap-2 border-b px-4">
23+
<SidebarTrigger className="-ml-1" />
24+
<Separator orientation="vertical" className="mr-2 h-4" />
25+
<Breadcrumb>
26+
<BreadcrumbList>
27+
<BreadcrumbItem className="hidden md:block">
28+
<BreadcrumbLink href="#">
29+
Building Your Application
30+
</BreadcrumbLink>
31+
</BreadcrumbItem>
32+
<BreadcrumbSeparator className="hidden md:block" />
33+
<BreadcrumbItem>
34+
<BreadcrumbPage>Data Fetching</BreadcrumbPage>
35+
</BreadcrumbItem>
36+
</BreadcrumbList>
37+
</Breadcrumb>
38+
</header>
39+
<div className="flex flex-1 flex-col gap-4 p-4">
40+
<div className="grid auto-rows-min gap-4 md:grid-cols-3">
41+
<div className="aspect-video rounded-xl bg-muted/50" />
42+
<div className="aspect-video rounded-xl bg-muted/50" />
43+
<div className="aspect-video rounded-xl bg-muted/50" />
44+
</div>
45+
<div className="min-h-[100vh] flex-1 rounded-xl bg-muted/50 md:min-h-min" />
46+
</div>
47+
</SidebarInset>
48+
</SidebarProvider>
49+
)
50+
}

course-matrix/frontend/src/components/time-picker-hr.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { Label } from "@/components/ui/label";
33
import { TimePickerInput } from "./time-picker-input";
44
import { TimePeriodSelect } from "./period-select";
55
import { Period } from "../utils/time-picker-utils";
6-
76
interface TimePickerHrProps {
87
date: Date | undefined;
98
setDate: (date: Date | undefined) => void;
@@ -16,7 +15,6 @@ export function TimePickerHr({ date, setDate }: TimePickerHrProps) {
1615
const hourRef = React.useRef<HTMLInputElement>(null);
1716
const secondRef = React.useRef<HTMLInputElement>(null);
1817
const periodRef = React.useRef<HTMLButtonElement>(null);
19-
2018
return (
2119
<div className="flex items-end gap-2">
2220
<div className="grid gap-1 text-center">

course-matrix/frontend/src/components/time-picker-input.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Input } from "@/components/ui/input";
2-
32
import { cn } from "@/lib/utils";
43
import React from "react";
54
import {
@@ -9,7 +8,6 @@ import {
98
getDateByType,
109
setDateByType,
1110
} from "../utils/time-picker-utils";
12-
1311
export interface TimePickerInputProps
1412
extends React.InputHTMLAttributes<HTMLInputElement> {
1513
picker: TimePickerType;
@@ -19,7 +17,6 @@ export interface TimePickerInputProps
1917
onRightFocus?: () => void;
2018
onLeftFocus?: () => void;
2119
}
22-
2320
const TimePickerInput = React.forwardRef<
2421
HTMLInputElement,
2522
TimePickerInputProps
@@ -91,15 +88,13 @@ const TimePickerInput = React.forwardRef<
9188
}
9289
if (e.key >= "0" && e.key <= "9") {
9390
if (picker === "12hours") setPrevIntKey(e.key);
94-
9591
const newValue = calculateNewValue(e.key);
9692
if (flag) onRightFocus?.();
9793
setFlag((prev) => !prev);
9894
const tempDate = new Date(date);
9995
setDate(setDateByType(tempDate, newValue, picker, period));
10096
}
10197
};
102-
10398
return (
10499
<Input
105100
ref={ref}

course-matrix/frontend/src/utils/time-picker-utils.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@
44
export function isValidHour(value: string) {
55
return /^(0[0-9]|1[0-9]|2[0-3])$/.test(value);
66
}
7-
87
/**
98
* regular expression to check for valid 12 hour format (01-12)
109
*/
1110
export function isValid12Hour(value: string) {
1211
return /^(0[1-9]|1[0-2])$/.test(value);
1312
}
14-
1513
/**
1614
* regular expression to check for valid minute format (00-59)
1715
*/
@@ -45,17 +43,14 @@ export function getValidHour(value: string) {
4543
if (isValidHour(value)) return value;
4644
return getValidNumber(value, { max: 23 });
4745
}
48-
4946
export function getValid12Hour(value: string) {
5047
if (isValid12Hour(value)) return value;
5148
return getValidNumber(value, { min: 1, max: 12 });
5249
}
53-
5450
export function getValidMinuteOrSecond(value: string) {
5551
if (isValidMinuteOrSecond(value)) return value;
5652
return getValidNumber(value, { max: 59 });
5753
}
58-
5954
type GetValidArrowNumberConfig = {
6055
min: number;
6156
max: number;
@@ -91,19 +86,16 @@ export function setMinutes(date: Date, value: string) {
9186
date.setMinutes(parseInt(minutes, 10));
9287
return date;
9388
}
94-
9589
export function setSeconds(date: Date, value: string) {
9690
const seconds = getValidMinuteOrSecond(value);
9791
date.setSeconds(parseInt(seconds, 10));
9892
return date;
9993
}
100-
10194
export function setHours(date: Date, value: string) {
10295
const hours = getValidHour(value);
10396
date.setHours(parseInt(hours, 10));
10497
return date;
10598
}
106-
10799
export function set12Hours(date: Date, value: string, period: Period) {
108100
const hours = parseInt(getValid12Hour(value), 10);
109101
const convertedHours = convert12HourTo24Hour(hours, period);
@@ -135,7 +127,6 @@ export function setDateByType(
135127
return date;
136128
}
137129
}
138-
139130
export function getDateByType(date: Date, type: TimePickerType) {
140131
switch (type) {
141132
case "minutes":
@@ -170,7 +161,6 @@ export function getArrowByType(
170161
return "00";
171162
}
172163
}
173-
174164
/**
175165
* handles value change of 12-hour input
176166
* 12:00 PM is 12:00
@@ -189,7 +179,6 @@ export function convert12HourTo24Hour(hour: number, period: Period) {
189179
}
190180
return hour;
191181
}
192-
193182
/**
194183
* time is stored in the 24-hour form,
195184
* but needs to be displayed to the user

doc/sprint0/product.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ A fully realized Course Matrix will include the following features and developme
7878
- **Intuitive User Interface**: A seamless and user-friendly design ensures users can easily navigate and utilize the platform without requiring extensive instructions.
7979

8080
**Development Standards**:
81-
8281
- **Rigorous Testing**: All code is thoroughly tested to address potential bugs and ensure functionality across all use cases.
8382
- **Feature Integration and Code Review**: New features are reviewed by at least two team members to ensure quality and consistency before being merged into the production environment, adhering to a structured code review process.
8483

0 commit comments

Comments
 (0)