Skip to content

Commit

Permalink
feat(web): enable 2567 with warnings (#682)
Browse files Browse the repository at this point in the history
* enable 2567

* feat: 2567 warning
  • Loading branch information
leomotors authored Jun 8, 2024
1 parent 889ae3a commit 02b8e7b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
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]

0 comments on commit 02b8e7b

Please sign in to comment.