mirror of
https://github.com/rjNemo/ticket_manager
synced 2026-06-12 03:36:39 +00:00
[Chore] apply default exports and cleaner imports
This commit is contained in:
parent
f23bfad793
commit
447d52e490
69 changed files with 364 additions and 382 deletions
|
|
@ -11,12 +11,6 @@
|
||||||
/>
|
/>
|
||||||
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
||||||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
||||||
|
|
||||||
<!-- <link
|
|
||||||
rel="stylesheet"
|
|
||||||
href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css"
|
|
||||||
/>
|
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script> -->
|
|
||||||
<link
|
<link
|
||||||
rel="stylesheet"
|
rel="stylesheet"
|
||||||
href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"
|
href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"short_name": "React App",
|
"short_name": "BugBuster",
|
||||||
"name": "Create React App Sample",
|
"name": "BugBuster | Project Management",
|
||||||
"icons": [
|
"icons": [
|
||||||
{
|
{
|
||||||
"src": "favicon.ico",
|
"src": "favicon.ico",
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import { Router } from "react-router-dom";
|
||||||
import { useAuth0 } from "./authentication/auth0";
|
import { useAuth0 } from "./authentication/auth0";
|
||||||
import { history } from "./utils/history";
|
import { history } from "./utils/history";
|
||||||
import MainLayout from "./layouts/MainLayout";
|
import MainLayout from "./layouts/MainLayout";
|
||||||
import { AppRouter } from "./routes/AppRouter";
|
import AppRouter from "./routes/AppRouter";
|
||||||
|
|
||||||
export default function App() {
|
export default function App() {
|
||||||
const { loading } = useAuth0();
|
const { loading } = useAuth0();
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
import { Ticket } from "../types/Ticket";
|
import Activity from "../types/Activity";
|
||||||
import { Project } from "../types/Project";
|
import AppFile from "../types/AppFile";
|
||||||
import { AppFile } from "../types/AppFile";
|
import Project from "../types/Project";
|
||||||
import { Activity } from "../types/Activity";
|
import Ticket from "../types/Ticket";
|
||||||
import { User } from "../types/User";
|
import User from "../types/User";
|
||||||
import { getRemainingdays } from "../utils/methods";
|
import getRemainingdays from "../utils/methods";
|
||||||
|
|
||||||
export default class ProjectVM {
|
export default class ProjectVM {
|
||||||
public id: number;
|
public id: number;
|
||||||
|
|
@ -47,7 +47,7 @@ export default class ProjectVM {
|
||||||
this.ticketsDone =
|
this.ticketsDone =
|
||||||
this.tickets === undefined
|
this.tickets === undefined
|
||||||
? 0
|
? 0
|
||||||
: this.tickets.filter(t => t.status === "Done").length;
|
: this.tickets.filter((t) => t.status === "Done").length;
|
||||||
this.remainingDays = getRemainingdays(project.endingDate);
|
this.remainingDays = getRemainingdays(project.endingDate);
|
||||||
this.allProjects = allProjects;
|
this.allProjects = allProjects;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import { Ticket } from "../types/Ticket";
|
import Project from "../types/Project";
|
||||||
import { Project } from "../types/Project";
|
import Ticket from "../types/Ticket";
|
||||||
import { User } from "../types/User";
|
import User from "../types/User";
|
||||||
|
|
||||||
export class TicketVM {
|
export default class TicketVM {
|
||||||
public id: number;
|
public id: number;
|
||||||
public title: string;
|
public title: string;
|
||||||
public description: string;
|
public description: string;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { Project } from "../types/Project";
|
import Activity from "../types/Activity";
|
||||||
import { Ticket } from "../types/Ticket";
|
import Project from "../types/Project";
|
||||||
import { User } from "../types/User";
|
import Ticket from "../types/Ticket";
|
||||||
import { Activity } from "../types/Activity";
|
import User from "../types/User";
|
||||||
|
|
||||||
export class UserVM {
|
export class UserVM {
|
||||||
public id: string;
|
public id: string;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
// src/react-auth0-spa.js
|
|
||||||
import React, { useState, useEffect, useContext } from "react";
|
import React, { useState, useEffect, useContext } from "react";
|
||||||
import createAuth0Client from "@auth0/auth0-spa-js";
|
import createAuth0Client from "@auth0/auth0-spa-js";
|
||||||
|
|
||||||
|
|
@ -68,6 +67,7 @@ export const Auth0Provider = ({
|
||||||
setIsAuthenticated(true);
|
setIsAuthenticated(true);
|
||||||
setUser(user);
|
setUser(user);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Auth0Context.Provider
|
<Auth0Context.Provider
|
||||||
value={{
|
value={{
|
||||||
|
|
@ -81,7 +81,7 @@ export const Auth0Provider = ({
|
||||||
loginWithRedirect: (...p) => auth0Client.loginWithRedirect(...p),
|
loginWithRedirect: (...p) => auth0Client.loginWithRedirect(...p),
|
||||||
getTokenSilently: (...p) => auth0Client.getTokenSilently(...p),
|
getTokenSilently: (...p) => auth0Client.getTokenSilently(...p),
|
||||||
getTokenWithPopup: (...p) => auth0Client.getTokenWithPopup(...p),
|
getTokenWithPopup: (...p) => auth0Client.getTokenWithPopup(...p),
|
||||||
logout: (...p) => auth0Client.logout(...p)
|
logout: (...p) => auth0Client.logout(...p),
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
import React, { FC } from "react";
|
import React, { FC } from "react";
|
||||||
import { Activity } from "../types/Activity";
|
import Activity from "../types/Activity";
|
||||||
|
|
||||||
type IProps = {
|
type IProps = {
|
||||||
activities: Activity[];
|
activities: Activity[];
|
||||||
filterText: string;
|
filterText: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const ActivityCollection: FC<IProps> = ({ activities, filterText }) => {
|
const ActivityCollection: FC<IProps> = ({ activities, filterText }) => {
|
||||||
return activities === undefined ? (
|
return activities === undefined ? (
|
||||||
<></>
|
<></>
|
||||||
) : (
|
) : (
|
||||||
|
|
@ -17,7 +17,7 @@ export const ActivityCollection: FC<IProps> = ({ activities, filterText }) => {
|
||||||
) : (
|
) : (
|
||||||
activities
|
activities
|
||||||
.filter(
|
.filter(
|
||||||
a =>
|
(a) =>
|
||||||
a.description
|
a.description
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.includes(filterText.toLowerCase()) ||
|
.includes(filterText.toLowerCase()) ||
|
||||||
|
|
@ -67,3 +67,4 @@ export const ActivityEntry: FC<IFProps> = ({ activity }) => {
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
export default ActivityCollection;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
import React, { FC } from "react";
|
import React, { FC } from "react";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import Avatar from "@material-ui/core/Avatar";
|
import { makeStyles, Theme, createStyles, Avatar } from "@material-ui/core";
|
||||||
import AvatarGroup from "@material-ui/lab/AvatarGroup";
|
import AvatarGroup from "@material-ui/lab/AvatarGroup";
|
||||||
import { User } from "../../types/User";
|
import User from "../../types/User";
|
||||||
import { makeStyles, Theme, createStyles } from "@material-ui/core";
|
|
||||||
|
|
||||||
interface AvatarListProps {
|
interface AvatarListProps {
|
||||||
users: User[];
|
users: User[];
|
||||||
|
|
@ -34,3 +33,5 @@ export const AvatarList: FC<AvatarListProps> = ({ users }) => {
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default AvatarList;
|
||||||
|
|
|
||||||
|
|
@ -12,17 +12,17 @@ const useStyles = makeStyles((theme: Theme) =>
|
||||||
root: {
|
root: {
|
||||||
display: "flex",
|
display: "flex",
|
||||||
"& > *": {
|
"& > *": {
|
||||||
margin: theme.spacing(1)
|
margin: theme.spacing(1),
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
small: {
|
small: {
|
||||||
width: theme.spacing(3),
|
width: theme.spacing(3),
|
||||||
height: theme.spacing(3)
|
height: theme.spacing(3),
|
||||||
},
|
},
|
||||||
large: {
|
large: {
|
||||||
width: theme.spacing(10),
|
width: theme.spacing(10),
|
||||||
height: theme.spacing(10)
|
height: theme.spacing(10),
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -35,3 +35,5 @@ export const UserAvatar: FC<IProps> = ({ picture, alt }) => {
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default UserAvatar;
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,26 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import {
|
||||||
|
AppBar,
|
||||||
|
Button,
|
||||||
|
IconButton,
|
||||||
|
Toolbar,
|
||||||
|
Typography,
|
||||||
|
} from "@material-ui/core";
|
||||||
import { createStyles, makeStyles, Theme } from "@material-ui/core/styles";
|
import { createStyles, makeStyles, Theme } from "@material-ui/core/styles";
|
||||||
import AppBar from "@material-ui/core/AppBar";
|
|
||||||
import Toolbar from "@material-ui/core/Toolbar";
|
|
||||||
import Typography from "@material-ui/core/Typography";
|
|
||||||
import Button from "@material-ui/core/Button";
|
|
||||||
import IconButton from "@material-ui/core/IconButton";
|
|
||||||
import MenuIcon from "@material-ui/icons/Menu";
|
import MenuIcon from "@material-ui/icons/Menu";
|
||||||
import { useAuth0 } from "../authentication/auth0";
|
import { useAuth0 } from "../authentication/auth0";
|
||||||
|
|
||||||
const useStyles = makeStyles((theme: Theme) =>
|
const useStyles = makeStyles((theme: Theme) =>
|
||||||
createStyles({
|
createStyles({
|
||||||
root: {
|
root: {
|
||||||
flexGrow: 1
|
flexGrow: 1,
|
||||||
},
|
},
|
||||||
menuButton: {
|
menuButton: {
|
||||||
marginRight: theme.spacing(2)
|
marginRight: theme.spacing(2),
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
flexGrow: 1
|
flexGrow: 1,
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,12 +9,12 @@ interface IProps {
|
||||||
onClick?: (e: MouseEvent) => void;
|
onClick?: (e: MouseEvent) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Button: FC<IProps> = ({
|
const Button: FC<IProps> = ({
|
||||||
size = "small",
|
size = "small",
|
||||||
shape = "",
|
shape = "",
|
||||||
color,
|
color,
|
||||||
onClick,
|
onClick,
|
||||||
children
|
children,
|
||||||
}) => {
|
}) => {
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
|
|
@ -25,3 +25,5 @@ export const Button: FC<IProps> = ({
|
||||||
</button>
|
</button>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default Button;
|
||||||
|
|
|
||||||
|
|
@ -10,13 +10,7 @@ interface IProps {
|
||||||
text?: string;
|
text?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const FloatingButton: FC<IProps> = ({
|
const FloatingButton: FC<IProps> = ({ color, icon, size, text, onClick }) => {
|
||||||
color,
|
|
||||||
icon,
|
|
||||||
size,
|
|
||||||
text,
|
|
||||||
onClick
|
|
||||||
}) => {
|
|
||||||
return (
|
return (
|
||||||
<Fab color={color} aria-label={icon} size={size} onClick={onClick}>
|
<Fab color={color} aria-label={icon} size={size} onClick={onClick}>
|
||||||
<AddIcon />
|
<AddIcon />
|
||||||
|
|
@ -24,3 +18,5 @@ export const FloatingButton: FC<IProps> = ({
|
||||||
</Fab>
|
</Fab>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default FloatingButton;
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,7 @@
|
||||||
import React, { FC, ReactNode } from "react";
|
import React, { FC, ReactNode } from "react";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { makeStyles } from "@material-ui/core/styles";
|
import { makeStyles } from "@material-ui/core/styles";
|
||||||
import Card from "@material-ui/core/Card";
|
import { Card, CardActions, CardContent, Typography } from "@material-ui/core";
|
||||||
import CardActions from "@material-ui/core/CardActions";
|
|
||||||
import CardContent from "@material-ui/core/CardContent";
|
|
||||||
import Typography from "@material-ui/core/Typography";
|
|
||||||
import { ProgressBar } from "../Progress/ProgressBar";
|
import { ProgressBar } from "../Progress/ProgressBar";
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
|
|
@ -22,7 +19,7 @@ const useStyles = makeStyles({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const HorizontalCard: FC<IProps> = ({
|
const HorizontalCard: FC<IProps> = ({
|
||||||
title,
|
title,
|
||||||
link = "#",
|
link = "#",
|
||||||
content,
|
content,
|
||||||
|
|
@ -46,3 +43,5 @@ export const HorizontalCard: FC<IProps> = ({
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default HorizontalCard;
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
import React, { FC } from "react";
|
import React, { FC } from "react";
|
||||||
import { HorizontalCard } from "./HorizontalCard";
|
|
||||||
import { makeStyles, Theme, createStyles } from "@material-ui/core";
|
import { makeStyles, Theme, createStyles } from "@material-ui/core";
|
||||||
import { AvatarList } from "../Avatars/AvatarList";
|
import HorizontalCard from "./HorizontalCard";
|
||||||
import { ProgressInfo } from "../Progress/ProgressInfo";
|
import AvatarList from "../Avatars/AvatarList";
|
||||||
import { User } from "../../types/User";
|
import ProgressInfo from "../Progress/ProgressInfo";
|
||||||
import { getRemainingdays } from "../../utils/methods";
|
import User from "../../types/User";
|
||||||
|
import getRemainingdays from "../../utils/methods";
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
title?: string;
|
title?: string;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
import React, { FC, MouseEvent } from "react";
|
import React, { FC, MouseEvent } from "react";
|
||||||
import { Button, Typography, Grid } from "@material-ui/core";
|
import { Button, Typography, Grid } from "@material-ui/core";
|
||||||
import { HorizontalCard } from "./HorizontalCard";
|
import HorizontalCard from "./HorizontalCard";
|
||||||
import TicketChipsArray from "./TicketChipsArray";
|
import TicketChipsArray from "./TicketChipsArray";
|
||||||
import { Ticket } from "../../types/Ticket";
|
import Ticket from "../../types/Ticket";
|
||||||
import { getRemainingdays } from "../../utils/methods";
|
import getRemainingdays from "../../utils/methods";
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
ticket?: Ticket;
|
ticket?: Ticket;
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,14 @@
|
||||||
import React, { FC } from "react";
|
import React, { FC } from "react";
|
||||||
|
import {
|
||||||
|
Avatar,
|
||||||
|
ListItemAvatar,
|
||||||
|
List,
|
||||||
|
ListItemText,
|
||||||
|
ListItem,
|
||||||
|
} from "@material-ui/core";
|
||||||
import { createStyles, Theme, makeStyles } from "@material-ui/core/styles";
|
import { createStyles, Theme, makeStyles } from "@material-ui/core/styles";
|
||||||
import List from "@material-ui/core/List";
|
|
||||||
import ListItem from "@material-ui/core/ListItem";
|
|
||||||
import ListItemText from "@material-ui/core/ListItemText";
|
|
||||||
import ListItemAvatar from "@material-ui/core/ListItemAvatar";
|
|
||||||
import Avatar from "@material-ui/core/Avatar";
|
|
||||||
import WorkIcon from "@material-ui/icons/Work";
|
import WorkIcon from "@material-ui/icons/Work";
|
||||||
import { AppFile } from "../types/AppFile";
|
import AppFile from "../types/AppFile";
|
||||||
|
|
||||||
type IProps = {
|
type IProps = {
|
||||||
files: AppFile[];
|
files: AppFile[];
|
||||||
|
|
@ -18,12 +20,12 @@ const useStyles = makeStyles((theme: Theme) =>
|
||||||
root: {
|
root: {
|
||||||
width: "100%",
|
width: "100%",
|
||||||
maxWidth: 360,
|
maxWidth: 360,
|
||||||
backgroundColor: theme.palette.background.paper
|
backgroundColor: theme.palette.background.paper,
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
export const FileCollection: FC<IProps> = ({ files, filterText }) => {
|
const FileCollection: FC<IProps> = ({ files, filterText }) => {
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
return (
|
return (
|
||||||
<List className={classes.root}>
|
<List className={classes.root}>
|
||||||
|
|
@ -32,7 +34,7 @@ export const FileCollection: FC<IProps> = ({ files, filterText }) => {
|
||||||
) : (
|
) : (
|
||||||
files
|
files
|
||||||
.filter(
|
.filter(
|
||||||
f =>
|
(f) =>
|
||||||
f.name.toLowerCase().includes(filterText.toLowerCase()) ||
|
f.name.toLowerCase().includes(filterText.toLowerCase()) ||
|
||||||
f.format.toLowerCase().includes(filterText.toLowerCase())
|
f.format.toLowerCase().includes(filterText.toLowerCase())
|
||||||
)
|
)
|
||||||
|
|
@ -61,3 +63,4 @@ export const FileEntry: FC<IFProps> = ({ file }) => {
|
||||||
</ListItem>
|
</ListItem>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
export default FileCollection;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
import React, { FC, ChangeEvent, MouseEvent } from "react";
|
import React, { FC, ChangeEvent, MouseEvent } from "react";
|
||||||
import { useRouteMatch } from "react-router-dom";
|
import { useRouteMatch } from "react-router-dom";
|
||||||
|
import { Grid, TextField } from "@material-ui/core";
|
||||||
import { createStyles, makeStyles, Theme } from "@material-ui/core/styles";
|
import { createStyles, makeStyles, Theme } from "@material-ui/core/styles";
|
||||||
import TextField from "@material-ui/core/TextField";
|
|
||||||
import { Grid } from "@material-ui/core";
|
|
||||||
// import { AccountCircle, FilterList, FilterListSharp } from "@material-ui/icons";
|
|
||||||
|
|
||||||
type IProps = {
|
type IProps = {
|
||||||
filterText: string;
|
filterText: string;
|
||||||
|
|
@ -28,7 +26,7 @@ const useStyles = makeStyles((theme: Theme) =>
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
export const FilterBar: FC<IProps> = ({
|
const FilterBar: FC<IProps> = ({
|
||||||
filterText,
|
filterText,
|
||||||
handleChange,
|
handleChange,
|
||||||
// clearFilterText
|
// clearFilterText
|
||||||
|
|
@ -55,3 +53,4 @@ export const FilterBar: FC<IProps> = ({
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
export default FilterBar;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
import React, { FC } from "react";
|
import React, { FC } from "react";
|
||||||
import Typography from "@material-ui/core/Typography";
|
import { Container, Typography, Link } from "@material-ui/core";
|
||||||
import { makeStyles } from "@material-ui/core/styles";
|
import { makeStyles } from "@material-ui/core/styles";
|
||||||
import Container from "@material-ui/core/Container";
|
|
||||||
import Link from "@material-ui/core/Link";
|
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
brand: string;
|
brand: string;
|
||||||
|
|
@ -11,7 +9,7 @@ interface IProps {
|
||||||
|
|
||||||
const copyParams: IProps = {
|
const copyParams: IProps = {
|
||||||
brand: "BugBuster",
|
brand: "BugBuster",
|
||||||
text: "Made with 🔥"
|
text: "Made with 🔥",
|
||||||
};
|
};
|
||||||
|
|
||||||
const Copyright: FC<IProps> = ({ brand, text }) => {
|
const Copyright: FC<IProps> = ({ brand, text }) => {
|
||||||
|
|
@ -27,15 +25,15 @@ const Copyright: FC<IProps> = ({ brand, text }) => {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const useStyles = makeStyles(theme => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
footer: {
|
footer: {
|
||||||
padding: theme.spacing(3, 2),
|
padding: theme.spacing(3, 2),
|
||||||
marginTop: "auto",
|
marginTop: "auto",
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
theme.palette.type === "light"
|
theme.palette.type === "light"
|
||||||
? theme.palette.grey[200]
|
? theme.palette.grey[200]
|
||||||
: theme.palette.grey[800]
|
: theme.palette.grey[800],
|
||||||
}
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export default function Footer() {
|
export default function Footer() {
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ type HeaderProps = {
|
||||||
description: string;
|
description: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const Header: FC<HeaderProps> = ({ title, description }) => {
|
const Header: FC<HeaderProps> = ({ title, description }) => {
|
||||||
return (
|
return (
|
||||||
<Box>
|
<Box>
|
||||||
<Typography variant="h2" component="h2">
|
<Typography variant="h2" component="h2">
|
||||||
|
|
@ -18,3 +18,5 @@ export const Header: FC<HeaderProps> = ({ title, description }) => {
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default Header;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { FC } from "react";
|
import React, { FC } from "react";
|
||||||
|
|
||||||
export const InputField: FC = () => {
|
const InputField: FC = () => {
|
||||||
return (
|
return (
|
||||||
<div className="input-field">
|
<div className="input-field">
|
||||||
<input id="email" type="text" className="validate" />
|
<input id="email" type="text" className="validate" />
|
||||||
|
|
@ -8,3 +8,5 @@ export const InputField: FC = () => {
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default InputField;
|
||||||
|
|
|
||||||
|
|
@ -3,22 +3,20 @@ import { CloudUpload } from "@material-ui/icons";
|
||||||
import { makeStyles, createStyles, Theme } from "@material-ui/core/styles";
|
import { makeStyles, createStyles, Theme } from "@material-ui/core/styles";
|
||||||
import Button from "@material-ui/core/Button";
|
import Button from "@material-ui/core/Button";
|
||||||
|
|
||||||
export const InputFile: FC = () => {
|
const InputFile: FC = () => {
|
||||||
return (
|
return (
|
||||||
<>
|
<form action="/upload">
|
||||||
<form action="/upload">
|
<div className="file-field input-field">
|
||||||
<div className="file-field input-field">
|
<UploadButton>
|
||||||
<UploadButton>
|
<CloudUpload />
|
||||||
<CloudUpload />
|
<input
|
||||||
<input
|
type="file"
|
||||||
type="file"
|
multiple
|
||||||
multiple
|
accept=".doc,.docx,.pdf,.md,.gdoc,.zip,image/*"
|
||||||
accept=".doc,.docx,.pdf,.md,.gdoc,.zip,image/*"
|
/>
|
||||||
/>
|
</UploadButton>
|
||||||
</UploadButton>
|
</div>
|
||||||
</div>
|
</form>
|
||||||
</form>
|
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -26,12 +24,12 @@ const useStyles = makeStyles((theme: Theme) =>
|
||||||
createStyles({
|
createStyles({
|
||||||
root: {
|
root: {
|
||||||
"& > *": {
|
"& > *": {
|
||||||
margin: theme.spacing(1)
|
margin: theme.spacing(1),
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
input: {
|
input: {
|
||||||
display: "none"
|
display: "none",
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -60,3 +58,5 @@ const UploadButton: FC = () => {
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default InputFile;
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
import React, { FC, useState, ChangeEvent, MouseEvent } from "react";
|
import React, { FC, useState, ChangeEvent, MouseEvent } from "react";
|
||||||
import { ActivityCollection } from "../ActivityCollection";
|
import ActivityCollection from "../ActivityCollection";
|
||||||
import { Activity } from "../../types/Activity";
|
import FilterBar from "../FilterBar";
|
||||||
import { FilterBar } from "../FilterBar";
|
import Activity from "../../types/Activity";
|
||||||
|
|
||||||
type IProps = {
|
type IProps = {
|
||||||
activities: Activity[];
|
activities: Activity[];
|
||||||
};
|
};
|
||||||
|
|
||||||
export const ActivityList: FC<IProps> = ({ activities }) => {
|
const ActivityList: FC<IProps> = ({ activities }) => {
|
||||||
const [filterText, setFilterText] = useState<string>("");
|
const [filterText, setFilterText] = useState<string>("");
|
||||||
const clearFilterText: (e: MouseEvent) => void = (e: MouseEvent) => {
|
const clearFilterText: (e: MouseEvent) => void = (e: MouseEvent) => {
|
||||||
setFilterText("");
|
setFilterText("");
|
||||||
|
|
@ -30,3 +30,5 @@ export const ActivityList: FC<IProps> = ({ activities }) => {
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default ActivityList;
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,15 @@
|
||||||
import React, { FC, useState, ChangeEvent, MouseEvent } from "react";
|
import React, { FC, useState, ChangeEvent, MouseEvent } from "react";
|
||||||
import { AppFile } from "../../types/AppFile";
|
|
||||||
import { FileCollection } from "../FileCollection";
|
|
||||||
import { InputFile } from "../InputFile";
|
|
||||||
import { FilterBar } from "../FilterBar";
|
|
||||||
import { Grid, Typography } from "@material-ui/core";
|
import { Grid, Typography } from "@material-ui/core";
|
||||||
|
import FileCollection from "../FileCollection";
|
||||||
|
import FilterBar from "../FilterBar";
|
||||||
|
import InputFile from "../InputFile";
|
||||||
|
import AppFile from "../../types/AppFile";
|
||||||
|
|
||||||
type IProps = {
|
type IProps = {
|
||||||
files: AppFile[];
|
files: AppFile[];
|
||||||
};
|
};
|
||||||
|
|
||||||
export const FileList: FC<IProps> = ({ files }) => {
|
const FileList: FC<IProps> = ({ files }) => {
|
||||||
const [filterText, setFilterText] = useState<string>("");
|
const [filterText, setFilterText] = useState<string>("");
|
||||||
const clearFilterText = (e: MouseEvent): void => {
|
const clearFilterText = (e: MouseEvent): void => {
|
||||||
setFilterText("");
|
setFilterText("");
|
||||||
|
|
@ -38,3 +38,5 @@ export const FileList: FC<IProps> = ({ files }) => {
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default FileList;
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
import React, { FC, useState, ChangeEvent, MouseEvent } from "react";
|
import React, { FC, useState, ChangeEvent, MouseEvent } from "react";
|
||||||
import { UsersModalEntry } from "../Modals/UsersModalEntry";
|
import FilterBar from "../FilterBar";
|
||||||
import { FilterBar } from "../FilterBar";
|
import UsersModalEntry from "../Modals/UsersModalEntry";
|
||||||
import { User } from "../../types/User";
|
import User from "../../types/User";
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
users: User[];
|
users: User[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export const MemberList: FC<IProps> = ({ users }) => {
|
const MemberList: FC<IProps> = ({ users }) => {
|
||||||
const [members, setMembers] = useState<User[]>([]);
|
const [members, setMembers] = useState<User[]>([]);
|
||||||
const [filterText, setFilterText] = useState<string>("");
|
const [filterText, setFilterText] = useState<string>("");
|
||||||
const clearFilterText = (e: MouseEvent): void => {
|
const clearFilterText = (e: MouseEvent): void => {
|
||||||
|
|
@ -37,3 +37,5 @@ export const MemberList: FC<IProps> = ({ users }) => {
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default MemberList;
|
||||||
|
|
|
||||||
|
|
@ -6,12 +6,12 @@ import {
|
||||||
createStyles,
|
createStyles,
|
||||||
Theme,
|
Theme,
|
||||||
} from "@material-ui/core";
|
} from "@material-ui/core";
|
||||||
import { FilterBar } from "../FilterBar";
|
import FilterBar from "../FilterBar";
|
||||||
import ProjectCard from "../Cards/ProjectCard";
|
import ProjectCard from "../Cards/ProjectCard";
|
||||||
import { FloatingButton } from "../Buttons/FloatingButton";
|
import FloatingButton from "../Buttons/FloatingButton";
|
||||||
import { NewProjectModal } from "../Modals/NewProjectModal";
|
import NewProjectModal from "../Modals/NewProjectModal";
|
||||||
import { Project } from "../../types/Project";
|
import Project from "../../types/Project";
|
||||||
import { User } from "../../types/User";
|
import User from "../../types/User";
|
||||||
|
|
||||||
const useStyles = makeStyles((theme: Theme) =>
|
const useStyles = makeStyles((theme: Theme) =>
|
||||||
createStyles({
|
createStyles({
|
||||||
|
|
@ -30,7 +30,7 @@ type IProps = {
|
||||||
allUsers: User[];
|
allUsers: User[];
|
||||||
};
|
};
|
||||||
|
|
||||||
export const ProjectList: FC<IProps> = ({ projects, allUsers }) => {
|
const ProjectList: FC<IProps> = ({ projects, allUsers }) => {
|
||||||
const [filterText, setFilterText] = useState<string>("");
|
const [filterText, setFilterText] = useState<string>("");
|
||||||
const clearFilterText: (e: MouseEvent) => void = (e: MouseEvent) => {
|
const clearFilterText: (e: MouseEvent) => void = (e: MouseEvent) => {
|
||||||
setFilterText("");
|
setFilterText("");
|
||||||
|
|
@ -109,3 +109,5 @@ export const ProjectList: FC<IProps> = ({ projects, allUsers }) => {
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default ProjectList;
|
||||||
|
|
|
||||||
|
|
@ -6,15 +6,15 @@ import {
|
||||||
Theme,
|
Theme,
|
||||||
createStyles,
|
createStyles,
|
||||||
} from "@material-ui/core";
|
} from "@material-ui/core";
|
||||||
import { FloatingButton } from "../Buttons/FloatingButton";
|
import FloatingButton from "../Buttons/FloatingButton";
|
||||||
import { FilterBar } from "../FilterBar";
|
import FilterBar from "../FilterBar";
|
||||||
import { HttpResponse } from "../../types/HttpResponse";
|
|
||||||
import { Ticket } from "../../types/Ticket";
|
|
||||||
import { NewTicketModal } from "../Modals/NewTicketModal";
|
|
||||||
import { Project } from "../../types/Project";
|
|
||||||
import { put } from "../../utils/http";
|
|
||||||
import { Constants } from "../../utils/Constants";
|
|
||||||
import TicketCard from "../Cards/TicketCard";
|
import TicketCard from "../Cards/TicketCard";
|
||||||
|
import NewTicketModal from "../Modals/NewTicketModal";
|
||||||
|
import HttpResponse from "../../types/HttpResponse";
|
||||||
|
import Ticket from "../../types/Ticket";
|
||||||
|
import Project from "../../types/Project";
|
||||||
|
import { put } from "../../utils/http";
|
||||||
|
import Constants from "../../utils/Constants";
|
||||||
|
|
||||||
const useStyles = makeStyles((theme: Theme) =>
|
const useStyles = makeStyles((theme: Theme) =>
|
||||||
createStyles({
|
createStyles({
|
||||||
|
|
@ -34,7 +34,7 @@ type TicketListProps = {
|
||||||
addButton?: Boolean;
|
addButton?: Boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const TicketList: FC<TicketListProps> = ({
|
const TicketList: FC<TicketListProps> = ({
|
||||||
tickets,
|
tickets,
|
||||||
allProjects,
|
allProjects,
|
||||||
addButton = true,
|
addButton = true,
|
||||||
|
|
@ -124,3 +124,5 @@ export const TicketList: FC<TicketListProps> = ({
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default TicketList;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import React, { FC } from "react";
|
import React, { FC } from "react";
|
||||||
import { InputField } from "./InputField";
|
import InputField from "./InputField";
|
||||||
import { PasswordField } from "./PasswordField";
|
import PasswordField from "./PasswordField";
|
||||||
import { Button } from "./Buttons/Button";
|
import Button from "./Buttons/Button";
|
||||||
|
|
||||||
export const LogInForm: FC = () => {
|
export const LogInForm: FC = () => {
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { FC } from "react";
|
import React, { FC } from "react";
|
||||||
import Dialog from "@material-ui/core/Dialog";
|
|
||||||
import {
|
import {
|
||||||
|
Dialog,
|
||||||
DialogTitle,
|
DialogTitle,
|
||||||
Typography,
|
Typography,
|
||||||
IconButton,
|
IconButton,
|
||||||
|
|
@ -36,7 +36,7 @@ const useStyles = makeStyles((theme: Theme) =>
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
export const Modal: FC<IProps> = ({
|
const Modal: FC<IProps> = ({
|
||||||
handleClose,
|
handleClose,
|
||||||
show,
|
show,
|
||||||
action,
|
action,
|
||||||
|
|
@ -77,3 +77,5 @@ export const Modal: FC<IProps> = ({
|
||||||
</Dialog>
|
</Dialog>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default Modal;
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
import React, { FC, useState, FormEvent } from "react";
|
import React, { FC, useState, FormEvent } from "react";
|
||||||
import { TextField } from "@material-ui/core";
|
import TextField from "@material-ui/core";
|
||||||
import { Modal } from "./Modal";
|
import Modal from "./Modal";
|
||||||
import { Project } from "../../types/Project";
|
import Project from "../../types/Project";
|
||||||
import { User } from "../../types/User";
|
import User from "../../types/User";
|
||||||
import { post } from "../../utils/http";
|
import post from "../../utils/http";
|
||||||
import { Constants } from "../../utils/Constants";
|
import Constants from "../../utils/Constants";
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
show: boolean;
|
show: boolean;
|
||||||
|
|
@ -12,7 +12,7 @@ interface IProps {
|
||||||
allUsers: User[];
|
allUsers: User[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export const NewProjectModal: FC<IProps> = ({ show, handleClose }) => {
|
const NewProjectModal: FC<IProps> = ({ show, handleClose }) => {
|
||||||
const [title, setTitle] = useState("");
|
const [title, setTitle] = useState("");
|
||||||
const [description, setDescription] = useState("");
|
const [description, setDescription] = useState("");
|
||||||
const [endingDate, setEndingDate] = useState("");
|
const [endingDate, setEndingDate] = useState("");
|
||||||
|
|
@ -88,3 +88,5 @@ export const NewProjectModal: FC<IProps> = ({ show, handleClose }) => {
|
||||||
</Modal>
|
</Modal>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default NewProjectModal;
|
||||||
|
|
|
||||||
|
|
@ -7,14 +7,14 @@ import {
|
||||||
makeStyles,
|
makeStyles,
|
||||||
Theme,
|
Theme,
|
||||||
} from "@material-ui/core";
|
} from "@material-ui/core";
|
||||||
import { Modal } from "./Modal";
|
import Modal from "./Modal";
|
||||||
import { Ticket } from "../../types/Ticket";
|
import Ticket from "../../types/Ticket";
|
||||||
import { Project } from "../../types/Project";
|
import Project from "../../types/Project";
|
||||||
import { post } from "../../utils/http";
|
|
||||||
import { Constants } from "../../utils/Constants";
|
|
||||||
import Category from "../../types/enums/category";
|
import Category from "../../types/enums/category";
|
||||||
import Impact from "../../types/enums/impact";
|
import Impact from "../../types/enums/impact";
|
||||||
import Difficulty from "../../types/enums/difficulty";
|
import Difficulty from "../../types/enums/difficulty";
|
||||||
|
import { post } from "../../utils/http";
|
||||||
|
import Constants from "../../utils/Constants";
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
show: boolean;
|
show: boolean;
|
||||||
|
|
@ -28,11 +28,7 @@ const useStyles = makeStyles((theme: Theme) => ({
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export const NewTicketModal: FC<IProps> = ({
|
const NewTicketModal: FC<IProps> = ({ show, handleClose, allProjects }) => {
|
||||||
show,
|
|
||||||
handleClose,
|
|
||||||
allProjects,
|
|
||||||
}) => {
|
|
||||||
const [title, setTitle] = useState("");
|
const [title, setTitle] = useState("");
|
||||||
const [description, setDescription] = useState("");
|
const [description, setDescription] = useState("");
|
||||||
const [endingDate, setEndingDate] = useState("");
|
const [endingDate, setEndingDate] = useState("");
|
||||||
|
|
@ -211,3 +207,5 @@ export const NewTicketModal: FC<IProps> = ({
|
||||||
</Modal>
|
</Modal>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default NewTicketModal;
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,22 @@
|
||||||
import React, { FC, useState, ChangeEvent, FormEvent } from "react";
|
import React, { FC, useState, ChangeEvent, FormEvent } from "react";
|
||||||
import { useParams } from "react-router-dom";
|
import { useParams } from "react-router-dom";
|
||||||
import { Grid } from "@material-ui/core";
|
import {
|
||||||
|
Avatar,
|
||||||
|
Checkbox,
|
||||||
|
Grid,
|
||||||
|
List,
|
||||||
|
ListItem,
|
||||||
|
ListItemSecondaryAction,
|
||||||
|
ListItemText,
|
||||||
|
ListItemAvatar,
|
||||||
|
} from "@material-ui/core";
|
||||||
import { createStyles, makeStyles, Theme } from "@material-ui/core/styles";
|
import { createStyles, makeStyles, Theme } from "@material-ui/core/styles";
|
||||||
import List from "@material-ui/core/List";
|
import AvatarList from "../Avatars/AvatarList";
|
||||||
import ListItem from "@material-ui/core/ListItem";
|
import FilterBar from "../FilterBar";
|
||||||
import ListItemSecondaryAction from "@material-ui/core/ListItemSecondaryAction";
|
import Modal from "./Modal";
|
||||||
import ListItemText from "@material-ui/core/ListItemText";
|
import User from "../../types/User";
|
||||||
import ListItemAvatar from "@material-ui/core/ListItemAvatar";
|
|
||||||
import Checkbox from "@material-ui/core/Checkbox";
|
|
||||||
import Avatar from "@material-ui/core/Avatar";
|
|
||||||
import { Modal } from "./Modal";
|
|
||||||
import { AvatarList } from "../Avatars/AvatarList";
|
|
||||||
import { FilterBar } from "../FilterBar";
|
|
||||||
import { User } from "../../types/User";
|
|
||||||
import { patch } from "../../utils/http";
|
import { patch } from "../../utils/http";
|
||||||
import { Constants } from "../../utils/Constants";
|
import Constants from "../../utils/Constants";
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
show: boolean;
|
show: boolean;
|
||||||
|
|
@ -33,12 +35,7 @@ const useStyles = makeStyles((theme: Theme) =>
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
export const UsersModal: FC<IProps> = ({
|
const UsersModal: FC<IProps> = ({ show, handleClose, users, allUsers }) => {
|
||||||
show,
|
|
||||||
handleClose,
|
|
||||||
users,
|
|
||||||
allUsers,
|
|
||||||
}) => {
|
|
||||||
const { id } = useParams();
|
const { id } = useParams();
|
||||||
|
|
||||||
const [filterText, setFilterText] = useState<string>("");
|
const [filterText, setFilterText] = useState<string>("");
|
||||||
|
|
@ -112,3 +109,5 @@ export const UsersModal: FC<IProps> = ({
|
||||||
</Modal>
|
</Modal>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default UsersModal;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import React, { FC } from "react";
|
import React, { FC } from "react";
|
||||||
import { User } from "../../types/User";
|
import User from "../../types/User";
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
setMembers: React.Dispatch<React.SetStateAction<User[]>>;
|
setMembers: React.Dispatch<React.SetStateAction<User[]>>;
|
||||||
|
|
@ -7,7 +7,7 @@ interface IProps {
|
||||||
user: User;
|
user: User;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const UsersModalEntry: FC<IProps> = ({ user, setMembers, members }) => {
|
const UsersModalEntry: FC<IProps> = ({ user, setMembers, members }) => {
|
||||||
const match: (id: string) => boolean = (id: string) => {
|
const match: (id: string) => boolean = (id: string) => {
|
||||||
return Boolean(members.find((m) => m.id === id));
|
return Boolean(members.find((m) => m.id === id));
|
||||||
};
|
};
|
||||||
|
|
@ -40,3 +40,5 @@ export const UsersModalEntry: FC<IProps> = ({ user, setMembers, members }) => {
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default UsersModalEntry;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useAuth0 } from "../authentication/auth0";
|
import { useAuth0 } from "../authentication/auth0";
|
||||||
|
|
||||||
export const NavBar = () => {
|
const NavBar = () => {
|
||||||
const { isAuthenticated, loginWithRedirect, logout } = useAuth0();
|
const { isAuthenticated, loginWithRedirect, logout } = useAuth0();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
@ -14,3 +14,5 @@ export const NavBar = () => {
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default NavBar;
|
||||||
|
|
|
||||||
|
|
@ -1,67 +0,0 @@
|
||||||
import React, { FC } from "react";
|
|
||||||
import { TextField, MenuItem } from "@material-ui/core";
|
|
||||||
import { Project } from "../types/Project";
|
|
||||||
|
|
||||||
interface IProps {
|
|
||||||
title: string;
|
|
||||||
setTitle: React.Dispatch<React.SetStateAction<string>>;
|
|
||||||
description: string;
|
|
||||||
setDescription: React.Dispatch<React.SetStateAction<string>>;
|
|
||||||
endingDate: string;
|
|
||||||
setEndingDate: React.Dispatch<React.SetStateAction<string>>;
|
|
||||||
allProjects: Project[];
|
|
||||||
projectId: string;
|
|
||||||
setProjectId: React.Dispatch<React.SetStateAction<string>>;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const NewTicketForm: FC<IProps> = ({
|
|
||||||
title,
|
|
||||||
setTitle,
|
|
||||||
description,
|
|
||||||
setDescription,
|
|
||||||
endingDate,
|
|
||||||
setEndingDate,
|
|
||||||
allProjects,
|
|
||||||
projectId,
|
|
||||||
setProjectId,
|
|
||||||
}) => {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
{/* <div className="row">
|
|
||||||
<div className="input-field">
|
|
||||||
<i className="material-icons prefix">date_range</i>
|
|
||||||
<input
|
|
||||||
id="Due Date"
|
|
||||||
type="text"
|
|
||||||
className="datepicker"
|
|
||||||
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
|
|
||||||
setEndingDate(e.target.value)
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
<label htmlFor="Due Date">Due Date</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="input-field">
|
|
||||||
<select
|
|
||||||
id="project"
|
|
||||||
className="browser-default"
|
|
||||||
value={projectId}
|
|
||||||
onChange={(e: React.ChangeEvent<HTMLSelectElement>) => {
|
|
||||||
e.preventDefault();
|
|
||||||
setProjectId(e.target.value);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<option value={0} disabled>
|
|
||||||
Project
|
|
||||||
</option>
|
|
||||||
{allProjects.map((p) => (
|
|
||||||
<option key={p.id} value={p.id}>
|
|
||||||
{p.title}
|
|
||||||
</option>
|
|
||||||
))}
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div> */}
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
@ -1,16 +1,11 @@
|
||||||
import React, { FC, useState, ReactNode } from "react";
|
import React, { FC, useState, ReactNode } from "react";
|
||||||
import { makeStyles, Theme, useTheme } from "@material-ui/core/styles";
|
|
||||||
import AppBar from "@material-ui/core/AppBar";
|
|
||||||
import Tabs from "@material-ui/core/Tabs";
|
|
||||||
import Tab from "@material-ui/core/Tab";
|
|
||||||
import Typography from "@material-ui/core/Typography";
|
|
||||||
import Box from "@material-ui/core/Box";
|
|
||||||
import SwipeableViews from "react-swipeable-views";
|
import SwipeableViews from "react-swipeable-views";
|
||||||
import { Ticket } from "../../types/Ticket";
|
import { makeStyles, Theme, useTheme } from "@material-ui/core/styles";
|
||||||
import { Project } from "../../types/Project";
|
import { AppBar, Box, Tab, Tabs, Typography } from "@material-ui/core";
|
||||||
import { TicketList } from "../Lists/TicketList";
|
import Ticket from "../../types/Ticket";
|
||||||
// import { FileList } from "./AppFileList";
|
import Project from "../../types/Project";
|
||||||
import { AppFile } from "../../types/AppFile";
|
import TicketList from "../Lists/TicketList";
|
||||||
|
import AppFile from "../../types/AppFile";
|
||||||
|
|
||||||
interface TabProps {
|
interface TabProps {
|
||||||
children?: ReactNode;
|
children?: ReactNode;
|
||||||
|
|
@ -59,7 +54,7 @@ interface IProps {
|
||||||
allProjects: Project[];
|
allProjects: Project[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ProjectTabPanel: FC<IProps> = ({
|
const ProjectTabPanel: FC<IProps> = ({
|
||||||
tickets,
|
tickets,
|
||||||
tabNames,
|
tabNames,
|
||||||
files,
|
files,
|
||||||
|
|
@ -116,3 +111,5 @@ export const ProjectTabPanel: FC<IProps> = ({
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default ProjectTabPanel;
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
import React, { FC } from "react";
|
import React, { FC } from "react";
|
||||||
import { Route, useRouteMatch, Redirect } from "react-router-dom";
|
import { Route, useRouteMatch, Redirect } from "react-router-dom";
|
||||||
import { TabRouterHeader } from "./TabRouterHeader";
|
import TabRouterHeader from "./TabRouterHeader";
|
||||||
import { TicketList } from "../Lists/TicketList";
|
import TicketList from "../Lists/TicketList";
|
||||||
import { FileList } from "../Lists/AppFileList";
|
import FileList from "../Lists/AppFileList";
|
||||||
import { Ticket } from "../../types/Ticket";
|
import Ticket from "../../types/Ticket";
|
||||||
import { AppFile } from "../../types/AppFile";
|
import AppFile from "../../types/AppFile";
|
||||||
import { Activity } from "../../types/Activity";
|
import Activity from "../../types/Activity";
|
||||||
import { Project } from "../../types/Project";
|
import Project from "../../types/Project";
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
tickets: Ticket[];
|
tickets: Ticket[];
|
||||||
|
|
@ -17,7 +17,7 @@ interface IProps {
|
||||||
allProjects: Project[];
|
allProjects: Project[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export const TabRouter: FC<IProps> = ({
|
const TabRouter: FC<IProps> = ({
|
||||||
tickets,
|
tickets,
|
||||||
tabNames,
|
tabNames,
|
||||||
files,
|
files,
|
||||||
|
|
@ -48,3 +48,5 @@ export const TabRouter: FC<IProps> = ({
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default TabRouter;
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,9 @@ interface IProps {
|
||||||
tabNames: string[];
|
tabNames: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export const TabRouterHeader: FC<IProps> = ({
|
const TabRouterHeader: FC<IProps> = ({
|
||||||
tabNames,
|
tabNames,
|
||||||
tabClass = `tab col s${12 / tabNames.length}`
|
tabClass = `tab col s${12 / tabNames.length}`,
|
||||||
}) => {
|
}) => {
|
||||||
const [isActive, setIsActive] = useState(0);
|
const [isActive, setIsActive] = useState(0);
|
||||||
const nTabs = tabNames.length;
|
const nTabs = tabNames.length;
|
||||||
|
|
@ -31,7 +31,7 @@ export const TabRouterHeader: FC<IProps> = ({
|
||||||
className="indicator indigo lighten-2"
|
className="indicator indigo lighten-2"
|
||||||
style={{
|
style={{
|
||||||
left: `${(isActive / nTabs) * 100}%`,
|
left: `${(isActive / nTabs) * 100}%`,
|
||||||
right: `${(1 - (isActive + 1) / nTabs) * 100}%`
|
right: `${(1 - (isActive + 1) / nTabs) * 100}%`,
|
||||||
}}
|
}}
|
||||||
></li>
|
></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
@ -54,7 +54,7 @@ const TabUnit: FC<TabUnitProps> = ({
|
||||||
setIsActive,
|
setIsActive,
|
||||||
text,
|
text,
|
||||||
value,
|
value,
|
||||||
nTabs
|
nTabs,
|
||||||
}) => {
|
}) => {
|
||||||
const { url } = useRouteMatch();
|
const { url } = useRouteMatch();
|
||||||
return (
|
return (
|
||||||
|
|
@ -63,7 +63,7 @@ const TabUnit: FC<TabUnitProps> = ({
|
||||||
key={value}
|
key={value}
|
||||||
style={{
|
style={{
|
||||||
left: `${(isActive / nTabs) * 100}%`,
|
left: `${(isActive / nTabs) * 100}%`,
|
||||||
right: `${(1 - (isActive + 1) / nTabs) * 100}%`
|
right: `${(1 - (isActive + 1) / nTabs) * 100}%`,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Link
|
<Link
|
||||||
|
|
@ -81,3 +81,5 @@ const TabUnit: FC<TabUnitProps> = ({
|
||||||
</li>
|
</li>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default TabRouterHeader;
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,12 @@
|
||||||
import React, { FC, useState, ReactNode } from "react";
|
import React, { FC, useState, ReactNode } from "react";
|
||||||
import SwipeableViews from "react-swipeable-views";
|
import SwipeableViews from "react-swipeable-views";
|
||||||
import { makeStyles, Theme, useTheme } from "@material-ui/core/styles";
|
import { makeStyles, Theme, useTheme } from "@material-ui/core/styles";
|
||||||
import AppBar from "@material-ui/core/AppBar";
|
import { AppBar, Box, Tab, Tabs, Typography } from "@material-ui/core";
|
||||||
import Tabs from "@material-ui/core/Tabs";
|
import ProjectList from "../Lists/ProjectList";
|
||||||
import Tab from "@material-ui/core/Tab";
|
import TicketList from "../Lists/TicketList";
|
||||||
import Typography from "@material-ui/core/Typography";
|
import Ticket from "../../types/Ticket";
|
||||||
import Box from "@material-ui/core/Box";
|
import Project from "../../types/Project";
|
||||||
import { Ticket } from "../../types/Ticket";
|
import User from "../../types/User";
|
||||||
import { Project } from "../../types/Project";
|
|
||||||
import { ProjectList } from "../Lists/ProjectList";
|
|
||||||
import { TicketList } from "../Lists/TicketList";
|
|
||||||
import { User } from "../../types/User";
|
|
||||||
|
|
||||||
interface TabProps {
|
interface TabProps {
|
||||||
children?: ReactNode;
|
children?: ReactNode;
|
||||||
|
|
@ -58,7 +54,7 @@ interface IProps {
|
||||||
allUsers: User[];
|
allUsers: User[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export const UserTabPanel: FC<IProps> = ({
|
const UserTabPanel: FC<IProps> = ({
|
||||||
tickets,
|
tickets,
|
||||||
tabNames,
|
tabNames,
|
||||||
projects,
|
projects,
|
||||||
|
|
@ -107,3 +103,4 @@ export const UserTabPanel: FC<IProps> = ({
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
export default UserTabPanel;
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
import React, { FC } from "react";
|
import React, { FC } from "react";
|
||||||
import { Route, useRouteMatch, Redirect } from "react-router-dom";
|
import { Route, useRouteMatch, Redirect } from "react-router-dom";
|
||||||
import { TabRouterHeader } from "./TabRouterHeader";
|
import TabRouterHeader from "./TabRouterHeader";
|
||||||
import { ProjectList } from "../Lists/ProjectList";
|
import TicketList from "../Lists/TicketList";
|
||||||
import { Ticket } from "../../types/Ticket";
|
import Ticket from "../../types/Ticket";
|
||||||
import { Project } from "../../types/Project";
|
import Project from "../../types/Project";
|
||||||
import { TicketList } from "../Lists/TicketList";
|
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
tabNames: string[];
|
tabNames: string[];
|
||||||
|
|
@ -33,3 +32,5 @@ export const UserTabRouter: FC<IProps> = ({ tickets, tabNames, projects }) => {
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default UserTabRouter;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { FC } from "react";
|
import React, { FC } from "react";
|
||||||
|
|
||||||
export const PasswordField: FC = () => {
|
const PasswordField: FC = () => {
|
||||||
return (
|
return (
|
||||||
<div className="input-field">
|
<div className="input-field">
|
||||||
<input id="password" type="password" className="validate" />
|
<input id="password" type="password" className="validate" />
|
||||||
|
|
@ -8,3 +8,5 @@ export const PasswordField: FC = () => {
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default PasswordField;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { FC } from "react";
|
import React, { FC } from "react";
|
||||||
|
|
||||||
export const Preloader: FC = () => {
|
const Preloader: FC = () => {
|
||||||
return (
|
return (
|
||||||
<div className="preloader-wrapper big active">
|
<div className="preloader-wrapper big active">
|
||||||
<div className="spinner-layer spinner-blue">
|
<div className="spinner-layer spinner-blue">
|
||||||
|
|
@ -53,3 +53,5 @@ export const Preloader: FC = () => {
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default Preloader;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import React, { FC } from "react";
|
import React, { FC } from "react";
|
||||||
import { UserAvatar } from "./Avatars/UserAvatar";
|
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
|
import { UserAvatar } from "./Avatars/UserAvatar";
|
||||||
|
|
||||||
export const ProfileSelector: FC = () => {
|
const ProfileSelector: FC = () => {
|
||||||
return (
|
return (
|
||||||
<div className="section col s10 offset-s1 white z-depth-1">
|
<div className="section col s10 offset-s1 white z-depth-1">
|
||||||
<div className="row ">
|
<div className="row ">
|
||||||
|
|
@ -20,3 +20,4 @@ export const ProfileSelector: FC = () => {
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
export default ProfileSelector;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
import React, { FC } from "react";
|
import React, { FC } from "react";
|
||||||
|
import { Box, LinearProgress } from "@material-ui/core";
|
||||||
import { makeStyles, Theme, createStyles } from "@material-ui/core/styles";
|
import { makeStyles, Theme, createStyles } from "@material-ui/core/styles";
|
||||||
import LinearProgress from "@material-ui/core/LinearProgress";
|
|
||||||
import { Box } from "@material-ui/core";
|
|
||||||
|
|
||||||
type IProps = {
|
type IProps = {
|
||||||
value: number;
|
value: number;
|
||||||
|
|
@ -18,7 +17,7 @@ const useStyles = makeStyles((theme: Theme) =>
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
export const ProgressBar: FC<IProps> = ({ value }) => {
|
const ProgressBar: FC<IProps> = ({ value }) => {
|
||||||
// const styleString: CSSProperties = { width: `${value}%` };
|
// const styleString: CSSProperties = { width: `${value}%` };
|
||||||
// let barColor: string = "green";
|
// let barColor: string = "green";
|
||||||
|
|
||||||
|
|
@ -43,3 +42,5 @@ export const ProgressBar: FC<IProps> = ({ value }) => {
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default ProgressBar;
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ type IProps = {
|
||||||
// })
|
// })
|
||||||
// );
|
// );
|
||||||
|
|
||||||
export const ProgressInfo: FC<IProps> = ({
|
const ProgressInfo: FC<IProps> = ({
|
||||||
tasksDone,
|
tasksDone,
|
||||||
tasksTotalCount,
|
tasksTotalCount,
|
||||||
remainingDays,
|
remainingDays,
|
||||||
|
|
@ -39,3 +39,5 @@ export const ProgressInfo: FC<IProps> = ({
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default ProgressInfo;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { FC } from "react";
|
import React, { FC } from "react";
|
||||||
import { Header } from "../components/Header";
|
import Header from "../components/Header";
|
||||||
import { UserAvatar } from "./Avatars/UserAvatar";
|
import UserAvatar from "./Avatars/UserAvatar";
|
||||||
import {
|
import {
|
||||||
Grid,
|
Grid,
|
||||||
// makeStyles, Theme
|
// makeStyles, Theme
|
||||||
|
|
@ -19,7 +19,7 @@ interface IProps {
|
||||||
// },
|
// },
|
||||||
// }));
|
// }));
|
||||||
|
|
||||||
export const UserHeader: FC<IProps> = ({ fullName, presentation, picture }) => {
|
const UserHeader: FC<IProps> = ({ fullName, presentation, picture }) => {
|
||||||
// const classes = useStyles();
|
// const classes = useStyles();
|
||||||
return (
|
return (
|
||||||
// <div className={classes.root}>
|
// <div className={classes.root}>
|
||||||
|
|
@ -34,3 +34,5 @@ export const UserHeader: FC<IProps> = ({ fullName, presentation, picture }) => {
|
||||||
// </div>
|
// </div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default UserHeader;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ interface IProps {
|
||||||
error: string;
|
error: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ErrorController: FC<IProps> = ({ error }) => {
|
const ErrorController: FC<IProps> = ({ error }) => {
|
||||||
switch (error) {
|
switch (error) {
|
||||||
case "Bad Request":
|
case "Bad Request":
|
||||||
return <Redirect to="/400" />;
|
return <Redirect to="/400" />;
|
||||||
|
|
@ -20,3 +20,5 @@ export const ErrorController: FC<IProps> = ({ error }) => {
|
||||||
return <Redirect to="/404" />;
|
return <Redirect to="/404" />;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default ErrorController;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
import React, { FC } from "react";
|
import React, { FC } from "react";
|
||||||
import { HomePage } from "../pages/HomePage";
|
import HomePage from "../pages/HomePage";
|
||||||
|
|
||||||
export const HomeController: FC = () => {
|
const HomeController: FC = () => {
|
||||||
return <HomePage />;
|
return <HomePage />;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default HomeController;
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,16 @@
|
||||||
import React, { FC, useState, useEffect } from "react";
|
import React, { FC, useState, useEffect } from "react";
|
||||||
import { useParams } from "react-router-dom";
|
import { useParams } from "react-router-dom";
|
||||||
import { ErrorController } from "./ErrorController";
|
import ErrorController from "./ErrorController";
|
||||||
import { ProjectPage } from "../pages/ProjectPage";
|
import ProjectPage from "../pages/ProjectPage";
|
||||||
import ProjectVM from "../VM/ProjectVM";
|
import ProjectVM from "../VM/ProjectVM";
|
||||||
import { Project } from "../types/Project";
|
import HttpResponse from "../types/HttpResponse";
|
||||||
import { HttpResponse } from "../types/HttpResponse";
|
import Project from "../types/Project";
|
||||||
|
import User from "../types/User";
|
||||||
import { Preloader } from "../components/Preloader";
|
import { Preloader } from "../components/Preloader";
|
||||||
import { Constants } from "../utils/Constants";
|
import Constants from "../utils/Constants";
|
||||||
import { get } from "../utils/http";
|
import { get } from "../utils/http";
|
||||||
import { User } from "../types/User";
|
|
||||||
|
|
||||||
export const ProjectController: FC = () => {
|
const ProjectController: FC = () => {
|
||||||
const [project, setProject] = useState<Project>({} as Project);
|
const [project, setProject] = useState<Project>({} as Project);
|
||||||
const [allUsers, setAllUsers] = useState<User[]>([]);
|
const [allUsers, setAllUsers] = useState<User[]>([]);
|
||||||
const [allProjects, setAllProjects] = useState<Project[]>([]);
|
const [allProjects, setAllProjects] = useState<Project[]>([]);
|
||||||
|
|
@ -81,3 +81,5 @@ export const ProjectController: FC = () => {
|
||||||
const viewModel = new ProjectVM(project, allUsers, allProjects);
|
const viewModel = new ProjectVM(project, allUsers, allProjects);
|
||||||
return isLoading ? <Preloader /> : <ProjectPage viewModel={viewModel} />;
|
return isLoading ? <Preloader /> : <ProjectPage viewModel={viewModel} />;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default ProjectController;
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,15 @@
|
||||||
import React, { FC, useState, useEffect } from "react";
|
import React, { FC, useState, useEffect } from "react";
|
||||||
import { useParams } from "react-router-dom";
|
import { useParams } from "react-router-dom";
|
||||||
import { TicketPage } from "../pages/TicketPage";
|
import ErrorController from "./ErrorController";
|
||||||
import { ErrorController } from "./ErrorController";
|
import TicketPage from "../pages/TicketPage";
|
||||||
import { HttpResponse } from "../types/HttpResponse";
|
import TicketVM from "../VM/TicketVM";
|
||||||
|
import HttpResponse from "../types/HttpResponse";
|
||||||
|
import Ticket from "../types/Ticket";
|
||||||
import { Preloader } from "../components/Preloader";
|
import { Preloader } from "../components/Preloader";
|
||||||
import { get } from "../utils/http";
|
import { get } from "../utils/http";
|
||||||
import { Constants } from "../utils/Constants";
|
import Constants from "../utils/Constants";
|
||||||
import { Ticket } from "../types/Ticket";
|
|
||||||
import { TicketVM } from "../VM/TicketVM";
|
|
||||||
|
|
||||||
export const TicketController: FC = () => {
|
const TicketController: FC = () => {
|
||||||
const [isLoading, setIsLoading] = useState(true);
|
const [isLoading, setIsLoading] = useState(true);
|
||||||
const [ticket, setTicket] = useState<Ticket>({} as Ticket);
|
const [ticket, setTicket] = useState<Ticket>({} as Ticket);
|
||||||
const [hasError, setHasError] = useState(false);
|
const [hasError, setHasError] = useState(false);
|
||||||
|
|
@ -48,3 +48,5 @@ export const TicketController: FC = () => {
|
||||||
const viewModel = new TicketVM(ticket);
|
const viewModel = new TicketVM(ticket);
|
||||||
return isLoading ? <Preloader /> : <TicketPage viewModel={viewModel} />;
|
return isLoading ? <Preloader /> : <TicketPage viewModel={viewModel} />;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default TicketController;
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,15 @@
|
||||||
import React, { FC, useState, useEffect } from "react";
|
import React, { FC, useState, useEffect } from "react";
|
||||||
import { useParams } from "react-router-dom";
|
import { useParams } from "react-router-dom";
|
||||||
import { UserPage } from "../pages/UserPage";
|
import ErrorController from "./ErrorController";
|
||||||
|
import UserPage from "../pages/UserPage";
|
||||||
import { UserVM } from "../VM/UserVM";
|
import { UserVM } from "../VM/UserVM";
|
||||||
import { User } from "../types/User";
|
import HttpResponse from "../types/HttpResponse";
|
||||||
import { HttpResponse } from "../types/HttpResponse";
|
import User from "../types/User";
|
||||||
import { Preloader } from "../components/Preloader";
|
import { Preloader } from "../components/Preloader";
|
||||||
|
import Constants from "../utils/Constants";
|
||||||
import { get } from "../utils/http";
|
import { get } from "../utils/http";
|
||||||
import { Constants } from "../utils/Constants";
|
|
||||||
import { ErrorController } from "./ErrorController";
|
|
||||||
|
|
||||||
export const UserController: FC = () => {
|
const UserController: FC = () => {
|
||||||
const [isLoading, setIsLoading] = useState(true);
|
const [isLoading, setIsLoading] = useState(true);
|
||||||
const [user, setUser] = useState<User>({} as User);
|
const [user, setUser] = useState<User>({} as User);
|
||||||
const [hasError, setHasError] = useState(false);
|
const [hasError, setHasError] = useState(false);
|
||||||
|
|
@ -64,3 +64,5 @@ export const UserController: FC = () => {
|
||||||
const viewModel = new UserVM(user, allUsers);
|
const viewModel = new UserVM(user, allUsers);
|
||||||
return isLoading ? <Preloader /> : <UserPage viewModel={viewModel} />;
|
return isLoading ? <Preloader /> : <UserPage viewModel={viewModel} />;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default UserController;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
import React from "react";
|
import React, { FC } from "react";
|
||||||
// import { LogInForm } from "../components/LogInForm";
|
// import { LogInForm } from "../components/LogInForm";
|
||||||
// import { ProfileSelector } from "../components/ProfileSelector";
|
// import { ProfileSelector } from "../components/ProfileSelector";
|
||||||
import SignInSide from "../components/SignInSide";
|
import SignInSide from "../components/SignInSide";
|
||||||
|
|
||||||
export const HomePage: React.FC = () => {
|
const HomePage: FC = () => {
|
||||||
return (
|
return (
|
||||||
// <div className="section">
|
// <div className="section">
|
||||||
// <div className="container center">
|
// <div className="container center">
|
||||||
|
|
@ -21,3 +21,5 @@ export const HomePage: React.FC = () => {
|
||||||
<SignInSide />
|
<SignInSide />
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default HomePage;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
import React, { FC } from "react";
|
import React, { FC } from "react";
|
||||||
import PageLayout from "../layouts/PageLayout";
|
import PageLayout from "../layouts/PageLayout";
|
||||||
import { Header } from "../components/Header";
|
import Header from "../components/Header";
|
||||||
|
|
||||||
interface IProps {}
|
const NotFoundPage: FC = () => {
|
||||||
export const NotFoundPage: FC<IProps> = () => {
|
|
||||||
return (
|
return (
|
||||||
<PageLayout
|
<PageLayout
|
||||||
header={<Header title="Error page" description="Something went wrong" />}
|
header={<Header title="Error page" description="Something went wrong" />}
|
||||||
|
|
@ -11,3 +10,5 @@ export const NotFoundPage: FC<IProps> = () => {
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default NotFoundPage;
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
import React, { FC, useState } from "react";
|
import React, { FC, useState } from "react";
|
||||||
import { Grid, makeStyles, Theme } from "@material-ui/core";
|
import { Grid, makeStyles, Theme } from "@material-ui/core";
|
||||||
import { Header } from "../components/Header";
|
import Header from "../components/Header";
|
||||||
import { AvatarList } from "../components/Avatars/AvatarList";
|
import AvatarList from "../components/Avatars/AvatarList";
|
||||||
import { ProgressBar } from "../components/Progress/ProgressBar";
|
import ProgressBar from "../components/Progress/ProgressBar";
|
||||||
import { FloatingButton } from "../components/Buttons/FloatingButton";
|
import FloatingButton from "../components/Buttons/FloatingButton";
|
||||||
import { UsersModal } from "../components/Modals/UsersModal";
|
import UsersModal from "../components/Modals/UsersModal";
|
||||||
import { ProjectTabPanel } from "../components/Panels/ProjectTabPanel";
|
import ProjectTabPanel from "../components/Panels/ProjectTabPanel";
|
||||||
|
import ProgressInfo from "../components/Progress/ProgressInfo";
|
||||||
import ProjectVM from "../VM/ProjectVM";
|
import ProjectVM from "../VM/ProjectVM";
|
||||||
import PageLayout from "../layouts/PageLayout";
|
import PageLayout from "../layouts/PageLayout";
|
||||||
import { ProgressInfo } from "../components/Progress/ProgressInfo";
|
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
viewModel: ProjectVM;
|
viewModel: ProjectVM;
|
||||||
|
|
@ -22,7 +22,7 @@ const useStyles = makeStyles((theme: Theme) => ({
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export const ProjectPage: FC<IProps> = ({ viewModel }) => {
|
const ProjectPage: FC<IProps> = ({ viewModel }) => {
|
||||||
const {
|
const {
|
||||||
// id,
|
// id,
|
||||||
title,
|
title,
|
||||||
|
|
@ -97,3 +97,5 @@ export const ProjectPage: FC<IProps> = ({ viewModel }) => {
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default ProjectPage;
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,12 @@ import React, { FC } from "react";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { makeStyles, Theme, Grid, Typography } from "@material-ui/core";
|
import { makeStyles, Theme, Grid, Typography } from "@material-ui/core";
|
||||||
import { Timer } from "@material-ui/icons";
|
import { Timer } from "@material-ui/icons";
|
||||||
|
import TicketVM from "../VM/TicketVM";
|
||||||
import PageLayout from "../layouts/PageLayout";
|
import PageLayout from "../layouts/PageLayout";
|
||||||
import { TicketVM } from "../VM/TicketVM";
|
import Header from "../components/Header";
|
||||||
import { Header } from "../components/Header";
|
import AvatarList from "../components/Avatars/AvatarList";
|
||||||
import { AvatarList } from "../components/Avatars/AvatarList";
|
|
||||||
import TicketChipsArray from "../components/Cards/TicketChipsArray";
|
import TicketChipsArray from "../components/Cards/TicketChipsArray";
|
||||||
import { getRemainingdays } from "../utils/methods";
|
import getRemainingdays from "../utils/methods";
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
viewModel: TicketVM;
|
viewModel: TicketVM;
|
||||||
|
|
@ -16,7 +16,6 @@ interface IProps {
|
||||||
const useStyles = makeStyles((theme: Theme) => ({
|
const useStyles = makeStyles((theme: Theme) => ({
|
||||||
root: {
|
root: {
|
||||||
margin: theme.spacing(1),
|
margin: theme.spacing(1),
|
||||||
// flexGrow: 1,
|
|
||||||
},
|
},
|
||||||
table: {
|
table: {
|
||||||
margin: "auto",
|
margin: "auto",
|
||||||
|
|
@ -28,7 +27,7 @@ const useStyles = makeStyles((theme: Theme) => ({
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export const TicketPage: FC<IProps> = ({ viewModel }) => {
|
const TicketPage: FC<IProps> = ({ viewModel }) => {
|
||||||
const {
|
const {
|
||||||
title,
|
title,
|
||||||
description,
|
description,
|
||||||
|
|
@ -133,3 +132,5 @@ export const TicketPage: FC<IProps> = ({ viewModel }) => {
|
||||||
// </TableContainer>
|
// </TableContainer>
|
||||||
// );
|
// );
|
||||||
// };
|
// };
|
||||||
|
|
||||||
|
export default TicketPage;
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
import React, { FC } from "react";
|
import React, { FC } from "react";
|
||||||
import { UserVM } from "../VM/UserVM";
|
import { UserVM } from "../VM/UserVM";
|
||||||
import { UserHeader } from "../components/UserHeader";
|
import UserHeader from "../components/UserHeader";
|
||||||
import { UserTabPanel } from "../components/Panels/UserTabPanel";
|
import UserTabPanel from "../components/Panels/UserTabPanel";
|
||||||
import PageLayout from "../layouts/PageLayout";
|
import PageLayout from "../layouts/PageLayout";
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
viewModel: UserVM;
|
viewModel: UserVM;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const UserPage: FC<IProps> = ({ viewModel }) => {
|
const UserPage: FC<IProps> = ({ viewModel }) => {
|
||||||
const {
|
const {
|
||||||
fullName,
|
fullName,
|
||||||
presentation,
|
presentation,
|
||||||
|
|
@ -39,3 +39,5 @@ export const UserPage: FC<IProps> = ({ viewModel }) => {
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default UserPage;
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { Route, Switch } from "react-router-dom";
|
import { Route, Switch } from "react-router-dom";
|
||||||
import { HomeController } from "../controllers/HomeController";
|
import HomeController from "../controllers/HomeController";
|
||||||
import { ProjectController } from "../controllers/ProjectController";
|
import ProjectController from "../controllers/ProjectController";
|
||||||
import { UserController } from "../controllers/UserController";
|
import UserController from "../controllers/UserController";
|
||||||
import { TicketController } from "../controllers/TicketController";
|
import TicketController from "../controllers/TicketController";
|
||||||
import { NotFoundPage } from "../pages/NotFoundPage";
|
import NotFoundPage from "../pages/NotFoundPage";
|
||||||
import { TestPage } from "../pages/TestPage";
|
import TestPage from "../pages/TestPage";
|
||||||
import { PrivateRoute } from "./PrivateRoute";
|
import PrivateRoute from "./PrivateRoute";
|
||||||
|
|
||||||
export const AppRouter = () => {
|
const AppRouter = () => {
|
||||||
return (
|
return (
|
||||||
<Switch>
|
<Switch>
|
||||||
<PrivateRoute path="/test" component={TestPage} />
|
<PrivateRoute path="/test" component={TestPage} />
|
||||||
|
|
@ -35,3 +35,5 @@ export const AppRouter = () => {
|
||||||
</Switch>
|
</Switch>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default AppRouter;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import React, { useEffect } from "react";
|
||||||
import { Route } from "react-router-dom";
|
import { Route } from "react-router-dom";
|
||||||
import { useAuth0 } from "../authentication/auth0";
|
import { useAuth0 } from "../authentication/auth0";
|
||||||
|
|
||||||
export const PrivateRoute = ({ component: Component, path, ...rest }) => {
|
const PrivateRoute = ({ component: Component, path, ...rest }) => {
|
||||||
const { loading, isAuthenticated, loginWithRedirect } = useAuth0();
|
const { loading, isAuthenticated, loginWithRedirect } = useAuth0();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
@ -22,3 +22,5 @@ export const PrivateRoute = ({ component: Component, path, ...rest }) => {
|
||||||
|
|
||||||
return <Route path={path} render={render} {...rest} />;
|
return <Route path={path} render={render} {...rest} />;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default PrivateRoute;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { User } from "./User";
|
import { User } from "./User";
|
||||||
import { Ticket } from "./Ticket";
|
import { Ticket } from "./Ticket";
|
||||||
|
|
||||||
export interface Activity {
|
export default interface Activity {
|
||||||
id: number;
|
id: number;
|
||||||
description: string;
|
description: string;
|
||||||
date: Date;
|
date: Date;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { User } from "./User";
|
import { User } from "./User";
|
||||||
|
|
||||||
export interface AppFile {
|
export default interface AppFile {
|
||||||
id: number;
|
id: number;
|
||||||
name: string;
|
name: string;
|
||||||
description: string;
|
description: string;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
export interface HttpResponse<T> extends Response {
|
export default interface HttpResponse<T> extends Response {
|
||||||
parsedBody?: T;
|
parsedBody?: T;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
export interface Note {
|
export default interface Note {
|
||||||
Id: number;
|
Id: number;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
import { Ticket } from "./Ticket";
|
import AppFile from "./AppFile";
|
||||||
import { User } from "./User";
|
import Activity from "./Activity";
|
||||||
import { AppFile } from "./AppFile";
|
import Ticket from "./Ticket";
|
||||||
import { Activity } from "./Activity";
|
import User from "./User";
|
||||||
|
|
||||||
export interface Project {
|
export default interface Project {
|
||||||
id: number;
|
id: number;
|
||||||
title: string;
|
title: string;
|
||||||
description: string;
|
description: string;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { Project } from "./Project";
|
import Project from "./Project";
|
||||||
import { User } from "./User";
|
import User from "./User";
|
||||||
|
|
||||||
export interface Ticket {
|
export default interface Ticket {
|
||||||
id: number;
|
id: number;
|
||||||
title: string;
|
title: string;
|
||||||
description: string;
|
description: string;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import { Activity } from "./Activity";
|
import Activity from "./Activity";
|
||||||
import { Project } from "./Project";
|
import Project from "./Project";
|
||||||
import { Ticket } from "./Ticket";
|
import Ticket from "./Ticket";
|
||||||
|
|
||||||
export interface User {
|
export default interface User {
|
||||||
id: string;
|
id: string;
|
||||||
firstName: string;
|
firstName: string;
|
||||||
lastName: string;
|
lastName: string;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
export class Constants {
|
export default class Constants {
|
||||||
static projectsURI: string = "/api/v1/projects";
|
static projectsURI: string = "/api/v1/projects";
|
||||||
static ticketsURI: string = "/api/v1/tickets";
|
static ticketsURI: string = "/api/v1/tickets";
|
||||||
static usersURI: string = "/api/v1/users";
|
static usersURI: string = "/api/v1/users";
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,4 @@
|
||||||
import * as createHistory from "history";
|
import * as createHistory from "history";
|
||||||
export const history = createHistory.createBrowserHistory();
|
const history = createHistory.createBrowserHistory();
|
||||||
|
|
||||||
|
export default history;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { HttpResponse } from "../types/HttpResponse";
|
import HttpResponse from "../types/HttpResponse";
|
||||||
|
|
||||||
export async function http<T>(request: RequestInfo): Promise<HttpResponse<T>> {
|
export async function http<T>(request: RequestInfo): Promise<HttpResponse<T>> {
|
||||||
const response: HttpResponse<T> = await fetch(request);
|
const response: HttpResponse<T> = await fetch(request);
|
||||||
|
|
@ -24,7 +24,7 @@ export async function post<T>(
|
||||||
args: RequestInit = {
|
args: RequestInit = {
|
||||||
method: "post",
|
method: "post",
|
||||||
headers: headers,
|
headers: headers,
|
||||||
body: JSON.stringify(body)
|
body: JSON.stringify(body),
|
||||||
}
|
}
|
||||||
): Promise<HttpResponse<T>> {
|
): Promise<HttpResponse<T>> {
|
||||||
return await http<T>(new Request(path, args));
|
return await http<T>(new Request(path, args));
|
||||||
|
|
@ -36,7 +36,7 @@ export async function put<T>(
|
||||||
args: RequestInit = {
|
args: RequestInit = {
|
||||||
method: "put",
|
method: "put",
|
||||||
headers: headers,
|
headers: headers,
|
||||||
body: JSON.stringify(body)
|
body: JSON.stringify(body),
|
||||||
}
|
}
|
||||||
): Promise<HttpResponse<T>> {
|
): Promise<HttpResponse<T>> {
|
||||||
return await http<T>(new Request(path, args));
|
return await http<T>(new Request(path, args));
|
||||||
|
|
@ -48,7 +48,7 @@ export async function patch<T>(
|
||||||
args: RequestInit = {
|
args: RequestInit = {
|
||||||
method: "patch",
|
method: "patch",
|
||||||
headers: headers,
|
headers: headers,
|
||||||
body: JSON.stringify(body)
|
body: JSON.stringify(body),
|
||||||
}
|
}
|
||||||
): Promise<HttpResponse<T>> {
|
): Promise<HttpResponse<T>> {
|
||||||
return await http<T>(new Request(path, args));
|
return await http<T>(new Request(path, args));
|
||||||
|
|
@ -58,5 +58,5 @@ const headers: Headers = new Headers({
|
||||||
Accept: "application/json",
|
Accept: "application/json",
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
Authorization:
|
Authorization:
|
||||||
"Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Ik1UWkNSRFEzUkRnd1FUQXlNRFExTmtOQ09UQXlSamhGTURaRU1Ea3pNRGxHUkRrelFqZENSZyJ9.eyJpc3MiOiJodHRwczovL2Rldi1meWpydm9oeC5hdXRoMC5jb20vIiwic3ViIjoiR3dlZTlGUnN3ejNWNE5vZFVRTjJIcjJyQjJTMDI1UmZAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbG9jYWxob3N0OjUwMDEvYXBpL1YxLyIsImlhdCI6MTU4NDE5ODQ4MCwiZXhwIjoxNTg0Mjg0ODgwLCJhenAiOiJHd2VlOUZSc3d6M1Y0Tm9kVVFOMkhyMnJCMlMwMjVSZiIsImd0eSI6ImNsaWVudC1jcmVkZW50aWFscyJ9.I1D49ILGBLhnq9biIA0y6Ra93zTKRDJI_rfGvU05MtT1zkI1ZliX9P-7LyKeWBv8tPonB6gT12lJiai_GHBET8kKbXNqwfVvDJ3eqYK-TtTqfL65RfWL9tQfQybHbfuF9M0oiXMqWMqmsc5Umpp4a3bLTQgwkUEKxcdMm84L7zoaqMycns4mFojWpQJKfPa64oZFDIXYy6hPDXcX50Djuk1m-aqMhtpmqkZvPfwEjvtEtGGCTOJHV7uugn3r8Wk4HX02ShrV676GICE1Yw7eHufAbY7yvHz3ImZ1cfEVrRbbijPA2vogXd5RmqNyindDDlT1Y_C80U0DyvhS7P7apQ"
|
"Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Ik1UWkNSRFEzUkRnd1FUQXlNRFExTmtOQ09UQXlSamhGTURaRU1Ea3pNRGxHUkRrelFqZENSZyJ9.eyJpc3MiOiJodHRwczovL2Rldi1meWpydm9oeC5hdXRoMC5jb20vIiwic3ViIjoiR3dlZTlGUnN3ejNWNE5vZFVRTjJIcjJyQjJTMDI1UmZAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbG9jYWxob3N0OjUwMDEvYXBpL1YxLyIsImlhdCI6MTU4NDE5ODQ4MCwiZXhwIjoxNTg0Mjg0ODgwLCJhenAiOiJHd2VlOUZSc3d6M1Y0Tm9kVVFOMkhyMnJCMlMwMjVSZiIsImd0eSI6ImNsaWVudC1jcmVkZW50aWFscyJ9.I1D49ILGBLhnq9biIA0y6Ra93zTKRDJI_rfGvU05MtT1zkI1ZliX9P-7LyKeWBv8tPonB6gT12lJiai_GHBET8kKbXNqwfVvDJ3eqYK-TtTqfL65RfWL9tQfQybHbfuF9M0oiXMqWMqmsc5Umpp4a3bLTQgwkUEKxcdMm84L7zoaqMycns4mFojWpQJKfPa64oZFDIXYy6hPDXcX50Djuk1m-aqMhtpmqkZvPfwEjvtEtGGCTOJHV7uugn3r8Wk4HX02ShrV676GICE1Yw7eHufAbY7yvHz3ImZ1cfEVrRbbijPA2vogXd5RmqNyindDDlT1Y_C80U0DyvhS7P7apQ",
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
export const getRemainingdays: (endDate: string) => number = (
|
const getRemainingdays: (endDate: string) => number = (endDate: string) => {
|
||||||
endDate: string
|
|
||||||
) => {
|
|
||||||
let endingDate: Date = new Date(endDate);
|
let endingDate: Date = new Date(endDate);
|
||||||
let today: Date = new Date();
|
let today: Date = new Date();
|
||||||
return Math.abs(endingDate.getDate() - today.getDate());
|
return Math.abs(endingDate.getDate() - today.getDate());
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default getRemainingdays;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue