From 14236c7c9af449504eda903f41b4e09bf7c3fe58 Mon Sep 17 00:00:00 2001 From: Pranay-Gottimukula <97828875+Pranay-Gottimukula@users.noreply.github.com> Date: Mon, 1 Jun 2026 01:41:18 +0530 Subject: [PATCH 1/8] PPO frontend (#450) --- src/app/(routes)/admin/oncampus-offers/page.tsx | 14 ++++++++++++-- src/dto/onCampusOfferDTO.ts | 9 +++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/app/(routes)/admin/oncampus-offers/page.tsx b/src/app/(routes)/admin/oncampus-offers/page.tsx index ab949ff..52eadd3 100644 --- a/src/app/(routes)/admin/oncampus-offers/page.tsx +++ b/src/app/(routes)/admin/oncampus-offers/page.tsx @@ -1,7 +1,7 @@ "use client"; import { fetchAllSeasons, fetchOnCampusOffers, deleteOnCampusOffers } from "@/helpers/api"; import generateColumns from "@/components/NewTableComponent/ColumnMapping"; -import { onCampusOfferDTO } from "@/dto/onCampusOfferDTO"; +import { onCampusOfferDTO, ON_CAMPUS_OFFER_STATUS_LABELS } from "@/dto/onCampusOfferDTO"; import Table from "@/components/NewTableComponent/Table"; import { useEffect, useState } from "react"; import Loader from "@/components/Loader/loader"; @@ -12,7 +12,17 @@ const internHiddenColumns = ["salary.firstYearCTC", "salary.totalCTC", "salary.s const placementHiddenColumns = ["salary.stipend", "salary.otherCompensations", "salary.salaryPeriod"]; const OnCampusOffersPage = () => { - const columns = generateColumns(onCampusOfferDTO); + const columns = generateColumns(onCampusOfferDTO).map((col: any) => + col.accessorKey === "status" + ? { + ...col, + cell: ({ getValue }: { getValue: () => unknown }) => { + const val = getValue() as string; + return ON_CAMPUS_OFFER_STATUS_LABELS[val] ?? val; + }, + } + : col, + ); const [seasons, setSeasons] = useState<{ id: string; name: string, type: string }[]>([]); const [selectedSeason, setSelectedSeason] = useState(""); const [loading, setLoading] = useState(true); diff --git a/src/dto/onCampusOfferDTO.ts b/src/dto/onCampusOfferDTO.ts index 555f01b..e797a1f 100644 --- a/src/dto/onCampusOfferDTO.ts +++ b/src/dto/onCampusOfferDTO.ts @@ -1,3 +1,12 @@ +export const ON_CAMPUS_OFFER_STATUS_LABELS: Record = { + ACCEPTED: "Accepted", + REJECTED: "Rejected", + ONGOING: "Ongoing", + PPO_ACCEPTED: "PPO Accepted", + PLACEMENT_FTE: "FTE (Direct)", + PLACEMENT_PPO: "FTE (via PPO)", +}; + const onCampusOfferDTO = [ { status: "string", From 43654875c8846e4cd364adefbed5ad7097835b48 Mon Sep 17 00:00:00 2001 From: metamyte <89248467+metamyteee@users.noreply.github.com> Date: Mon, 1 Jun 2026 01:42:15 +0530 Subject: [PATCH 2/8] events in schedule (#446) Co-authored-by: Prince Kumar --- src/components/Calendar/CalenderComponent/Labels.tsx | 6 +++--- src/components/Calendar/context/ContextWrapper.tsx | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/Calendar/CalenderComponent/Labels.tsx b/src/components/Calendar/CalenderComponent/Labels.tsx index 04a2de3..9f731a2 100644 --- a/src/components/Calendar/CalenderComponent/Labels.tsx +++ b/src/components/Calendar/CalenderComponent/Labels.tsx @@ -3,14 +3,14 @@ import GlobalContext from "../context/GlobalContext"; import { labelsClasses } from "../context/ContextWrapper"; let colors = - "text-green-400 text-red-400 text-indigo-400 text-gray-400 text-blue-400 text-purple-400"; + "text-green-400 text-red-400 text-indigo-400 text-gray-400 text-blue-400 text-purple-400 text-yellow-400"; export default function Labels() { const { labels, updateLabel } = useContext(GlobalContext); return (

Label

- {Array.from(labelsClasses.entries()).map(([label, color], idx) => { + {Array.from(labelsClasses.entries()).map(([label, colors], idx) => { const checked = labels.find((lbl) => lbl.label === label)?.checked || false; return ( @@ -19,7 +19,7 @@ export default function Labels() { type="checkbox" checked={checked} onChange={() => updateLabel({ label, checked: !checked })} - className={`form-checkbox h-5 w-5 text-${color}-400 rounded focus:ring-0 cursor-pointer`} + className={`form-checkbox h-5 w-5 text-${colors}-400 rounded focus:ring-0 cursor-pointer`} /> {label} diff --git a/src/components/Calendar/context/ContextWrapper.tsx b/src/components/Calendar/context/ContextWrapper.tsx index 96ca84a..0a0bc2e 100644 --- a/src/components/Calendar/context/ContextWrapper.tsx +++ b/src/components/Calendar/context/ContextWrapper.tsx @@ -16,6 +16,7 @@ export const labelsClasses = new Map([ ["COMPLETED", "blue"], ["APPLICATION", "purple"], ["POLL", "gray"], + ["EVENTS","yellow"], ]); function savedEventsReducer( From 23d65104d2b0691289a61b5074606e097bc8306d Mon Sep 17 00:00:00 2001 From: Sakshya2504 Date: Tue, 2 Jun 2026 16:57:04 +0530 Subject: [PATCH 3/8] NoticeBoard (#451) --- src/app/(routes)/admin/noticeboard/page.tsx | 300 +------------------- src/components/Sidebar.tsx | 7 +- 2 files changed, 4 insertions(+), 303 deletions(-) diff --git a/src/app/(routes)/admin/noticeboard/page.tsx b/src/app/(routes)/admin/noticeboard/page.tsx index 6e5b086..7f4ce55 100644 --- a/src/app/(routes)/admin/noticeboard/page.tsx +++ b/src/app/(routes)/admin/noticeboard/page.tsx @@ -1,299 +1,5 @@ -"use client"; +import NoticeBoard from "@/components/Admin/NoticeBoard"; -import React, { useState, ChangeEvent, FormEvent } from "react"; -import { useRouter } from "next/navigation"; - -interface AnnouncementFormData { - clubname: string; - heading: string; - info: string; - announcelogo: string; -} - -export default function Announce(): JSX.Element { - const router = useRouter(); - - const [group, setGroup] = useState("all"); - const [manualEmails, setManualEmails] = useState(""); - const [loading, setLoading] = useState(false); - const [errors, setErrors] = useState([]); - const [logoPreview, setLogoPreview] = useState(""); - - const [formData, setFormData] = useState({ - clubname: "CAMC", - heading: "", - info: "", - announcelogo: "", - }); - - const handleChange = ( - e: ChangeEvent - ) => { - const { name, value } = e.target; - - setFormData((prev) => ({ - ...prev, - [name]: value, - })); - - if (errors.length > 0) { - setErrors([]); - } - }; - - const handleLogoChange = (e: ChangeEvent) => { - const file = e.target.files?.[0]; - - if (!file) { - return; - } - - const reader = new FileReader(); - - reader.onloadend = () => { - const imageBase64 = reader.result as string; - - setLogoPreview(imageBase64); - - setFormData((prev) => ({ - ...prev, - announcelogo: imageBase64, - })); - }; - - reader.readAsDataURL(file); - }; - - const validateForm = () => { - const validationErrors: string[] = []; - - if (!formData.heading.trim()) { - validationErrors.push("Announcement heading is required."); - } - - if (!formData.info.trim()) { - validationErrors.push("Announcement content is required."); - } - - setErrors(validationErrors); - - return validationErrors.length === 0; - }; - - const handleSubmit = async (e: FormEvent) => { - e.preventDefault(); - - if (!validateForm()) { - return; - } - - setLoading(true); - setErrors([]); - - try { - const emailsArray = manualEmails - .split(",") - .map((email) => email.trim()) - .filter((email) => email.length > 0); - - const response = await fetch( - `${process.env.NEXT_PUBLIC_BACKEND_URL}/api/v1/announce`, - { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - credentials: "include", - body: JSON.stringify({ - ...formData, - group, - emails: emailsArray, - }), - } - ); - - const result = await response.json(); - - if (!response.ok) { - if (result.errors && Array.isArray(result.errors)) { - setErrors(result.errors); - } else { - setErrors([result.message || "Failed to publish announcement."]); - } - - return; - } - - alert(result.message || "Announcement published successfully."); - - setFormData({ - clubname: "CAMC", - heading: "", - info: "", - announcelogo: "", - }); - - setLogoPreview(""); - setManualEmails(""); - setGroup("all"); - - router.push("/admin/noticeboardview"); - } catch (error: any) { - setErrors([ - error?.message || "Something went wrong while publishing announcement.", - ]); - } finally { - setLoading(false); - } - }; - - return ( -
-
-
-

- Create Announcement -

- - -
- -
- {errors.length > 0 && ( -
- {errors.map((error, index) => ( -

- {error} -

- ))} -
- )} - -
- - - -
- -
- - - -
- -
- - -