diff --git a/app.db b/app.db index de14588..a8c3bd0 100644 Binary files a/app.db and b/app.db differ diff --git a/client/src/components/Cards/TicketCard.tsx b/client/src/components/Cards/TicketCard.tsx index dcd1090..9018c84 100644 --- a/client/src/components/Cards/TicketCard.tsx +++ b/client/src/components/Cards/TicketCard.tsx @@ -1,13 +1,9 @@ import React, { FC, MouseEvent } from "react"; import { Button, Typography, Grid } from "@material-ui/core"; -import { createStyles, makeStyles, Theme } from "@material-ui/core/styles"; -import Chip from "@material-ui/core/Chip"; -import Paper from "@material-ui/core/Paper"; - import { HorizontalCard } from "./HorizontalCard"; +import TicketChipsArray from "./TicketChipsArray"; import { Ticket } from "../../types/Ticket"; import { getRemainingdays } from "../../utils/methods"; -import TicketChipsArray from "./TicketChipsArray"; interface IProps { ticket?: Ticket; diff --git a/client/src/components/Cards/TicketChipsArray.tsx b/client/src/components/Cards/TicketChipsArray.tsx index 92b57f9..ec50e81 100644 --- a/client/src/components/Cards/TicketChipsArray.tsx +++ b/client/src/components/Cards/TicketChipsArray.tsx @@ -3,7 +3,6 @@ import { Grid, Chip, makeStyles, Theme, createStyles } from "@material-ui/core"; import CategoryIcon from "@material-ui/icons/Category"; import PriorityHighIcon from "@material-ui/icons/PriorityHigh"; import SpeedIcon from "@material-ui/icons/Speed"; -import { Ticket } from "../../types/Ticket"; const useStyles = makeStyles((theme: Theme) => createStyles({ diff --git a/client/src/components/Modals/NewProjectModal.tsx b/client/src/components/Modals/NewProjectModal.tsx index 94476ec..3d63126 100644 --- a/client/src/components/Modals/NewProjectModal.tsx +++ b/client/src/components/Modals/NewProjectModal.tsx @@ -1,21 +1,10 @@ import React, { FC, useState, FormEvent } from "react"; -import { useRouteMatch } from "react-router-dom"; -import { - TextField, - MenuItem, - Grid, - makeStyles, - Theme, - createStyles, -} from "@material-ui/core"; +import { TextField } from "@material-ui/core"; import { Modal } from "./Modal"; -import { Ticket } from "../../types/Ticket"; +import { Project } from "../../types/Project"; import { User } from "../../types/User"; import { post } from "../../utils/http"; import { Constants } from "../../utils/Constants"; -import Category from "../../types/enums/category"; -import Impact from "../../types/enums/impact"; -import Difficulty from "../../types/enums/difficulty"; interface IProps { show: boolean; @@ -23,53 +12,30 @@ interface IProps { allUsers: User[]; } -const useStyles = makeStyles((theme: Theme) => ({ - select: { - width: 120, - }, -})); - -export const NewProjectModal: FC = ({ - show, - handleClose, - allUsers, -}) => { +export const NewProjectModal: FC = ({ show, handleClose }) => { const [title, setTitle] = useState(""); const [description, setDescription] = useState(""); const [endingDate, setEndingDate] = useState(""); - const { url } = useRouteMatch(); - const id = url.split("/")[2]; - const [projectId, setProjectId] = useState(id); - const [categoryID, setCategoryID] = useState(0); - const [impactID, setImpactID] = useState(0); - const [difficultyID, setDifficultyID] = useState(0); - const handleSubmit = async (e: FormEvent) => { e.preventDefault(); - let newTicket = { + let newProject = { title: title, description: description, endingDate: new Date(endingDate).toISOString(), - creatorId: "20bf4b2a-7209-4826-96cd-29c2bc937a94", // get current User id - projectId: parseInt(projectId), - impact: impactID, - difficulty: difficultyID, - category: categoryID, + managerId: "cd179eb7-3a54-4060-b22c-3e947bdffcbc", // get current User id }; - // const response: HttpResponse = - await post(`${Constants.ticketsURI}`, newTicket); + await post(`${Constants.projectsURI}`, newProject); handleClose(); }; - const classes = useStyles(); return ( = ({ multiline /> - ) => { - e.preventDefault(); - setProjectId(e.target.value); - }} - // helperText="Please select your currency" - variant="outlined" - margin="normal" - > - {allUsers.map((p) => ( - - {p} - - ))} - - = ({ type="date" margin="normal" fullWidth - // defaultValue={new Date().toISOString()} - // className={classes.textField} InputLabelProps={{ shrink: true, }} @@ -144,71 +85,6 @@ export const NewProjectModal: FC = ({ setEndingDate(e.target.value) } /> - - - ) => { - e.preventDefault(); - setCategoryID(parseInt(e.target.value)); - }} - variant="outlined" - margin="normal" - className={classes.select} - > - {Category.map((c: string, i: number) => ( - - {c} - - ))} - - - ) => { - e.preventDefault(); - setImpactID(parseInt(e.target.value)); - }} - variant="outlined" - margin="normal" - > - {Impact.map((c: string, i: number) => ( - - {c} - - ))} - - - ) => { - e.preventDefault(); - setDifficultyID(parseInt(e.target.value)); - }} - variant="outlined" - margin="normal" - > - {Difficulty.map((c: string, i: number) => ( - - {c} - - ))} - - ); }; diff --git a/client/src/components/Modals/NewTicketModal.tsx b/client/src/components/Modals/NewTicketModal.tsx index bb29b1d..9493b17 100644 --- a/client/src/components/Modals/NewTicketModal.tsx +++ b/client/src/components/Modals/NewTicketModal.tsx @@ -6,7 +6,6 @@ import { Grid, makeStyles, Theme, - createStyles, } from "@material-ui/core"; import { Modal } from "./Modal"; import { Ticket } from "../../types/Ticket"; diff --git a/client/src/components/Panels/UserTabPanel.tsx b/client/src/components/Panels/UserTabPanel.tsx index c23b783..ad0c2ba 100644 --- a/client/src/components/Panels/UserTabPanel.tsx +++ b/client/src/components/Panels/UserTabPanel.tsx @@ -48,6 +48,7 @@ const useStyles = makeStyles((theme: Theme) => ({ backgroundColor: "#E9ECEF", borderRadius: "20px", }, + topbar: { borderTopLeftRadius: "10px", borderTopRightRadius: "10px" }, })); interface IProps { @@ -77,11 +78,7 @@ export const UserTabPanel: FC = ({ return (
- +