From 02b8e7b615c81c1e28d5c9c39accb805bb7aea6c Mon Sep 17 00:00:00 2001 From: Nutthapat Pongtanyavichai <59821765+leomotors@users.noreply.github.com> Date: Sat, 8 Jun 2024 21:56:07 +0700 Subject: [PATCH] feat(web): enable 2567 with warnings (#682) * enable 2567 * feat: 2567 warning --- .changeset/dull-schools-doubt.md | 5 +++++ .../TopBar/components/AnnouncementBar/announcements.ts | 9 +++++++++ apps/web/src/common/components/TopBar/index.tsx | 3 ++- apps/web/src/common/constants/terms.ts | 5 ++++- 4 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 .changeset/dull-schools-doubt.md diff --git a/.changeset/dull-schools-doubt.md b/.changeset/dull-schools-doubt.md new file mode 100644 index 000000000..c7d86bc15 --- /dev/null +++ b/.changeset/dull-schools-doubt.md @@ -0,0 +1,5 @@ +--- +"web": minor +--- + +feat: enable 2567 with warnings diff --git a/apps/web/src/common/components/TopBar/components/AnnouncementBar/announcements.ts b/apps/web/src/common/components/TopBar/components/AnnouncementBar/announcements.ts index 3c2ea782d..13d8b0c60 100644 --- a/apps/web/src/common/components/TopBar/components/AnnouncementBar/announcements.ts +++ b/apps/web/src/common/components/TopBar/components/AnnouncementBar/announcements.ts @@ -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', + } +} diff --git a/apps/web/src/common/components/TopBar/index.tsx b/apps/web/src/common/components/TopBar/index.tsx index 34dde74ac..c12d5ae97 100644 --- a/apps/web/src/common/components/TopBar/index.tsx +++ b/apps/web/src/common/components/TopBar/index.tsx @@ -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' @@ -13,6 +13,7 @@ export function AnnouncementSection() { <> + ) } diff --git a/apps/web/src/common/constants/terms.ts b/apps/web/src/common/constants/terms.ts index 6b2ac8161..4a925f231 100644 --- a/apps/web/src/common/constants/terms.ts +++ b/apps/web/src/common/constants/terms.ts @@ -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' }, @@ -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]