Skip to content

Commit

Permalink
Fixed and disabled eslint warnings as required
Browse files Browse the repository at this point in the history
  • Loading branch information
MatricalDefunkt committed May 9, 2024
1 parent 19f1af3 commit 76c48a0
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 26 deletions.
4 changes: 2 additions & 2 deletions src/backend/api/routes/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const app = new Elysia({ prefix: "/generateTT" })
)
.get(
"/loading",
async ({ body }) => {
async () => {
return await fetch(`${PYTHON_SERVER_URL}/loading`);
},
{
Expand All @@ -35,4 +35,4 @@ const app = new Elysia({ prefix: "/generateTT" })
},
);

export default app;
export default app;
2 changes: 1 addition & 1 deletion src/backend/api/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import available from "./available";
import editing from "./editing";
import validate from "./validate";
import addCsv from "./addCsv";
import generate from './generate';
import generate from "./generate";
import Elysia from "elysia";
import cors from "@elysiajs/cors";

Expand Down
1 change: 1 addition & 0 deletions src/backend/api/upload/dataUpload.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import {
AcademicYear,
Batch,
Expand Down
2 changes: 2 additions & 0 deletions src/backend/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable @typescript-eslint/no-unused-vars */

import sampleDataUpload from "./api/upload/sampleUpload";
import app from "./api/routes";

Expand Down
2 changes: 1 addition & 1 deletion src/frontend/Components/Buttons/Generate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
// );
// }
import { IconButton, Tooltip } from "@mui/material";
import AutoModeIcon from '@mui/icons-material/AutoMode';
import AutoModeIcon from "@mui/icons-material/AutoMode";
import { SelectedValuesContext } from "../../context/SelectedValuesContext";
import React, { useContext, useEffect, useRef } from "react";
import api from "../..";
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/Components/Buttons/ToggleAllData.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { SyntheticEvent, useContext, useEffect } from "react";
import React, { SyntheticEvent, useContext } from "react";
import Switch from "@mui/material/Switch";
import { FormControlLabel } from "@mui/material";
import { ViewAllDataContext } from "../../context/ViewAllDataContext";
Expand Down
10 changes: 7 additions & 3 deletions src/frontend/Components/Sidebar/Drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,12 @@ export function DrawerRight({
}

const slot = timetableData?.timetable?.slots[selectedSlotIndex!];
const slotDatas =
slot?.SlotDatas?.filter(checkIfSlotDataExists) || ([] as SlotDatas);
const slotDatas = slot?.SlotDatas?.filter(checkIfSlotDataExists) || ([] as SlotDatas);
useEffect(() => {
if (!update || slotDataIndexToUpdate == null) return;
updateSlotData(slotDataIndexToUpdate);
setUpdate(false);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [slotDatas, update, slotDataIndexToUpdate]);

useEffect(() => {
Expand Down Expand Up @@ -175,6 +175,7 @@ export function DrawerRight({
draft!.timetable!.slots[selectedSlotIndex!].SlotDatas = slotDatas as SlotDatas;
});
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [selectedSlotIndex, update]);

const theme = useTheme();
Expand Down Expand Up @@ -202,7 +203,10 @@ export function DrawerRight({
{theme.direction === "rtl" ? <ChevronLeftIcon /> : <ChevronRightIcon />}
</IconButton>
</DrawerHeader>
<Typography variant="h6" sx={{ fontWeight: "bold", marginLeft: "10px", marginTop: "10px" }}>
<Typography
variant="h6"
sx={{ fontWeight: "bold", marginLeft: "10px", marginTop: "10px" }}
>
Day: {slot.day}, Slot: {slot.number}, Index: {selectedSlotIndex}
</Typography>
<Divider />
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/Components/Timetable/OldTimetable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { TimetableResponse } from "../../../backend/api/routes/responseTypes";
import { checkIfSlotDataExists } from "../fetchAndSet";
import { useReactToPrint } from "react-to-print";
import { IconButton, Tooltip } from "@mui/material";
import PrintIcon from '@mui/icons-material/Print';
import PrintIcon from "@mui/icons-material/Print";

type Timetable = TimetableResponse["timetable"];
type Slots = Timetable["slots"];
Expand Down
2 changes: 0 additions & 2 deletions src/frontend/Pages/DataUpload.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React from "react";
import {
ButtonGroup,
Card,
CardActionArea,
CardContent,
CardHeader,
List,
Expand Down
37 changes: 23 additions & 14 deletions src/frontend/Pages/LandingPage.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, { useState } from "react";
import { styled } from "@mui/material/styles";
import { Box, Button, Typography, Container, Grid, Paper } from "@mui/material";
import { Button, Typography, Container, Grid, Paper } from "@mui/material";
import { Link } from "react-router-dom";

const Main = styled("main", {
shouldForwardProp: (prop) => prop !== "drawerState"
shouldForwardProp: (prop) => prop !== "drawerState",
})<{
drawerState?: boolean;
drawerwidth: number;
Expand All @@ -13,15 +13,15 @@ const Main = styled("main", {
padding: theme.spacing(3),
transition: theme.transitions.create("margin", {
easing: theme.transitions.easing.sharp,
duration: theme.transitions.duration.leavingScreen
duration: theme.transitions.duration.leavingScreen,
}),
marginRight: -drawerwidth,
...(drawerState && {
transition: theme.transitions.create("margin", {
easing: theme.transitions.easing.easeOut,
duration: theme.transitions.duration.enteringScreen
duration: theme.transitions.duration.enteringScreen,
}),
marginRight: 0
marginRight: 0,
}),
position: "relative",
backgroundColor: "#f7f7f7",
Expand All @@ -40,9 +40,9 @@ const FancyButton = styled(Button)({
color: "white",
height: 48,
padding: "0 30px",
'&:hover': {
"&:hover": {
background: "#1976d2",
}
},
});

const ButtonContainer = styled("div")({
Expand All @@ -56,10 +56,12 @@ const ButtonContainer = styled("div")({
export default function LandingPage() {
const [drawerState, setDrawerState] = useState(false);

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const handleDrawerOpen = () => {
setDrawerState(true);
};

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const handleDrawerClose = () => {
setDrawerState(false);
};
Expand All @@ -74,19 +76,26 @@ export default function LandingPage() {
Time Table Generator
</Typography>
<Typography variant="body1" paragraph>
Effortlessly create tailor-made timetables for your university with just one click, enhancing organization and efficiency instantly.
Effortlessly create tailor-made timetables for your university with
just one click, enhancing organization and efficiency instantly.
</Typography>
</Grid>
<Grid item xs={12} md={6}>
<Paper elevation={3}>
<img src="src/icons/3895889.jpg" alt="placeholder" style={{ width: "100%" }} />
<img
src="src/icons/3895889.jpg"
alt="placeholder"
style={{ width: "100%" }}
/>
<ButtonContainer>
<Link to="/upload"> {/* Link to Upload.tsx */}
<FancyButton variant="contained">
Upload CSV
</FancyButton>
<Link to="/upload">
{" "}
{/* Link to Upload.tsx */}
<FancyButton variant="contained">Upload CSV</FancyButton>
</Link>
<Link to="/combined"> {/* Link to TimetableCombined.tsx */}
<Link to="/combined">
{" "}
{/* Link to TimetableCombined.tsx */}
<FancyButton variant="contained">
Generate or Edit
</FancyButton>
Expand Down
1 change: 0 additions & 1 deletion src/frontend/Pages/TimetableCombined.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ const drawerwidth = 300;
// );
// }
import React, { useContext, useState } from "react";
import OldTimetable from "../Components/Timetable/OldTimetable";
import { styled } from "@mui/material/styles";
import { Box } from "@mui/material";
import { DrawerHeader, DrawerRight } from "../Components/Sidebar/Drawer";
Expand Down

0 comments on commit 76c48a0

Please sign in to comment.