-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into studentPageChanges
- Loading branch information
Showing
17 changed files
with
1,304 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: build-test | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
|
||
jobs: | ||
build-lint-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: yarn | ||
cache-dependency-path: 'yarn.lock' | ||
- run: yarn | ||
- run: yarn build |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import Link from "next/link"; | ||
|
||
interface Props { | ||
children: React.ReactNode; | ||
} | ||
|
||
const FacultyLayout = ({ children }: Props) => { | ||
return <div>{children}</div>; | ||
}; | ||
|
||
export default FacultyLayout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
"use client"; | ||
import { fetchApprovals, updateApproval } from "@/helpers/faculty/api"; | ||
import Cookies from "js-cookie"; | ||
import TableComponent from "@/components/TableComponent/TableComponent"; | ||
import generateColumns from "@/components/TableComponent/ColumnMapping"; | ||
import { useState, useEffect } from "react"; | ||
import loadingImg from "@/components/Faculty/loadingSpinner.svg"; | ||
|
||
const dto = [ | ||
{ | ||
status: "string", | ||
remarks: "string", | ||
faculty: { | ||
department: "string", | ||
user: { | ||
email: "string", | ||
name: "string", | ||
contact: "string", | ||
}, | ||
}, | ||
salary: { | ||
salaryPeriod: "string", | ||
totalCTC: "number", | ||
job: { | ||
role: "string", | ||
joiningDate: "string", | ||
season: { | ||
year: "string", | ||
type: "string", | ||
}, | ||
company: { | ||
name: "string", | ||
}, | ||
}, | ||
}, | ||
}, | ||
]; | ||
|
||
const dynamicColumns = generateColumns(dto); | ||
|
||
const FacultyPage = () => { | ||
const [data, setData] = useState(null); | ||
const [loading, setLoading] = useState(true); | ||
|
||
useEffect(() => { | ||
const fetchData = async () => { | ||
try { | ||
const jsonData = await fetchApprovals( | ||
Cookies.get("accessToken"), | ||
undefined | ||
); | ||
setData(jsonData); | ||
} catch (error) { | ||
console.error("Error fetching data:", error); | ||
} finally { | ||
setLoading(false); | ||
} | ||
}; | ||
|
||
fetchData(); | ||
}, []); | ||
return ( | ||
<div className="md:m-12 m-2"> | ||
<h1 className="text-center font-bold text-3xl my-5 py-5">Approvals</h1> | ||
<div> | ||
{loading && ( | ||
<img src={loadingImg.src} alt="" className="mx-auto my-auto" /> | ||
)} | ||
{data && ( | ||
<TableComponent | ||
data={data} | ||
columns={dynamicColumns} | ||
dto={dto} | ||
isFeedbackForm={true} | ||
/> | ||
)} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default FacultyPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
"use client"; | ||
|
||
import React, { useEffect, useState } from "react"; | ||
import FacultyProfile from "@/components/Faculty/Profile"; | ||
import { fetchProfile } from "@/helpers/faculty/api"; | ||
import Cookies from "js-cookie"; | ||
import loadingImg from "@/components/Faculty/loadingSpinner.svg"; | ||
import { ProfileFC } from "@/helpers/faculty/api"; | ||
|
||
const Profile = ({ params }: { params: { facultyId: string } }) => { | ||
const [data, setData] = useState<ProfileFC>(); | ||
const [loading, setLoading] = useState(true); | ||
|
||
useEffect(() => { | ||
const profileData = async () => { | ||
const jsonData = await fetchProfile(Cookies.get("accessToken")); | ||
setData(jsonData); | ||
setLoading(false); | ||
}; | ||
profileData(); | ||
}, []); | ||
|
||
return ( | ||
<div className="h-screen grid justify-center items-center"> | ||
{loading && <img src={loadingImg.src} />} | ||
{data && <FacultyProfile profile={data} />} | ||
</div> | ||
); | ||
}; | ||
|
||
export default Profile; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.