Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 10 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Binary file added src/assets/img/TaskSphereLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/components/CapstoneAdviser/AdviserDashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -361,6 +362,8 @@ const AdviserDashboard = ({ activePageFromHeader }) => {
switch (activePage) {
case "TeamsSummary":
return <AdviserTeamSummary />;
case "TermsOfService":
return <TermsOfService />;
case "Tasks":
return <AdviserTask setActivePage={setActivePage} />;
case "Oral Defense":
Expand Down
149 changes: 149 additions & 0 deletions src/components/CapstoneAdviser/AdviserTermsOfService.jsx
Original file line number Diff line number Diff line change
@@ -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 (
<div className="flex flex-col min-h-screen bg-gray-50">
<Header />

<main className="flex-grow flex flex-col items-center justify-center p-6">
<div className="bg-white shadow-lg rounded-lg p-8 max-w-3xl w-full">
<h1 className="text-3xl font-bold mb-4 text-center">
Terms of Service
</h1>

<div className="text-gray-700 leading-relaxed space-y-4 max-h-96 overflow-y-auto p-4 border rounded">
{/* ✳️ Your terms content here */}
<p>
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.
</p>
<p>
Advisers are expected to uphold academic integrity, maintain
confidentiality of student works, and ensure fair evaluation
across all teams.
</p>
<p>
Any misuse of this system, unauthorized sharing of data, or
violation of confidentiality policies may result in account
suspension or disciplinary action.
</p>
<p>
Continued use of the platform signifies your acceptance of these
terms and all future updates communicated through official
channels.
</p>
<p>
Please read carefully and select whether you accept or decline the
Terms of Service below.
</p>
</div>

<div className="mt-6 text-center space-x-6">
<label className="inline-flex items-center">
<input
type="radio"
name="tos"
value="accept"
checked={choice === "accept"}
onChange={(e) => setChoice(e.target.value)}
className="mr-2"
/>
Accept
</label>
<label className="inline-flex items-center">
<input
type="radio"
name="tos"
value="decline"
checked={choice === "decline"}
onChange={(e) => setChoice(e.target.value)}
className="mr-2"
/>
Decline
</label>
</div>

<div className="mt-6 text-center">
<button
onClick={handleSave}
className="bg-blue-600 hover:bg-blue-700 text-white py-2 px-6 rounded"
>
Save
</button>
</div>
</div>
</main>

<Footer />
</div>
);
};

export default AdviserTermsOfService;
32 changes: 16 additions & 16 deletions src/components/Instructor/ForgotPassword.jsx
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -57,7 +57,7 @@ const ForgotPassword = () => {
icon: "success",
title: "OTP sent",
html: `We've sent a 6-digit code to <b>${entered}</b>.`,
confirmButtonColor: "#3B0304",
confirmButtonColor: "#611A11",
allowOutsideClick: false,
allowEscapeKey: false,
});
Expand All @@ -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
}
Expand All @@ -87,26 +86,27 @@ const ForgotPassword = () => {
icon: "error",
title: "Something went wrong",
text: err?.message || "Please try again in a moment.",
confirmButtonColor: "#3B0304",
confirmButtonColor: "#611A11",
});
} finally {
setSending(false);
}
};

return (
<div className="min-h-screen flex flex-col justify-center items-center bg-[#f8f8f8] px-4">
<div className="bg-white border-4 border-[#3B0304] rounded-2xl shadow-md p-8 w-full max-w-md text-center">
<div className="min-h-screen flex flex-col justify-center items-center bg-[#f8f8f8] px-4 select-none">
<div className="bg-white rounded-2xl shadow-lg p-8 w-full max-w-md text-center border border-neutral-200">
<img
src={Logo1}
alt="DCT Logo"
className="w-24 h-24 mx-auto mb-4 object-contain"
className="w-24 h-24 mx-auto mb-4 object-contain pointer-events-none"
draggable="false"
/>
<h1 className="text-2xl font-bold text-[#3B0304] mb-2">
<h1 className="text-2xl font-bold text-[#611A11] mb-2">
Forgot Password?
</h1>
<p className="text-gray-700 text-sm mb-6 leading-relaxed">
No worries! To reset your password, well 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.
</p>
Expand All @@ -115,7 +115,7 @@ const ForgotPassword = () => {
<div className="text-left">
<label
htmlFor="email"
className="block text-sm font-medium text-gray-700 mb-1"
className="block text-sm font-medium text-gray-700 mb-1 select-none"
>
Email
</label>
Expand All @@ -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"
/>
</div>

<button
type="submit"
disabled={sending}
className={`w-full py-2 text-white font-medium rounded-md transition-all ${
className={`w-full py-3 text-white font-medium rounded-md transition-all select-none ${
sending
? "bg-gray-400 cursor-not-allowed"
: "bg-[#3B0304] hover:bg-[#2a0203]"
: "bg-[#611A11] hover:bg-[#7a2218]"
}`}
>
{sending ? "Sending OTP..." : "Reset Password"}
Expand All @@ -146,4 +146,4 @@ const ForgotPassword = () => {
);
};

export default ForgotPassword;
export default ForgotPassword;
Loading