Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup/tan #48

Merged
merged 9 commits into from
May 7, 2024
Merged
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
15 changes: 15 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Run `openssl rand -base64 32` to generate a new secret,
# below is what an example secret looks like
NEXTAUTH_SECRET = FXFuxR4wxRD/fcK4FQLgfPK/HejPH4wHwYy9ow2D6sA=

# The base URL of the application
# Ex: http://localhost:3000 or http://192.168.XXX.XXX:3000 or https://example.com
NEXTAUTH_URL = http://localhost:3000

# The URL of MySQL database
# Ex: mysql://[username]:[password]@[host]:[port]/[database_name]
DATABASE_URL = mysql://johndoe:[email protected]:1234/LegacyQCDatabase

# The default file path for building data
# See more at: .scripts/populateBuilding/README.md
BUILDING_DEFAULT_FILE = ./scripts/populateBuilding/data.csv
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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions figma/Inspection Pages Design/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Introduction

Inside, you'll find detailed designs tailored for various screen sizes, including the iPhone 8, iPad Mini 8.3, and desktop. Inside each folder, you will see a PNG file labeled (1) that will contain the home view on the Inspection Page and contain a list of inspections remaining, and the PNG file labeled (2) contains the view of which inspection is to be made.

The design of (1) will allow you to search inspections by team member name, building name, floor number, etc. You can also create a new inspection using drop-down menus. The design of (2) will allow you to perform inspections based on a quantitative rubric. It includes a checklist of items, which you can remove or add freely. Please note that instead of checking unacceptable items, you check off acceptable items instead. To accommodate this change, it is planned that all items will be checked at the start. During inspection, you can also add comments, upload images, and add extra points.

# Notes

This design had not been updated for the current design, which also contain a date picker.
27 changes: 0 additions & 27 deletions functions/resizeImage.ts

This file was deleted.

12 changes: 0 additions & 12 deletions functions/sortMembers.ts

This file was deleted.

2 changes: 1 addition & 1 deletion pages/api/building/addDefault.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import prisma from "../../../lib/prisma";
import generateBuilding, {
BuildingData,
RoomData,
} from "../../../functions/generateBuilding";
} from "../../../scripts/populateBuilding/generateBuilding";

export default async function handler(
req: NextApiRequest,
Expand Down
2 changes: 1 addition & 1 deletion pages/members_performance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const Performance = () => {
// Fetch members from API
const getMembers = async () => {
try {
const response = await fetch("http://localhost:3000/api/member/members", {
const response = await fetch("/api/member/members", {
method: "GET",
headers: { "Content-Type": "application/json" },
});
Expand Down
5 changes: 0 additions & 5 deletions pages/userName.tsx

This file was deleted.

166 changes: 0 additions & 166 deletions prisma/schema(old).prisma

This file was deleted.

11 changes: 11 additions & 0 deletions scripts/populateBuilding/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Description

Add default building and room to database through API call

# Instructions

0. Ensure that you have the database set up and have npm run dev session on

1. Add `Sq_Ft_LMP.csv` to this folder
2. Add `BUILDING_DEFAULT_FILE = ./scripts/populateBuilding/Sq_Ft_LMP.csv` to .env file
3. Call POST: /api/building/addDefault using Postman or similar program
File renamed without changes.
35 changes: 0 additions & 35 deletions slices/counterSlice.ts

This file was deleted.

8 changes: 2 additions & 6 deletions src/components/adminDashboard/navbar/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,18 @@ import {
Avatar,
Box,
Button,
Container,
IconButton,
Menu,
MenuItem,
Typography,
useMediaQuery,
useTheme,
} from "@mui/material";
import { signOut } from "next-auth/react";
import { signOut, useSession } from "next-auth/react";
import Link from "next/link";
import MenuIcon from "@mui/icons-material/Menu";

import { useState, useEffect } from "react";
import { useSession } from "next-auth/react";

import { montserrat } from "../../../../pages/theme";
import { montserrat } from "../../../theme";

export default function navbar() {
const theme = useTheme();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Box, Typography } from "@mui/material";
import { montserrat } from "../../../pages/theme";
import { montserrat } from "../../theme";

const dashboardCardHeading = (props: { text: string }) => {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,9 @@ import { InspectionCardProps, toCompletedInspectionCardProps } from "../props";
import { useDispatch } from "react-redux";
import { setInspectionSelectionData } from "../../inspectionSelectionSlice";
import { useRouter } from "next/router";
import { Inspection } from "../../../../../ts/types/db.interfaces";
import { CompletedCardProps } from "./props";

const CompletedCard = ({
card_id,
inspection,
}: {
card_id: number;
inspection: Inspection;
}) => {
const CompletedCard = ({ card_id, inspection }: CompletedCardProps) => {
const inspectionProps: InspectionCardProps =
toCompletedInspectionCardProps(inspection);
const router = useRouter();
Expand Down
6 changes: 6 additions & 0 deletions src/components/inspections/Grid/CompletedCard/props.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { Inspection } from "../../../../../ts/types/db.interfaces";

export interface CompletedCardProps {
card_id: number;
inspection: Inspection;
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import {
Box,
Button,
Card,
CardActionArea,
CardActions,
CardContent,
Typography,
Expand All @@ -15,15 +13,9 @@ import {
import { useDispatch } from "react-redux";
import { setInspectionSelectionData } from "../../inspectionSelectionSlice";
import { useRouter } from "next/router";
import { Inspection } from "../../../../../ts/types/db.interfaces";
import { UncompletedCardProps } from "./props";

const UncompletedCard = ({
card_id,
inspection,
}: {
card_id: number;
inspection: Inspection;
}) => {
const UncompletedCard = ({ card_id, inspection }: UncompletedCardProps) => {
const inspectionProps: InspectionCardProps =
toUncompletedInspectionCardProps(inspection);
const router = useRouter();
Expand Down
6 changes: 6 additions & 0 deletions src/components/inspections/Grid/UncompletedCard/props.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { Inspection } from "../../../../../ts/types/db.interfaces";

export interface UncompletedCardProps {
card_id: number;
inspection: Inspection;
}
Loading