Skip to content

Commit

Permalink
Merge pull request #11 from akshayks13/v2
Browse files Browse the repository at this point in the history
Commented out unused variables
  • Loading branch information
Ashrockzzz2003 authored Jan 7, 2025
2 parents 20e16a3 + 4a66c7f commit 230bf4a
Show file tree
Hide file tree
Showing 20 changed files with 29 additions and 180 deletions.
13 changes: 1 addition & 12 deletions app/dashboard/admin/company/[companyId]/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function CompanyPage() {
const [deptSectionWiseHiredStudents, setDeptSectionWiseHiredStudents] = useState([]);
const [sortedDeptSectionWiseHiredStudents, setSortedDeptSectionWiseHiredStudents] = useState([]);
const [isLoading, setIsLoading] = useState(true);
const [userAccess, setUserAccess] = useState({});
const [_, setUserAccess] = useState({});

const [companyName, setCompanyName] = useState("");
const router = useRouter();
Expand All @@ -35,14 +35,6 @@ export default function CompanyPage() {
});
};

const alertSuccess = (summary, detail) => {
toast.current.show({
severity: 'success',
summary: summary,
detail: detail,
});
};

const { companyId } = useParams();

const basicOptions = {
Expand Down Expand Up @@ -76,9 +68,6 @@ export default function CompanyPage() {
}
};




