diff --git a/src/Admin/Pages/Pages/SubPages/Institutions.js b/src/Admin/Pages/Pages/SubPages/Institutions.js index 874292c1d21397e0020590f9e4457257f375879d..d8d2856acaf2d8ea09a63845608c1a90fb9d0900 100644 --- a/src/Admin/Pages/Pages/SubPages/Institutions.js +++ b/src/Admin/Pages/Pages/SubPages/Institutions.js @@ -47,7 +47,7 @@ import { getRequest, deleteRequest } from '../../../../Components/HelperFunction //Filters import { Url, DeleteFilter } from "../../../Filters"; //router -import { Link } from 'react-router-dom'; +import { Link, useHistory } from 'react-router-dom'; import styled from "styled-components" import AccountBalanceRoundedIcon from "@material-ui/icons/AccountBalanceRounded"; @@ -69,24 +69,9 @@ const StyledTableRow = withStyles((theme) => ({ }, }))(TableRow); -const useStyles = makeStyles((theme) => ({ - root: { - flexGrow: 1, - }, - paper: { - padding: theme.spacing(1), - textAlign: "start", - }, - button: { - margin: theme.spacing(1), - alignSelf: "flex-end", - }, -})); - const Institutions = () => { - const classes = useStyles(); const WINDOW_WIDTH = window.innerWidth - + const router = useHistory() const ADD_ONE_LENGHT = [""]; const [error, setError] = useState(null); //Necessary to consult the API, catch errors @@ -344,6 +329,14 @@ const Institutions = () => { setShowFilter(!showFilter); }, icon: <FilterListRoundedIcon /> + }, + { + name: "Novo", + isLoading: false, + func: () => { + router.push('/admin/InstitutionCreate') + }, + icon: <AddRoundedIcon /> } ]} > @@ -486,6 +479,14 @@ const Institutions = () => { setShowFilter(!showFilter); }, icon: <FilterListRoundedIcon /> + }, + { + name: "Novo", + isLoading: false, + func: () => { + router.push('/admin/InstitutionCreate') + }, + icon: <AddRoundedIcon /> } ]} > diff --git a/src/Admin/Pages/Pages/SubPages/Languages.js b/src/Admin/Pages/Pages/SubPages/Languages.js index 6eee28f699dfe4419f489f06c2b04b09fca18577..f985fdc8bc1990366750afa27f17b2c40f064cb6 100644 --- a/src/Admin/Pages/Pages/SubPages/Languages.js +++ b/src/Admin/Pages/Pages/SubPages/Languages.js @@ -41,7 +41,7 @@ import UpdateRoundedIcon from '@material-ui/icons/UpdateRounded'; import EditRoundedIcon from '@material-ui/icons/EditRounded'; import DeleteRoundedIcon from '@material-ui/icons/DeleteRounded'; //router -import { Link } from 'react-router-dom'; +import { Link, useHistory } from 'react-router-dom'; import styled from "styled-components" import LanguageRoundedIcon from "@material-ui/icons/LanguageRounded"; @@ -67,6 +67,7 @@ const Languages = () => { const ADD_ONE_LENGHT = [""]; const TOP_LABELS = ['ID', 'NOME', 'CODE', 'EDITAR', 'DELETAR'] //Labels from Table const WINDOW_WIDTH = window.innerWidth + const router = useHistory() const [error, setError] = useState(null); //Necessary to consult the API, catch errors const [isLoaded, setIsLoaded] = useState(false); //Necessary to consult the API, wait until complete @@ -226,6 +227,14 @@ const Languages = () => { }, icon: <UpdateRoundedIcon /> }, + { + name: "Novo", + isLoading: false, + func: () => { + router.push('/admin/languageCreate') + }, + icon: <AddRoundedIcon /> + } ]} > </MobilePageHeader> @@ -323,6 +332,14 @@ const Languages = () => { }, icon: <UpdateRoundedIcon /> }, + { + name: "Novo", + isLoading: false, + func: () => { + router.push('/admin/languageCreate') + }, + icon: <AddRoundedIcon /> + } ]} > </PageHeader> diff --git a/src/Admin/Pages/Pages/SubPages/Permissions.js b/src/Admin/Pages/Pages/SubPages/Permissions.js index b5a3278341b00911c5aeb9a3758daf004512ab2a..699e1836b46eb5f7ebf698a7add0897b890b32b5 100644 --- a/src/Admin/Pages/Pages/SubPages/Permissions.js +++ b/src/Admin/Pages/Pages/SubPages/Permissions.js @@ -40,7 +40,7 @@ import UpdateRoundedIcon from '@material-ui/icons/UpdateRounded'; import EditRoundedIcon from '@material-ui/icons/EditRounded'; import DeleteRoundedIcon from '@material-ui/icons/DeleteRounded'; //router -import { Link } from 'react-router-dom'; +import { Link, useHistory } from 'react-router-dom'; import styled from "styled-components" import AccountCircleRoundedIcon from "@material-ui/icons/AccountCircleRounded" @@ -66,6 +66,7 @@ const UserPermissions = () => { const ADD_ONE_LENGHT = [""]; const TOP_LABELS = ['ID', 'NOME', 'DESCRIÇÃO', 'AÇÕES'] //Labels from Table const WINDOW_WIDTH = window.innerWidth + const router = useHistory() const [error, setError] = useState(null); //Necessary to consult the API, catch errors const [isLoaded, setIsLoaded] = useState(false); //Necessary to consult the API, wait until complete @@ -223,6 +224,14 @@ const UserPermissions = () => { }, icon: <UpdateRoundedIcon /> }, + { + name: "Novo", + isLoading: false, + func: () => { + router.push('/admin/CreateRole') + }, + icon: <AddRoundedIcon /> + } ]} > </MobilePageHeader> @@ -318,6 +327,14 @@ const UserPermissions = () => { }, icon: <UpdateRoundedIcon /> }, + { + name: "Novo", + isLoading: false, + func: () => { + router.push('/admin/CreateRole') + }, + icon: <AddRoundedIcon /> + } ]} > </PageHeader> diff --git a/src/Admin/Pages/Pages/SubPages/Questions.js b/src/Admin/Pages/Pages/SubPages/Questions.js index affb59e8857a4090e2c031f807c4f465bebb78a6..1d34bd10fa203caeb51297867335925ec9b6f3ae 100644 --- a/src/Admin/Pages/Pages/SubPages/Questions.js +++ b/src/Admin/Pages/Pages/SubPages/Questions.js @@ -40,7 +40,7 @@ import AddRoundedIcon from '@material-ui/icons/AddRounded'; import UpdateRoundedIcon from '@material-ui/icons/UpdateRounded'; import Switch from '@material-ui/core/Switch'; //router -import { Link } from 'react-router-dom'; +import { Link, useHistory } from 'react-router-dom'; import styled from "styled-components" import HelpRoundedIcon from "@material-ui/icons/HelpRounded"; @@ -68,6 +68,7 @@ const Questions = () => { const ADD_ONE_LENGHT = [""]; const WINDOW_WIDTH = window.innerWidth const TOP_LABELS = ['ID', 'CRIAÇÃO EM', 'DESCRIÇÃO', 'STATUS', 'ATUALIZAÇÃO EM'] //Labels from Table + const router = useHistory() const [error, setError] = useState(null); //Necessary to consult the API, catch errors const [isLoaded, setIsLoaded] = useState(false); //Necessary to consult the API, wait until complete @@ -230,7 +231,7 @@ const Questions = () => { /> <MobilePageHeader - title="Questões da curadoria" + title="Perguntas da curadoria" actions={[ { name: "Atualizar", @@ -240,6 +241,13 @@ const Questions = () => { }, icon: <UpdateRoundedIcon /> }, + { + name: "Novo", + isLoading: false, + func: () => { + router.push('/admin/CreateQuestion') + }, + } ]} > </MobilePageHeader> @@ -334,7 +342,7 @@ const Questions = () => { /> <PageHeader - title="Questões da curadoria" + title="Perguntas da curadoria" actions={[ { name: "Atualizar", @@ -344,6 +352,13 @@ const Questions = () => { }, icon: <UpdateRoundedIcon /> }, + { + name: "Novo", + isLoading: false, + func: () => { + router.push('/admin/CreateQuestion') + }, + } ]} > </PageHeader> diff --git a/src/Admin/Pages/Pages/SubPages/Rating.js b/src/Admin/Pages/Pages/SubPages/Rating.js index 80feabfa60911c88a8a1b304e170fd3985c1b956..8fe70d9bb4de14d9cc3c11382d43a6f084a6e3d3 100644 --- a/src/Admin/Pages/Pages/SubPages/Rating.js +++ b/src/Admin/Pages/Pages/SubPages/Rating.js @@ -44,7 +44,7 @@ import { Url } from '../../../Filters'; import { DeleteFilter } from '../../../Filters'; import { getRequest, deleteRequest } from '../../../../Components/HelperFunctions/getAxiosConfig' //routers -import { Link } from 'react-router-dom'; +import { Link, useHistory } from 'react-router-dom'; import StarRoundedIcon from "@material-ui/icons/StarRounded"; import styled from "styled-components" @@ -69,6 +69,7 @@ const StyledTableRow = withStyles((theme) => ({ const Ratings = () => { const WINDOW_WIDTH = window.innerWidth const ADD_ONE_LENGHT = [""]; + const router = useHistory() const [error, setError] = useState(null); //Necessary to consult the API, catch errors const [isLoaded, setIsLoaded] = useState(false); //Necessary to consult the API, wait until complete @@ -229,6 +230,14 @@ const Ratings = () => { }, icon: <UpdateRoundedIcon /> }, + { + name: "Novo", + isLoading: false, + func: () => { + router.push('/admin/CreateRating') + }, + icon: <AddRoundedIcon /> + } ]} > </MobilePageHeader> @@ -325,6 +334,14 @@ const Ratings = () => { }, icon: <UpdateRoundedIcon /> }, + { + name: "Novo", + isLoading: false, + func: () => { + router.push('/admin/CreateRating') + }, + icon: <AddRoundedIcon /> + } ]} > </PageHeader> diff --git a/src/Admin/Pages/Pages/SubPages/Users.js b/src/Admin/Pages/Pages/SubPages/Users.js index 75c7544062cf82380355aa94d95b4656913d3ad4..7e606d71a1f3e39fbaa70fe3f80d2feda411ced2 100644 --- a/src/Admin/Pages/Pages/SubPages/Users.js +++ b/src/Admin/Pages/Pages/SubPages/Users.js @@ -42,7 +42,7 @@ import PageHeader from "../../../Components/Components/PageHeader" import { getRequest, putRequest } from '../../../../Components/HelperFunctions/getAxiosConfig' import { Url } from '../../../Filters'; //routers -import { Link } from 'react-router-dom'; +import { Link, useHistory } from 'react-router-dom'; import moment from 'moment'; import styled from 'styled-components' import EmailRoundedIcon from '@material-ui/icons/EmailRounded'; @@ -69,6 +69,7 @@ const StyledTableRow = withStyles((theme) => ({ const Users = () => { const ADD_ONE_LENGHT = ['']; + const router = useHistory() const WINDOW_WIDTH = window.innerWidth const [error, setError] = useState(null); //Necessary to consult the API, catch errors const [isLoaded, setIsLoaded] = useState(false); //Necessary to consult the API, wait until complete @@ -265,6 +266,13 @@ const Users = () => { setShowFilter(!showFilter); }, icon: <FilterListRoundedIcon /> + }, + { + name: "Novo", + isLoading: false, + func: () => { + router.push('/admin/EditUser/-1') + }, } ]} > @@ -426,6 +434,13 @@ const Users = () => { setShowFilter(!showFilter); }, icon: <FilterListRoundedIcon /> + }, + { + name: "Novo", + isLoading: false, + func: () => { + router.push('/admin/EditUser/-1') + }, } ]} >