From b81c1a2c42da58cc36b5920f0195624e9daa3ec7 Mon Sep 17 00:00:00 2001 From: xiaoxu Date: Sun, 15 Dec 2024 22:13:12 +0800 Subject: [PATCH 01/15] fix:adjust marathon content and nav content --- components/Marathon/Equip/index.jsx | 2 +- components/Marathon/Faq/index.jsx | 4 ++-- components/Marathon/Spotlight/index.jsx | 2 +- pages/learning-marathon/index.jsx | 10 +++++----- pages/learning-marathon/success/index.jsx | 2 +- .../MainNav/Hamberger/MarathonList/index.jsx | 18 ++++++++++-------- .../MainNav/SubList/MarathonList/index.jsx | 18 ++++++++++-------- 7 files changed, 30 insertions(+), 26 deletions(-) diff --git a/components/Marathon/Equip/index.jsx b/components/Marathon/Equip/index.jsx index 78649e17..253774df 100644 --- a/components/Marathon/Equip/index.jsx +++ b/components/Marathon/Equip/index.jsx @@ -102,7 +102,7 @@ export default function Equip() {
  • 進度安排與檢核表
  • 自我檢核表
  • 學習成果分享專區
  • -
  • AI智慧推薦與引導
  • +
  • AI推薦與引導
  • diff --git a/components/Marathon/Faq/index.jsx b/components/Marathon/Faq/index.jsx index c14ac7f9..0a337d1c 100644 --- a/components/Marathon/Faq/index.jsx +++ b/components/Marathon/Faq/index.jsx @@ -117,7 +117,7 @@ export default function Faq() { - 僅有工作坊會有錄影,小組討論和Mentor 團體諮詢不會有錄影。 + 僅有工作坊會有錄影,學習小組會議、引導師諮詢、社群活動等不會有錄影。 - 本次計劃皆是線上進行,參與者需要有電腦和網路參與。 + 本次計劃鼓勵各地學習者參與,故多數活動為線上,但為增加實體互動,部分社群活動將以實體為主,實體地點將視入圍學員所在地調整,詳細請參考重要時程。 萃取多位自我導向學習實踐者之經驗
  • 結合被譽為全球最接近民主教育的美國百年民主大學 Goddard College 教學方法(首次在台灣公開)
  • 結合 High Performance Learning Journeys 學習引導法
  • -
  • AI智慧推薦與引導
  • +
  • AI推薦與引導
  • diff --git a/pages/learning-marathon/index.jsx b/pages/learning-marathon/index.jsx index 93596d59..183a5d02 100644 --- a/pages/learning-marathon/index.jsx +++ b/pages/learning-marathon/index.jsx @@ -211,9 +211,9 @@ const Sidebar = ({ onClickSignupButton }) => { const Nav = () => { const navItems = [ - { label: '活動辦法', href: '#', active: true }, - { label: '活動公告', href: '/marathon-announcement' }, - { label: '自學計畫分享區', href: '/marathon-sharing', external: true }, + { label: '活動詳情', href: '#', active: true }, + { label: '活動公告(未開放)', href: '/marathon-announcement', disabled: true }, + { label: '學習計畫分享區(未開放)', href: '/marathon-sharing', disabled: true, external: true }, { label: '成果發表(未開放)', href: '#', disabled: true }, ]; @@ -360,7 +360,7 @@ const LearningMarathon = () => {

    特別提醒:
    - 活動重視社群互動與共學,若無法在計劃期間投入時間參與並和其他夥伴和 Mentor 互動,請斟酌申請。 + 活動重視社群互動與共學,若無法在計劃期間投入時間參與並和其他夥伴、引導師互動,請斟酌申請。

    @@ -388,7 +388,7 @@ const LearningMarathon = () => { className="bg-primary-lightest" >

    - 只要申請,不論有無入選,就可以優先使用島島阿學 AI 個人化學習工具,包含自主學習模板、學習日誌、學習進度追蹤、AI智慧與引導等功能! + 只要申請,不論有無入選,就可以優先使用島島阿學 AI 個人化學習工具,包含自主學習模板、學習日誌、學習進度追蹤、AI推薦與引導等功能!

    而入選後,你還可以與專屬引導師與學習夥伴跑完一趟自我導向學習的馬拉松,完成遲遲未開始的計畫,並在過程中... diff --git a/pages/learning-marathon/success/index.jsx b/pages/learning-marathon/success/index.jsx index 23e2f04e..97b28b36 100644 --- a/pages/learning-marathon/success/index.jsx +++ b/pages/learning-marathon/success/index.jsx @@ -108,7 +108,7 @@ const LearningMarathonSignUp = () => { <> -

    報名參加學習徵件計畫

    +

    申請參加島島盃學習馬拉松

    {} }) => { path: '/learning-marathon#marathon-intro' }, { - name: '學習計畫分享區', - id: 'marathon-sharing', - path: '/marathon-sharing' + name: '活動公告(未公開)', + id: 'marathon-announcement', + path: '/marathon-announcement', + disabled: true }, { - name: '活動公告', - id: 'marathon-announcement', - path: '/marathon-announcement' + name: '學習計畫分享區(未公開)', + id: 'marathon-sharing', + path: '/marathon-sharing', + disabled: true }, { - name: '成果分享(暫不公開)', + name: '成果分享(未公開)', id: 'project-sharing', path: '/project-sharing', disabled: true @@ -100,7 +102,7 @@ const MarathonList = ({ onCloseMenu = () => {} }) => { as="div" key={section.id} delay={`${i * 0.1}s`} - isDisabled={section.id === 'project-sharing'} + isDisabled={section.disabled === true} onClick={() => handleNavigation(section)} > {section.name} diff --git a/shared/components/Navigation_v2/MainNav/SubList/MarathonList/index.jsx b/shared/components/Navigation_v2/MainNav/SubList/MarathonList/index.jsx index 8bfd1d45..a8d9e869 100644 --- a/shared/components/Navigation_v2/MainNav/SubList/MarathonList/index.jsx +++ b/shared/components/Navigation_v2/MainNav/SubList/MarathonList/index.jsx @@ -63,17 +63,19 @@ const MarathonList = ({ onCloseMenu = () => {}, user }) => { path: '/learning-marathon#marathon-intro' }, { - name: '學習計畫分享區', - id: 'marathon-sharing', - path: '/marathon-sharing' + name: '活動公告(未公開)', + id: 'marathon-announcement', + path: '/marathon-announcement', + disabled: true }, { - name: '活動公告', - id: 'marathon-announcement', - path: '/marathon-announcement' + name: '學習計畫分享區(未公開)', + id: 'marathon-sharing', + path: '/marathon-sharing', + disabled: true }, { - name: '成果分享(暫不公開)', + name: '成果分享(未公開)', id: 'project-sharing', path: '/project-sharing', disabled: true @@ -126,7 +128,7 @@ const MarathonList = ({ onCloseMenu = () => {}, user }) => { as="div" key={section.id} delay={`${i * 0.1}s`} - isDisabled={section.id === 'project-sharing'} + isDisabled={section.disabled === true} onClick={() => handleNavigation(section)} > {section.name} From e12fc02bf0793e234b8602ae5695903b918b8997 Mon Sep 17 00:00:00 2001 From: xiaoxu Date: Sun, 15 Dec 2024 22:51:00 +0800 Subject: [PATCH 02/15] fix:adjust marathon promotion nav profile content --- components/Marathon/Price/index.jsx | 6 +++--- components/Marathon/SignUp/ConfirmForm.jsx | 8 ++++---- components/Marathon/SignUp/MarathonForm.jsx | 4 ++-- components/Marathon/SignUp/PricingForm.jsx | 4 ++-- components/Marathon/SignUp/SaveBar.jsx | 2 +- pages/learning-marathon/index.jsx | 2 +- pages/learning-marathon/signup/index.jsx | 2 +- pages/learning-marathon/success/index.jsx | 6 +++--- pages/profile/index.jsx | 4 ++-- .../Navigation_v2/MainNav/SubList/MarathonList/index.jsx | 3 ++- shared/components/Navigation_v2/index.jsx | 4 ++-- 11 files changed, 23 insertions(+), 22 deletions(-) diff --git a/components/Marathon/Price/index.jsx b/components/Marathon/Price/index.jsx index 48986ff4..c075c71e 100644 --- a/components/Marathon/Price/index.jsx +++ b/components/Marathon/Price/index.jsx @@ -332,7 +332,7 @@ export default function Price() { return ( - 報名無需費用,入選後才需繳交!
    + 申請無需費用,入選後才需繳交!
    完賽可退全額!
    @@ -355,7 +355,7 @@ export default function Price() {
    早鳥價 - 12/31 23:59 前報名 + 12/31 23:59 前申請

    NT$

    @@ -408,7 +408,7 @@ export default function Price() {
    • 活動費用於入選公告後再繳費即可,主辦單位將會寄發繳費通知到入選者信箱
    • 若完成指定的條件,會退回活動費用
    • -
    • 島島阿學提供三名中低收入戶學習者免活動費用的參與機會,報名時須提供證明
    • +
    • 島島阿學提供三名中低收入戶學習者免活動費用的參與機會,申請時須提供證明
    • 申請期間有不定期的折價優惠活動,至高可折 500 元,歡迎追蹤島島阿學 Instagram 與 FB 粉絲專頁。
    diff --git a/components/Marathon/SignUp/ConfirmForm.jsx b/components/Marathon/SignUp/ConfirmForm.jsx index b926debf..dc64fd7f 100644 --- a/components/Marathon/SignUp/ConfirmForm.jsx +++ b/components/Marathon/SignUp/ConfirmForm.jsx @@ -312,7 +312,7 @@ export default function ConfirmForm({ <>
    - 徵件計畫 + 學習計畫

    學習主題名稱:{marathonState?.title}

    @@ -412,7 +412,7 @@ export default function ConfirmForm({ /> - 報名的資格 + 申請資格 - 主辦單位將於報名成功後,確認並通知各報名者須繳交之費用 + 主辦單位將於申請成功後,確認並通知各申請者須繳交之費用 @@ -509,7 +509,7 @@ export default function ConfirmForm({ variant="contained" onClick={onSubmit} > - 提交報名 + 提交申請 diff --git a/components/Marathon/SignUp/MarathonForm.jsx b/components/Marathon/SignUp/MarathonForm.jsx index 590a2c94..73be4431 100644 --- a/components/Marathon/SignUp/MarathonForm.jsx +++ b/components/Marathon/SignUp/MarathonForm.jsx @@ -129,8 +129,8 @@ export default function MarathonForm({ marginBottom: '20px', }} > - 計劃內容在報名截止日前皆可修改。
    - 入選公告後,所有入選者及報名者亦可持續修改學習計劃 + 計劃內容在申請截止日前皆可修改。
    + 入選公告後,所有入選者及申請者亦可持續修改學習計劃 diff --git a/components/Marathon/SignUp/PricingForm.jsx b/components/Marathon/SignUp/PricingForm.jsx index 1a801d93..0af0fccb 100644 --- a/components/Marathon/SignUp/PricingForm.jsx +++ b/components/Marathon/SignUp/PricingForm.jsx @@ -97,7 +97,7 @@ export default function PricingForm({ return ( <> - 請選擇你報名的資格 + 請選擇你申請的資格 @@ -299,7 +299,7 @@ export default function PricingForm({ - 主辦單位將於報名成功後,確認並通知各報名者須繳交之費用 + 主辦單位將於申請成功後,確認並通知各申請者須繳交之費用 ); diff --git a/components/Marathon/SignUp/SaveBar.jsx b/components/Marathon/SignUp/SaveBar.jsx index 36bc1df0..0dbdde07 100644 --- a/components/Marathon/SignUp/SaveBar.jsx +++ b/components/Marathon/SignUp/SaveBar.jsx @@ -64,7 +64,7 @@ export default function SaveBar({ currentStep }) { return (
    -

    報名參加學習徵件計畫

    +

    申請參加學習馬拉松

    diff --git a/pages/learning-marathon/index.jsx b/pages/learning-marathon/index.jsx index f13aba67..294ae918 100644 --- a/pages/learning-marathon/index.jsx +++ b/pages/learning-marathon/index.jsx @@ -349,7 +349,7 @@ const LearningMarathon = () => { className="bg-primary-lightest" > -
  • 16歲以上學習者皆可報名,優先以高中及大學生為主
  • +
  • 16歲以上學習者皆可申請,優先以高中及大學生為主
  • 有意願為自己打造專屬學習旅程的學習者
  • diff --git a/pages/learning-marathon/signup/index.jsx b/pages/learning-marathon/signup/index.jsx index a6dda0bf..4d9fc7a5 100644 --- a/pages/learning-marathon/signup/index.jsx +++ b/pages/learning-marathon/signup/index.jsx @@ -51,7 +51,7 @@ const LearningMarathonSignUp = () => { const router = useRouter(); const SEOData = useMemo( () => ({ - title: '報名島島盃 - 2025 春季學習馬拉松|多元學習資源平台|島島阿學', + title: '申請島島盃 - 2025 春季學習馬拉松|多元學習資源平台|島島阿學', description: '「島島阿學」盼能透過建立多元的學習資源網絡,讓自主學習者能找到合適的成長方法,進一步成為自己想成為的人,從中培養共好精神。目前正積極打造「可共編的學習資源平台」。', keywords: '島島阿學', diff --git a/pages/learning-marathon/success/index.jsx b/pages/learning-marathon/success/index.jsx index 97b28b36..87f39a97 100644 --- a/pages/learning-marathon/success/index.jsx +++ b/pages/learning-marathon/success/index.jsx @@ -74,7 +74,7 @@ const LearningMarathonSignUp = () => { const router = useRouter(); const SEOData = useMemo( () => ({ - title: '報名島島盃 - 2025 春季學習馬拉松|多元學習資源平台|島島阿學', + title: '申請島島盃 - 2025 春季學習馬拉松|多元學習資源平台|島島阿學', description: '「島島阿學」盼能透過建立多元的學習資源網絡,讓自主學習者能找到合適的成長方法,進一步成為自己想成為的人,從中培養共好精神。目前正積極打造「可共編的學習資源平台」。', keywords: '島島阿學', @@ -122,7 +122,7 @@ const LearningMarathonSignUp = () => { marginBottom: '20px' }} > - 報名成功 + 申請成功 { marginBottom: '20px' }} > - 記得到信箱確認收到報名成功信,並確認信件沒有跑進垃圾桶。 + 記得到信箱確認收到申請成功信,並確認信件沒有跑進垃圾桶。 signup success diff --git a/pages/profile/index.jsx b/pages/profile/index.jsx index e65aced0..b0c3add4 100644 --- a/pages/profile/index.jsx +++ b/pages/profile/index.jsx @@ -82,8 +82,8 @@ const ProfilePage = () => { }, { id: 'my-marathon', - tabLabel: '學習計畫', - view: + tabLabel: '學習馬拉松', + view: } ]; diff --git a/shared/components/Navigation_v2/MainNav/SubList/MarathonList/index.jsx b/shared/components/Navigation_v2/MainNav/SubList/MarathonList/index.jsx index a8d9e869..dee5eca8 100644 --- a/shared/components/Navigation_v2/MainNav/SubList/MarathonList/index.jsx +++ b/shared/components/Navigation_v2/MainNav/SubList/MarathonList/index.jsx @@ -100,6 +100,7 @@ const MarathonList = ({ onCloseMenu = () => {}, user }) => { fontWeight: '500', display: 'flex', alignItems: 'center', + width: '215px', backgroundColor: isOpenMenu ? '#def5f5' : '#16b9b3', color: isOpenMenu ? '#16b9b3' : '#fff', padding: '8px', @@ -122,7 +123,7 @@ const MarathonList = ({ onCloseMenu = () => {}, user }) => { zIndex: 1, }} > - + {sections.map((section, i) => ( { }; const texts = [ - '✨「島島盃 - 2025 春季學習馬拉松」開跑啦!1/19 截止報名!✨', + '✨「島島盃 - 2025 春季學習馬拉松」開跑啦!1/19 截止申請!✨', '✨參加學習馬拉松,一起為自己重新打造喜歡的學習生活吧!✨', - '✨報名學習馬拉松,即可試用最新個人化功能輔助學習唷!✨', + '✨申請學習馬拉松,即可試用最新個人化功能輔助學習唷!✨', ]; // const ToolbarWrapper = styled(Toolbar)` From 21a61eb1731edf3fc262f537acbaa7816c85deb7 Mon Sep 17 00:00:00 2001 From: ruby10127130 Date: Sun, 15 Dec 2024 23:09:05 +0800 Subject: [PATCH 03/15] remove: remove no use test milestone data --- components/Marathon/SignUp/MilestoneGroup.jsx | 36 ------------------- 1 file changed, 36 deletions(-) diff --git a/components/Marathon/SignUp/MilestoneGroup.jsx b/components/Marathon/SignUp/MilestoneGroup.jsx index d91fba10..b62e3fd8 100644 --- a/components/Marathon/SignUp/MilestoneGroup.jsx +++ b/components/Marathon/SignUp/MilestoneGroup.jsx @@ -19,42 +19,6 @@ export default function MilestoneGroup({ onChange = null, isDisabled = false }) { - const testMilestones = [ - { - name: "第一階段 - 初步學習", - startDate: "2024-01-10T00:00:00.000Z", - endDate: "2024-02-10T00:00:00.000Z", - subMilestones: [ - { - name: "學習自主學習方法", - dates: ["2024-01-05T00:00:00.000Z", "2024-01-06T00:00:00.000Z"], - description: "學員將學習不同的自主學習方法,並選擇適合自己的方式。", - }, - { - name: "設立學習目標", - dates: ["2024-01-07T00:00:00.000Z", "2024-01-08T00:00:00.000Z"], - description: "學員將設立短期和長期的學習目標。", - }, - ], - }, - { - name: "第二階段 - 應用實踐", - startDate: "2024-03-01T00:00:00.000Z", - endDate: "2024-03-15T00:00:00.000Z", - subMilestones: [ - { - name: "實踐學習技巧", - dates: ["2024-02-25T00:00:00.000Z", "2024-02-28T00:00:00.000Z"], - description: "學員將開始實踐所學的時間管理與學習技巧。", - }, - { - name: "評估學習成果", - dates: ["2024-03-10T00:00:00.000Z", "2024-03-12T00:00:00.000Z"], - description: "學員將評估自己在學習過程中的進展,並調整學習策略。", - }, - ], - }, - ]; const eventWeekRange = 11; // Must be 11 weeks const [startDate, setStartDate] = useState(dayjs()); From e0361003195bac26a6f93e040d2a7b314009eb5e Mon Sep 17 00:00:00 2001 From: xiaoxu Date: Sun, 15 Dec 2024 23:51:44 +0800 Subject: [PATCH 04/15] fix:adjust marathon date and nav style --- components/Marathon/Apply/index.jsx | 6 +++--- .../MainNav/SubList/MarathonList/index.jsx | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/components/Marathon/Apply/index.jsx b/components/Marathon/Apply/index.jsx index 4ebefe51..b58a98cf 100644 --- a/components/Marathon/Apply/index.jsx +++ b/components/Marathon/Apply/index.jsx @@ -193,8 +193,8 @@ export default function Apply() { -

    02/03
    -
    +
    01/27
    +
    @@ -253,7 +253,7 @@ export default function Apply() { 14:00-15:00 - 線上暖身活動 + 暖身活動(線上) diff --git a/shared/components/Navigation_v2/MainNav/SubList/MarathonList/index.jsx b/shared/components/Navigation_v2/MainNav/SubList/MarathonList/index.jsx index dee5eca8..a040325e 100644 --- a/shared/components/Navigation_v2/MainNav/SubList/MarathonList/index.jsx +++ b/shared/components/Navigation_v2/MainNav/SubList/MarathonList/index.jsx @@ -24,8 +24,7 @@ const StyledMenuItem = styled(MenuItem)` color: ${props.isDisabled ? 'rgba(83, 97, 102, 0.5)' : '#536166'}; cursor: ${props.isDisabled ? 'not-allowed' : 'pointer'}; animation-delay: ${props.delay}; - min-width: 126px; - padding: ${props.isPadScreen ? '12px 52px' : '12px'}; + padding: 8px; font-size: ${props.isPadScreen ? '18px' : '16px'}; margin-top: ${props.isPadScreen ? '18px' : '0'}; &:hover { @@ -99,12 +98,13 @@ const MarathonList = ({ onCloseMenu = () => {}, user }) => { sx={{ fontWeight: '500', display: 'flex', + justifyContent: 'center', alignItems: 'center', - width: '215px', backgroundColor: isOpenMenu ? '#def5f5' : '#16b9b3', color: isOpenMenu ? '#16b9b3' : '#fff', + width: '230px', padding: '8px', - borderRadius: '8px', + borderRadius: '4px', transition: 'background-color 0.3s ease, padding 0.3s ease', }} onClick={() => setIsOpenMenu(!isOpenMenu)} @@ -123,7 +123,7 @@ const MarathonList = ({ onCloseMenu = () => {}, user }) => { zIndex: 1, }} > - + {sections.map((section, i) => ( Date: Mon, 16 Dec 2024 00:24:59 +0800 Subject: [PATCH 05/15] chore: correct code indent --- components/Marathon/SignUp/ConfirmForm.jsx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/components/Marathon/SignUp/ConfirmForm.jsx b/components/Marathon/SignUp/ConfirmForm.jsx index dc64fd7f..b5714633 100644 --- a/components/Marathon/SignUp/ConfirmForm.jsx +++ b/components/Marathon/SignUp/ConfirmForm.jsx @@ -287,17 +287,17 @@ export default function ConfirmForm({ }; useEffect(() => { - switch (marathonState.apiState) { - case 'success': { - toast.success('更新成功'); - break; - } - case 'Reject': { - toast.error('更新失敗'); - break; - } - default: + switch (marathonState.apiState) { + case 'success': { + toast.success('更新成功'); + break; } + case 'Reject': { + toast.error('更新失敗'); + break; + } + default: + } }, [user.apiState]); useEffect(() => { From b5e6adcedc8316437765a97e8dc8e33cac5fb65e Mon Sep 17 00:00:00 2001 From: ruby10127130 Date: Mon, 16 Dec 2024 00:33:07 +0800 Subject: [PATCH 06/15] feat: freeze startDate to 2025/02/09, freeze endDate to 2025/07/12, disabled startDate, set eventWeekRange to 22 weeks, set default frequency to biweekly, change weekNumber calculate position to avoid errors in confirmForm --- components/Marathon/SignUp/MilestoneGroup.jsx | 122 +++++++++--------- components/Marathon/SignUp/MilestonePanel.jsx | 10 +- 2 files changed, 63 insertions(+), 69 deletions(-) diff --git a/components/Marathon/SignUp/MilestoneGroup.jsx b/components/Marathon/SignUp/MilestoneGroup.jsx index b62e3fd8..a7a29147 100644 --- a/components/Marathon/SignUp/MilestoneGroup.jsx +++ b/components/Marathon/SignUp/MilestoneGroup.jsx @@ -19,20 +19,40 @@ export default function MilestoneGroup({ onChange = null, isDisabled = false }) { + const eventWeekRange = 22; + const [startDate, setStartDate] = useState('2025-02-09'); + const [endDate, setEndDate] = useState(dayjs(startDate).add('22', 'week')); + const [frequency, setFrequency] = useState('biweekly'); - const eventWeekRange = 11; // Must be 11 weeks - const [startDate, setStartDate] = useState(dayjs()); - const [endDate, setEndDate] = useState(dayjs().add('11', 'week')); - const [frequency, setFrequency] = useState('weekly'); + function arabicToChinese(num) { + const digits = ["零", "一", "二", "三", "四", "五", "六", "七", "八", "九"]; + if (num < 1 || num > 100 || !Number.isInteger(num)) { + return "Input Number must >= 1 && =< 100"; + } + + if (num === 100) { + return "一百"; + } + + const tens = Math.floor(num / 10); + const ones = num % 10; + + if (tens === 0) { + return digits[ones]; + } + if (tens === 1) { + return ones === 0 ? "十" : `十${digits[ones]}`; + } + return `${digits[tens]}十${ones === 0 ? "" : digits[ones]}`; + } function calculateMilestones( - dateToStart = dayjs(), - freq = 'weekly', + dateToStart = '2025-02-09', + freq = 'biweekly', defaultMilestones = [] ) { const interval = (freq === 'weekly') ? 7 : 14; - const milestoneLength = (freq === 'weekly') ? 11 : 6; - const week = (freq === 'weekly') ? ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '十一'] : ['一', '三', '五', '七', '九', '十一']; + const milestoneLength = (freq === 'weekly') ? 22 : 11; const newData = []; const mode = defaultMilestones.length ? 'modify' : 'create'; @@ -48,7 +68,6 @@ export default function MilestoneGroup({ name: existingMilestone.name || '', startDate: start.format('YYYY-MM-DD'), endDate: end.format('YYYY-MM-DD'), - weekNumber: `第${week[i]}週`, subMilestones: newSubMilestones }); } @@ -98,57 +117,27 @@ export default function MilestoneGroup({ }); }; useEffect(() => { - const storgedStartDate = milestones[0]?.startDate || dayjs(); - setStartDate(storgedStartDate); - - const biWeeklyMilestonesLength = 6; - const weeklyMilestonesLength = 11; + const weeklyMilestonesLength = 22; + const eventStartDate = '2025-02-09'; + setStartDate(eventStartDate); let initMilestones = []; - if (isDisabled) { - if (milestones.length === biWeeklyMilestonesLength) { - setFrequency('biweekly'); - } else { - setFrequency('weekly'); - } + if (milestones.length === weeklyMilestonesLength) { + setFrequency('weekly'); + initMilestones = calculateMilestones(eventStartDate, 'weekly', milestones); } else { - if (milestones.length === biWeeklyMilestonesLength) { - setFrequency('biweekly'); - initMilestones = calculateMilestones(storgedStartDate, 'biweekly', milestones); - onChange({ - type: 'UPDATE_FIELD', - payload: { - key: 'milestones', - value: initMilestones - } - }); - return; - } - - if (milestones.length === weeklyMilestonesLength) { - setFrequency('weekly'); - initMilestones = calculateMilestones(storgedStartDate, 'weekly', milestones); - onChange({ - type: 'UPDATE_FIELD', - payload: { - key: 'milestones', - value: initMilestones - } - }); - return; - } + setFrequency('biweekly'); + initMilestones = calculateMilestones(eventStartDate, 'biweekly', milestones); + } - if (!milestones.length) { - setFrequency('weekly'); - initMilestones = calculateMilestones(dayjs(), 'weekly', []); - onChange({ - type: 'UPDATE_FIELD', - payload: { - key: 'milestones', - value: initMilestones - } - }); - } + if (!isDisabled) { + onChange({ + type: 'UPDATE_FIELD', + payload: { + key: 'milestones', + value: initMilestones + } + }); } }, []); @@ -169,11 +158,9 @@ export default function MilestoneGroup({ ( - {milestones.map((milestone, _i) => { + {milestones.map((milestone, i) => { + const interval = frequency === 'biweekly' ? 14 : 7; + const taskStartDate = dayjs('2025-02-9').add(i * interval, 'day'); + const taskEndDate = taskStartDate.add(interval - 1, 'day'); + const weekNumber = frequency === 'biweekly' ? arabicToChinese(i * 2 + 1) : arabicToChinese(i + 1); return ( ); diff --git a/components/Marathon/SignUp/MilestonePanel.jsx b/components/Marathon/SignUp/MilestonePanel.jsx index 107a90dd..b70e2d0a 100644 --- a/components/Marathon/SignUp/MilestonePanel.jsx +++ b/components/Marathon/SignUp/MilestonePanel.jsx @@ -94,12 +94,12 @@ export default function MilestonePanel({ milestone, onChange = null, isDisabled = false, + startDate = '', + endDate = '', + weekNumber = '', }) { const { name, - weekNumber, - startDate, - endDate, subMilestones } = milestone; const [onEdit, setOnEdit] = useState(false); @@ -152,11 +152,11 @@ export default function MilestonePanel({ {weekNumber} - {dayjs(startDate).format('YYYY/MM/DD')} + {startDate} - {dayjs(endDate).format('YYYY/MM/DD')} + {endDate} From 61c93415b3da5a3ff43248f28bcb7f790185d90e Mon Sep 17 00:00:00 2001 From: ruby10127130 Date: Mon, 16 Dec 2024 00:35:29 +0800 Subject: [PATCH 07/15] fix: correct confirmForm resource data from newMathon to marathonState --- components/Marathon/SignUp/ConfirmForm.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Marathon/SignUp/ConfirmForm.jsx b/components/Marathon/SignUp/ConfirmForm.jsx index b5714633..a61f0d5d 100644 --- a/components/Marathon/SignUp/ConfirmForm.jsx +++ b/components/Marathon/SignUp/ConfirmForm.jsx @@ -374,7 +374,7 @@ export default function ConfirmForm({ }} > - {newMarathon?.resources} + {marathonState?.resources} From 0711eeeca84138a57e5d72ef10413679cbb61c8c Mon Sep 17 00:00:00 2001 From: ruby10127130 Date: Mon, 16 Dec 2024 16:10:31 +0800 Subject: [PATCH 08/15] fix: correct service updateUserProfile api methon --- services/users.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/users.ts b/services/users.ts index e7e2bff1..34400f40 100644 --- a/services/users.ts +++ b/services/users.ts @@ -79,6 +79,6 @@ export const updateUserProfileSchema = z.object({ export type UpdateUserProfile = z.infer; export const updateUserProfile = async (user: UpdateUserProfile) => { - const response = await http.delete<{ data: IUser }>(`/user/${user.id}`, user); + const response = await http.put<{ data: IUser }>(`/user/${user.id}`, user); return response.data; }; From 169c1be0be50065f1f1671abc2c5255bb0db267a Mon Sep 17 00:00:00 2001 From: xiaoxu Date: Mon, 16 Dec 2024 19:04:58 +0800 Subject: [PATCH 09/15] fix:adjust marathon content --- components/Marathon/Apply/index.jsx | 4 ++-- components/Marathon/Equip/index.jsx | 6 +++--- pages/learning-marathon/index.jsx | 8 ++++---- .../Navigation_v2/MainNav/SubList/MarathonList/index.jsx | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/components/Marathon/Apply/index.jsx b/components/Marathon/Apply/index.jsx index b58a98cf..ca4b8914 100644 --- a/components/Marathon/Apply/index.jsx +++ b/components/Marathon/Apply/index.jsx @@ -156,8 +156,8 @@ export default function Apply() { -
    12/15
    -
    +
    12/16
    +
    diff --git a/components/Marathon/Equip/index.jsx b/components/Marathon/Equip/index.jsx index 253774df..b4991c63 100644 --- a/components/Marathon/Equip/index.jsx +++ b/components/Marathon/Equip/index.jsx @@ -57,7 +57,7 @@ export default function Equip() {
    • 3 次 1 小時一對一諮詢
    • 2 次 1 小時團體諮詢
    • -
    • Mentor 每兩週對學員的學習進度給予回饋
    • +
    • 引導師每兩週對學員的學習進度給予回饋
    @@ -84,7 +84,7 @@ export default function Equip() {
    • 5 次 1 小時全員每月聚會
    • 專屬學習小組,5 次 1 小時學習小組每月聚會
    • -
    • 島島阿學 Discord 社群即時交流
    • +
    • 島島阿學Discord社群即時交流
    • 島島阿學網站找夥伴找揪團功能
    @@ -93,7 +93,7 @@ export default function Equip() { backgroundColor: '#DEF5F5' }} > - 「AI 個人化學習工具」
    引導你學習方向及自律學習
    + 「AI個人化學習工具」
    引導你學習方向及自律學習
    • 具引導性的自主學習模板
    • diff --git a/pages/learning-marathon/index.jsx b/pages/learning-marathon/index.jsx index 294ae918..ca07efe4 100644 --- a/pages/learning-marathon/index.jsx +++ b/pages/learning-marathon/index.jsx @@ -212,9 +212,9 @@ const Sidebar = ({ onClickSignupButton }) => { const Nav = () => { const navItems = [ { label: '活動詳情', href: '#', active: true }, - { label: '活動公告(未開放)', href: '/marathon-announcement', disabled: true }, - { label: '學習計畫分享區(未開放)', href: '/marathon-sharing', disabled: true, external: true }, - { label: '成果發表(未開放)', href: '#', disabled: true }, + { label: '活動公告', href: '/marathon-announcement', disabled: true }, + { label: '學習計畫分享區', href: '/marathon-sharing', disabled: true, external: true }, + { label: '成果發表', href: '#', disabled: true }, ]; const scrollPaddingTop = useScrollPaddingTop(); @@ -388,7 +388,7 @@ const LearningMarathon = () => { className="bg-primary-lightest" >

      - 只要申請,不論有無入選,就可以優先使用島島阿學 AI 個人化學習工具,包含自主學習模板、學習日誌、學習進度追蹤、AI推薦與引導等功能! + 只要申請,不論有無入選,就可以優先使用島島阿學AI個人化學習工具,包含自主學習模板、學習日誌、學習進度追蹤、AI推薦與引導等功能!

      而入選後,你還可以與專屬引導師與學習夥伴跑完一趟自我導向學習的馬拉松,完成遲遲未開始的計畫,並在過程中... diff --git a/shared/components/Navigation_v2/MainNav/SubList/MarathonList/index.jsx b/shared/components/Navigation_v2/MainNav/SubList/MarathonList/index.jsx index a040325e..a43c2c96 100644 --- a/shared/components/Navigation_v2/MainNav/SubList/MarathonList/index.jsx +++ b/shared/components/Navigation_v2/MainNav/SubList/MarathonList/index.jsx @@ -123,7 +123,7 @@ const MarathonList = ({ onCloseMenu = () => {}, user }) => { zIndex: 1, }} > - + {sections.map((section, i) => ( Date: Mon, 16 Dec 2024 19:06:24 +0800 Subject: [PATCH 10/15] fix: add conditional to avoid infinity loop of auth.updateUser --- components/Marathon/SignUp/UserProfileForm.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/Marathon/SignUp/UserProfileForm.jsx b/components/Marathon/SignUp/UserProfileForm.jsx index e7c4f386..28b01ce2 100644 --- a/components/Marathon/SignUp/UserProfileForm.jsx +++ b/components/Marathon/SignUp/UserProfileForm.jsx @@ -66,6 +66,7 @@ export default function UserProfileForm({ const check = searchParams.get('check'); const [hasClickNextStep, setHasClickNextStep] = useState(false); const [hasGetLatestMarathon, setHasGetLatestMarathon] = useState(false); + const [hasUpdateAuthContext, setHasUpdateAuthContext] = useState(false); const { userState, errors, @@ -144,7 +145,10 @@ export default function UserProfileForm({ reduxDispatch(fetchMarathonProfileByUserEvent(user._id, "2025S1")); setHasGetLatestMarathon(true); } - authDispatch.updateUser(user); + if (!hasUpdateAuthContext) { + authDispatch.updateUser(user); + setHasUpdateAuthContext(true); + } } }, [user]); From 200d7a6b238a1dd9189e846a5a426a89dcc05274 Mon Sep 17 00:00:00 2001 From: ruby10127130 Date: Mon, 16 Dec 2024 19:41:09 +0800 Subject: [PATCH 11/15] feat: seperate marathon api state with action type --- components/Marathon/SignUp/ConfirmForm.jsx | 26 ++++++++++++---------- redux/reducers/marathon.js | 17 ++++++++++++++ 2 files changed, 31 insertions(+), 12 deletions(-) diff --git a/components/Marathon/SignUp/ConfirmForm.jsx b/components/Marathon/SignUp/ConfirmForm.jsx index a61f0d5d..f41e221e 100644 --- a/components/Marathon/SignUp/ConfirmForm.jsx +++ b/components/Marathon/SignUp/ConfirmForm.jsx @@ -287,27 +287,29 @@ export default function ConfirmForm({ }; useEffect(() => { - switch (marathonState.apiState) { - case 'success': { + switch (marathonState.apiStateWithType) { + case 'updateMarathonProfileSuccess': { toast.success('更新成功'); + router.push('/learning-marathon/success'); break; } - case 'Reject': { + case 'createMarathonProfileByTokenSuccess': { + toast.success('申請成功'); + router.push('/learning-marathon/success'); + break; + } + case 'updateMarathonProfileFailure': { toast.error('更新失敗'); break; } + case 'createMarathonProfileByTokenFailure': { + toast.error('申請失敗'); + break; + } default: } - }, [user.apiState]); + }, [marathonState.apiStateWithType]); - useEffect(() => { - if ( - marathonState._id && - hasClickSubmitButton && - (marathonState.apiState === 'success')) { - router.push('/learning-marathon/success'); - } - }, [hasClickSubmitButton, user.apiState, marathonState.apiState]); return ( <> diff --git a/redux/reducers/marathon.js b/redux/reducers/marathon.js index 6b1924ac..81ec5676 100644 --- a/redux/reducers/marathon.js +++ b/redux/reducers/marathon.js @@ -31,6 +31,7 @@ const reducer = (state = initialState, action) => { return { ...state, apiState: "pending", + apiStateWithType: 'fetchMarathonProfileByUserId' }; } case "FETCH_MARATHON_PROFILE_BY_USER_ID_SUCCESS": { @@ -38,23 +39,27 @@ const reducer = (state = initialState, action) => { ...state, userMarathon: action.payload, apiState: "success", + apiStateWithType: 'fetchMarathonProfileByUserIdSuccess' }; } case "FETCH_MARATHON_PROFILE_BY_USER_ID_FAILURE": { return { ...state, apiState: "reject", + apiStateWithType: 'fetchMarathonProfileByUserIdFailure' }; } case "UPDATE_NEW_MARATHON": { return { ...action.payload, + apiStateWithType: 'updateNewMarathon' }; } case "FETCH_MARATHON_PROFILE_BY_USER_EVENT": { return { ...state, apiState: "pending", + apiStateWithType: 'fetchMarathonProfileByUserEvent' }; } case "FETCH_MARATHON_PROFILE_BY_USER_EVENT_SUCCESS": { @@ -62,12 +67,14 @@ const reducer = (state = initialState, action) => { ...state, ...action.payload, apiState: "success", + apiStateWithType: 'fetchMarathonProfileByUserEventSuccess' }; } case "FETCH_MARATHON_PROFILE_BY_USER_EVENT_FAILURE": { return { ...state, apiState: "reject", + apiStateWithType: 'fetchMarathonProfileByUserEventFailure' }; } case "FETCH_MARATHON_PROFILE_BY_ID_SUCCESS": { @@ -75,18 +82,21 @@ const reducer = (state = initialState, action) => { ...state, ...action.payload, apiState: "success", + apiStateWithType: 'fetchMarathonProfileByIdSuccess' }; } case "FETCH_MARATHON_PROFILE_BY_ID_FAILURE": { return { ...state, apiState: "reject", + apiStateWithType: 'fetchMarathonProfileByIdFailure' }; } case "UPDATE_MARATHON_PROFILE": { return { ...state, apiState: "pending", + apiStateWithType: 'updateMarathonProfile' }; } case "UPDATE_MARATHON_PROFILE_SUCCESS": { @@ -94,12 +104,14 @@ const reducer = (state = initialState, action) => { ...state, ...action.payload, apiState: "success", + apiStateWithType: 'updateMarathonProfileSuccess' }; } case "UPDATE_MARATHON_PROFILE_FAILURE": { return { ...state, apiState: "reject", + apiStateWithType: 'updateMarathonProfileFailure', }; } @@ -107,6 +119,7 @@ const reducer = (state = initialState, action) => { return { ...state, apiState: "pending", + apiStateWithType: 'createMarathonProfileByToken', }; } case "CREATE_MARATHON_PROFILE_BY_TOKEN_SUCCESS": { @@ -114,24 +127,28 @@ const reducer = (state = initialState, action) => { ...state, ...action.payload, apiState: "success", + apiStateWithType: 'createMarathonProfileByTokenSuccess' }; } case "CREATE_MARATHON_PROFILE_BY_TOKEN_FAILURE": { return { ...state, apiState: "reject", + apiStateWithType: 'createMarathonProfileByTokenFailure' }; } case "FETCH_MARATHON_PROFILE_BY_ID": { return { ...state, apiState: "pending", + apiStateWithType: 'fetchMarathonProfileById', }; } case 'UPDATE_MARATHON_PROFILE_API_STATE_RESET': { return { ...state, apiState: 'None', + apiStateWithType: 'updateMarathonProfileApiStateReset' }; } default: { From 42f8f0fd01a2b823ee268c692926164cecae2818 Mon Sep 17 00:00:00 2001 From: xiaoxu Date: Mon, 16 Dec 2024 21:14:30 +0800 Subject: [PATCH 12/15] fix: adjust css style to fix only watch 4 cards --- components/Marathon/Mentors.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Marathon/Mentors.jsx b/components/Marathon/Mentors.jsx index fdb18034..64d964bf 100644 --- a/components/Marathon/Mentors.jsx +++ b/components/Marathon/Mentors.jsx @@ -290,7 +290,7 @@ const Mentors = () => {

      Date: Mon, 16 Dec 2024 21:29:02 +0800 Subject: [PATCH 13/15] fix:add cotent to intro for card display error --- components/Marathon/Mentors.jsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/Marathon/Mentors.jsx b/components/Marathon/Mentors.jsx index 64d964bf..f727ef4e 100644 --- a/components/Marathon/Mentors.jsx +++ b/components/Marathon/Mentors.jsx @@ -287,6 +287,11 @@ const Mentors = () => {
    +
    +

    + 本次引導師皆有豐富的自主學習實踐與陪伴引導經驗,共六位:林怡廷(島島阿學發起人)、許明宏(島島阿學發起人)、謝佩君(Talent Lab-Learning Facilitator)、沈潔伃(魚水教育催化劑創辦人)、閉恩濡(實驗教育工作者)、楊逸帆(《學習的理由》紀錄片導演)。 +

    +
    { ))}
    + Date: Mon, 16 Dec 2024 21:50:57 +0800 Subject: [PATCH 14/15] fix:adjust eslint error --- components/Marathon/Mentors.jsx | 1 - 1 file changed, 1 deletion(-) diff --git a/components/Marathon/Mentors.jsx b/components/Marathon/Mentors.jsx index e80f61a4..a05fa034 100644 --- a/components/Marathon/Mentors.jsx +++ b/components/Marathon/Mentors.jsx @@ -327,7 +327,6 @@ const Mentors = () => { ))}
    - Date: Mon, 16 Dec 2024 22:15:26 +0800 Subject: [PATCH 15/15] fix:remove content for better operatering card --- components/Marathon/Mentors.jsx | 6 ------ 1 file changed, 6 deletions(-) diff --git a/components/Marathon/Mentors.jsx b/components/Marathon/Mentors.jsx index a05fa034..33d34fe9 100644 --- a/components/Marathon/Mentors.jsx +++ b/components/Marathon/Mentors.jsx @@ -290,12 +290,6 @@ const Mentors = () => { -
    -

    - 本次引導師皆有豐富的自主學習實踐與陪伴引導經驗,共六位:林怡廷(島島阿學發起人)、許明宏(島島阿學發起人)、謝佩君(Talent Lab-Learning Facilitator)、沈潔伃(魚水教育催化劑創辦人)、閉恩濡(實驗教育工作者)、楊逸帆(《學習的理由》紀錄片導演)。 -

    -
    -