useEffect(() => {
setUserAccess(secureLocalStorage.getItem("userAccess"));

Expand Down
10 changes: 1 addition & 9 deletions app/dashboard/admin/company/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function AllCompaniesScreen() {
const [companyHireData, setCompanyHireData] = useState([]);
const [companyHireDataFiltered, setCompanyHireDataFiltered] = useState([]);
const [isLoading, setIsLoading] = useState(true);
const [userAccess, setUserAccess] = useState("");
const [_, setUserAccess] = useState("");

const [sectionData, setSectionData] = useState({});

Expand Down Expand Up @@ -157,14 +157,6 @@ export default function AllCompaniesScreen() {
});
};

const alertSuccess = (summary, detail) => {
toast.current.show({
severity: 'success',
summary: summary,
detail: detail,
});
};

const [searchText, setSearchText] = useState("");

useEffect(() => {
Expand Down
4 changes: 0 additions & 4 deletions app/dashboard/admin/official/page.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"use client";
import Aos from "aos";
import "primereact/resources/primereact.min.css";
import "primereact/resources/themes/lara-light-indigo/theme.css";
import 'material-icons/iconfont/material-icons.css';
Expand Down Expand Up @@ -161,9 +160,6 @@ export default function AllOfficialsScreen() {
}
}, [officials, searchText, role, status])




return <>
{isLoading ? <LoadingScreen /> : (
<main className="mb-16" data-aos="fade-in">
Expand Down
1 change: 0 additions & 1 deletion app/dashboard/admin/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ export default function AdminDashboard() {
alertError("Error", "Something went wrong in adding company. Please try again later.");
}


} catch (err) {
console.log(err);
alertError("Error", "Something went wrong. Please try again later.");
Expand Down
1 change: 0 additions & 1 deletion app/dashboard/admin/placement/new/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ export default function NewPlacementScreen() {
setIsOpen(true)
}


useEffect(() => {
setUserAccess(secureLocalStorage.getItem("userAccess"));

Expand Down
16 changes: 1 addition & 15 deletions app/dashboard/admin/placement/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default function AllPlacedStudentsScreen() {
const [allPlacedStudentDataFiltered, setAllPlacedStudentDataFiltered] = useState([]);

const [isLoading, setIsLoading] = useState(true);
const [userAccess, setUserAccess] = useState("");
const [_, setUserAccess] = useState("");
const [sections, setSections] = useState();
const [companyList, setCompanyList] = useState([]);

Expand Down Expand Up @@ -69,7 +69,6 @@ export default function AllPlacedStudentsScreen() {
}
};


const toast = useRef(null);
const router = useRouter();

Expand All @@ -81,14 +80,6 @@ export default function AllPlacedStudentsScreen() {
});
};

const alertSuccess = (summary, detail) => {
toast.current.show({
severity: 'success',
summary: summary,
detail: detail,
});
};

useEffect(() => {
setUserAccess(secureLocalStorage.getItem("userAccess"));

Expand Down Expand Up @@ -567,9 +558,6 @@ export default function AllPlacedStudentsScreen() {
return acc;
}, {});




// Overall Sort by top placement
const sortedData = Object.values(groupedData).sort((a, b) => {
return new Date(b["placements"][0]["ctc"]) - new Date(a["placements"][0]["ctc"]);
Expand Down Expand Up @@ -623,8 +611,6 @@ export default function AllPlacedStudentsScreen() {
setStudentBatch(studentBatch);
setIsLoading(false);
})


}

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export default function NewPlacementScreen() {
const placements = JSON.parse(p);
const student = JSON.parse(secureLocalStorage.getItem("currentStudent"));

const [studentId, setStudentId] = useState(student ? student.studentId : "");
const [studentRollNo, setStudentRollNo] = useState(student ? student.studentRollNo : "");
const [studentId, _setStudentId] = useState(student ? student.studentId : "");
const [studentRollNo, _setStudentRollNo] = useState(student ? student.studentRollNo : "");
const [companyList, setCompanyList] = useState([]);
const [isLoading, setIsLoading] = useState(true);
const [userAccess, setUserAccess] = useState("");
Expand All @@ -50,9 +50,7 @@ export default function NewPlacementScreen() {
const [extraData, setExtraData] = useState("");
const toast = useRef(null);


//console.log(student);


useEffect(() => {
if (!student) {
Expand Down Expand Up @@ -154,8 +152,6 @@ export default function NewPlacementScreen() {

const isValidInput = isValidCtc && isValidJobRole && isValidCompanyId && isValidJobLocation && isValidPlacementDate && isValidIntern && isValidPPO && isValidOnCampus && isValidGirlsDrive;



const alertError = (summary, detail) => {
toast.current.show({
severity: 'error',
Expand All @@ -180,10 +176,6 @@ export default function NewPlacementScreen() {
setIsOpen(true)
}





const handleEditPlacement = async (e) => {
setIsLoading(true);
e.preventDefault();
Expand Down Expand Up @@ -272,7 +264,6 @@ export default function NewPlacementScreen() {
}
}


const isValidCompanyName = companyName.length > 0;

const addNewCompany = async (e) => {
Expand Down Expand Up @@ -333,7 +324,6 @@ export default function NewPlacementScreen() {
alertError("Error", "Something went wrong. Please try again later.");
}


} catch (err) {
console.log(err);
alertError("Error", "Something went wrong. Please try again later.");
Expand Down
16 changes: 4 additions & 12 deletions app/dashboard/admin/student/[studentId]/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ export default function StudentDashboard() {

const { studentId } = useParams();

const [studentEmail, setStudentEmail] = useState('');
const [_studentEmail, setStudentEmail] = useState('');
const [studentName, setStudentName] = useState('');
const [studentRollNo, setStudentRollNo] = useState('');
//const [studentId, setStudentId] = useState('');
const [studentSection, setStudentSection] = useState('');
const [studentGender, setStudentGender] = useState('');
const [_studentGender, setStudentGender] = useState('');
const [studentBatch, setStudentBatch] = useState('');
const [studentDept, setStudentDept] = useState('');
const [isHigherStudies, setIsHigherStudies] = useState('');
const [CGPA, setCGPA] = useState('');
const [_isHigherStudies, setIsHigherStudies] = useState('');
const [_CGPA, setCGPA] = useState('');

const [userAccess, setUserAccess] = useState('');
const [isLoading, setIsLoading] = useState(true);
Expand All @@ -59,14 +59,6 @@ export default function StudentDashboard() {
});
};

const alertSuccess = (summary, detail) => {
toast.current.show({
severity: 'success',
summary: summary,
detail: detail,
});
};


useEffect(() => {
setUserAccess(secureLocalStorage.getItem("userAccess"));
Expand Down
2 changes: 1 addition & 1 deletion app/dashboard/admin/student/new/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function RegisterStudent() {
const higherStudiesOptions = ["Yes", "No"];
const [isHigherStudies, setIsHigherStudies] = useState("");

const [isPlaced, setIsPlaced] = useState("0");
const [isPlaced, _setIsPlaced] = useState("0");
const [CGPA, setCGPA] = useState("");

const [loading, setLoading] = useState(false);
Expand Down
15 changes: 3 additions & 12 deletions app/dashboard/admin/student/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ export default function AllPlacedStudentsScreen() {
const [allPlacedStudentData, setAllPlacedStudentData] = useState([]);
const [allPlacedStudentDataFiltered, setAllPlacedStudentDataFiltered] = useState([]);
const [isLoading, setIsLoading] = useState(true);
const [userAccess, setUserAccess] = useState("");
const [_userAccess, setUserAccess] = useState("");
const [sections, setSections] = useState();
const [companyList, setCompanyList] = useState([]);

const [minCTC, setMinCTC] = useState(0);
const [maxCTC, setMaxCTC] = useState(0);
const [avgCTC, setAvgCTC] = useState(0);

const [totalStudents, setTotalStudents] = useState(0);
const [tempTotalStudents, setTempTotalStudents] = useState(0);
const [_totalStudents, setTotalStudents] = useState(0);
const [_tempTotalStudents, setTempTotalStudents] = useState(0);

const [totalOffers, setTotalOffers] = useState(0);
const [tempTotalOffers, setTempTotalOffers] = useState(0);
Expand All @@ -48,14 +48,6 @@ export default function AllPlacedStudentsScreen() {
});
};

const alertSuccess = (summary, detail) => {
toast.current.show({
severity: 'success',
summary: summary,
detail: detail,
});
};

useEffect(() => {
setUserAccess(secureLocalStorage.getItem("userAccess"));

Expand Down Expand Up @@ -286,7 +278,6 @@ export default function AllPlacedStudentsScreen() {

allPlacedStudentDataFiltered.forEach((student) => {
student["placements"].forEach((placement) => {
// check for conditions
if (isIntern !== null && isIntern !== '' && placement["isIntern"] !== isIntern) {
return;
}
Expand Down
13 changes: 1 addition & 12 deletions app/dashboard/manager/company/[companyId]/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function CompanyPage() {
const [deptSectionWiseHiredStudents, setDeptSectionWiseHiredStudents] = useState([]);
const [sortedDeptSectionWiseHiredStudents, setSortedDeptSectionWiseHiredStudents] = useState([]);
const [isLoading, setIsLoading] = useState(true);
const [userAccess, setUserAccess] = useState({});
const [_, setUserAccess] = useState({});

const [companyName, setCompanyName] = useState("");
const router = useRouter();
Expand All @@ -35,14 +35,6 @@ export default function CompanyPage() {
});
};

const alertSuccess = (summary, detail) => {
toast.current.show({
severity: 'success',
summary: summary,
detail: detail,
});
};

const { companyId } = useParams();

const basicOptions = {
Expand Down Expand Up @@ -76,9 +68,6 @@ export default function CompanyPage() {
}
};




useEffect(() => {
setUserAccess(secureLocalStorage.getItem("userAccess"));

Expand Down
2 changes: 1 addition & 1 deletion app/dashboard/manager/company/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function AllCompaniesScreen() {
const [companyHireData, setCompanyHireData] = useState([]);
const [companyHireDataFiltered, setCompanyHireDataFiltered] = useState([]);
const [isLoading, setIsLoading] = useState(true);
const [userAccess, setUserAccess] = useState("");
const [_, setUserAccess] = useState("");

const [sectionData, setSectionData] = useState({});

Expand Down
13 changes: 1 addition & 12 deletions app/dashboard/manager/placement/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default function AllPlacedStudentsScreen() {
const [allPlacedStudentDataFiltered, setAllPlacedStudentDataFiltered] = useState([]);

const [isLoading, setIsLoading] = useState(true);
const [userAccess, setUserAccess] = useState("");
const [_, setUserAccess] = useState("");
const [sections, setSections] = useState();
const [companyList, setCompanyList] = useState([]);

Expand Down Expand Up @@ -81,14 +81,6 @@ export default function AllPlacedStudentsScreen() {
});
};

const alertSuccess = (summary, detail) => {
toast.current.show({
severity: 'success',
summary: summary,
detail: detail,
});
};

useEffect(() => {
setUserAccess(secureLocalStorage.getItem("userAccess"));

Expand Down Expand Up @@ -568,8 +560,6 @@ export default function AllPlacedStudentsScreen() {
}, {});




// Overall Sort by top placement
const sortedData = Object.values(groupedData).sort((a, b) => {
return new Date(b["placements"][0]["ctc"]) - new Date(a["placements"][0]["ctc"]);
Expand Down Expand Up @@ -624,7 +614,6 @@ export default function AllPlacedStudentsScreen() {
setIsLoading(false);
})


}

return (
Expand Down
8 changes: 0 additions & 8 deletions app/dashboard/manager/student/[studentId]/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,6 @@ export default function StudentPage() {
});
};

const alertSuccess = (summary, detail) => {
toast.current.show({
severity: 'success',
summary: summary,
detail: detail,
});
};

const { studentId } = useParams();

useEffect(() => {
Expand Down
4 changes: 2 additions & 2 deletions app/dashboard/manager/student/new/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ export default function RegisterStudent() {
const [studentGender, setStudentGender] = useState("");
const [studentBatch, setStudentBatch] = useState("");

const [studentDept, setStudentDept] = useState("CSE");
const [studentDept, _setStudentDept] = useState("CSE");

const higherStudiesOptions = ["Yes", "No"];
const [isHigherStudies, setIsHigherStudies] = useState("");

const [isPlaced, setIsPlaced] = useState("0");
const [isPlaced, _setIsPlaced] = useState("0");
const [CGPA, setCGPA] = useState("");

const [loading, setLoading] = useState(false);
Expand Down
Loading

0 comments on commit 230bf4a

Please sign in to comment.