diff --git a/package-lock.json b/package-lock.json index 03357af..5564781 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,6 +20,7 @@ "file-saver": "^2.0.5", "jspdf": "^3.0.3", "jspdf-autotable": "^5.0.2", + "lucide-react": "^0.545.0", "react": "^19.1.0", "react-chartjs-2": "^5.3.0", "react-dom": "^19.1.0", @@ -3571,6 +3572,15 @@ "dev": true, "license": "ISC" }, + "node_modules/lucide-react": { + "version": "0.545.0", + "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.545.0.tgz", + "integrity": "sha512-7r1/yUuflQDSt4f1bpn5ZAocyIxcTyVyBBChSVtBKn5M+392cPmI5YJMWOJKk/HUWGm5wg83chlAZtCcGbEZtw==", + "license": "ISC", + "peerDependencies": { + "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, "node_modules/magic-string": { "version": "0.30.17", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz", diff --git a/package.json b/package.json index 302a8f6..a646710 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "file-saver": "^2.0.5", "jspdf": "^3.0.3", "jspdf-autotable": "^5.0.2", + "lucide-react": "^0.545.0", "react": "^19.1.0", "react-chartjs-2": "^5.3.0", "react-dom": "^19.1.0", diff --git a/src/assets/img/TaskSphereLogo.png b/src/assets/img/TaskSphereLogo.png new file mode 100644 index 0000000..a0d3be8 Binary files /dev/null and b/src/assets/img/TaskSphereLogo.png differ diff --git a/src/components/CapstoneAdviser/AdviserDashboard.jsx b/src/components/CapstoneAdviser/AdviserDashboard.jsx index cbc23f7..8638223 100644 --- a/src/components/CapstoneAdviser/AdviserDashboard.jsx +++ b/src/components/CapstoneAdviser/AdviserDashboard.jsx @@ -3,6 +3,7 @@ import { useNavigate, useLocation, useParams } from "react-router-dom"; import Sidebar from "../Sidebar"; import { useAuthGuard } from "../../components/hooks/useAuthGuard"; import AdviserTeamSummary from "./AdviserTeamsSummary"; +import AdviserTermsOfService from "./AdviserTermsOfService"; import AdviserTask from "./AdviserTask/AdviserTask"; import AdviserOralDef from "./AdviserTask/AdviserOralDef"; import AdviserFinalDef from "./AdviserTask/AdviserFinalDef"; @@ -361,6 +362,8 @@ const AdviserDashboard = ({ activePageFromHeader }) => { switch (activePage) { case "TeamsSummary": return ; + case "TermsOfService": + return ; case "Tasks": return ; case "Oral Defense": diff --git a/src/components/CapstoneAdviser/AdviserTermsOfService.jsx b/src/components/CapstoneAdviser/AdviserTermsOfService.jsx new file mode 100644 index 0000000..c948888 --- /dev/null +++ b/src/components/CapstoneAdviser/AdviserTermsOfService.jsx @@ -0,0 +1,149 @@ +// src/pages/Adviser/TermsOfService.jsx +import React, { useState, useEffect } from "react"; +import { useNavigate } from "react-router-dom"; +import Swal from "sweetalert2"; +import { supabase } from "../../supabaseClient"; +import Header from "../Header"; +import Footer from "../Footer"; + +const AdviserTermsOfService = () => { + const [choice, setChoice] = useState(""); + const navigate = useNavigate(); + + // check if logged in + useEffect(() => { + const storedUser = localStorage.getItem("customUser"); + if (!storedUser) { + navigate("/Signin"); + } + }, [navigate]); + + const handleSave = async () => { + const storedUser = localStorage.getItem("customUser"); + if (!storedUser) { + navigate("/Signin"); + return; + } + + const user = JSON.parse(storedUser); + + if (choice === "accept") { + Swal.fire({ + icon: "success", + title: "Terms Accepted", + text: "Thank you for accepting the terms of service.", + timer: 1500, + showConfirmButton: false, + }); + + // OPTIONAL: Update Supabase record (if you track agreement) + await supabase + .from("user_credentials") + .update({ terms_accepted: true }) + .eq("id", user.id); + + navigate("/Adviser/Dashboard"); + } + else if (choice === "decline") { + Swal.fire({ + icon: "warning", + title: "Terms Declined", + text: "You must accept the Terms of Service to continue.", + timer: 1500, + showConfirmButton: false, + }); + + // log out + localStorage.removeItem("customUser"); + localStorage.removeItem("user_id"); + navigate("/Signin", { replace: true }); + } + else { + Swal.fire({ + icon: "info", + title: "No Selection", + text: "Please select Accept or Decline before saving.", + }); + } + }; + + return ( +
+
+ +
+
+

+ Terms of Service +

+ +
+ {/* ✳️ Your terms content here */} +

+ Welcome to the TaskSphere IT platform. By using this system, you + agree to comply with the institutional guidelines for managing, + evaluating, and monitoring IT Capstone projects. +

+

+ Advisers are expected to uphold academic integrity, maintain + confidentiality of student works, and ensure fair evaluation + across all teams. +

+

+ Any misuse of this system, unauthorized sharing of data, or + violation of confidentiality policies may result in account + suspension or disciplinary action. +

+

+ Continued use of the platform signifies your acceptance of these + terms and all future updates communicated through official + channels. +

+

+ Please read carefully and select whether you accept or decline the + Terms of Service below. +

+
+ +
+ + +
+ +
+ +
+
+
+ +
+
+ ); +}; + +export default AdviserTermsOfService; diff --git a/src/components/Instructor/ForgotPassword.jsx b/src/components/Instructor/ForgotPassword.jsx index 53ff047..d488510 100644 --- a/src/components/Instructor/ForgotPassword.jsx +++ b/src/components/Instructor/ForgotPassword.jsx @@ -1,6 +1,6 @@ import React, { useState } from "react"; import { useNavigate } from "react-router-dom"; -import Logo1 from "../../assets/img/Dct-Logo.png"; +import Logo1 from "../../assets/img/TaskSphereLogo.png"; import Swal from "sweetalert2"; import { showOTP, fetchAdminEmail } from "../../assets/scripts/forgotPassword"; @@ -25,7 +25,7 @@ const ForgotPassword = () => { icon: "warning", title: "Enter your email", text: "Please provide the email you registered with.", - confirmButtonColor: "#3B0304", + confirmButtonColor: "#611A11", }); return; } @@ -40,7 +40,7 @@ const ForgotPassword = () => { icon: "error", title: "Not an admin email", text: "Only admin accounts can reset a password here.", - confirmButtonColor: "#3B0304", + confirmButtonColor: "#611A11", }); return; } @@ -57,7 +57,7 @@ const ForgotPassword = () => { icon: "success", title: "OTP sent", html: `We've sent a 6-digit code to ${entered}.`, - confirmButtonColor: "#3B0304", + confirmButtonColor: "#611A11", allowOutsideClick: false, allowEscapeKey: false, }); @@ -68,7 +68,6 @@ const ForgotPassword = () => { expectedOtp: otp, onConfirm: async (code, { expected }) => { if (String(code) === String(expected)) { - //alert("success"); navigate("/NewPassword", { state: { email: entered } }); return true; // ✅ close the Swal } @@ -87,7 +86,7 @@ const ForgotPassword = () => { icon: "error", title: "Something went wrong", text: err?.message || "Please try again in a moment.", - confirmButtonColor: "#3B0304", + confirmButtonColor: "#611A11", }); } finally { setSending(false); @@ -95,18 +94,19 @@ const ForgotPassword = () => { }; return ( -
-
+
+
DCT Logo -

+

Forgot Password?

- No worries! To reset your password, we’ll send a one-time password + No worries! To reset your password, we'll send a one-time password (OTP) to your registered email address. Please check your inbox and follow the instructions to continue.

@@ -115,7 +115,7 @@ const ForgotPassword = () => {
@@ -125,17 +125,17 @@ const ForgotPassword = () => { value={email} onChange={(e) => setEmail(e.target.value)} placeholder="admin1@gmail.com" - className="w-full p-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-[#3B0304] focus:outline-none" + className="w-full p-3 bg-white border border-gray-300 rounded-md focus:ring-2 focus:ring-[#611A11] focus:border-[#611A11] focus:outline-none" />