Skip to content

Commit

Permalink
lint: fixed eslint for cicd
Browse files Browse the repository at this point in the history
  • Loading branch information
e-tayfw committed Oct 8, 2024
1 parent c6e4c92 commit 470a1a8
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 223 deletions.
5 changes: 3 additions & 2 deletions src/components/Nav/MobileNav/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { useRouter } from "next/router";
import { FiMenu, FiX } from "react-icons/fi";
import NextLink from "next/link";
import { NavLink } from "..";
import { Body } from "@/components/TextStyles";
import Link from "next/link";
// import { Body } from "@/components/TextStyles";
// import Link from "next/link";

export interface MobileMenuProps {
scrollPos: number;
Expand Down Expand Up @@ -60,6 +60,7 @@ export const mobileMenuLinks: NavLink[] = [
export const MobileMenu: FC<MobileMenuProps> = ({ scrollPos, isHomePage }) => {
const [isOpen, setIsOpen] = useState(false);
const router = useRouter();
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const [showNumber, setShowNumber] = useState(false);

const containerVariants = {
Expand Down
1 change: 1 addition & 0 deletions src/components/apply/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const Apply: React.FC = ({}) => {
}, []);

//remove later
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const simulateApiCall = (data: SubmitData): Promise<{ success: boolean; message: string }> => {
return new Promise((resolve) => {
setTimeout(() => {
Expand Down
1 change: 1 addition & 0 deletions src/components/auth/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export function Auth() {
}
};

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const submitForm = async (_username: string, userType: string) => {
return new Promise((resolve) => {
setTimeout(() => {
Expand Down
4 changes: 4 additions & 0 deletions src/components/history/entry/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@ interface RequestEntryProps {
}

const RequestEntry: React.FC<RequestEntryProps> = ({
// eslint-disable-next-line @typescript-eslint/no-unused-vars
requestId,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
requestorId,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
approverId,
status = 'unknown', // Default to 'unknown' if status is undefined
dateRequested,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
requestBatch,
dateOfRequest,
duration,
Expand Down
8 changes: 6 additions & 2 deletions src/components/history/table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import axios from 'axios';
import Swal from 'sweetalert2';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faSort, faSortUp, faSortDown } from '@fortawesome/free-solid-svg-icons';
import { RootState } from '@/redux/store';

// Interface for request data
interface Request {
Expand All @@ -31,7 +32,7 @@ export const RequestTable: React.FC = () => {
const [currentPage, setCurrentPage] = useState<number>(1); // For pagination

// Retrieve staffId (which is employeeId) from Redux store
const employeeId = useSelector((state: any) => state.auth.staffId);
const employeeId = useSelector((state: RootState) => state.auth.staffId);

// Fetch requests using Axios and SweetAlert2 loader
useEffect(() => {
Expand All @@ -53,6 +54,7 @@ export const RequestTable: React.FC = () => {
// Make Axios call using the employeeId
const response = await axios.get(`http://127.0.0.1:8085/api/request/requestorId/${employeeId}`);

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const mappedRequests = response.data.map((item: any) => ({
requestId: item.Request_ID,
requestorId: item.Requestor_ID,
Expand Down Expand Up @@ -94,10 +96,12 @@ export const RequestTable: React.FC = () => {

// Sort requests
const sortedRequests = useMemo(() => {
let sortableRequests = [...requests];
const sortableRequests = [...requests];
if (sortConfig !== null) {
sortableRequests.sort((a, b) => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let aValue: any = a[sortConfig.key];
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let bValue: any = b[sortConfig.key];

// Handle sorting for date fields
Expand Down
5 changes: 3 additions & 2 deletions src/components/nav/MobileNav/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { useRouter } from "next/router";
import { FiMenu, FiX } from "react-icons/fi";
import NextLink from "next/link";
import { NavLink } from "..";
import { Body } from "@/components/TextStyles";
import Link from "next/link";
// import { Body } from "@/components/TextStyles";
// import Link from "next/link";

export interface MobileMenuProps {
scrollPos: number;
Expand Down Expand Up @@ -60,6 +60,7 @@ export const mobileMenuLinks: NavLink[] = [
export const MobileMenu: FC<MobileMenuProps> = ({ scrollPos, isHomePage }) => {
const [isOpen, setIsOpen] = useState(false);
const router = useRouter();
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const [showNumber, setShowNumber] = useState(false);

const containerVariants = {
Expand Down
4 changes: 2 additions & 2 deletions src/pages/apply/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState } from "react";
import React from "react";
import { Apply } from "@/components/apply";
import axios from 'axios'


const ApplyPage: React.FC = ({}) => {
return (
Expand Down
Loading

0 comments on commit 470a1a8

Please sign in to comment.