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