Skip to content

Commit

Permalink
Revert "Merge branch 'main' into reformat-buildingCatalogue"
Browse files Browse the repository at this point in the history
This reverts commit 16f69b9, reversing
changes made to 8bf0cbb.
  • Loading branch information
xgraceyan committed Feb 3, 2025
1 parent 16f69b9 commit 0f53db5
Show file tree
Hide file tree
Showing 32 changed files with 878 additions and 529 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ A summary of the libraries we use are listed below.
### Backend
- [tRPC](https://trpc.io) - type-safe API access layer for the AntAlmanac API.
- [Anteater API](https://docs.icssc.club/developer/anteaterapi) - API maintained by ICSSC for retrieving UCI data.
- [Drizzle ORM](https://orm.drizzle.team/) - [high-performance](https://orm.drizzle.team/benchmarks) type-safe SQL-like access layer compatiable with all major SQL dialects.

### Tooling
- [Vite](https://vitejs.dev) - Blazingly fast, modern bundler.
Expand Down Expand Up @@ -53,9 +52,8 @@ Since then, the project has continued to evolve and grow with successive generat
| 2019 - 2021 | @devsdevsdevs |
| 2021 - 2022 | @ChaseC99 |
| 2022 - 2024 | @EricPedley |
| 2023 - 2024 | @ap0nia |
| 2023 - Present | @ap0nia |
| 2024 - Present | @MinhxNguyen7 |
| 2024 - Present | @adcockdalton |


# Contributing
Expand All @@ -79,9 +77,13 @@ Here is a rough guide on how to contribute:
Repeat until your pull request is approved.
8. Merge your pull request and your changes will appear on the live website shortly! 🥳

## Video Walkhrough
We also have a 30 minute contributor [video tutorial](https://www.youtube.com/watch?v=_v91cqGzu5o) available on YouTube.

## Additional Help
If you ever need help, feel free to ask around on our [Discord server](https://discord.gg/Zu8KZHERtJ).


# Development Environment

## Pre-requisites
Expand Down
51 changes: 36 additions & 15 deletions apps/antalmanac/src/components/Calendar/CourseCalendarEvent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@ import { Theme, withStyles } from '@material-ui/core/styles';
import { ClassNameMap, Styles } from '@material-ui/core/styles/withStyles';
import { Delete, Search } from '@material-ui/icons';
import { WebsocSectionFinalExam } from '@packages/antalmanac-types';
import { useEffect, useRef } from 'react';
import { useEffect, useRef, useCallback } from 'react';
import { Event } from 'react-big-calendar';
import { Link } from 'react-router-dom';

import { deleteCourse, deleteCustomEvent } from '$actions/AppStoreActions';
import CustomEventDialog from '$components/Calendar/Toolbar/CustomEventDialog/';
import ColorPicker from '$components/ColorPicker';
import { MapLink } from '$components/buttons/MapLink';
import analyticsEnum, { logAnalytics } from '$lib/analytics';
import { clickToCopy, useQuickSearchForClasses } from '$lib/helpers';
import buildingCatalogue from '$lib/locations/buildingCatalogue';
import locationIds from '$lib/locations/locations';
import AppStore from '$stores/AppStore';
import { useTimeFormatStore } from '$stores/SettingsStore';
import { useTimeFormatStore, useThemeStore } from '$stores/SettingsStore';
import { useTabStore } from '$stores/TabStore';
import { formatTimes } from '$stores/calendarizeHelpers';

const styles: Styles<Theme, object> = {
Expand Down Expand Up @@ -145,10 +146,8 @@ interface CourseCalendarEventProps {

const MONTHS = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];

const CourseCalendarEvent = ({ classes, selectedEvent, scheduleNames, closePopover }: CourseCalendarEventProps) => {
const CourseCalendarEvent = (props: CourseCalendarEventProps) => {
const paperRef = useRef<HTMLInputElement>(null);
const quickSearch = useQuickSearchForClasses();
const { isMilitaryTime } = useTimeFormatStore();

useEffect(() => {
const handleKeyDown = (event: { keyCode: number }) => {
Expand All @@ -165,6 +164,18 @@ const CourseCalendarEvent = ({ classes, selectedEvent, scheduleNames, closePopov
};
}, []);

const { setActiveTab } = useTabStore();
const quickSearch = useQuickSearchForClasses();

const { isMilitaryTime } = useTimeFormatStore();
const isDark = useThemeStore((store) => store.isDark);

const focusMap = useCallback(() => {
setActiveTab(2);
}, [setActiveTab]);

const { classes, selectedEvent } = props;

if (!selectedEvent.isCustomEvent) {
const { term, instructors, sectionCode, title, finalExam, locations, sectionType, deptValue, courseNumber } =
selectedEvent;
Expand Down Expand Up @@ -205,7 +216,7 @@ const CourseCalendarEvent = ({ classes, selectedEvent, scheduleNames, closePopov
size="small"
style={{ textDecoration: 'underline' }}
onClick={() => {
closePopover();
props.closePopover();
deleteCourse(sectionCode, term);
logAnalytics({
category: analyticsEnum.calendar.title,
Expand Down Expand Up @@ -251,10 +262,14 @@ const CourseCalendarEvent = ({ classes, selectedEvent, scheduleNames, closePopov
<td className={`${classes.multiline} ${classes.rightCells}`}>
{locations.map((location) => (
<div key={`${sectionCode} @ ${location.building} ${location.room}`}>
<MapLink
buildingId={locationIds[location.building] ?? '0'}
room={`${location.building} ${location.room}`}
/>
<Link
className={classes.clickableLocation}
to={`/map?location=${locationIds[location.building] ?? 0}`}
onClick={focusMap}
color={isDark ? '#1cbeff' : 'blue'}
>
{location.building} {location.room}
</Link>
</div>
))}
</td>
Expand Down Expand Up @@ -287,7 +302,13 @@ const CourseCalendarEvent = ({ classes, selectedEvent, scheduleNames, closePopov
{building && (
<div className={classes.table}>
Location:&nbsp;
<MapLink buildingId={+building} room={buildingCatalogue[+building]?.name ?? ''} />
<Link
className={classes.clickableLocation}
to={`/map?location=${building ?? 0}`}
onClick={focusMap}
>
{buildingCatalogue[+building]?.name ?? ''}
</Link>
</div>
)}
<div className={classes.buttonBar}>
Expand All @@ -300,15 +321,15 @@ const CourseCalendarEvent = ({ classes, selectedEvent, scheduleNames, closePopov
/>
</div>
<CustomEventDialog
onDialogClose={closePopover}
onDialogClose={props.closePopover}
customEvent={AppStore.schedule.getExistingCustomEvent(customEventID)}
scheduleNames={scheduleNames}
scheduleNames={props.scheduleNames}
/>

<Tooltip title="Delete">
<IconButton
onClick={() => {
closePopover();
props.closePopover();
deleteCustomEvent(customEventID);
logAnalytics({
category: analyticsEnum.calendar.title,
Expand Down
24 changes: 13 additions & 11 deletions apps/antalmanac/src/components/PatchNotes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { getLocalStoragePatchNotesKey, setLocalStoragePatchNotesKey } from '$lib
*
* @example '20230819'
*/
export const latestPatchNotesUpdate = '20250121';
export const latestPatchNotesUpdate = '20241124';

/**
* Whether the user's last visited patch notes is outdated.
Expand Down Expand Up @@ -53,24 +53,26 @@ function PatchNotes() {
data-testid={dialogTestId}
slots={{ backdrop: PatchNotesBackdrop }}
>
<DialogTitle>{"What's New - January 2025"}</DialogTitle>
<DialogTitle>{"What's New - November 2024"}</DialogTitle>

<DialogContent>
<Typography>Features</Typography>
<Typography>Migration</Typography>
<ul>
<li>We are migrating our database to support exciting features coming this year!</li>
<li>
Added column linking to course syllabi (thanks to the ASUCI{' '}
<a href="https://asuci.uci.edu/academicvp/" target="_blank">
AAVP
If you experience issues with saving and retrieving schedules, please let us know by filling out
the{' '}
<a href="https://docs.google.com/forms/d/e/1FAIpQLSe0emRHqog-Ctl8tjZfJvewY_CSGXys8ykBkFBy1EEUUUHbUw/viewform">
feedback form
</a>
!).
.
</li>
<li>Direct course search buttons in calendar pop-up and course header.</li>
<li>Search caching for faster results on repeated queries.</li>
</ul>
<Typography>Bug Fixes</Typography>

<Typography>Features</Typography>
<ul>
<li>Loading schedules with BIO SCI classes. Thank you for your feedback and patience!</li>
<li>Search now contains all new classes and will update automatically!</li>
<li>Many bug fixes and quality-of-life improvements</li>
</ul>
</DialogContent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ function AddedSectionsGrid() {
<ClearScheduleButton buttonSx={buttonSx} />
<ColumnToggleDropdown />
</Box>
<Box style={{ marginTop: 56 }}>
<Box style={{ marginTop: 50 }}>
<Typography variant="h6">{`${scheduleName} (${scheduleUnits} Units)`}</Typography>
{courses.length < 1 ? NoCoursesBox : null}
<Box display="flex" flexDirection="column" gap={1}>
Expand All @@ -363,7 +363,7 @@ function AddedSectionsGrid() {
);
}

export function AddedCoursePane() {
export default function AddedCoursePaneFunctionComponent() {
const [skeletonMode, setSkeletonMode] = useState(AppStore.getSkeletonMode());

useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@ import { Delete } from '@mui/icons-material';
import { Box, Card, CardActions, CardHeader, IconButton, Tooltip } from '@mui/material';
import type { RepeatingCustomEvent } from '@packages/antalmanac-types';
import moment from 'moment';
import { useEffect, useState } from 'react';
import { useEffect, useState, useCallback } from 'react';
import { Link } from 'react-router-dom';

import ColorPicker from '../../ColorPicker';

import { deleteCustomEvent } from '$actions/AppStoreActions';
import CustomEventDialog from '$components/Calendar/Toolbar/CustomEventDialog/';
import { MapLink } from '$components/buttons/MapLink';
import analyticsEnum from '$lib/analytics';
import buildingCatalogue from '$lib/locations/buildingCatalogue';
import AppStore from '$stores/AppStore';
import { useTimeFormatStore } from '$stores/SettingsStore';
import { useTabStore } from '$stores/TabStore';

interface CustomEventDetailViewProps {
scheduleNames: string[];
Expand Down Expand Up @@ -56,6 +57,12 @@ const CustomEventDetailView = (props: CustomEventDetailViewProps) => {
return `${startTime.format(timeFormat)}${endTime.format(timeFormat)}${daysString}`;
};

const { setActiveTab } = useTabStore();

const focusMap = useCallback(() => {
setActiveTab(2);
}, [setActiveTab]);

return (
<Card>
<CardHeader
Expand All @@ -67,10 +74,9 @@ const CustomEventDetailView = (props: CustomEventDetailViewProps) => {
}}
/>
<Box sx={{ margin: '0.75rem', color: '#bbbbbb', fontSize: '1rem' }}>
<MapLink
buildingId={Number(customEvent.building) || 0}
room={(customEvent.building && buildingCatalogue[+customEvent.building]?.name) || ''}
/>
<Link to={`/map?location=${customEvent.building ?? 0}`} onClick={focusMap}>
{(customEvent.building && buildingCatalogue[+customEvent.building]?.name) || ''}
</Link>
</Box>

{!skeletonMode && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ const columnLabels: Record<SectionTableColumn, string> = {
sectionEnrollment: 'Enrollment',
restrictions: 'Restrictions',
status: 'Status',
syllabus: 'Syllabus',
};

/**
Expand Down Expand Up @@ -154,6 +153,7 @@ export function CoursePaneButtonRow(props: CoursePaneButtonRowProps) {
display: props.showSearch ? 'block' : 'none',
width: '100%',
zIndex: 3,
marginBottom: 8,
position: 'absolute',
}}
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Close } from '@mui/icons-material';
import { Alert, Box, IconButton, Link, useMediaQuery, useTheme } from '@mui/material';
import { Alert, Box, IconButton, useMediaQuery } from '@mui/material';
import { AACourse, AASection, WebsocDepartment, WebsocSchool, WebsocAPIResponse, GE } from '@packages/antalmanac-types';
import { useCallback, useEffect, useState } from 'react';
import LazyLoad from 'react-lazyload';
Expand Down Expand Up @@ -166,51 +166,13 @@ const LoadingMessage = () => {
};

const ErrorMessage = () => {
const theme = useTheme();
const isDark = useThemeStore((store) => store.isDark);

const formData = RightPaneStore.getFormData();
const deptValue = formData.deptValue.replace(' ', '').toUpperCase() || null;
const courseNumber = formData.courseNumber.replace(/\s+/g, '').toUpperCase() || null;
const courseId = deptValue && courseNumber ? `${deptValue}${courseNumber}` : null;

return (
<Box
sx={{
height: '100%',
display: 'flex',
alignItems: 'center',
flexDirection: 'column',
}}
>
{courseId ? (
<Link href={`https://peterportal.org/course/${courseId}`} target="_blank" sx={{ width: '100%' }}>
<Alert
variant="filled"
severity="info"
sx={{
display: 'flex',
alignItems: 'center',
fontSize: 14,
backgroundColor: theme.palette.primary.main,
color: 'white',
}}
>
<span>
Search for{' '}
<span style={{ textDecoration: 'underline' }}>
{deptValue} {courseNumber}
</span>{' '}
on PeterPortal!
</span>
</Alert>
</Link>
) : null}

<Box sx={{ height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
<img
src={isDark ? darkNoNothing : noNothing}
alt="No Results Found"
style={{ objectFit: 'contain', width: '80%', height: '80%', pointerEvents: 'none' }}
style={{ objectFit: 'contain', width: '80%', height: '80%' }}
/>
</Box>
);
Expand Down Expand Up @@ -320,8 +282,6 @@ export default function CourseRenderPane(props: { id?: number }) {

return (
<>
<Box sx={{ height: '56px' }} />

{loading ? (
<LoadingMessage />
) : error || courseData.length === 0 ? (
Expand All @@ -330,6 +290,7 @@ export default function CourseRenderPane(props: { id?: number }) {
<>
<RecruitmentBanner />
<Box>
<Box sx={{ height: '50px', marginBottom: '5px' }} />
{courseData.map((_: WebsocSchool | WebsocDepartment | AACourse, index: number) => {
let heightEstimate = 200;
if ((courseData[index] as AACourse).sections !== undefined)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ const tableHeaderColumns: Record<Exclude<SectionTableColumn, 'action'>, TableHea
label: 'Status',
width: '8%',
},
syllabus: {
label: 'Syllabus',
width: '8%',
},
};
const tableHeaderColumnEntries = Object.entries(tableHeaderColumns);

Expand Down

This file was deleted.

Loading

0 comments on commit 0f53db5

Please sign in to comment.