Skip to content

Commit

Permalink
changes for prod
Browse files Browse the repository at this point in the history
  • Loading branch information
Krishnansh5 committed Jan 16, 2024
1 parent a607aef commit 48339eb
Show file tree
Hide file tree
Showing 12 changed files with 150 additions and 170 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ RUN git clone --depth 1 https://github.com/PhD-PAS/PhD-PAS-frontend.git .
EXPOSE 80

# Run script
CMD [ "/home/ras/scripts/production.sh" ]
CMD bash /home/ras/scripts/production.sh
13 changes: 6 additions & 7 deletions components/Layouts/LayoutWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import BarChartIcon from "@mui/icons-material/BarChart";
import CalendarMonthIcon from "@mui/icons-material/CalendarMonth";
import EqualizerIcon from "@mui/icons-material/Equalizer";
import FeedIcon from "@mui/icons-material/Feed";
import LightbulbIcon from "@mui/icons-material/Lightbulb";
import PieChartIcon from "@mui/icons-material/PieChart";
import TravelExploreIcon from "@mui/icons-material/TravelExplore";
import { useRouter } from "next/router";
Expand Down Expand Up @@ -427,12 +426,12 @@ function LayoutWrapper({ children }: { children: JSX.Element }) {
// role === 100 || role === 101
// ?
// { avatar: <></>, name: "", id: "", hidden: true }
// ? {
// avatar: <BarChartIcon />,
// name: "User Database",
// id: "/users",
// }
// : { avatar: <></>, name: "", id: "", hidden: true },
// ? {
// avatar: <BarChartIcon />,
// name: "User Database",
// id: "/users",
// }
// : { avatar: <></>, name: "", id: "", hidden: true },
// role === 100 || role === 101
// ? {
// avatar: <BarChartIcon />,
Expand Down
1 change: 0 additions & 1 deletion components/Layouts/MasterLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import styled from "@emotion/styled";
import CallIcon from "@mui/icons-material/Call";
import LogoutIcon from "@mui/icons-material/Logout";
import MenuIcon from "@mui/icons-material/Menu";
import {
Expand Down
7 changes: 5 additions & 2 deletions components/Parser/parser.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { func, programType, rev } from "@components/Utils/matrixUtils";
import { func, rev } from "@components/Utils/matrixUtils";

export const getProgram = (id: number) => {
if (id === 200 || id === 0) return "NA";
Expand All @@ -25,5 +25,8 @@ export const getId = (program: string, department: string) => {
return 200;

if (program === "" || department === "") return 0;
return func[department as keyof typeof func][program as keyof programType];
const temp = func[department as keyof typeof func];
const idx =
func[department as keyof typeof func][program as keyof typeof temp];
return idx;
};
248 changes: 125 additions & 123 deletions components/Utils/MatrixCondensed.tsx
Original file line number Diff line number Diff line change
@@ -1,127 +1,129 @@
export {};

/* eslint-disable no-nested-ternary */
import RemoveIcon from "@mui/icons-material/Remove";
import {
Paper,
Table,
TableBody,
TableCell,
TableContainer,
TableRow,
} from "@mui/material";
import React from "react";
import CloseIcon from "@mui/icons-material/Close";
import CheckIcon from "@mui/icons-material/Check";
// import RemoveIcon from "@mui/icons-material/Remove";
// import {
// Paper,
// Table,
// TableBody,
// TableCell,
// TableContainer,
// TableRow,
// } from "@mui/material";
// import React from "react";
// import CloseIcon from "@mui/icons-material/Close";
// import CheckIcon from "@mui/icons-material/Check";

import { Branches, func } from "@components/Utils/matrixUtils";
// import { Branches, func } from "@components/Utils/matrixUtils";

function MatrixCondensed({ data }: { data: string }) {
return (
<TableContainer component={Paper}>
<Table sx={{ minWidth: 650 }} aria-label="simple table">
{/* <TableHead>
<TableRow>
<TableCell align="center" width={100} sx={{ fontWeight: 600 }}>
Program
</TableCell>
<TableCell align="center" width={100} sx={{ fontWeight: 600 }}>
BT / BS / Double Major
</TableCell>
<TableCell align="center" width={100} sx={{ fontWeight: 600 }}>
MT / MSc /MSR
</TableCell>
<TableCell align="center" width={100} sx={{ fontWeight: 600 }}>
Dual
</TableCell>
<TableCell align="center" width={100} sx={{ fontWeight: 600 }}>
MDes
</TableCell>
<TableCell align="center" width={100} sx={{ fontWeight: 600 }}>
MBA
</TableCell>
<TableCell align="center" width={100} sx={{ fontWeight: 600 }}>
PhD
</TableCell>
</TableRow>
</TableHead> */}
<TableBody>
{Branches.map((branch) => (
<TableRow>
<TableCell component="th" scope="row" sx={{ fontWeight: 600 }}>
{branch}
</TableCell>
{/* <TableCell width={100} align="center">
{func[branch as keyof typeof func].BT === -1 &&
func[branch as keyof typeof func].BS === -1 &&
func[branch as keyof typeof func].DoubleMajor === -1 ? (
<RemoveIcon />
) : data[func[branch as keyof typeof func].BT] === "1" ||
data[func[branch as keyof typeof func].BS] === "1" ||
data[func[branch as keyof typeof func].DoubleMajor] ===
"1" ? (
<CheckIcon sx={{ color: "green" }} />
) : (
<CloseIcon sx={{ color: "red" }} />
)}
</TableCell>
<TableCell width={100} align="center">
{func[branch as keyof typeof func].MT === -1 &&
func[branch as keyof typeof func].MSc === -1 &&
func[branch as keyof typeof func].MSR === -1 ? (
<RemoveIcon />
) : data[func[branch as keyof typeof func].MT] === "1" ||
data[func[branch as keyof typeof func].MSc] === "1" ||
data[func[branch as keyof typeof func].MSR] === "1" ? (
<CheckIcon sx={{ color: "green" }} />
) : (
<CloseIcon sx={{ color: "red" }} />
)}
</TableCell>
<TableCell width={100} align="center">
{func[branch as keyof typeof func].DualA === -1 &&
func[branch as keyof typeof func].DualB === -1 &&
func[branch as keyof typeof func].DualC === -1 ? (
<RemoveIcon />
) : data[func[branch as keyof typeof func].DualA] === "1" ||
data[func[branch as keyof typeof func].DualB] === "1" ||
data[func[branch as keyof typeof func].DualC] === "1" ? (
<CheckIcon sx={{ color: "green" }} />
) : (
<CloseIcon sx={{ color: "red" }} />
)}
</TableCell>
<TableCell width={100} align="center">
{func[branch as keyof typeof func].MDes === -1 ? (
<RemoveIcon />
) : data[func[branch as keyof typeof func].MDes] === "1" ? (
<CheckIcon sx={{ color: "green" }} />
) : (
<CloseIcon sx={{ color: "red" }} />
)}
</TableCell>
<TableCell width={100} align="center">
{func[branch as keyof typeof func].MBA === -1 ? (
<RemoveIcon />
) : data[func[branch as keyof typeof func].MBA] === "1" ? (
<CheckIcon sx={{ color: "green" }} />
) : (
<CloseIcon sx={{ color: "red" }} />
)}
</TableCell> */}
<TableCell width={100} align="center">
{func[branch as keyof typeof func].PhD === -1 ? (
<RemoveIcon />
) : data[func[branch as keyof typeof func].PhD] === "1" ? (
<CheckIcon sx={{ color: "green" }} />
) : (
<CloseIcon sx={{ color: "red" }} />
)}
</TableCell>
</TableRow>
))}
</TableBody>
</Table>
</TableContainer>
);
}
// function MatrixCondensed({ data }: { data: string }) {
// return (
// <TableContainer component={Paper}>
// <Table sx={{ minWidth: 650 }} aria-label="simple table">
// {/* <TableHead>
// <TableRow>
// <TableCell align="center" width={100} sx={{ fontWeight: 600 }}>
// Program
// </TableCell>
// <TableCell align="center" width={100} sx={{ fontWeight: 600 }}>
// BT / BS / Double Major
// </TableCell>
// <TableCell align="center" width={100} sx={{ fontWeight: 600 }}>
// MT / MSc /MSR
// </TableCell>
// <TableCell align="center" width={100} sx={{ fontWeight: 600 }}>
// Dual
// </TableCell>
// <TableCell align="center" width={100} sx={{ fontWeight: 600 }}>
// MDes
// </TableCell>
// <TableCell align="center" width={100} sx={{ fontWeight: 600 }}>
// MBA
// </TableCell>
// <TableCell align="center" width={100} sx={{ fontWeight: 600 }}>
// PhD
// </TableCell>
// </TableRow>
// </TableHead> */}
// <TableBody>
// {Branches.map((branch) => (
// <TableRow>
// <TableCell component="th" scope="row" sx={{ fontWeight: 600 }}>
// {branch}
// </TableCell>
// {/* <TableCell width={100} align="center">
// {func[branch as keyof typeof func].BT === -1 &&
// func[branch as keyof typeof func].BS === -1 &&
// func[branch as keyof typeof func].DoubleMajor === -1 ? (
// <RemoveIcon />
// ) : data[func[branch as keyof typeof func].BT] === "1" ||
// data[func[branch as keyof typeof func].BS] === "1" ||
// data[func[branch as keyof typeof func].DoubleMajor] ===
// "1" ? (
// <CheckIcon sx={{ color: "green" }} />
// ) : (
// <CloseIcon sx={{ color: "red" }} />
// )}
// </TableCell>
// <TableCell width={100} align="center">
// {func[branch as keyof typeof func].MT === -1 &&
// func[branch as keyof typeof func].MSc === -1 &&
// func[branch as keyof typeof func].MSR === -1 ? (
// <RemoveIcon />
// ) : data[func[branch as keyof typeof func].MT] === "1" ||
// data[func[branch as keyof typeof func].MSc] === "1" ||
// data[func[branch as keyof typeof func].MSR] === "1" ? (
// <CheckIcon sx={{ color: "green" }} />
// ) : (
// <CloseIcon sx={{ color: "red" }} />
// )}
// </TableCell>
// <TableCell width={100} align="center">
// {func[branch as keyof typeof func].DualA === -1 &&
// func[branch as keyof typeof func].DualB === -1 &&
// func[branch as keyof typeof func].DualC === -1 ? (
// <RemoveIcon />
// ) : data[func[branch as keyof typeof func].DualA] === "1" ||
// data[func[branch as keyof typeof func].DualB] === "1" ||
// data[func[branch as keyof typeof func].DualC] === "1" ? (
// <CheckIcon sx={{ color: "green" }} />
// ) : (
// <CloseIcon sx={{ color: "red" }} />
// )}
// </TableCell>
// <TableCell width={100} align="center">
// {func[branch as keyof typeof func].MDes === -1 ? (
// <RemoveIcon />
// ) : data[func[branch as keyof typeof func].MDes] === "1" ? (
// <CheckIcon sx={{ color: "green" }} />
// ) : (
// <CloseIcon sx={{ color: "red" }} />
// )}
// </TableCell>
// <TableCell width={100} align="center">
// {func[branch as keyof typeof func].MBA === -1 ? (
// <RemoveIcon />
// ) : data[func[branch as keyof typeof func].MBA] === "1" ? (
// <CheckIcon sx={{ color: "green" }} />
// ) : (
// <CloseIcon sx={{ color: "red" }} />
// )}
// </TableCell> */}
// <TableCell width={100} align="center">
// {func[branch as keyof typeof func].PhD === -1 ? (
// <RemoveIcon />
// ) : data[func[branch as keyof typeof func].PhD] === "1" ? (
// <CheckIcon sx={{ color: "green" }} />
// ) : (
// <CloseIcon sx={{ color: "red" }} />
// )}
// </TableCell>
// </TableRow>
// ))}
// </TableBody>
// </Table>
// </TableContainer>
// );
// }

export default MatrixCondensed;
// export default MatrixCondensed;
6 changes: 1 addition & 5 deletions components/Utils/MatrixExpanded.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ import React from "react";
import CloseIcon from "@mui/icons-material/Close";
import CheckIcon from "@mui/icons-material/Check";

import {
Branches,
func,
totalDeptKeywords,
} from "@components/Utils/matrixUtils";
import { Branches, func } from "@components/Utils/matrixUtils";

function MatrixExpanded({ data }: { data: string }) {
if (data?.length < 110)
Expand Down
8 changes: 8 additions & 0 deletions pages/admin/companyHR/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// import { GridColDef } from "@mui/x-data-grid";
// import React, { useEffect, useState } from "react";
import React from "react";

// import CompanyHRRequest, {
// CompanyHR,
Expand Down Expand Up @@ -73,3 +74,10 @@

// Index.layout = "adminDashBoard";
// export default Index;

function Index() {
return <div>companyHR</div>;
}

Index.layout = "adminDashBoard";
export default Index;
17 changes: 1 addition & 16 deletions pages/admin/rc/[rcid]/company/[companyId]/index.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
/* eslint-disable no-shadow */
import React, { useEffect, useState } from "react";
import { GridColDef } from "@mui/x-data-grid";
import {
Button,
Card,
IconButton,
Modal,
Stack,
Typography,
} from "@mui/material";
import { Button, Card, IconButton, Stack, Typography } from "@mui/material";
import Grid from "@mui/material/Grid";
import AddIcon from "@mui/icons-material/Add";
import { useRouter } from "next/router";

import DataGrid from "@components/DataGrid";
import Meta from "@components/Meta";
import AddPPO from "@components/Modals/addPPO";
import useStore from "@store/store";
import requestProforma, { ProformaType } from "@callbacks/admin/rc/proforma";
import requestCompany, { CompanyRc } from "@callbacks/admin/rc/company";
Expand Down Expand Up @@ -89,14 +81,7 @@ function Index() {
const { rcid } = router.query;
const rid = (rcid || "").toString();
const ID = (CID || "").toString();
const [openNew, setOpenNew] = useState(false);
const [rows, setRows] = useState<ProformaType[]>([]);
const handleOpenNew = () => {
setOpenNew(true);
};
const handleCloseNew = () => {
setOpenNew(false);
};
const { token, rcName, role } = useStore();
const [showExtraContent, setShowExtraContent] = useState(false);
const [row, setRow] = useState<CompanyRc>({
Expand Down
6 changes: 1 addition & 5 deletions pages/admin/rc/[rcid]/proforma/[proformaid]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ import StudentRequest from "@callbacks/admin/rc/proforma/students";
import { CDN_URL } from "@callbacks/constants";
import DataGrid from "@components/DataGrid";
import Meta from "@components/Meta";
import {
getDepartment,
getDeptProgram,
getProgram,
} from "@components/Parser/parser";
import { getDepartment, getProgram } from "@components/Parser/parser";
import useStore from "@store/store";
import zip from "@callbacks/auth/zip";
import DownloadResume, {
Expand Down
1 change: 0 additions & 1 deletion pages/admin/rc/[rcid]/stats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import Tab from "@mui/material/Tab";
import Box from "@mui/material/Box";
import { useRouter } from "next/router";

import BranchStats from "sections/BranchStats";
import StudentStats from "sections/StudentStats";
import statRequest, { Stats as StatsType } from "@callbacks/admin/rc/stats";
import useStore from "@store/store";
Expand Down
Loading

0 comments on commit 48339eb

Please sign in to comment.