Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 30 additions & 31 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ name: "CodeQL"

on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
branches: ["main"]
schedule:
- cron: '38 21 * * 2'
- cron: "38 21 * * 2"

jobs:
analyze:
Expand All @@ -32,41 +32,40 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
language: ["javascript"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.


# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh
# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ jobs:
- name: Install Packages
run: npm install --legacy-peer-deps
- name: Lint Check
run: npm run lint
run: npm run lint
9 changes: 4 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
}
6 changes: 3 additions & 3 deletions callbacks/admin/rc/userDetails.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import axios, { AxiosResponse } from "axios";

import { successNotification,errorNotification } from "@callbacks/notifcation";
import { successNotification, errorNotification } from "@callbacks/notifcation";

import { AUTH_URL, ErrorType, SERVER_ERROR, setConfig } from "../../constants";

Expand Down Expand Up @@ -58,7 +58,7 @@ const userDetailsRequest = {
)
.then(() => {
successNotification("Success", "Role updated successfully");
return true
return true;
})
.catch((err: ErrorType) => {
errorNotification("Error", err.response?.data?.error || err.message);
Expand All @@ -69,7 +69,7 @@ const userDetailsRequest = {
.put(`admins/${user_id}/active`, { user_id: user_id }, setConfig(token))
.then(() => {
successNotification("Success", "Active status updated successfully");
return true
return true;
})
.catch((err: ErrorType) => {
errorNotification("Error", err.response?.data?.error || err.message);
Expand Down
5 changes: 4 additions & 1 deletion callbacks/auth/zip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ const zip = {
window.open(
`http://placement.iitk.ac.in/cdn/zip/${res.data.filename}`
);
return {filename : res.data.filename, message: "Zipping Sucessful"} as ZipResponse;
return {
filename: res.data.filename,
message: "Zipping Sucessful",
} as ZipResponse;
}
})
.catch((err: ErrorType) => {
Expand Down
2 changes: 1 addition & 1 deletion pages/admin/companyHR/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function Index() {
const fetch = async () => {
const companyHR = await CompanyHRRequest.getAll(token).catch(() => []);
setRows(companyHR);
console.log(companyHR);

setLoading(false);
};
fetch();
Expand Down
31 changes: 18 additions & 13 deletions pages/admin/rc/[rcid]/calendar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ import useStore from "@store/store";
import calendarLinks from "@components/Utils/calendarUtils";
import { errorNotification } from "@callbacks/notifcation";

const isSameDay = (d1: Date, d2: Date) =>
d1.getFullYear() === d2.getFullYear() &&
d1.getMonth() === d2.getMonth() &&
d1.getDate() === d2.getDate();
const columns: GridColDef[] = [
{
field: "ID",
Expand Down Expand Up @@ -105,27 +109,28 @@ function Calendar() {
const fetchData = async () => {
if (router.isReady) {
let response = await eventRequest.getAll(token, rid);
for (let i = 0; i < response.length; i += 1) {
response[i].recruitment_cycle_id = rid;
}
response = response.map((e) => ({
...e,
recruitment_cycle_id: rid,
start_time: Number(e.start_time),
end_time: Number(e.end_time),
}));
setEvents(response);
}
};
if (router.isReady) fetchData();
}, [rid, router.isReady, token]);

useEffect(() => {
setActivity(
events.filter(
(e) => new Date(e.start_time).toDateString() === value?.toDateString()
)
);
setRows(
events.filter(
(e) => new Date(e.start_time).toDateString() === value?.toDateString()
)
);
const filtered = events.filter((e) => {
const eventDate = new Date(e.start_time);
const match = isSameDay(eventDate, value as Date);
return match;
});
setActivity(filtered);
setRows(filtered);
}, [value, events]);

return (
<div>
<h2>Calendar</h2>
Expand Down
32 changes: 18 additions & 14 deletions pages/student/rc/[rcid]/calendar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ const columns: GridColDef[] = [
),
},
];
const isSameDay = (d1: Date, d2: Date) =>
d1.getFullYear() === d2.getFullYear() &&
d1.getMonth() === d2.getMonth() &&
d1.getDate() === d2.getDate();

function Calendar() {
const [value, setValue] = useState<Date | null>(new Date());
Expand All @@ -101,26 +105,26 @@ function Calendar() {
const fetchData = async () => {
if (router.isReady) {
let response = await eventsRequest.getAll(token, rid);
for (let i = 0; i < response.length; i += 1) {
response[i].recruitment_cycle_id = rid;
}
response = response.map((e: { start_time: any; end_time: any }) => ({
...e,
recruitment_cycle_id: rid,
start_time: Number(e.start_time),
end_time: Number(e.end_time),
}));
setEvents(response);
}
};
if (router.isReady) fetchData();
}, [rid, router.isReady, token]);

useEffect(() => {
setActivity(
events.filter(
(e) => new Date(e.start_time).toDateString() === value?.toDateString()
)
);
setRows(
events.filter(
(e) => new Date(e.start_time).toDateString() === value?.toDateString()
)
);
const filtered = events.filter((e) => {
const eventDate = new Date(e.start_time);
const match = isSameDay(eventDate, value as Date);
return match;
});
setActivity(filtered);
setRows(filtered);
}, [value, events]);

return (
Expand Down Expand Up @@ -168,7 +172,7 @@ function Calendar() {
heighted
/>
) : (
<h2>No event scheduled</h2>
<h2>No event scheduld</h2>
)}
</Grid>
</Grid>
Expand Down
2 changes: 1 addition & 1 deletion sections/PastHires.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,4 +200,4 @@ function PastHires() {
</div>
);
}
export default PastHires;
export default PastHires;
40 changes: 19 additions & 21 deletions styles/Dashboard.module.css
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
.container{
width: 300px;
-ms-overflow-style: none;
scrollbar-width: none;
.container {
width: 300px;
-ms-overflow-style: none;
scrollbar-width: none;
}

.container::-webkit-scrollbar {
display: none;
.container::-webkit-scrollbar {
display: none;
}

.drawer{
-ms-overflow-style: none;
scrollbar-width: none;
.drawer {
-ms-overflow-style: none;
scrollbar-width: none;
}

.drawer::-webkit-scrollbar {
display: none;
.drawer::-webkit-scrollbar {
display: none;
}

@media(max-width: 1750px){
.container{
width: 250px;
}
@media (max-width: 1750px) {
.container {
width: 250px;
}
}


@media(max-width: 1535.6px){
.container{
display:none;
}
@media (max-width: 1535.6px) {
.container {
display: none;
}
}

18 changes: 9 additions & 9 deletions styles/Footer.module.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
.footerMobile {
display: none;
display: none;
}

@media(max-width:1000px) {
.footer {
display: none;
}
@media (max-width: 1000px) {
.footer {
display: none;
}

.footerMobile {
display: block;
}
}
.footerMobile {
display: block;
}
}
24 changes: 12 additions & 12 deletions styles/Form.module.css
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
@media(max-width:950px){
.image{
display: none;
}
@media (max-width: 950px) {
.image {
display: none;
}
}

@media(max-width:1200px){
.creditsimage{
display: none;
}
@media (max-width: 1200px) {
.creditsimage {
display: none;
}
}

.tiles:hover{
transform: scale(1.05);
transition: all 200ms ease-in-out;
}
.tiles:hover {
transform: scale(1.05);
transition: all 200ms ease-in-out;
}
Loading