diff --git a/client/package.json b/client/package.json
index f8e56288..cebf966c 100644
--- a/client/package.json
+++ b/client/package.json
@@ -15,7 +15,7 @@
"react-dom": "^19.0.0",
"react-icons": "^5.5.0",
"react-router-dom": "^7.4.1",
- "react-scripts": "5.0.1",
+ "react-scripts": "^5.0.1",
"react-signature-canvas": "^1.1.0-alpha.2",
"react-toastify": "^11.0.5",
"sweetalert2": "^11.17.2",
diff --git a/client/src/pages/A1InternshipRequestForm.js b/client/src/pages/A1InternshipRequestForm.js
index 009a0979..82950c9c 100644
--- a/client/src/pages/A1InternshipRequestForm.js
+++ b/client/src/pages/A1InternshipRequestForm.js
@@ -128,6 +128,17 @@ const A1InternshipRequestForm = ({ userRole = "student" }) => {
}
};
+ useEffect(() => {
+ const storedUser = JSON.parse(localStorage.getItem("ipmsUser"));
+ if (storedUser) {
+ setFormData((prev) => ({
+ ...prev,
+ interneeName: storedUser.fullName || "",
+ interneeEmail: storedUser.email || ""
+ }));
+ }
+ }, []);
+
const handleInputChange = (e) => {
const { id, value } = e.target;
setFormData((prev) => ({ ...prev, [id]: value }));
@@ -349,7 +360,8 @@ const A1InternshipRequestForm = ({ userRole = "student" }) => {
id="interneeName"
value={formData.interneeName}
onChange={handleInputChange}
- disabled={!isFieldEditable("interneeName")}
+ // disabled={!isFieldEditable("interneeName")}
+ disabled
/>
{errors.interneeName &&
{errors.interneeName}
}
@@ -418,7 +430,8 @@ const A1InternshipRequestForm = ({ userRole = "student" }) => {
id="interneeEmail"
value={formData.interneeEmail}
onChange={handleInputChange}
- disabled={!isFieldEditable("interneeEmail")}
+ disabled
+ // disabled={!isFieldEditable("interneeEmail")}
/>
{errors.interneeEmail && {errors.interneeEmail}
}
diff --git a/client/src/pages/A3JobEvaluationForm.jsx b/client/src/pages/A3JobEvaluationForm.jsx
index cb63ddf3..cc510f71 100644
--- a/client/src/pages/A3JobEvaluationForm.jsx
+++ b/client/src/pages/A3JobEvaluationForm.jsx
@@ -9,6 +9,7 @@ import {
Modal,
Tab,
Nav,
+ Alert,
} from "react-bootstrap";
import SignatureCanvas from "react-signature-canvas";
import "../styles/A3JobEvaluationForm.css";
@@ -41,22 +42,24 @@ const A3JobEvaluationForm = () => {
interneeName: "",
interneeID: "",
interneeEmail: "",
- advisorSignature: "",
- advisorAgreement: false,
+ supervisorSignature: "",
+ supervisorAgreement: false,
coordinatorSignature: "",
coordinatorAgreement: false,
+ locked: false, //not locked with fresh form
});
+ const [supervisorDetails, setSupervisorDetails] = useState(null);
const [errors, setErrors] = useState({});
-
+
// Ratings and comments
const [ratings, setRatings] = useState({});
const [comments, setComments] = useState({});
// Modal state
const [showModal, setShowModal] = useState(false);
- const [activeSignatureTarget, setActiveSignatureTarget] = useState("advisor");
+ const [activeSignatureTarget, setActiveSignatureTarget] = useState("supervisor");
const [typedSignatures, setTypedSignatures] = useState({
- advisor: "",
+ supervisor: "",
coordinator: "",
});
const [selectedFont, setSelectedFont] = useState(fonts[0]);
@@ -68,7 +71,7 @@ const A3JobEvaluationForm = () => {
if (!formData.interneeName?.trim()) newErrors.interneeName = "Name is required.";
if (!/^\d{9}$/.test(formData.interneeID || "")) newErrors.interneeID = "Enter a valid 9-digit Sooner ID.";
if (!/\S+@\S+\.\S+/.test(formData.interneeEmail || "")) newErrors.interneeEmail = "Invalid email.";
- if (!formData.advisorSignature) newErrors.advisorSignature = "Signature is required.";
+ if (!formData.supervisorSignature) newErrors.supervisorSignature = "Signature is required.";
if (!formData.coordinatorSignature) newErrors.coordinatorSignature = "Signature is required.";
evaluationItems.forEach((item) => {
if (!ratings[item]) {
@@ -109,8 +112,8 @@ const A3JobEvaluationForm = () => {
// Handle inserting signature from modal
const handleSignatureInsert = () => {
const targetField =
- activeSignatureTarget === "advisor"
- ? "advisorSignature"
+ activeSignatureTarget === "supervisor"
+ ? "supervisorSignature"
: "coordinatorSignature";
if (activeTab === "type" && typedSignatures[activeSignatureTarget].trim()) {
//handleChange(targetField, JSON.stringify({ type: 'text', value: typedSignatures[activeSignatureTarget], font: selectedFont }));
@@ -143,7 +146,7 @@ const A3JobEvaluationForm = () => {
// Submit the form to the backend
const handleSubmit = async (e) => {
e.preventDefault();
- if (!validateForm() || !formData.advisorAgreement || !formData.coordinatorAgreement) {
+ if (!validateForm() || !formData.supervisorAgreement || !formData.coordinatorAgreement) {
alert("Please confirm internee details and both signature agreements before submitting.");
return;
}
@@ -157,9 +160,9 @@ const A3JobEvaluationForm = () => {
interneeName: formData.interneeName,
interneeID: formData.interneeID,
interneeEmail: formData.interneeEmail,
- advisorSignature: formData.advisorSignature,
+ supervisorSignature: formData.supervisorSignature,
coordinatorSignature: formData.coordinatorSignature,
- advisorAgreement: formData.advisorAgreement,
+ supervisorAgreement: formData.supervisorAgreement,
coordinatorAgreement: formData.coordinatorAgreement,
ratings,
comments,
@@ -172,14 +175,18 @@ const A3JobEvaluationForm = () => {
interneeName: "",
interneeID: "",
interneeEmail: "",
- advisorSignature: "",
- advisorAgreement: false,
+ supervisorName: "",
+ supervisorJobTitle: "",
+ supervisorEmail: "",
+ supervisorSignature: "",
+ supervisorAgreement: false,
coordinatorSignature: "",
coordinatorAgreement: false,
+ locked: true, //locked when properly approved
});
setRatings({});
setComments({});
- setTypedSignatures({ advisor: "", coordinator: "" });
+ setTypedSignatures({ supervisor: "", coordinator: "" });
sigCanvasRef.current?.clear();
} else {
const err = await response.json();
@@ -231,29 +238,44 @@ const A3JobEvaluationForm = () => {
style={{ backgroundColor: "#fff", maxWidth: "900px", width: "100%" }}
>