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

feat(web): enable 2567 with warnings #682

Merged
merged 2 commits into from
Jun 8, 2024
Merged
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
5 changes: 5 additions & 0 deletions .changeset/dull-schools-doubt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"web": minor
---

feat: enable 2567 with warnings
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,12 @@ export function getNotRegChulaWarning(): AnnouncementItem {
severity: 'warning',
}
}

export function term67Issue(): AnnouncementItem {
return {
id: 'term_67_issue',
label:
'ข้อมูลของปีการศึกษา 2567 จะยังมีไม่ครบ เนื่องจากปัญหาของการเชื่อมต่อระหว่าง CU Get Reg กับเว็บไซต์ของทะเบียนจุฬาฯ ขออภัยในความไม่สะดวก',
severity: 'error',
}
}
3 changes: 2 additions & 1 deletion apps/web/src/common/components/TopBar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useRouter } from 'next/router'

import { AnnouncementBar } from './components/AnnouncementBar'
import { getAnnouncement1, getNotRegChulaWarning } from './components/AnnouncementBar/announcements'
import { getAnnouncement1, getNotRegChulaWarning, term67Issue } from './components/AnnouncementBar/announcements'
import { ConfigBar } from './components/ConfigBar'
import { ConfigBarLayout } from './components/ConfigBar/styled'
import { NavBar } from './components/NavBar'
Expand All @@ -13,6 +13,7 @@ export function AnnouncementSection() {
<>
<AnnouncementBar announcement={getAnnouncement1()} />
<AnnouncementBar announcement={getNotRegChulaWarning()} />
<AnnouncementBar announcement={term67Issue()} />
</>
)
}
Expand Down
5 changes: 4 additions & 1 deletion apps/web/src/common/constants/terms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ interface TermOption {
}

export const termOptions: TermOption[] = [
{ academicYear: '2567', semester: '3', label: '2567/ฤดูร้อน' },
{ academicYear: '2567', semester: '2', label: '2567/2' },
{ academicYear: '2567', semester: '1', label: '2567/1' },
{ academicYear: '2566', semester: '3', label: '2566/ฤดูร้อน' },
{ academicYear: '2566', semester: '2', label: '2566/2' },
{ academicYear: '2566', semester: '1', label: '2566/1' },
Expand All @@ -16,4 +19,4 @@ export const termOptions: TermOption[] = [
{ academicYear: '2564', semester: '1', label: '2564/1' },
]

export const tempHardCodedCurrentTerm = termOptions[1]
export const tempHardCodedCurrentTerm = termOptions[2]
Loading