-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from LioQing/v0.2.0
v0.2.0
- Loading branch information
Showing
14 changed files
with
939 additions
and
751 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Changelog | ||
|
||
## [0.2.0] - 2023-07-23 | ||
|
||
🎉 New academic year, new version! 🎉 | ||
|
||
🌟 Wish everyone a great year ahead 🌟 | ||
|
||
### Added | ||
|
||
- 📅 Time slots with overlapping courses now try to show course codes in the table view. | ||
- 🔍 Search bar now supports searching course by title and regex. | ||
- 📝 Changelog button in the 'About This App' section. | ||
|
||
### Changed | ||
|
||
- 💬 Introduction and help messages. | ||
|
||
### Fixed | ||
|
||
- 📜 Course list not taking up full width provided by the panel. | ||
- 🏎️ Minor performance improvements. | ||
|
||
## [0.1.1] - 2023-05-19 | ||
|
||
Undocumented bug fixes. | ||
|
||
## [0.1.0] - 2022-7-21 | ||
|
||
Initial release. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,54 @@ | ||
{ | ||
"name": "hku-timetable-viewer", | ||
"version": "0.1.1", | ||
"private": true, | ||
"homepage": "http://lioqing.github.io/hku-timetable-viewer", | ||
"dependencies": { | ||
"@emotion/react": "^11.9.0", | ||
"@emotion/styled": "^11.8.1", | ||
"@mui/icons-material": "^5.8.0", | ||
"@mui/material": "^5.8.1", | ||
"@mui/x-data-grid": "^5.13.1", | ||
"@testing-library/jest-dom": "^5.16.4", | ||
"@testing-library/react": "^13.3.0", | ||
"@testing-library/user-event": "^13.5.0", | ||
"file-saver": "^2.0.5", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"react-scripts": "5.0.1", | ||
"typescript": "^4.7.4", | ||
"web-vitals": "^2.1.4", | ||
"xlsx": "^0.18.5" | ||
}, | ||
"scripts": { | ||
"start": "react-scripts start WATCHPACK_POLLING=true", | ||
"build": "react-scripts build", | ||
"test": "react-scripts test", | ||
"eject": "react-scripts eject" | ||
}, | ||
"eslintConfig": { | ||
"extends": [ | ||
"react-app", | ||
"react-app/jest" | ||
] | ||
}, | ||
"browserslist": { | ||
"production": [ | ||
">0.2%", | ||
"not dead", | ||
"not op_mini all" | ||
], | ||
"development": [ | ||
"last 1 chrome version", | ||
"last 1 firefox version", | ||
"last 1 safari version" | ||
] | ||
}, | ||
"devDependencies": { | ||
"@types/file-saver": "^2.0.5", | ||
"@types/jest": "^27.5.2", | ||
"@types/node": "^16.11.45", | ||
"@types/react": "^18.0.15", | ||
"@types/react-dom": "^18.0.6" | ||
} | ||
} | ||
{ | ||
"name": "hku-timetable-viewer", | ||
"version": "0.2.0", | ||
"private": true, | ||
"homepage": "http://lioqing.github.io/hku-timetable-viewer", | ||
"dependencies": { | ||
"@emotion/react": "^11.9.0", | ||
"@emotion/styled": "^11.8.1", | ||
"@mui/icons-material": "^5.8.0", | ||
"@mui/material": "^5.8.1", | ||
"@mui/x-data-grid": "^5.13.1", | ||
"@testing-library/jest-dom": "^5.16.4", | ||
"@testing-library/react": "^13.3.0", | ||
"@testing-library/user-event": "^13.5.0", | ||
"file-saver": "^2.0.5", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"react-scripts": "5.0.1", | ||
"typescript": "^4.7.4", | ||
"web-vitals": "^2.1.4", | ||
"xlsx": "^0.18.5" | ||
}, | ||
"scripts": { | ||
"start": "react-scripts start WATCHPACK_POLLING=true", | ||
"build": "react-scripts build", | ||
"test": "react-scripts test", | ||
"eject": "react-scripts eject" | ||
}, | ||
"eslintConfig": { | ||
"extends": [ | ||
"react-app", | ||
"react-app/jest" | ||
] | ||
}, | ||
"browserslist": { | ||
"production": [ | ||
">0.2%", | ||
"not dead", | ||
"not op_mini all" | ||
], | ||
"development": [ | ||
"last 1 chrome version", | ||
"last 1 firefox version", | ||
"last 1 safari version" | ||
] | ||
}, | ||
"devDependencies": { | ||
"@types/file-saver": "^2.0.5", | ||
"@types/jest": "^27.5.2", | ||
"@types/node": "^16.11.45", | ||
"@types/react": "^18.0.15", | ||
"@types/react-dom": "^18.0.6" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,111 +1,111 @@ | ||
import { useContext } from 'react'; | ||
import Typography from '@mui/material/Typography'; | ||
import Box from '@mui/material/Box'; | ||
import ToggleButton from '@mui/material/ToggleButton'; | ||
import Prompt from './Prompt'; | ||
import Course from '../utils/Course'; | ||
import { dayNames, getHourString } from '../utils/TimeUtils'; | ||
import { TimetableContext } from '../context/TimetableContext'; | ||
import TabOptions from '../utils/TabOptions'; | ||
|
||
interface Props { | ||
info: string | null; | ||
setInfo: (info: string | null) => void; | ||
} | ||
|
||
const CourseInfo = ({ info, setInfo }: Props) => { | ||
const { timetable, setTimetable } = useContext(TimetableContext); | ||
|
||
if (!info) return null; | ||
|
||
const isHidden = timetable.tabOptions.get(timetable.currTab)!.selectedHidden.get(info!)!; | ||
|
||
const maybeCourse = timetable.courses.get(info); | ||
if (!maybeCourse) { | ||
console.error(`CourseInfo: course ${info} not found`); | ||
return null; | ||
} | ||
const course = maybeCourse as Course; | ||
|
||
return ( | ||
<Prompt title='Course Info' open={info !== null} onClose={() => setInfo(null)}> | ||
<Typography variant='h4'>{course.courseTitle}</Typography> | ||
<Typography variant='body1'> | ||
Term: {course.term} | ||
<br /> | ||
Career: {course.acadCareer} | ||
<br /> | ||
Offer Department: {course.offerDept} | ||
<br /> | ||
<br /> | ||
Instructor: {course.instructor} | ||
<br /> | ||
<br /> | ||
</Typography> | ||
{course.times.map((time, i) => { | ||
return ( | ||
<Box key={i} style={{ display: 'flex', flexDirection: 'row', gap: '4px', alignItems: 'center', margin: '4px' }}> | ||
<ToggleButton | ||
value='hide button' | ||
color='primary' | ||
selected={isHidden ? isHidden[i] : false} | ||
disabled={!timetable.selected.get(timetable.currTab)!.includes(info)} | ||
onChange={() => { | ||
setTimetable({ | ||
...timetable, | ||
tabOptions: timetable.tabOptions.set( | ||
timetable.currTab, | ||
TabOptions.fromObject({ | ||
...timetable.tabOptions.get(timetable.currTab)!, | ||
selectedHidden: new Map( | ||
Array.from(timetable.tabOptions.get(timetable.currTab!)!.selectedHidden).map(([id, hidden]) => { | ||
if (id !== info) return [id, hidden]; | ||
return [ | ||
id, | ||
hidden.map((a, j) => { | ||
if (j !== i) return a; | ||
return !a; | ||
}) | ||
]; | ||
}) | ||
), | ||
}) | ||
), | ||
}); | ||
}} | ||
style={{ | ||
padding: '4px', | ||
}}> | ||
<Typography component='span' variant='caption'> | ||
Hide | ||
</Typography> | ||
</ToggleButton> | ||
<Typography component={'span'} variant='body1'> | ||
{time.startDate.toLocaleDateString('en-GB')} | ||
{' - '} | ||
{time.endDate.toLocaleDateString('en-GB')} | ||
{'; '} | ||
{getHourString(time.startTime)} | ||
{' - '} | ||
{getHourString(time.endTime)} | ||
{'; '} | ||
{time.weekday | ||
.map((day, index) => { | ||
if (!day) return null; | ||
return dayNames[index]; | ||
}) | ||
.filter(day => day !== null) | ||
.join(', ') | ||
} | ||
{'; '} | ||
{time.venue} | ||
<br /> | ||
</Typography> | ||
</Box> | ||
); | ||
})} | ||
</Prompt> | ||
); | ||
}; | ||
|
||
import { useContext } from 'react'; | ||
import Typography from '@mui/material/Typography'; | ||
import Box from '@mui/material/Box'; | ||
import ToggleButton from '@mui/material/ToggleButton'; | ||
import Prompt from './Prompt'; | ||
import Course from '../utils/Course'; | ||
import { dayNames, getHourString } from '../utils/TimeUtils'; | ||
import { TimetableContext } from '../context/TimetableContext'; | ||
import TabOptions from '../utils/TabOptions'; | ||
|
||
interface Props { | ||
info: string | null; | ||
setInfo: (info: string | null) => void; | ||
} | ||
|
||
const CourseInfo = ({ info, setInfo }: Props) => { | ||
const { timetable, setTimetable } = useContext(TimetableContext); | ||
|
||
if (!info) return null; | ||
|
||
const isHidden = timetable.tabOptions.get(timetable.currTab)!.selectedHidden.get(info!)!; | ||
|
||
const maybeCourse = timetable.courses.get(info); | ||
if (!maybeCourse) { | ||
console.error(`CourseInfo: course ${info} not found`); | ||
return null; | ||
} | ||
const course = maybeCourse as Course; | ||
|
||
return ( | ||
<Prompt title={`Course Info - ${course.courseCode} - ${course.classSection}`} open={info !== null} onClose={() => setInfo(null)}> | ||
<Typography variant='h4'>{course.courseTitle}</Typography> | ||
<Typography variant='body1'> | ||
Term: {course.term} | ||
<br /> | ||
Career: {course.acadCareer} | ||
<br /> | ||
Offer Department: {course.offerDept} | ||
<br /> | ||
<br /> | ||
Instructor: {course.instructor} | ||
<br /> | ||
<br /> | ||
</Typography> | ||
{course.times.map((time, i) => { | ||
return ( | ||
<Box key={i} style={{ display: 'flex', flexDirection: 'row', gap: '4px', alignItems: 'center', margin: '4px' }}> | ||
<ToggleButton | ||
value='hide button' | ||
color='primary' | ||
selected={isHidden ? isHidden[i] : false} | ||
disabled={!timetable.selected.get(timetable.currTab)!.includes(info)} | ||
onChange={() => { | ||
setTimetable({ | ||
...timetable, | ||
tabOptions: timetable.tabOptions.set( | ||
timetable.currTab, | ||
TabOptions.fromObject({ | ||
...timetable.tabOptions.get(timetable.currTab)!, | ||
selectedHidden: new Map( | ||
Array.from(timetable.tabOptions.get(timetable.currTab!)!.selectedHidden).map(([id, hidden]) => { | ||
if (id !== info) return [id, hidden]; | ||
return [ | ||
id, | ||
hidden.map((a, j) => { | ||
if (j !== i) return a; | ||
return !a; | ||
}) | ||
]; | ||
}) | ||
), | ||
}) | ||
), | ||
}); | ||
}} | ||
style={{ | ||
padding: '4px', | ||
}}> | ||
<Typography component='span' variant='caption'> | ||
Hide | ||
</Typography> | ||
</ToggleButton> | ||
<Typography component={'span'} variant='body1'> | ||
{time.startDate.toLocaleDateString('en-GB')} | ||
{' - '} | ||
{time.endDate.toLocaleDateString('en-GB')} | ||
{'; '} | ||
{getHourString(time.startTime)} | ||
{' - '} | ||
{getHourString(time.endTime)} | ||
{'; '} | ||
{time.weekday | ||
.map((day, index) => { | ||
if (!day) return null; | ||
return dayNames[index]; | ||
}) | ||
.filter(day => day !== null) | ||
.join(', ') | ||
} | ||
{'; '} | ||
{time.venue} | ||
<br /> | ||
</Typography> | ||
</Box> | ||
); | ||
})} | ||
</Prompt> | ||
); | ||
}; | ||
|
||
export default CourseInfo; |
Oops, something went wrong.