From 5a01aa5b8fd452c8fb9a0bae24c3a769210f46f1 Mon Sep 17 00:00:00 2001 From: chenyu-01 Date: Tue, 26 Dec 2023 05:21:41 +0800 Subject: [PATCH 1/3] ui change --- src/components/Dashboard/Dashboard.jsx | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/components/Dashboard/Dashboard.jsx b/src/components/Dashboard/Dashboard.jsx index d80e8e1..e89598d 100644 --- a/src/components/Dashboard/Dashboard.jsx +++ b/src/components/Dashboard/Dashboard.jsx @@ -1,22 +1,10 @@ import { React } from 'react'; import Layout from './Layout.jsx'; -import { AuthContext } from '../../context/AuthContext.jsx'; -import { useContext } from 'react'; +import Profile from '../Profile/Profile.jsx'; export default function Dashboard() { - const { userData } = useContext(AuthContext); - return ( -
-

Profile

-

Id: {userData.id}

-

Role: {userData.role}

-

User: {userData.name}

-

Email: {userData.email}

- {userData.role === 'User' ? ( -

Waiting for Admin to assign you your role

- ) : null} -
+
); } From e45b190f929d92ff85f75ddb5cee2c98c74633dd Mon Sep 17 00:00:00 2001 From: chenyu-01 Date: Tue, 26 Dec 2023 05:21:57 +0800 Subject: [PATCH 2/3] fix overseas deserialize --- src/components/LeaveHistory/LeaveModify.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/LeaveHistory/LeaveModify.jsx b/src/components/LeaveHistory/LeaveModify.jsx index 888b612..96b7729 100644 --- a/src/components/LeaveHistory/LeaveModify.jsx +++ b/src/components/LeaveHistory/LeaveModify.jsx @@ -105,7 +105,7 @@ function LeaveModify() { setEndDate(la.endDate); setReason(la.reason); setContactInfo(la.contactInfo || ''); // For not oversea leave, contactInfo may be null - setIsOverseas(la.isOverseas || false); + setIsOverseas(la.overseas); } else { console.error('Error fetching leave application:', response); } From 58ab573c2aa29c9c2ca149fe5a837fa18ed40f4a Mon Sep 17 00:00:00 2001 From: chenyu-01 Date: Tue, 26 Dec 2023 05:43:41 +0800 Subject: [PATCH 3/3] add workdissemination info --- src/components/LeaveHistory/LeaveModify.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/LeaveHistory/LeaveModify.jsx b/src/components/LeaveHistory/LeaveModify.jsx index 96b7729..61e8e89 100644 --- a/src/components/LeaveHistory/LeaveModify.jsx +++ b/src/components/LeaveHistory/LeaveModify.jsx @@ -104,8 +104,9 @@ function LeaveModify() { setStartDate(la.startDate); setEndDate(la.endDate); setReason(la.reason); - setContactInfo(la.contactInfo || ''); // For not oversea leave, contactInfo may be null + setContactInfo(la.contactInfo); setIsOverseas(la.overseas); + setWorkDissemination(la.workDissemination); } else { console.error('Error fetching leave application:', response); }