Skip to content

Commit

Permalink
Merge pull request #55 from Web-Team-IITI-Gymkhana/june-work
Browse files Browse the repository at this point in the history
Resolving Vercel Errors
  • Loading branch information
AryanGKulkarni authored Jun 15, 2024
2 parents f98d6b9 + 131faec commit 40afc81
Show file tree
Hide file tree
Showing 15 changed files with 1,126 additions and 910 deletions.
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
"lint": "next lint"
},
"dependencies": {
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
"@faker-js/faker": "^8.4.1",
"@mui/icons-material": "^5.15.19",
"@mui/material": "^5.15.19",
"@mui/x-date-pickers": "^7.6.2",
"@radix-ui/colors": "^3.0.0",
"@radix-ui/react-accordion": "^1.1.2",
"@radix-ui/react-checkbox": "^1.0.4",
Expand All @@ -34,13 +40,15 @@
"csv-parser": "^3.0.0",
"dayjs": "^1.11.10",
"embla-carousel-react": "^8.0.0-rc19",
"export-to-csv": "^1.3.0",
"formik": "^2.4.5",
"formik-wizard-form": "^2.1.0",
"framer-motion": "^10.16.4",
"js-cookie": "^3.0.5",
"jwt-decode": "^4.0.0",
"lucide-react": "^0.302.0",
"material-icons": "^1.13.12",
"material-react-table": "^2.13.0",
"next": "^14.1.4",
"next-auth": "^4.23.2",
"papaparse": "^5.4.1",
Expand Down
58 changes: 25 additions & 33 deletions src/app/(routes)/admin/jobs/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,41 @@
import { fetchAllJobs } from "@/helpers/api";
import Cookies from "js-cookie";
import TableComponent from "@/components/TableComponent/TableComponent";
import generateColumns from "@/components/TableComponent/ColumnMapping";
import generateColumns from "@/components/NewTableComponent/ColumnMapping";
import type { RecruitmentDTO } from "@/dto/JobDto";
import { recruitmentDTO } from "@/dto/JobDto";
import {
MaterialReactTable,
useMaterialReactTable,
type MRT_Row,
createMRTColumnHelper,
} from 'material-react-table';
import Table from "@/components/NewTableComponent/Table";

const dto = [
{
id: "string",
seasonId: "string",
recruiterId: "string",
companyId: "string",
role: "string",
active: "boolean",
currentStatus: "string",
season: {
id: "string",
year: "string",
type: "string",
},
company: {
id: "string",
name: "string",
},
}
];
const hiddenColumns = ['id'];

const dynamicColumns = generateColumns(dto[0]);

const StudentPage = async () => {
const AllStudents = await fetchAllJobs(Cookies.get("accessToken"),undefined);
const JobPage = async () => {
const columnHelper = createMRTColumnHelper<RecruitmentDTO>();
const columns = generateColumns(recruitmentDTO)
console.log(columns)
const AllJobs = await fetchAllJobs(Cookies.get("accessToken"),undefined);
console.log(AllJobs)
const visibleColumns = columns.filter(
(column:any) => !hiddenColumns.includes(column?.accessorKey)
);
return (
<div className="m-10">
<h1 className="text-center font-bold text-3xl my-5 py-5">Jobs</h1>
<div>
{AllStudents && (
<TableComponent
isAddButton={true}
AddButtonText={"Add Students"}
data={AllStudents}
columns={dynamicColumns}
dto={dto}
{AllJobs && (
<Table
data={AllJobs}
columns={visibleColumns}
/>
)}
</div>
</div>
);
};

export default StudentPage;
export default JobPage;
2 changes: 1 addition & 1 deletion src/app/(routes)/admin/students/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ interface Props {
}

const AdminStudentLayout = ({ children }: Props) => {
return <div className="mx-2 my-4 rounded-md bg-white">{children}</div>;
return <div className="mx-2 py-4 rounded-md bg-white">{children}</div>;
};

export default AdminStudentLayout;
52 changes: 22 additions & 30 deletions src/app/(routes)/admin/students/page.tsx
Original file line number Diff line number Diff line change
@@ -1,46 +1,38 @@
"use client";
import { fetchStudentData } from "@/helpers/api";
import Cookies from "js-cookie";
import TableComponent from "@/components/TableComponent/TableComponent";
import generateColumns from "@/components/TableComponent/ColumnMapping";
import Table from "@/components/NewTableComponent/Table";
import type {DTO} from '@/dto/StudentDto'
import {
MaterialReactTable,
useMaterialReactTable,
type MRT_Row,
createMRTColumnHelper,
} from 'material-react-table';
import generateColumns from "@/components/NewTableComponent/ColumnMapping";
import { jsondto } from "@/dto/StudentDto";

const dto = [
{
id: "string",
userId: "string",
programId: "string",
rollNo: "number",
category: "string",
gender: "MALE",
cpi: "number",
user: {
name: "string",
email: "string",
contact: "string",
},
program: {
course: "string",
branch: "string",
year: "number",
},
},
];

const dynamicColumns = generateColumns(dto[0]);
const hiddenColumns = ['userId', 'programId', 'id'];


const StudentPage = async () => {
const AllStudents = await fetchStudentData(Cookies.get("accessToken"),undefined);
const columnHelper = createMRTColumnHelper<DTO>();
const columns = generateColumns(jsondto)
console.log(columns)
const AllStudents = await fetchStudentData(Cookies.get("accessToken"),null);
const visibleColumns = columns.filter(
(column:any) => !hiddenColumns.includes(column?.accessorKey)
);

return (
<div className="m-10">
<h1 className="text-center font-bold text-3xl my-5 py-5">Students</h1>
<div>
{AllStudents && (
<TableComponent
isAddButton={true}
AddButtonText={"Add Students"}
<Table
data={AllStudents}
columns={dynamicColumns}
dto={dto}
columns={visibleColumns}
/>
)}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/app/(routes)/recruiter/prevjaf/[jaf]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ const JAFPage = ({
return (
<>
{jafs.map((jaf,index) => (
<div className="my-3">
<div key={index} className="my-3">
<JafCard JAF={jaf}/>
</div>
))}
Expand Down
Loading

1 comment on commit 40afc81

@vercel
Copy link

@vercel vercel bot commented on 40afc81 Jun 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.