Skip to content

Commit

Permalink
Merge pull request #150 from Web-Team-IITI-Gymkhana/tpc-member-fix
Browse files Browse the repository at this point in the history
tpc member fix
  • Loading branch information
SoniHarsh1 authored Aug 11, 2024
2 parents c797716 + 71057cd commit bb0a2b0
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 65 deletions.
13 changes: 7 additions & 6 deletions src/app/(routes)/admin/jobs/[jobId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1163,7 +1163,7 @@ const JobDetailPage = ({ params }: { params: { jobId: string } }) => {
<div className="text-center font-semibold">
<PersonIcon sx={{ fontSize: 80 }} className="mx-auto" />
<br />
{coordinator.tpcMember.user.name}
{coordinator.tpcMember.student.user.name}
</div>
<div>
<div>
Expand All @@ -1172,15 +1172,15 @@ const JobDetailPage = ({ params }: { params: { jobId: string } }) => {
</div>
<div>
<span className="font-semibold">Department : </span>
{coordinator.tpcMember.department}
{coordinator.tpcMember.student.program.department}
</div>
<div>
<span className="font-semibold">Email : </span>
{coordinator.tpcMember.user.email}
{coordinator.tpcMember.student.user.email}
</div>
<div>
<span className="font-semibold">Contact : </span>
{coordinator.tpcMember.user.contact}
{coordinator.tpcMember.student.user.contact}
</div>
</div>
</div>
Expand Down Expand Up @@ -1415,14 +1415,14 @@ const JobDetailPage = ({ params }: { params: { jobId: string } }) => {
</div>
)}
</div>
<Separator className="my-4" />
{/* <Separator className="my-4" /> */}
<div className="flex justify-between mt-2 mb-4">
<Button color="primary" onClick={() => { setApprovalModal(!approvalModal); getApprovals(salaryIndex) }} >Current Approvals</Button>
<div className="flex justify-end">
{facultyDropDown[salaryIndex] && (<button
className="bg-blue-500 text-white p-2 mr-4 rounded hover:bg-blue-600 transition duration-200"
onClick={() => submitApproval(salaryIndex)}
>
>
Submit Request
</button>)}
<Button
Expand All @@ -1440,6 +1440,7 @@ const JobDetailPage = ({ params }: { params: { jobId: string } }) => {
</Button>
</div>
</div>
<Separator className="my-8" />
{approvalModal && (
<div className="fixed inset-0 flex items-center justify-center z-30 bg-gray-800 bg-opacity-10">
<div className="bg-white rounded-lg shadow-lg w-3/4 md:w-1/2 lg:w-1/3">
Expand Down
8 changes: 4 additions & 4 deletions src/app/(routes)/recruiter/jobs/[jobID]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ const JobDetailPage = ({ params }: { params: { jobID: string } }) => {
<div className="text-center font-semibold">
<PersonIcon sx={{ fontSize: 80 }} className="mx-auto" />
<br />
{coordinator.tpcMember.user.name}
{coordinator.tpcMember.student.user.name}
</div>
<div>
<div>
Expand All @@ -531,15 +531,15 @@ const JobDetailPage = ({ params }: { params: { jobID: string } }) => {
</div>
<div>
<span className="font-semibold">Department : </span>
{coordinator.tpcMember.department}
{coordinator.tpcMember.student.program.department}
</div>
<div>
<span className="font-semibold">Email : </span>
{coordinator.tpcMember.user.email}
{coordinator.tpcMember.student.user.email}
</div>
<div>
<span className="font-semibold">Contact : </span>
{coordinator.tpcMember.user.contact}
{coordinator.tpcMember.student.user.contact}
</div>
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions src/app/(routes)/student/job/[jobId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,11 @@ const JobPage = ({ params }: { params: { jobId: string } }) => {
<TableBody>
{jobData?.jobCoordinators.map((coordinator, index) => (
<TableRow key={index}>
<TableCell>{coordinator.tpcMember.user.name}</TableCell>
<TableCell>{coordinator.tpcMember.student.user.name}</TableCell>
<TableCell>{coordinator.role}</TableCell>
<TableCell>{coordinator.tpcMember.department}</TableCell>
<TableCell>{coordinator.tpcMember.user.email}</TableCell>
<TableCell>{coordinator.tpcMember.user.contact}</TableCell>
<TableCell>{coordinator.tpcMember.student.program.department}</TableCell>
<TableCell>{coordinator.tpcMember.student.user.email}</TableCell>
<TableCell>{coordinator.tpcMember.student.user.contact}</TableCell>
</TableRow>
))}
</TableBody>
Expand Down
10 changes: 5 additions & 5 deletions src/components/Admin/AddForms.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const JobCoordinatorForm = ({ jobId }: { jobId: string }) => {
const [role, setRole] = useState("PRIMARY");
const [loading, setLoading] = useState(true);
const options = tpcMembers?.map((member) => ({
label: `${member.user.name} ${member.user.email}`,
label: `${member.student.user.name} ${member.student.user.email}`,
value: member.id,
}));
const jobRoleOptions = [
Expand Down Expand Up @@ -71,7 +71,7 @@ const JobCoordinatorForm = ({ jobId }: { jobId: string }) => {
isSearchable
className="mb-4 text-sm font-normal"
/>
{coordinator && coordinator.user.name}
{coordinator && coordinator.student.user.name}
</div>
{coordinator && (
<div>
Expand All @@ -81,15 +81,15 @@ const JobCoordinatorForm = ({ jobId }: { jobId: string }) => {
</div>
<div>
<span className="font-semibold">Department : </span>
{coordinator.department}
{coordinator.student.program.department}
</div>
<div>
<span className="font-semibold">Email : </span>
{coordinator.user.email}
{coordinator.student.user.email}
</div>
<div>
<span className="font-semibold">Contact : </span>
{coordinator.user.contact}
{coordinator.student.user.contact}
</div>
<Select
options={jobRoleOptions}
Expand Down
45 changes: 25 additions & 20 deletions src/components/Admin/types.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
export interface JobCoordinatorFC {

interface Program {
id: string;
role: string;
tpcMember: {
id: string;
department: string;
role: string;
user: {
id: string;
email: string;
name: string;
contact: string;
};
};
branch: string;
course: string;
year: string;
department: string;
}

interface User {
id: string;
name: string;
email: string;
contact: string;
}

interface Student {
id: string;
program: Program;
user: User;
}

export interface TPCMember {
id: string;
department: string;
role: string;
user: {
id: string;
name: string;
email: string;
contact: string;
};
student: Student;
}
export interface JobCoordinatorFC {
id: string;
role: string;
tpcMember: TPCMember;
}
8 changes: 4 additions & 4 deletions src/components/NewTableComponent/NewJobModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ const JobModal = ({
<div className="text-center font-semibold">
<PersonIcon sx={{ fontSize: 80 }} className="mx-auto" />
<br />
{coordinator.tpcMember.user.name}
{coordinator.tpcMember.student.user.name}
</div>
<div>
<div>
Expand All @@ -579,15 +579,15 @@ const JobModal = ({
</div>
<div>
<span className="font-semibold">Department : </span>
{coordinator.tpcMember.department}
{coordinator.tpcMember.student.program.department}
</div>
<div>
<span className="font-semibold">Email : </span>
{coordinator.tpcMember.user.email}
{coordinator.tpcMember.student.user.email}
</div>
<div>
<span className="font-semibold">Contact : </span>
{coordinator.tpcMember.user.contact}
{coordinator.tpcMember.student.user.contact}
</div>
</div>
</div>
Expand Down
14 changes: 3 additions & 11 deletions src/helpers/recruiter/types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { TPCMember } from "@/components/Admin/types";

export interface ApplicationFC {
id: string;
student: {
Expand Down Expand Up @@ -110,17 +112,7 @@ export interface JobDetailFC {
{
id: string;
role: string;
tpcMember: {
id: string;
department: string;
role: string;
user: {
id: string;
email: string;
name: string;
contact: string;
};
};
tpcMember: TPCMember;
},
];
events: [
Expand Down
14 changes: 3 additions & 11 deletions src/helpers/student/types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { TPCMember } from "@/components/Admin/types";

export interface OnCampusOffers {
id: string;
status: string;
Expand Down Expand Up @@ -237,17 +239,7 @@ export interface Job {
jobCoordinators: {
id: string;
role: string;
tpcMember: {
id: string;
department: string;
role: string;
user: {
id: string;
email: string;
name: string;
contact: string;
};
};
tpcMember: TPCMember
}[];

events: {
Expand Down

0 comments on commit bb0a2b0

Please sign in to comment.