Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
156bc03
Update Home.js
Kamal-Poshala Apr 14, 2025
653b4a5
Update CoordinatorDashboard.js
Kamal-Poshala Apr 14, 2025
eb4e8e3
Update package.json
Kamal-Poshala Apr 14, 2025
eacf9ed
Merge branch 'main' into team-a/development
Kamal-Poshala Apr 14, 2025
5de02bf
Update index.js
Kamal-Poshala Apr 14, 2025
aee8575
fix tests
Apr 14, 2025
806c547
Merge branch 'main' into team-a/development
ICook094 Apr 14, 2025
ce35fdf
undo test 'fix' - fix
Apr 14, 2025
291e1dd
Delete package.json
Kamal-Poshala Apr 14, 2025
b808bbf
address comments
Apr 14, 2025
417ef7c
Merge branch 'team-a/development' of https://github.com/IPMS-Project/…
Apr 14, 2025
91f4487
Restore client/package-lock.json to fix massive diff
Kamal-Poshala Apr 3, 2025
88bdb6c
Restore server/package-lock.json to clean up diff
Kamal-Poshala Apr 3, 2025
e9d59bc
student dashboard filtering
Kamal-Poshala Apr 18, 2025
a7360d4
student dashboard update from Group F
Kamal-Poshala Apr 18, 2025
177143c
Complete Task 4: Notify student if coordinator does not respond after…
Kamal-Poshala Apr 18, 2025
ac9dc26
Resolved conflicts while merging team-a/development into team-a/kamal…
Kamal-Poshala Apr 19, 2025
2b97507
Delete client/package-lock.json
Kamal-Poshala Apr 19, 2025
8ecf917
Delete server/package-lock.json
Kamal-Poshala Apr 19, 2025
6457e0c
Resolved more conflicts while merging team-a/development into team-a/…
Kamal-Poshala Apr 19, 2025
b744542
Merge branch 'team-a/kamal-dev' of https://github.com/IPMS-Project/IP…
Kamal-Poshala Apr 19, 2025
b6c6b75
updated email sending functionality for sprint 2
vijaychirram Apr 20, 2025
6008400
removed coordinator.js
vijaychirram Apr 20, 2025
7dc612e
send reminder emails after 5 then 10 work days
Apr 20, 2025
1f6a7af
Merge branch 'main' of https://github.com/IPMS-Project/IPMS into team…
Apr 20, 2025
654a0ca
fix errors
Apr 20, 2025
d4fed4c
Merge pull request #131 from IPMS-Project/teama/3
vijaychirram Apr 20, 2025
f740c91
updated coordinator dashboard
vijaychirram Apr 20, 2025
a8298ef
updated index.js
vijaychirram Apr 20, 2025
f78dbd1
Merge branch 'team-a/development' into team-a/kamal-dev
Kamal-Poshala Apr 20, 2025
e212910
Merge pull request #127 from IPMS-Project/team-a/kamal-dev
Kamal-Poshala Apr 20, 2025
e9fe5d8
Update CoordinatorDashboard.js
vijaychirram Apr 21, 2025
b406222
Update index.js
vijaychirram Apr 21, 2025
612f5a5
resolved some errors
Kamal-Poshala Apr 21, 2025
228cd28
Update Home.js
Kamal-Poshala Apr 21, 2025
5fbb503
Merge branch 'main' into team-a/development
ICook094 Apr 21, 2025
4fe9c05
Merge branch 'main' into team-a/development
ICook094 Apr 21, 2025
4cd7c5f
updated approval routes for supervisor status fetching from submisssion
vijaychirram Apr 21, 2025
791a0ac
up to date and ready for review
Kamal-Poshala Apr 21, 2025
cd280e4
Update StudentDashboard.jsx
Kamal-Poshala Apr 21, 2025
e7ffdc1
Delete client/src/pages/StudentDashboard.js
Kamal-Poshala Apr 21, 2025
6599135
Merge branch 'main' into team-a/development
Kamal-Poshala Apr 22, 2025
2ad2930
Update reminderEmail.js
Kamal-Poshala Apr 22, 2025
7e50df1
Update reminderEmail.js
Kamal-Poshala Apr 22, 2025
061218a
Update approvalController.js
Kamal-Poshala Apr 22, 2025
37f43a9
Update reminderEmail.test.js
Kamal-Poshala Apr 22, 2025
9c3ab54
Update reminderEmail.test.js
Kamal-Poshala Apr 22, 2025
66b10d3
Update reminderEmail.test.js
Kamal-Poshala Apr 22, 2025
368606b
Update reminderEmail.test.js
Kamal-Poshala Apr 22, 2025
3d65071
some minor adjustment
Kamal-Poshala Apr 23, 2025
6bc649e
minor change
Kamal-Poshala Apr 23, 2025
7e3ec52
Update reminderEmail.test.js
Kamal-Poshala Apr 23, 2025
b6d5d48
Update reminderEmail.test.js
Kamal-Poshala Apr 23, 2025
428160b
update
Kamal-Poshala Apr 23, 2025
ac2fbfb
Update
Kamal-Poshala Apr 23, 2025
c4ed842
Update reminderEmail.test.js
Kamal-Poshala Apr 23, 2025
d91aca3
Update reminderEmail.test.js
Kamal-Poshala Apr 23, 2025
7637eec
Delete server/jobs/reminderEmail.test.js
Kamal-Poshala Apr 23, 2025
d410ba5
Resolved merge conflicts
Apr 25, 2025
5494920
changes after resolving conflicts
Apr 25, 2025
a2e854d
Resolved merge conflicts
Apr 25, 2025
814b145
Resolved merge conflicts
Apr 25, 2025
852a5d4
Merge pull request #137 from IPMS-Project/team-a/development
Pratham0919 Apr 25, 2025
8cc098f
Merge branch 'GroupE-frontend' into GroupE/frontend
MRPHFitch Apr 25, 2025
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
16 changes: 8 additions & 8 deletions client/src/pages/A1InternshipRequestForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,11 @@ const A1InternshipRequestForm = ({ userRole = "student" }) => {

const submitFormData = async () => {
try {
const submissionPayload = {
studentName: formData.interneeName,
soonerId: formData.soonerId,
studentEmail: formData.interneeEmail,
// Fetch logged-in student ID from localStorage or context
const studentId = localStorage.getItem("studentId"); // You must store this during login

const payload = {
student: studentId,
workplace: {
name: formData.workplaceName,
website: formData.website,
Expand All @@ -271,15 +272,13 @@ const A1InternshipRequestForm = ({ userRole = "student" }) => {
endDate: formData.endDate,
tasks: formData.tasks,
status: "submitted",
approvals: ["advisor"]
};
console.log("Submitting payload:", submissionPayload);



const response = await fetch(`${process.env.REACT_APP_API_URL}/api/form/submit`, {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(submissionPayload),
});

Expand All @@ -293,6 +292,7 @@ const A1InternshipRequestForm = ({ userRole = "student" }) => {
throw error;
}
};


const sendTaskDescriptions = async (descriptions) => {
try {
Expand Down
83 changes: 38 additions & 45 deletions client/src/pages/Home.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, useEffect } from "react";
import React, { useState } from "react";
import { Link, useNavigate } from "react-router-dom";
import "../styles/App.css";
import { FaEnvelope, FaLock, FaEye, FaEyeSlash } from "react-icons/fa";
Expand All @@ -13,28 +13,20 @@ function Home() {
const [formData, setFormData] = useState({
email: "",
password: "",

role: "student",
});
const [showPassword, setShowPassword] = useState(false);
const [role] = useState("student");

// Sync role into formData.role
useEffect(() => {
setFormData((prev) => ({ ...prev, role }));
}, [role]);

const handleInputChange = (e) => {
const { name, value } = e.target;
setFormData({
...formData,
setFormData((prev) => ({
...prev,
[name]: value,
});
}));
};

const handleSubmit = async (e) => {
e.preventDefault();

const { email: ouEmail, password, role } = formData;


Expand All @@ -55,7 +47,7 @@ function Home() {
"Content-Type": "application/json",
},
body: JSON.stringify({ ouEmail, password, role }),
},
}
);

const data = await response.json();
Expand All @@ -64,22 +56,29 @@ function Home() {
const user = data.user;
if(role === "student"){
// Store only required fields
const limitedUserInfo = {
fullName: user.fullName,
id: user._id,
email:user.ouEmail
};
localStorage.setItem("ipmsUser", JSON.stringify(limitedUserInfo));
navigate("/student-dashboard");
}else if(role === "supervisor"){
const limitedUserInfo = {
fullName: user.fullName,
id: user._id,
email:user.ouEmail
};

localStorage.setItem("ipmsUser", JSON.stringify(limitedUserInfo));
navigate("/student-dashboard");
} else if(role === "supervisor"){
Swal.fire({
icon: "success",
title: "Login Successful 🌟",
text: `Welcome back, ${role}!`,
});
navigate("/supervisor-dashboard");
}else{
} else if (role === "coordinator") {
Swal.fire({
icon: "success",
title: "Login Successful 🌟",
text: `Welcome back, ${role}!`,
});
navigate("/coordinator-dashboard");
} else{
Swal.fire({
icon: "success",
title: "Login Successful 🌟",
Expand All @@ -101,6 +100,7 @@ function Home() {
Swal.fire({
icon: "error",
title: "Login Failed",
text: data.message || "Something went wrong",
html: data.message + " " +
(data.renewalLink
? `Please click <a href="${data.renewalLink}" target="_blank" rel="noopener noreferrer">here</a> to request a new token.`
Expand All @@ -125,9 +125,7 @@ function Home() {
</div>

<div className="login-options">
<h2 style={{ fontWeight: "600", fontSize: "1.9rem" }}>
Welcome back
</h2>
<h2 style={{ fontWeight: "600", fontSize: "1.9rem" }}>Welcome back</h2>

<form className="login-form" onSubmit={handleSubmit}>
<div className="form-group">
Expand All @@ -146,27 +144,32 @@ function Home() {
formData.role === r ? "selected" : ""
}`}
onClick={() =>
setFormData({
...formData,
role: r,
})
setFormData((prev) => ({ ...prev, role: r }))
}

>
<Icon />
<p className="role-label">
{r.charAt(0).toUpperCase() + r.slice(1)}
</p>
<span
className="info-icon"
title={
r === "student"
? "Students request internships and submit weekly reports."
: r === "supervisor"
? "Supervisors review and approve student progress."
: "Coordinators manage the internship workflow and approvals."
}
></span>
</div>
))}
</div>
</div>

<div className="form-group clean-input">
<label htmlFor="email">
<FaEnvelope
style={{ marginRight: "6px", verticalAlign: "middle" }}
/>
<FaEnvelope style={{ marginRight: "6px", verticalAlign: "middle" }} />
Email
</label>
<input
Expand All @@ -182,9 +185,7 @@ function Home() {

<div className="form-group clean-input">
<label htmlFor="password">
<FaLock
style={{ marginRight: "6px", verticalAlign: "middle" }}
/>
<FaLock style={{ marginRight: "6px", verticalAlign: "middle" }} />
Password
</label>
<div className="password-wrapper">
Expand All @@ -206,15 +207,7 @@ function Home() {
</div>
</div>

<div
className="form-subtext"
style={{
display: "flex",
justifyContent: "space-between",
fontSize: "0.9rem",
marginBottom: "1rem",
}}
>
<div className="form-subtext">
<label className="d-flex align-items-center">
<input type="checkbox" style={{ marginRight: "6px" }} />
Remember me
Expand Down
Loading