diff --git a/src/Admin/Components/Components/DataCards/CommunityQuestionCard.js b/src/Admin/Components/Components/DataCards/CommunityQuestionCard.js index b8ae952c3dabc4ff4c7fd73ceb45a6d3123972b1..3a4b844e2b53297d42df642af9dbcc37b7c187a2 100644 --- a/src/Admin/Components/Components/DataCards/CommunityQuestionCard.js +++ b/src/Admin/Components/Components/DataCards/CommunityQuestionCard.js @@ -16,7 +16,7 @@ GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with Plataforma Integrada MEC. If not, see <http://www.gnu.org/licenses/>.*/ -import React, { useState, useEffect, useContext } from "react"; +import React, { useState, useEffect } from "react"; import moment from 'moment'; // Maerial ui components import Card from "@material-ui/core/Card"; @@ -30,14 +30,11 @@ import { useStyles } from "../../Styles/DataCard"; import EmailRoundedIcon from '@material-ui/icons/EmailRounded'; //imports from local files import { GetAData } from "../../../Filters"; -import { Store } from '../../../../Store'; import { Link } from 'react-router-dom' -import Unauthorized from "../Unauthorized"; import { getRequest } from '../../../../Components/HelperFunctions/getAxiosConfig' import LoadingSpinner from '../../../../Components/LoadingSpinner'; const CommunityQuestions = () => { - const { state } = useContext(Store); const classes = useStyles(); const [error, setError] = useState(null); //Necessary to consult the API, catch errors @@ -51,22 +48,6 @@ const CommunityQuestions = () => { .toString(); }; - const CheckUserPermission = () => { - let canUserEdit = false; - - if (state.userIsLoggedIn) { - const roles = [...state.currentUser.roles]; - for (let i = 0; i < roles.length; i++) - if (roles[i].name === 'admin' || roles[i].name === 'editor') - canUserEdit = true; - } - else { - canUserEdit = false; - } - - return canUserEdit; - } - useEffect(() => { const urlParams = new URLSearchParams(window.location.search); const query = urlParams.get("question"); @@ -88,7 +69,7 @@ const CommunityQuestions = () => { return <div>Houve um erro</div>; } else if (!isLoaded) { return <LoadingSpinner text="Carregando..." /> - } else if (CheckUserPermission()) { + } else { const DATA = [ { subTitle: "ID", @@ -157,7 +138,7 @@ const CommunityQuestions = () => { </CardContent> </Card> ); - } else return <Unauthorized /> + } }; export default CommunityQuestions; diff --git a/src/Admin/Components/Components/Inputs/CreateInstitution.js b/src/Admin/Components/Components/Inputs/CreateInstitution.js index 378c0960b36556a71709978fed512c03db48a9ba..a0ba3c1a55a97bc023537d4e7ad0a444a1c0d8ab 100644 --- a/src/Admin/Components/Components/Inputs/CreateInstitution.js +++ b/src/Admin/Components/Components/Inputs/CreateInstitution.js @@ -16,7 +16,7 @@ GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with Plataforma Integrada MEC. If not, see <http://www.gnu.org/licenses/>.*/ -import React, { useState, useContext } from 'react'; +import React, { useState } from 'react'; //imports material ui componets import Card from "@material-ui/core/Card"; import CardContent from "@material-ui/core/CardContent"; @@ -27,14 +27,11 @@ import AddRoundedIcon from '@material-ui/icons/AddRounded'; import ListRoundedIcon from '@material-ui/icons/ListRounded'; //imports local files import SnackBar from '../../../../Components/SnackbarComponent'; -import { Store } from '../../../../Store'; import { postRequest } from '../../../../Components/HelperFunctions/getAxiosConfig' -import Unauthorized from '../Unauthorized'; //router import { Link } from 'react-router-dom'; const CreateInstitution = (props) => { - const { state } = useContext(Store); const [name, setName] = useState('Nova Instituição'); const [description, setDescription] = useState(''); @@ -101,23 +98,6 @@ const CreateInstitution = (props) => { }) } - const CheckUserPermission = () => { - let canUserEdit = false; - - if (state.userIsLoggedIn) { - const roles = [...state.currentUser.roles]; - for (let i = 0; i < roles.length; i++) - if (roles[i].name === 'admin' || roles[i].name === 'editor') - canUserEdit = true; - } - else { - canUserEdit = false; - } - - return canUserEdit; - } - - //Handle submit async function onSubmit() { setIsLoading(true) @@ -203,80 +183,77 @@ const CreateInstitution = (props) => { onChange: (event) => CountryHandler(event) } ] - - if (CheckUserPermission()) { - return ( - <Card> - <SnackBar - severity={snackInfo.icon} - text={snackInfo.message} - snackbarOpen={snackInfo.open} - color={snackInfo.color} - handleClose={() => setSnackInfo({ - message: '', - icon: '', - open: false, - color: '' - })} - /> - <CardContent> - <Grid container direction='row' justify='space-between' alignContent="center" alignItems="center" xs={12}> - <Grid item> - <Typography variant='h4'> - {name} - </Typography> - </Grid> - <Grid item> - <Link style={{ textDecoration: 'none' }} to={'/admin/institutions'}> - <Button - onClick={props.BackToList} - startIcon={<ListRoundedIcon />} - variant='outlined' - color='primary' - > - Listar - </Button> - </Link> - </Grid> + return ( + <Card> + <SnackBar + severity={snackInfo.icon} + text={snackInfo.message} + snackbarOpen={snackInfo.open} + color={snackInfo.color} + handleClose={() => setSnackInfo({ + message: '', + icon: '', + open: false, + color: '' + })} + /> + <CardContent> + <Grid container direction='row' justify='space-between' alignContent="center" alignItems="center" xs={12}> + <Grid item> + <Typography variant='h4'> + {name} + </Typography> + </Grid> + <Grid item> + <Link style={{ textDecoration: 'none' }} to={'/admin/institutions'}> + <Button + onClick={props.BackToList} + startIcon={<ListRoundedIcon />} + variant='outlined' + color='primary' + > + Listar + </Button> + </Link> </Grid> + </Grid> - <div style={{ height: '1em' }}></div> + <div style={{ height: '1em' }}></div> - <form style={{ display: 'flex', flexDirection: 'column' }}> - {fields.map((field, index) => ( - <TextField - key={index} - required={field.required} - error={field.error} - helperText={field.error ? field.errorMessage : ''} - style={{ width: '250px', marginBottom: '1em' }} - label={field.label} - value={field.value} - onChange={field.onChange} - type="search" - multiline={true} - /> - ))} - </form> - </CardContent> - <CardAction> - <Button - onClick={() => { - onSubmit(); - }} - variant="contained" - color="primary" - disabled={isLoading} - startIcon={isLoading ? null : <AddRoundedIcon />} - > - { - isLoading ? <CircularProgress size={24} /> : 'Adicionar' - } - </Button> - </CardAction> - </Card> - ); - } else return <Unauthorized /> + <form style={{ display: 'flex', flexDirection: 'column' }}> + {fields.map((field, index) => ( + <TextField + key={index} + required={field.required} + error={field.error} + helperText={field.error ? field.errorMessage : ''} + style={{ width: '250px', marginBottom: '1em' }} + label={field.label} + value={field.value} + onChange={field.onChange} + type="search" + multiline={true} + /> + ))} + </form> + </CardContent> + <CardAction> + <Button + onClick={() => { + onSubmit(); + }} + variant="contained" + color="primary" + disabled={isLoading} + startIcon={isLoading ? null : <AddRoundedIcon />} + > + { + isLoading ? <CircularProgress size={24} /> : 'Adicionar' + } + </Button> + </CardAction> + </Card> + ); } export default CreateInstitution; \ No newline at end of file diff --git a/src/Admin/Components/Components/Inputs/CreateLanguage.js b/src/Admin/Components/Components/Inputs/CreateLanguage.js index c9a6590184ea0695d365aa6a58e3119c5dfa4051..5cca9080607862eeaf69737624770700d5649193 100644 --- a/src/Admin/Components/Components/Inputs/CreateLanguage.js +++ b/src/Admin/Components/Components/Inputs/CreateLanguage.js @@ -16,7 +16,7 @@ GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with Plataforma Integrada MEC. If not, see <http://www.gnu.org/licenses/>.*/ -import React, { useState, useContext } from 'react'; +import React, { useState } from 'react'; //imports material ui componets import Card from "@material-ui/core/Card"; import CardContent from "@material-ui/core/CardContent"; @@ -27,14 +27,11 @@ import AddRoundedIcon from '@material-ui/icons/AddRounded'; import ListRoundedIcon from '@material-ui/icons/ListRounded'; //imports local files import SnackBar from '../../../../Components/SnackbarComponent'; -import { Store } from '../../../../Store'; import { postRequest } from '../../../../Components/HelperFunctions/getAxiosConfig' //router import { Link } from 'react-router-dom'; -import Unauthorized from '../Unauthorized'; const CreateLanguage = (props) => { - const { state } = useContext(Store); const [name, setName] = useState('Nova linguagem'); const [code, setCode] = useState(''); @@ -90,22 +87,6 @@ const CreateLanguage = (props) => { }) } - const CheckUserPermission = () => { - let canUserEdit = false; - - if (state.userIsLoggedIn) { - const roles = [...state.currentUser.roles]; - for (let i = 0; i < roles.length; i++) - if (roles[i].name === 'admin' || roles[i].name === 'editor') - canUserEdit = true; - } - else { - canUserEdit = false; - } - - return canUserEdit; - } - //Handle submit async function onSubmit() { setIsLoading(true) @@ -179,79 +160,77 @@ const CreateLanguage = (props) => { } ] - if (CheckUserPermission()) { - return ( - <Card> - <SnackBar - severity={snackInfo.icon} - text={snackInfo.message} - snackbarOpen={snackInfo.open} - color={snackInfo.color} - handleClose={() => setSnackInfo({ - message: '', - icon: '', - open: false, - color: '' - })} - /> - <CardContent> - <Grid container direction='row' justify='space-between' alignItems="center" alignContent="center" xs={12}> - <Grid item> - <Typography variant='h4'> - {name} - </Typography> - </Grid> - <Grid item> - <Link to={'/admin/languages'} style={{ textDecoration: 'none' }}> - <Button - onClick={props.BackToList} - startIcon={<ListRoundedIcon />} - variant='outlined' - color='primary' - > - Listar - </Button> - </Link> - </Grid> + return ( + <Card> + <SnackBar + severity={snackInfo.icon} + text={snackInfo.message} + snackbarOpen={snackInfo.open} + color={snackInfo.color} + handleClose={() => setSnackInfo({ + message: '', + icon: '', + open: false, + color: '' + })} + /> + <CardContent> + <Grid container direction='row' justify='space-between' alignItems="center" alignContent="center" xs={12}> + <Grid item> + <Typography variant='h4'> + {name} + </Typography> </Grid> - - <div style={{ height: '1em' }}></div> - - <form style={{ display: 'flex', flexDirection: 'column' }}> - {fields.map((field, index) => ( - <TextField - key={index} - required={field.required} - error={field.error} - helperText={field.error ? field.errorMessage : ''} - style={{ width: '250px', marginBottom: '1em' }} - label={field.label} - value={field.value} - onChange={field.onChange} - type="search" - multiline={true} - /> - ))} - </form> - </CardContent> - <CardAction> - <Button - onClick={() => { - onSubmit(); - }} - variant="contained" - color="primary" - disabled={isLoading} - startIcon={isLoading ? null : <AddRoundedIcon />} - > - { - isLoading ? <CircularProgress size={24} /> : 'Adicionar' - } - </Button> - </CardAction> - </Card> - ) - } else return <Unauthorized /> + <Grid item> + <Link to={'/admin/languages'} style={{ textDecoration: 'none' }}> + <Button + onClick={props.BackToList} + startIcon={<ListRoundedIcon />} + variant='outlined' + color='primary' + > + Listar + </Button> + </Link> + </Grid> + </Grid> + + <div style={{ height: '1em' }}></div> + + <form style={{ display: 'flex', flexDirection: 'column' }}> + {fields.map((field, index) => ( + <TextField + key={index} + required={field.required} + error={field.error} + helperText={field.error ? field.errorMessage : ''} + style={{ width: '250px', marginBottom: '1em' }} + label={field.label} + value={field.value} + onChange={field.onChange} + type="search" + multiline={true} + /> + ))} + </form> + </CardContent> + <CardAction> + <Button + onClick={() => { + onSubmit(); + }} + variant="contained" + color="primary" + disabled={isLoading} + startIcon={isLoading ? null : <AddRoundedIcon />} + > + { + isLoading ? <CircularProgress size={24} /> : 'Adicionar' + } + </Button> + </CardAction> + </Card> + ) } export default CreateLanguage; \ No newline at end of file diff --git a/src/Admin/Components/Components/Inputs/CreateQuestion.js b/src/Admin/Components/Components/Inputs/CreateQuestion.js index 89fd3f856e7b8cee4760048d3913723a9c24c129..58f0d5d4b5896e9088bea7d9b2287388a9bf7f76 100644 --- a/src/Admin/Components/Components/Inputs/CreateQuestion.js +++ b/src/Admin/Components/Components/Inputs/CreateQuestion.js @@ -16,7 +16,7 @@ GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with Plataforma Integrada MEC. If not, see <http://www.gnu.org/licenses/>.*/ -import React, { useState, useContext } from 'react'; +import React, { useState } from 'react'; //imports material ui componets import Card from "@material-ui/core/Card"; import CardContent from "@material-ui/core/CardContent"; @@ -27,15 +27,12 @@ import AddRoundedIcon from '@material-ui/icons/AddRounded'; import MenuItem from "@material-ui/core/MenuItem"; import ListRoundedIcon from '@material-ui/icons/ListRounded'; //imports local files -import { Store } from '../../../../Store'; import { postRequest } from '../../../../Components/HelperFunctions/getAxiosConfig' -import Unauthorized from '../Unauthorized'; import SnackBar from '../../../../Components/SnackbarComponent'; //router import { Link } from 'react-router-dom'; const CreateQuestion = (props) => { - const { state } = useContext(Store); const [status, setStatus] = useState(''); const [description, setDescription] = useState(''); @@ -80,23 +77,6 @@ const CreateQuestion = (props) => { }) } - const CheckUserPermission = () => { - let canUserEdit = false; - - if (state.userIsLoggedIn) { - const roles = [...state.currentUser.roles]; - for (let i = 0; i < roles.length; i++) - if (roles[i].name === 'admin') - canUserEdit = true; - } - else { - canUserEdit = false; - } - - return canUserEdit; - } - - //Handle submit async function onSubmit() { if (!isEmpty(description)) { @@ -166,100 +146,98 @@ const CreateQuestion = (props) => { }, ]; - if (CheckUserPermission()) { - return ( - <Card> - <SnackBar - severity={snackInfo.icon} - text={snackInfo.message} - snackbarOpen={snackInfo.open} - color={snackInfo.color} - handleClose={() => setSnackInfo({ - message: '', - icon: '', - open: false, - color: '' - })} - /> - <CardContent> - <Grid container direction='row' justify='space-between' alignContent="center" alignItems="center" xs={12}> - <Grid item> - <Typography variant='h4'> - Nova question - </Typography> - </Grid> - <Grid item> - <Link to={'/admin/Questions'} style={{ textDecoration: 'none' }}> - <Button - onClick={props.BackToList} - startIcon={<ListRoundedIcon />} - variant='outlined' - color='primary' - > - Listar - </Button> - </Link> - </Grid> + return ( + <Card> + <SnackBar + severity={snackInfo.icon} + text={snackInfo.message} + snackbarOpen={snackInfo.open} + color={snackInfo.color} + handleClose={() => setSnackInfo({ + message: '', + icon: '', + open: false, + color: '' + })} + /> + <CardContent> + <Grid container direction='row' justify='space-between' alignContent="center" alignItems="center" xs={12}> + <Grid item> + <Typography variant='h4'> + Nova question + </Typography> </Grid> - - <div style={{ height: '1em' }}></div> - - <form style={{ display: 'flex', flexDirection: 'column' }}> - <> - <TextField - select - label="Status" - value={status ? status : ""} - style={{ width: '250px', marginBottom: '1em' }} - onChange={handleChange} + <Grid item> + <Link to={'/admin/Questions'} style={{ textDecoration: 'none' }}> + <Button + onClick={props.BackToList} + startIcon={<ListRoundedIcon />} + variant='outlined' + color='primary' > - {STATUS_OPTIONS.map((option, index) => ( - <MenuItem - key={option.value} - value={option.value} - style={option.value === status ? { color: 'blue' } : { color: 'black' }} - > - { - option.label - } - </MenuItem> - ))} - </TextField> - {fields.map((field, index) => ( - <TextField - key={index} - required={field.required} - error={field.error} - helperText={field.error ? field.errorMessage : ''} - style={{ width: '250px', marginBottom: '1em' }} - label={field.label} - value={field.value} - onChange={field.onChange} - type="search" - multiline={true} - /> + Listar + </Button> + </Link> + </Grid> + </Grid> + + <div style={{ height: '1em' }}></div> + + <form style={{ display: 'flex', flexDirection: 'column' }}> + <> + <TextField + select + label="Status" + value={status ? status : ""} + style={{ width: '250px', marginBottom: '1em' }} + onChange={handleChange} + > + {STATUS_OPTIONS.map((option, index) => ( + <MenuItem + key={option.value} + value={option.value} + style={option.value === status ? { color: 'blue' } : { color: 'black' }} + > + { + option.label + } + </MenuItem> ))} - </> - </form> - </CardContent> - <CardAction> - <Button - onClick={() => { - onSubmit(); - }} - variant="contained" - color="primary" - disabled={isLoading} - startIcon={isLoading ? null : <AddRoundedIcon />} - > - { - isLoading ? <CircularProgress size={24} /> : 'Adicionar' - } - </Button> - </CardAction> - </Card> - ); - } else return <Unauthorized /> + </TextField> + {fields.map((field, index) => ( + <TextField + key={index} + required={field.required} + error={field.error} + helperText={field.error ? field.errorMessage : ''} + style={{ width: '250px', marginBottom: '1em' }} + label={field.label} + value={field.value} + onChange={field.onChange} + type="search" + multiline={true} + /> + ))} + </> + </form> + </CardContent> + <CardAction> + <Button + onClick={() => { + onSubmit(); + }} + variant="contained" + color="primary" + disabled={isLoading} + startIcon={isLoading ? null : <AddRoundedIcon />} + > + { + isLoading ? <CircularProgress size={24} /> : 'Adicionar' + } + </Button> + </CardAction> + </Card> + ); } export default CreateQuestion; \ No newline at end of file diff --git a/src/Admin/Components/Components/Inputs/CreateRating.js b/src/Admin/Components/Components/Inputs/CreateRating.js index 3a8907f9faed11a37027e592577703cfc8a88d59..3837c9e3dbc1eca1b292307af5c5d71046425513 100644 --- a/src/Admin/Components/Components/Inputs/CreateRating.js +++ b/src/Admin/Components/Components/Inputs/CreateRating.js @@ -16,7 +16,7 @@ GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with Plataforma Integrada MEC. If not, see <http://www.gnu.org/licenses/>.*/ -import React, { useState, useContext } from 'react'; +import React, { useState } from 'react'; //imports material ui componets import Card from "@material-ui/core/Card"; import CardContent from "@material-ui/core/CardContent"; @@ -26,16 +26,13 @@ import CircularProgress from '@material-ui/core/CircularProgress'; import AddRoundedIcon from '@material-ui/icons/AddRounded'; import ListRoundedIcon from '@material-ui/icons/ListRounded'; //imports local files -import { Store } from '../../../../Store'; import SnackBar from '../../../../Components/SnackbarComponent'; //imports services import { postRequest } from '../../../../Components/HelperFunctions/getAxiosConfig' //router import {Link} from 'react-router-dom'; -import Unauthorized from '../Unauthorized'; const CreateRating = (props) => { - const { state } = useContext(Store); const [name, setName] = useState('Novo rating'); const [description, setDescription] = useState(''); @@ -96,22 +93,6 @@ const CreateRating = (props) => { }) } - const CheckUserPermission = () => { - let canUserEdit = false; - - if (state.userIsLoggedIn) { - const roles = [...state.currentUser.roles]; - for (let i = 0; i < roles.length; i++) - if (roles[i].name === 'admin' || roles[i].name === 'editor') - canUserEdit = true; - } - else { - canUserEdit = false; - } - - return canUserEdit; - } - //Handle submit async function onSubmit() { setIsLoading(true) @@ -176,79 +157,77 @@ const CreateRating = (props) => { } ] - if(CheckUserPermission()) { - return ( - <Card> - <SnackBar - severity={snackInfo.icon} - text={snackInfo.message} - snackbarOpen={snackInfo.open} - color={snackInfo.color} - handleClose={() => setSnackInfo({ - message: '', - icon: '', - open: false, - color: '' - })} - /> - <CardContent> - <Grid container direction='row' justify='space-between' alignItems="center" alignContent="center" xs={12}> - <Grid item> - <Typography variant='h4'> - {name} - </Typography> - </Grid> - <Grid item> - <Link to={'/admin/Ratings'} style={{textDecoration: 'none'}}> - <Button - onClick={props.BackToList} - startIcon={<ListRoundedIcon />} - variant='outlined' - color='primary' - > - Listar - </Button> - </Link> - </Grid> + return ( + <Card> + <SnackBar + severity={snackInfo.icon} + text={snackInfo.message} + snackbarOpen={snackInfo.open} + color={snackInfo.color} + handleClose={() => setSnackInfo({ + message: '', + icon: '', + open: false, + color: '' + })} + /> + <CardContent> + <Grid container direction='row' justify='space-between' alignItems="center" alignContent="center" xs={12}> + <Grid item> + <Typography variant='h4'> + {name} + </Typography> + </Grid> + <Grid item> + <Link to={'/admin/Ratings'} style={{textDecoration: 'none'}}> + <Button + onClick={props.BackToList} + startIcon={<ListRoundedIcon />} + variant='outlined' + color='primary' + > + Listar + </Button> + </Link> </Grid> - - <div style={{ height: '1em' }}></div> - - <form style={{ display: 'flex', flexDirection: 'column' }}> - {fields.map((field, index) => ( - <TextField - key={index} - required={field.required} - error={field.error} - helperText={field.error ? field.errorMessage : ''} - style={{ width: '250px', marginBottom: '1em' }} - label={field.label} - value={field.value} - onChange={field.onChange} - type="search" - multiline={true} - /> - ))} - </form> - </CardContent> - <CardAction> - <Button - onClick={() => { - onSubmit(); - }} - variant="contained" - color="primary" - disabled={isLoading} - startIcon={isLoading ? null : <AddRoundedIcon />} - > - { - isLoading ? <CircularProgress size={24} /> : 'Adicionar' - } - </Button> - </CardAction> - </Card> - ); - } else return <Unauthorized/> + </Grid> + + <div style={{ height: '1em' }}></div> + + <form style={{ display: 'flex', flexDirection: 'column' }}> + {fields.map((field, index) => ( + <TextField + key={index} + required={field.required} + error={field.error} + helperText={field.error ? field.errorMessage : ''} + style={{ width: '250px', marginBottom: '1em' }} + label={field.label} + value={field.value} + onChange={field.onChange} + type="search" + multiline={true} + /> + ))} + </form> + </CardContent> + <CardAction> + <Button + onClick={() => { + onSubmit(); + }} + variant="contained" + color="primary" + disabled={isLoading} + startIcon={isLoading ? null : <AddRoundedIcon />} + > + { + isLoading ? <CircularProgress size={24} /> : 'Adicionar' + } + </Button> + </CardAction> + </Card> + ); } export default CreateRating; \ No newline at end of file diff --git a/src/Admin/Components/Components/Inputs/CreateRole.js b/src/Admin/Components/Components/Inputs/CreateRole.js index 94afb02479f83a1f9830f659c77d478247a62c26..421c8174d7bde52a2abed8ae1249c48f4e01c228 100644 --- a/src/Admin/Components/Components/Inputs/CreateRole.js +++ b/src/Admin/Components/Components/Inputs/CreateRole.js @@ -16,7 +16,7 @@ GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with Plataforma Integrada MEC. If not, see <http://www.gnu.org/licenses/>.*/ -import React, { useState, useContext } from 'react'; +import React, { useState } from 'react'; //imports material ui componets import Card from "@material-ui/core/Card"; import CardContent from "@material-ui/core/CardContent"; @@ -27,14 +27,11 @@ import AddRoundedIcon from '@material-ui/icons/AddRounded'; import ListRoundedIcon from '@material-ui/icons/ListRounded'; //imports local files import SnackBar from '../../../../Components/SnackbarComponent'; -import { Store } from '../../../../Store'; import { postRequest } from '../../../../Components/HelperFunctions/getAxiosConfig' //router import { Link } from 'react-router-dom'; -import Unauthorized from '../Unauthorized'; const CreateRole = (props) => { - const { state } = useContext(Store); const [name, setName] = useState('Nova role'); const [desc, setDesc] = useState(''); @@ -90,23 +87,6 @@ const CreateRole = (props) => { }) } - const CheckUserPermission = () => { - let canUserEdit = false; - - if (state.userIsLoggedIn) { - const roles = [...state.currentUser.roles]; - for (let i = 0; i < roles.length; i++) - if (roles[i].name === 'admin' || roles[i].name === 'editor') - canUserEdit = true; - } - else { - canUserEdit = false; - } - - return canUserEdit; - } - - //Handle submit async function onSubmit() { setIsLoading(true) @@ -170,79 +150,77 @@ const CreateRole = (props) => { } ] - if (CheckUserPermission()) { - return ( - <Card> - <SnackBar - severity={snackInfo.icon} - text={snackInfo.message} - snackbarOpen={snackInfo.open} - color={snackInfo.color} - handleClose={() => setSnackInfo({ - message: '', - icon: '', - open: false, - color: '' - })} - /> - <CardContent> - <Grid container direction='row' justify='space-between' alignItems="center" alignContent="center" xs={12}> - <Grid item> - <Typography variant='h4'> - {name} - </Typography> - </Grid> - <Grid item> - <Link to={'/admin/permissions'} style={{ textDecoration: 'none' }}> - <Button - onClick={props.BackToList} - startIcon={<ListRoundedIcon />} - variant='outlined' - color='primary' - > - Listar - </Button> - </Link> - </Grid> + return ( + <Card> + <SnackBar + severity={snackInfo.icon} + text={snackInfo.message} + snackbarOpen={snackInfo.open} + color={snackInfo.color} + handleClose={() => setSnackInfo({ + message: '', + icon: '', + open: false, + color: '' + })} + /> + <CardContent> + <Grid container direction='row' justify='space-between' alignItems="center" alignContent="center" xs={12}> + <Grid item> + <Typography variant='h4'> + {name} + </Typography> </Grid> - - <div style={{ height: '1em' }}></div> - - <form style={{ display: 'flex', flexDirection: 'column' }}> - {fields.map((field, index) => ( - <TextField - key={index} - required={field.required} - error={field.error} - helperText={field.error ? field.errorMessage : ''} - style={{ width: '250px', marginBottom: '1em' }} - label={field.label} - value={field.value} - onChange={field.onChange} - type="search" - multiline={true} - /> - ))} - </form> - </CardContent> - <CardAction> - <Button - onClick={() => { - onSubmit(); - }} - variant="contained" - color="primary" - disabled={isLoading} - startIcon={isLoading ? null : <AddRoundedIcon />} - > - { - isLoading ? <CircularProgress size={24} /> : 'Adicionar' - } - </Button> - </CardAction> - </Card> - ) - } else return <Unauthorized /> + <Grid item> + <Link to={'/admin/permissions'} style={{ textDecoration: 'none' }}> + <Button + onClick={props.BackToList} + startIcon={<ListRoundedIcon />} + variant='outlined' + color='primary' + > + Listar + </Button> + </Link> + </Grid> + </Grid> + + <div style={{ height: '1em' }}></div> + + <form style={{ display: 'flex', flexDirection: 'column' }}> + {fields.map((field, index) => ( + <TextField + key={index} + required={field.required} + error={field.error} + helperText={field.error ? field.errorMessage : ''} + style={{ width: '250px', marginBottom: '1em' }} + label={field.label} + value={field.value} + onChange={field.onChange} + type="search" + multiline={true} + /> + ))} + </form> + </CardContent> + <CardAction> + <Button + onClick={() => { + onSubmit(); + }} + variant="contained" + color="primary" + disabled={isLoading} + startIcon={isLoading ? null : <AddRoundedIcon />} + > + { + isLoading ? <CircularProgress size={24} /> : 'Adicionar' + } + </Button> + </CardAction> + </Card> + ) } export default CreateRole; \ No newline at end of file diff --git a/src/Admin/Components/Components/Inputs/EditCollection.js b/src/Admin/Components/Components/Inputs/EditCollection.js index 13aabcf16dac0ebc5f77ca965b60cfa6b5508395..4085a706c6340140fc4bd4c5f53b02620dfe45af 100644 --- a/src/Admin/Components/Components/Inputs/EditCollection.js +++ b/src/Admin/Components/Components/Inputs/EditCollection.js @@ -16,7 +16,7 @@ GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with Plataforma Integrada MEC. If not, see <http://www.gnu.org/licenses/>.*/ -import React, { useState, useEffect, useContext } from 'react'; +import React, { useState, useEffect } from 'react'; //imports material ui components import { Typography, TextField, Button, Grid } from '@material-ui/core'; import CircularProgress from '@material-ui/core/CircularProgress'; @@ -28,9 +28,7 @@ import SaveIcon from '@material-ui/icons/Save'; import MenuItem from "@material-ui/core/MenuItem"; //imports local files import SnackBar from '../../../../Components/SnackbarComponent'; -import Unauthorized from '../Unauthorized'; import { getRequest, putRequest } from '../../../../Components/HelperFunctions/getAxiosConfig' -import { Store } from '../../../../Store'; import LoadingSpinner from '../../../../Components/LoadingSpinner'; import { EditFilter, GetAData } from '../../../Filters'; //routers @@ -39,7 +37,7 @@ import ClassicEditor from "@ckeditor/ckeditor5-build-classic" import { CKEditor } from '@ckeditor/ckeditor5-react'; const EditCollection = () => { - const { state } = useContext(Store); + const urlParams = new URLSearchParams(window.location.search); const id = urlParams.get("collection"); @@ -120,22 +118,6 @@ const EditCollection = () => { }) } - const CheckUserPermission = () => { - let canUserEdit = false; - - if (state.userIsLoggedIn) { - const roles = [...state.currentUser.roles]; - for (let i = 0; i < roles.length; i++) - if (roles[i].name === 'admin' || roles[i].name === 'editor') - canUserEdit = true; - } - else { - canUserEdit = false; - } - - return canUserEdit; - } - const onSubmit = async () => { setIsLoading(true) const api = EditFilter('collections', id) @@ -186,7 +168,7 @@ const EditCollection = () => { return <div> Houve um erro... </div> } else if (!isLoaded) { return <LoadingSpinner text="Carregando..." /> - } else if (CheckUserPermission()) { + } else { return ( <Card> <SnackBar @@ -286,7 +268,7 @@ const EditCollection = () => { </CardAction> </Card> ) - } else return <Unauthorized /> + } } export default EditCollection; \ No newline at end of file diff --git a/src/Admin/Components/Components/Inputs/EditEducationalObect.js b/src/Admin/Components/Components/Inputs/EditEducationalObect.js index 5996383029e0fc08a2b770c8fe7aa32a6b6f2b9e..45a74427b0c47dc16dd3014b74606cb3f5a439ca 100644 --- a/src/Admin/Components/Components/Inputs/EditEducationalObect.js +++ b/src/Admin/Components/Components/Inputs/EditEducationalObect.js @@ -16,7 +16,7 @@ GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with Plataforma Integrada MEC. If not, see <http://www.gnu.org/licenses/>.*/ -import React, { useState, useEffect, useContext } from "react"; +import React, { useState, useEffect } from "react"; import PropTypes from "prop-types"; import SwipeableViews from "react-swipeable-views"; import moment from "moment"; @@ -36,8 +36,6 @@ import Box from "@material-ui/core/Box"; import SaveIcon from "@material-ui/icons/Save"; //imports local files import SnackBar from "../../../../Components/SnackbarComponent"; -import { Store } from "../../../../Store"; -import Unauthorized from "../Unauthorized"; import LoadingSpinner from "../../../../Components/LoadingSpinner"; import { fetchAllRequest, @@ -63,7 +61,6 @@ const useStyles = makeStyles((theme) => ({ let text; const EditEducationalObject = () => { - const { state } = useContext(Store); const urlParams = new URLSearchParams(window.location.search); const id = urlParams.get("learnObj"); @@ -382,21 +379,6 @@ const EditEducationalObject = () => { }, ]; - const CheckUserPermission = () => { - let canUserEdit = false; - - if (state.userIsLoggedIn) { - const roles = [...state.currentUser.roles]; - for (let i = 0; i < roles.length; i++) - if (roles[i].name === "admin" || roles[i].name === "editor") - canUserEdit = true; - } else { - canUserEdit = false; - } - - return canUserEdit; - }; - useEffect(() => { const urls = [ `/learning_objects/${id}`, @@ -446,7 +428,7 @@ const EditEducationalObject = () => { return <div> Houve um erro... </div>; } else if (!isLoaded) { return <LoadingSpinner text="Carregando..." />; - } else if (CheckUserPermission()) { + } else { return ( <Card variant="outlined"> <SnackBar @@ -627,7 +609,7 @@ const EditEducationalObject = () => { </CardAction> </Card> ); - } else return <Unauthorized />; + } }; export default EditEducationalObject; diff --git a/src/Admin/Components/Components/Inputs/EditLanguage.js b/src/Admin/Components/Components/Inputs/EditLanguage.js index 44df71ceed76a2846983700ced3f66f60143e7e4..c0b71d0ac7607fc968c0fd10145c8be363ad947d 100644 --- a/src/Admin/Components/Components/Inputs/EditLanguage.js +++ b/src/Admin/Components/Components/Inputs/EditLanguage.js @@ -16,7 +16,7 @@ GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with Plataforma Integrada MEC. If not, see <http://www.gnu.org/licenses/>.*/ -import React, { useState, useEffect, useContext } from 'react'; +import React, { useState, useEffect } from 'react'; //imports material ui components import { Typography, TextField, Button, Grid, ButtonGroup } from '@material-ui/core'; import CircularProgress from '@material-ui/core/CircularProgress'; @@ -27,7 +27,6 @@ import ListRoundedIcon from '@material-ui/icons/ListRounded'; import SaveIcon from '@material-ui/icons/Save'; //imports local files import SnackBar from '../../../../Components/SnackbarComponent'; -import { Store } from '../../../../Store'; import LoadingSpinner from '../../../../Components/LoadingSpinner'; //imports services import { getRequest, putRequest, deleteRequest } from '../../../../Components/HelperFunctions/getAxiosConfig' @@ -35,10 +34,9 @@ import { EditFilter, GetAData, DeleteFilter } from '../../../Filters'; import DeleteRoundedIcon from "@material-ui/icons/DeleteRounded"; //routers import { Link, useHistory } from 'react-router-dom'; -import Unauthorized from '../Unauthorized'; const EditLanguage = () => { - const { state } = useContext(Store); + let history = useHistory() const urlParams = new URLSearchParams(window.location.search); const id = urlParams.get("language"); @@ -147,23 +145,6 @@ const EditLanguage = () => { }) } - const CheckUserPermission = () => { - let canUserEdit = false; - - if (state.userIsLoggedIn) { - const roles = [...state.currentUser.roles]; - for (let i = 0; i < roles.length; i++) - if (roles[i].name === 'admin' || roles[i].name === 'editor') - canUserEdit = true; - } - else { - canUserEdit = false; - } - - return canUserEdit; - } - - const onSubmit = async () => { setIsLoading(true) const api = EditFilter('languages', id) @@ -232,7 +213,7 @@ const EditLanguage = () => { return <div> Houve um erro... </div> } else if (!isLoaded) { return <LoadingSpinner text="Carregando..." /> - } else if (CheckUserPermission()) { + } else { return ( <Card> <SnackBar @@ -310,7 +291,7 @@ const EditLanguage = () => { </CardAction> </Card> ) - } else return <Unauthorized /> + } } export default EditLanguage; \ No newline at end of file diff --git a/src/Admin/Components/Components/Inputs/EditRating.js b/src/Admin/Components/Components/Inputs/EditRating.js index 1b8e0e6fd7c2c054f389dd7f62316778c4aebfa1..e4e08aa1025b55885a18bd257529cfe47e647c31 100644 --- a/src/Admin/Components/Components/Inputs/EditRating.js +++ b/src/Admin/Components/Components/Inputs/EditRating.js @@ -16,7 +16,7 @@ GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with Plataforma Integrada MEC. If not, see <http://www.gnu.org/licenses/>.*/ -import React, { useState, useEffect, useContext } from 'react'; +import React, { useState, useEffect } from 'react'; //imports material ui components import { Typography, TextField, Button, Grid } from '@material-ui/core'; import CircularProgress from '@material-ui/core/CircularProgress'; @@ -27,17 +27,15 @@ import ListRoundedIcon from '@material-ui/icons/ListRounded'; import SaveIcon from '@material-ui/icons/Save'; //imports local files import SnackBar from '../../../../Components/SnackbarComponent'; -import { Store } from '../../../../Store'; import LoadingSpinner from '../../../../Components/LoadingSpinner'; //imports services import { getRequest, putRequest } from '../../../../Components/HelperFunctions/getAxiosConfig' import { EditFilter, GetAData } from '../../../Filters'; //routers import { Link } from 'react-router-dom'; -import Unauthorized from '../Unauthorized'; const EditRating = () => { - const { state } = useContext(Store); + const urlParams = new URLSearchParams(window.location.search); const id = urlParams.get("rating"); @@ -131,23 +129,6 @@ const EditRating = () => { }) } - const CheckUserPermission = () => { - let canUserEdit = false; - - if (state.userIsLoggedIn) { - const roles = [...state.currentUser.roles]; - for (let i = 0; i < roles.length; i++) - if (roles[i].name === 'admin' || roles[i].name === 'editor') - canUserEdit = true; - } - else { - canUserEdit = false; - } - - return canUserEdit; - } - - const onSubmit = async () => { setIsLoading(true) if (!isEmpty(name) && !isEmpty(description)) { @@ -211,7 +192,7 @@ const EditRating = () => { return <div> Houve um erro... </div> } else if (!isLoaded) { return <LoadingSpinner text="Carregando..." /> - } else if (CheckUserPermission()) { + } else { return ( <Card> <SnackBar @@ -283,7 +264,7 @@ const EditRating = () => { </CardAction> </Card> ) - } else return <Unauthorized /> + } } export default EditRating; \ No newline at end of file diff --git a/src/Admin/Components/Components/Inputs/EditRoles.js b/src/Admin/Components/Components/Inputs/EditRoles.js index 4b3aa488a8d6f8d2334d29a55680b49ed8020787..c9c49f583904b97a920884d0539c8834cc5d698c 100644 --- a/src/Admin/Components/Components/Inputs/EditRoles.js +++ b/src/Admin/Components/Components/Inputs/EditRoles.js @@ -16,7 +16,7 @@ GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with Plataforma Integrada MEC. If not, see <http://www.gnu.org/licenses/>.*/ -import React, { useState, useEffect, useContext } from 'react'; +import React, { useState, useEffect } from 'react'; //imports material ui components import { Typography, TextField, Button, Grid } from '@material-ui/core'; import CircularProgress from '@material-ui/core/CircularProgress'; @@ -29,17 +29,14 @@ import ButtonGroup from "@material-ui/core/ButtonGroup"; import DeleteRoundedIcon from "@material-ui/icons/DeleteRounded"; //imports local files import SnackBar from '../../../../Components/SnackbarComponent'; -import { Store } from '../../../../Store'; import LoadingSpinner from '../../../../Components/LoadingSpinner'; //imports services import { getRequest, putRequest, deleteRequest } from '../../../../Components/HelperFunctions/getAxiosConfig' import { EditFilter, GetAData, DeleteFilter } from '../../../Filters'; //routers import { Link, useHistory } from 'react-router-dom'; -import Unauthorized from '../Unauthorized'; const EditLanguage = () => { - const { state } = useContext(Store); let history = useHistory() const urlParams = new URLSearchParams(window.location.search); const id = urlParams.get("role"); @@ -125,23 +122,6 @@ const EditLanguage = () => { }, ] - const CheckUserPermission = () => { - let canUserEdit = false; - - if (state.userIsLoggedIn) { - const roles = [...state.currentUser.roles]; - for (let i = 0; i < roles.length; i++) - if (roles[i].name === 'admin' || roles[i].name === 'editor') - canUserEdit = true; - } - else { - canUserEdit = false; - } - - return canUserEdit; - } - - const onSubmit = async () => { setIsLoading(true) const api = EditFilter('roles', id) @@ -226,7 +206,7 @@ const EditLanguage = () => { return <div> Houve um erro... </div> } else if (!isLoaded) { return <LoadingSpinner text="Carregando..." /> - } else if (CheckUserPermission()) { + } else { return ( <Card> <SnackBar @@ -304,7 +284,7 @@ const EditLanguage = () => { </CardAction> </Card> ) - } else return <Unauthorized /> + } } export default EditLanguage; \ No newline at end of file diff --git a/src/Admin/Components/Components/Inputs/EditUser.js b/src/Admin/Components/Components/Inputs/EditUser.js index fe9a61c8931170c9685afa20e5a1ac118d569511..d0953435a8c1565451e85f4ca468fe14d83392fb 100644 --- a/src/Admin/Components/Components/Inputs/EditUser.js +++ b/src/Admin/Components/Components/Inputs/EditUser.js @@ -16,7 +16,7 @@ GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with Plataforma Integrada MEC. If not, see <http://www.gnu.org/licenses/>.*/ -import React, { useState, useEffect, useContext } from 'react'; +import React, { useState, useEffect } from 'react'; //imports material ui components import { Typography, TextField, Button, Grid } from '@material-ui/core'; import CircularProgress from '@material-ui/core/CircularProgress'; @@ -34,14 +34,12 @@ import AddRoundedIcon from '@material-ui/icons/AddRounded'; import MenuItem from '@material-ui/core/MenuItem'; //imports local files import SnackBar from '../../../../Components/SnackbarComponent'; -import { Store } from '../../../../Store'; import LoadingSpinner from '../../../../Components/LoadingSpinner'; //imports services import { getRequest, putRequest, deleteRequest, postRequest } from '../../../../Components/HelperFunctions/getAxiosConfig' import { EditFilter, GetAData } from '../../../Filters'; //routers import { Link, useHistory } from 'react-router-dom'; -import Unauthorized from '../Unauthorized'; const useStyles = makeStyles((theme) => ({ root: { @@ -60,7 +58,7 @@ const useStyles = makeStyles((theme) => ({ const EditUser = () => { const classes = useStyles(); let history = useHistory(); - const { state } = useContext(Store) + const urlParams = new URLSearchParams(window.location.search); const id = urlParams.get("id"); @@ -262,22 +260,6 @@ const EditUser = () => { }) } - const CheckUserPermission = () => { - let canUserEdit = false; - - if (state.userIsLoggedIn) { - const roles = [...state.currentUser.roles]; - for (let i = 0; i < roles.length; i++) - if (roles[i].name === 'admin' || roles[i].name === 'editor') - canUserEdit = true; - } - else { - canUserEdit = false; - } - - return canUserEdit; - } - const handleDelete = (chipToDelete) => () => { const currRolesList = [...rolesList]; currRolesList.push({ @@ -482,7 +464,7 @@ const EditUser = () => { return <div> Houve um erro... </div> } else if (!isLoaded) { return <LoadingSpinner text="Carregando..." /> - } else if (CheckUserPermission()) { + } else { return ( <Card> <SnackBar @@ -621,7 +603,7 @@ const EditUser = () => { </CardAction> </Card> ) - } else return <Unauthorized /> + } } export default EditUser; diff --git a/src/Admin/Components/Components/Inputs/IntitutionsInputs.js b/src/Admin/Components/Components/Inputs/IntitutionsInputs.js index ca1ea9dfb454b6cf7275e47b33f9b6da8cd2b212..874879d4c095fd1e9cfeee7279d7898621106081 100644 --- a/src/Admin/Components/Components/Inputs/IntitutionsInputs.js +++ b/src/Admin/Components/Components/Inputs/IntitutionsInputs.js @@ -16,7 +16,7 @@ GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with Plataforma Integrada MEC. If not, see <http://www.gnu.org/licenses/>.*/ -import React, { useState, useEffect, useContext } from 'react'; +import React, { useState, useEffect } from 'react'; //imports material ui components import { TextField, Button } from '@material-ui/core'; import CircularProgress from '@material-ui/core/CircularProgress'; @@ -27,9 +27,7 @@ import Typography from "@material-ui/core/Typography"; import ListRoundedIcon from "@material-ui/icons/ListRounded"; import Grid from "@material-ui/core/Grid"; //imports local files -import Unauthorized from '../Unauthorized'; import SnackBar from '../../../../Components/SnackbarComponent'; -import { Store } from '../../../../Store'; import LoadingSpinner from '../../../../Components/LoadingSpinner'; //imports services import { putRequest, getRequest } from '../../../../Components/HelperFunctions/getAxiosConfig' @@ -38,7 +36,7 @@ import { EditFilter, GetAData } from '../../../Filters'; import { Link } from 'react-router-dom'; const EditInstitution = () => { - const { state } = useContext(Store); + const urlParams = new URLSearchParams(window.location.search); const id = urlParams.get("institution"); @@ -109,22 +107,6 @@ const EditInstitution = () => { }) } - const CheckUserPermission = () => { - let canUserEdit = false; - - if (state.userIsLoggedIn) { - const roles = [...state.currentUser.roles]; - for (let i = 0; i < roles.length; i++) - if (roles[i].name === 'admin' || roles[i].name === 'editor') - canUserEdit = true; - } - else { - canUserEdit = false; - } - - return canUserEdit; - } - //Handle submit async function onSubmit() { setIsLoading(true) @@ -234,7 +216,7 @@ const EditInstitution = () => { return <div> Erro... </div> } else if (!isLoaded) { return <LoadingSpinner text="Carregando..." /> - } else if (CheckUserPermission()) { + } else { return ( <Card> <SnackBar @@ -313,8 +295,6 @@ const EditInstitution = () => { </CardContent> </Card> ); - } else { - return <Unauthorized /> } } diff --git a/src/Admin/Components/Components/Inputs/NoteVarInputs.js b/src/Admin/Components/Components/Inputs/NoteVarInputs.js index 3c1542ec851b700c0b53755592659fd2a7f9cd21..96b951f99289e01ce4f3d6dc0a7e2a3db44678f9 100644 --- a/src/Admin/Components/Components/Inputs/NoteVarInputs.js +++ b/src/Admin/Components/Components/Inputs/NoteVarInputs.js @@ -16,7 +16,7 @@ GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with Plataforma Integrada MEC. If not, see <http://www.gnu.org/licenses/>.*/ -import React, { useState, useEffect, useContext } from 'react'; +import React, { useState, useEffect } from 'react'; //imports material ui components import { TextField, Button } from '@material-ui/core'; import CircularProgress from '@material-ui/core/CircularProgress'; @@ -28,17 +28,15 @@ import ListRoundedIcon from "@material-ui/icons/ListRounded"; import Grid from '@material-ui/core/Grid'; //imports local files import SnackBar from '../../../../Components/SnackbarComponent'; -import { Store } from '../../../../Store'; import LoadingSpinner from '../../../../Components/LoadingSpinner'; //imports services import { getRequest, putRequest } from '../../../../Components/HelperFunctions/getAxiosConfig' import { EditFilter, GetAData } from '../../../Filters'; //Routers import { Link } from 'react-router-dom'; -import Unauthorized from '../Unauthorized'; const NoteVarInputs = () => { - const { state } = useContext(Store); + const urlParams = new URLSearchParams(window.location.search); const id = urlParams.get("id"); @@ -202,23 +200,6 @@ const NoteVarInputs = () => { ) } - const CheckUserPermission = () => { - let canUserEdit = false; - - if (state.userIsLoggedIn) { - const roles = [...state.currentUser.roles]; - for (let i = 0; i < roles.length; i++) - if (roles[i].name === 'admin' || roles[i].name === 'editor') - canUserEdit = true; - } - else { - canUserEdit = false; - } - - return canUserEdit; - } - - useEffect(() => { getRequest( GetAData("scores", id), @@ -239,7 +220,7 @@ const NoteVarInputs = () => { return <div>Houve um erro...</div> } else if (!isLoaded) { return <LoadingSpinner text="Carregando..." /> - } else if (CheckUserPermission()) { + } else { return ( <Card> <SnackBar @@ -316,7 +297,7 @@ const NoteVarInputs = () => { </CardContent> </Card> ) - } else return <Unauthorized /> + } } export default NoteVarInputs; \ No newline at end of file diff --git a/src/Components/Carousel.js b/src/Components/Carousel.js index 0240cef58f00934043c48257a7532c78f61037a6..ccad2bc64a51897a83da7575deb2ef8b28878bb0 100644 --- a/src/Components/Carousel.js +++ b/src/Components/Carousel.js @@ -17,14 +17,12 @@ You should have received a copy of the GNU Affero General Public License along with Plataforma Integrada MEC. If not, see <http://www.gnu.org/licenses/>.*/ -import React, { Component } from 'react'; +import React from 'react'; import "react-responsive-carousel/lib/styles/carousel.min.css"; import { Carousel } from 'react-responsive-carousel'; import styled from 'styled-components'; import Grid from '@material-ui/core/Grid'; - - /*Importação de imagens para o componente*/ import Handshake from "../img/termos/handshake.svg" import Pessoa from "../img/termos/Pessoa.svg" @@ -47,613 +45,603 @@ import { OrthogonalLineDown } from "ImportImages.js"; const Slide = styled.div` -position: absolute; -height: 500px; -width: 1366px; - -h2{ - font-family: "Pompiere", regular; - font-size: 44px; - line-height: 120%; - color: #FFFFFF; -} - -h3{ - font-family: "Roboto", regular; - font-size: 27px; - line-height: 120%; - color: #FFFFFF; -} - -p{ - font-family: "Roboto", regular; - font-size: 20px; - line-height: 120%; - color: #FFFFFF; - text-align: left; -} - -.container{ - position: absolute; - height: auto; - width: auto; - margin: 70px 180px 90px; -} - - -.tmpl1{ - background: ${props => props.contrast === "" ? "#00BCD4" : "black"}; - height: inherit; - width: inherit; - display: flex; - align-items: center; - - - .box-text{ - position: relative; - float: left; - padding-right: 10px; - padding-left: 10px; - - p { - margin: 0 0 10px; - } - } - - .box-image{ - position: relative; - float: right; - } -} - -.tmpl2{ - height: inherit; - width: inherit; - display: flex; - align-items: center; - background: ${props => props.contrast === "" ? "#673AB7" : "black"}; - - .title{ - padding-bottom: 50px; - } - - .images{ position: absolute; - display: table-row; - } + height: 500px; + width: 1366px; - .arrow{ - display: table-row; - position: absolute; - margin-left: 55px; - margin-top: -15px; - width: 282px; - } - - .circle{ - display: table-row; - position: absolute; - margin-top: -100px; - margin-left: 795px; - width: 191px; - } - - h2 { - margin-top: 20px; - margin-bottom: 10px; - font-weight: 500; - } - - .box-text{ - p{ - font-size: 18px; - line-height: 25px; + h2{ + font-family: "Pompiere", regular; + font-size: 44px; + line-height: 120%; + color: #FFFFFF; } - position: relative; - - } - - -} - -.tmpl3{ - height: inherit; - width: inherit; - display: flex; - align-items: center; - background: ${props => props.contrast === "" ? "#E81F4F" : "black"}; - - .title{ - position: relative; - padding-left: 10px; h3{ - line-height: 40px; + font-family: "Roboto", regular; + font-size: 27px; + line-height: 120%; + color: #FFFFFF; } - } - .box-text1{ - .text{ - padding-top: 20px; + p{ + font-family: "Roboto", regular; + font-size: 20px; + line-height: 120%; + color: #FFFFFF; + text-align: left; } - .content{ - display: table-row; - - p{ - display: table-cell; - font-size: 18px; - line-height: 25px; - vertical-align: middle; - } - - img{ - position: relative; - left: 0; - margin-right: 20px; - display: table-cell; - vertical-align: middle; - margin: 10px 20px 10px -10px; - } + .container{ + position: absolute; + height: auto; + width: auto; + margin: 70px 180px 90px; } - } - .box-text2{ - top: -50px; - .content{ - p{ - padding-bottom: 20px; - } - - img{ - margin-left: -65px; - margin-top: 25px; - } - - .twoArrow{ - margin-top: -5px; - } + .tmpl1{ + background: ${props => props.contrast === "" ? "#00BCD4" : "black"}; + height: inherit; + width: inherit; + display: flex; + align-items: center; + + .box-text{ + position: relative; + float: left; + padding-right: 10px; + padding-left: 10px; + + p { + margin: 0 0 10px; + } + } + + .box-image{ + position: relative; + float: right; + } } + .tmpl2{ + height: inherit; + width: inherit; + display: flex; + align-items: center; + background: ${props => props.contrast === "" ? "#673AB7" : "black"}; + + .title{ + padding-bottom: 50px; + } + + .images{ + position: absolute; + display: table-row; + } + + .arrow{ + display: table-row; + position: absolute; + margin-left: 55px; + margin-top: -15px; + width: 282px; + } + + .circle{ + display: table-row; + position: absolute; + margin-top: -100px; + margin-left: 795px; + width: 191px; + } + + h2 { + margin-top: 20px; + margin-bottom: 10px; + font-weight: 500; + } + + .box-text{ + p{ + font-size: 18px; + line-height: 25px; + } + + position: relative; + + } + } - } - - - -} - -.tmpl4{ - height: inherit; - width: inherit; - display: flex; - align-items: center; - background: ${props => props.contrast === "" ? "#FF7F00" : "black"}; - - h2{ - padding-bottom: 20px; - } - - p{ - font-size: 20px; - line-height: 25px; - vertical-align: middle; - } + .tmpl3{ + height: inherit; + width: inherit; + display: flex; + align-items: center; + background: ${props => props.contrast === "" ? "#E81F4F" : "black"}; + + .title{ + position: relative; + padding-left: 10px; + h3{ + line-height: 40px; + } + } + + .box-text1{ + .text{ + padding-top: 20px; + } + + .content{ + display: table-row; + + p{ + display: table-cell; + font-size: 18px; + line-height: 25px; + vertical-align: middle; + } + + img{ + position: relative; + left: 0; + margin-right: 20px; + display: table-cell; + vertical-align: middle; + margin: 10px 20px 10px -10px; + } + + } + } + + .box-text2{ + top: -50px; + .content{ + p{ + padding-bottom: 20px; + } + + img{ + margin-left: -65px; + margin-top: 25px; + } + + .twoArrow{ + margin-top: -5px; + } + } + } + } - .box-images{ - height: inherit; - display: table-row; - padding-top: 50px; - } + .tmpl4{ + height: inherit; + width: inherit; + display: flex; + align-items: center; + background: ${props => props.contrast === "" ? "#FF7F00" : "black"}; - img{ - display: table-cell; - vertical-align: middle; - top: 40px; - } + h2{ + padding-bottom: 20px; + } + p{ + font-size: 20px; + line-height: 25px; + vertical-align: middle; + } -} + .box-images{ + height: inherit; + display: table-row; + padding-top: 50px; + } -.tmpl5{ - height: inherit; - width: inherit; - display: flex; - align-items: center; - background: ${props => props.contrast === "" ? "#1AB9DE" : "black"}; + img{ + display: table-cell; + vertical-align: middle; + top: 40px; + } - .title{ - display: table-row; - align-items: center; - img{ - display: table-cell; - margin-right: 30px; } - h2{ - display: table-cell; - text-align: center; - vertical-align: middle; - } - } + .tmpl5{ + height: inherit; + width: inherit; + display: flex; + align-items: center; + background: ${props => props.contrast === "" ? "#1AB9DE" : "black"}; + + .title{ + display: table-row; + align-items: center; + + img{ + display: table-cell; + margin-right: 30px; + } + + h2{ + display: table-cell; + text-align: center; + vertical-align: middle; + } + } + + .box-text { + margin-top: 20px; + p{ + font-size: 17px; + font-weight: 15px; + } + } - .box-text { - margin-top: 20px; - p{ - font-size: 17px; - font-weight: 15px; } - } - -} -.tmpl6{ - height: inherit; - width: inherit; - display: flex; - align-items: center; - background: ${props => props.contrast === "" ? "#673AB7" : "black"}; + .tmpl6{ + height: inherit; + width: inherit; + display: flex; + align-items: center; + background: ${props => props.contrast === "" ? "#673AB7" : "black"}; + + .box-text-1{ + h3{ + margin-bottom: 20px; + font-size: 27px; + } + p{ + margin-bottom: 20px; + font-size: 18px; + margin-top: 0px; + } + + + .licences{ + padding: 35px 150px 50px 35px; + margin-top: 50pz; + background-image: url(${Entenda}); + background-repeat: no-repeat; + background-size: cover; + p::before{ + content: url(${V}); + } + p{ + padding-left: 20px; + font-family: "Kalam", regular; + font-size: 24px; + white-space: nowrap; + } + .row{ + padding-bottom: 5px; + } + } + } + + + .box-text-2{ + background-image: url(${OrthogonalLineUp}),url(${OrthogonalLineDown}); + background-repeat: no-repeat; + background-position: left top, right bottom; + padding-top: 30px; + padding-left: 50px; + p{ + font-size: 15px; + padding-bottom: 15px; + } + + .licenses_type{ + margin-left: -20px; + font-size: 22px; + font-weight: bold; + text-align: right; + white-space: nowrap; + } + .row { + margin-right: -15px; + margin-left: -15px; + + p { + padding-left: 15px; + } + } + } - .box-text-1{ - h3{ - margin-bottom: 20px; - font-size: 27px; } - p{ - margin-bottom: 20px; - font-size: 18px; - margin-top: 0px; - } - - .licences{ - padding: 35px 150px 50px 35px; - margin-top: 50pz; - background-image: url(${Entenda}); - background-repeat: no-repeat; - background-size: cover; - p::before{ - content: url(${V}); - } - p{ - padding-left: 20px; - font-family: "Kalam", regular; - font-size: 24px; - white-space: nowrap; - } - .row{ - padding-bottom: 5px; - - - } + .tmpl7{ + height: inherit; + width: inherit; + display: flex; + align-items: center; + background: ${props => props.contrast === "" ? "#E81F4F" : "black"}; + + .title{ + h2{ + font-family: Roboto; + font-size: 44px; + } + } + + .box-text{ + margin-top: 20px; + p{ + line-height: 20px; + font-family: "Roboto"; + font-size: 18px; + } + } + + .rodape{ + margin-top: 40px; + p{ + line-height: 20px; + font-family: "Pompiere", regular; + font-size: 28px; + text-align: center; + } + span{ + text-decoration: underline; + font-family: "Pompiere", regular; + line-height: 20px; + font-size: 28px; + cursor: pointer; + } + } } - } +` - .box-text-2{ - background-image: url(${OrthogonalLineUp}),url(${OrthogonalLineDown}); - background-repeat: no-repeat; - background-position: left top, right bottom; - padding-top: 30px; - padding-left: 50px; - p{ - font-size: 15px; - padding-bottom: 15px; - } +const CarouselStyled = styled(Carousel)` - .licenses_type{ - margin-left: -20px; - font-size: 22px; - font-weight: bold; - text-align: right; - white-space: nowrap; + .carousel.carousel-slider { + height: 500px !important; } - .row { - margin-right: -15px; - margin-left: -15px; - p { - padding-left: 15px; - } + .carousel .slider-wrapper.axis-horizontal { + height: 500px !important; } - } - -} - -.tmpl7{ - height: inherit; - width: inherit; - display: flex; - align-items: center; - background: ${props => props.contrast === "" ? "#E81F4F" : "black"}; - - .title{ - h2{ - font-family: Roboto; - font-size: 44px; + .carousel .control-dots { + position: absolute !important; + padding-bottom: 20px; } - } - .box-text{ - margin-top: 20px; - p{ - line-height: 20px; - font-family: "Roboto"; - font-size: 18px; + .carousel .control-arrow:before, .carousel.carousel-slider .control-arrow:before { + margin: 0 5px; + display: inline-block; + border-top: 8px solid transparent; + border-bottom: 8px solid transparent; + content: ' '; } - } - - .rodape{ - margin-top: 40px; - p{ - line-height: 20px; - font-family: "Pompiere", regular; - font-size: 28px; - text-align: center; + .carousel .control-arrow { + background: transparent !important; } - span{ - text-decoration: underline; - font-family: "Pompiere", regular; - line-height: 20px; - font-size: 28px; - cursor: pointer; + .m4d-icons { + size: 50px } - } -} - -` - -const CarouselStyled = styled(Carousel)` - - .carousel.carousel-slider { - height: 500px !important; - } - - .carousel .slider-wrapper.axis-horizontal { - height: 500px !important; - } - .carousel .control-dots { - position: absolute !important; - padding-bottom: 20px; - } - - .carousel .control-arrow:before, .carousel.carousel-slider .control-arrow:before { - margin: 0 5px; - display: inline-block; - border-top: 8px solid transparent; - border-bottom: 8px solid transparent; - content: ' '; - } - .carousel .control-arrow { - background: transparent !important; - } - .m4d-icons { - size: 50px - } ` export default function TermsCarousel({ contrast }) { - return ( - <CarouselStyled - showThumbs={false} - showStatus={false} - transitionTime={1000} - - width={"1366px"} - - > - <div > - <Slide contrast={contrast}> - <div className="tmpl1"> - <div className="container"> - <Grid container spacing={0}> - <Grid item xs={6} > - <div className="box-text"> - <p>A Plataforma Integrada MEC RED é parte do Compromisso 6 do 3º Plano de Ação da Parceria para Governo Aberto (OGP-Brasil), que tem por objetivo “incorporar na política educacional o potencial da cultura digital, de modo a fomentar a autonomia para uso, reuso e adaptação de recursos educacionais digitais, valorizando a pluralidade e a diversidade da educação brasileira”.</p> - </div> - </Grid> - <Grid style={{ display: "flex", justifyContent: "center" }} item xs={6}> - <div className="box-image"> - <img src={Handshake} alt="handshake" /> - </div> - </Grid> - </Grid> + return ( + <CarouselStyled + showThumbs={false} + showStatus={false} + transitionTime={1000} + + width={"1366px"} + + > + <div > + <Slide contrast={contrast}> + <div className="tmpl1"> + <div className="container"> + <Grid container spacing={0}> + <Grid item xs={6} > + <div className="box-text"> + <p>A Plataforma Integrada MEC RED é parte do Compromisso 6 do 3º Plano de Ação da Parceria para Governo Aberto (OGP-Brasil), que tem por objetivo “incorporar na política educacional o potencial da cultura digital, de modo a fomentar a autonomia para uso, reuso e adaptação de recursos educacionais digitais, valorizando a pluralidade e a diversidade da educação brasileira”.</p> + </div> + </Grid> + <Grid style={{ display: "flex", justifyContent: "center" }} item xs={6}> + <div className="box-image"> + <img src={Handshake} alt="handshake" /> + </div> + </Grid> + </Grid> + </div> + </div> + </Slide> + </div> - </div> - </Slide> - - </div> - <div> - <Slide contrast={contrast}> - <div className="tmpl2"> - <div className="container"> - <div className="title"> - <h2>O que é a Plataforma Integrada MEC RED e como ela está organizada?</h2> - <div className="images"> - <div className="arrow"> - <img src={Arrow_O} alt="Arrow_O" /> - </div> - <div className="circle"> - <img src={Arrow_O_1} alt="Arrow_O_1" /> - </div> - </div> - </div> - <Grid container> - <Grid className="box-text" item xs={6}> - <p>Uma plataforma interativa, colaborativa e criada em software livre, que disponibiliza conteúdos do acervo do MEC e indica conteúdos de parceiros com o objetivo de formar uma rede ativa de educadores interessados em usar, criar e compartilhar recursos educacionais digitais.</p> - </Grid> - <Grid className="box-text" item xs={6}> - <p><strong>Repositório</strong> de recursos educacionais digitais que permite aos usuários cadastrados a publicação de seus materiais e <strong>Referatório</strong> que aponta links para conteúdos em sites externos.</p> - </Grid> - </Grid> + <div> + <Slide contrast={contrast}> + <div className="tmpl2"> + <div className="container"> + <div className="title"> + <h2>O que é a Plataforma Integrada MEC RED e como ela está organizada?</h2> + <div className="images"> + <div className="arrow"> + <img src={Arrow_O} alt="Arrow_O" /> + </div> + <div className="circle"> + <img src={Arrow_O_1} alt="Arrow_O_1" /> + </div> + </div> + </div> + <Grid container> + <Grid className="box-text" item xs={6}> + <p>Uma plataforma interativa, colaborativa e criada em software livre, que disponibiliza conteúdos do acervo do MEC e indica conteúdos de parceiros com o objetivo de formar uma rede ativa de educadores interessados em usar, criar e compartilhar recursos educacionais digitais.</p> + </Grid> + <Grid className="box-text" item xs={6}> + <p><strong>Repositório</strong> de recursos educacionais digitais que permite aos usuários cadastrados a publicação de seus materiais e <strong>Referatório</strong> que aponta links para conteúdos em sites externos.</p> + </Grid> + </Grid> + </div> + </div> + </Slide> </div> - </div> - </Slide> - </div> - <div> - <Slide contrast={contrast}> - <div className="tmpl3"> - <div className="container"> - <Grid className="title" container spacing={1}> - <Grid item xs={12}> - <h3>Os recursos educacionais disponibilizados<br /> podem ser de dois tipos:</h3> - </Grid> - </Grid> - <Grid className="box-text1" container spacing={1}> - <Grid className="text" item xs={8}> - <div className="content"> - <img src={Aberto} alt="Aberto" /> - <p><strong>Abertos</strong>: recursos sem nenhuma restrição de acesso e<br /> com flexibilidade quanto ao uso ou reuso.</p> - </div> - <div className="content"> - <img src={Fechado} alt="Fechado" /> - <p><strong>Fechados</strong>: recursos com alguma restrição de acesso, uso<br /> ou reuso, como aqueles que, para acesso, há demanda de<br /> cadastro ou que têm licenças restritivas.</p> - </div> - </Grid> - <Grid className="box-text2" item xs={4}> - <div className="content"> - <img src={Arrow_down} alt="Arrow_down" /> - <p>Como repositório, a Plataforma hospeda somente Recursos Educacionais Abertos (REA). Todo conteúdo inserido por usuários deve ser aberto.</p> - </div> - <div className="content"> - <img alt="" className="twoArrow" src={Arrow_double} /> - <p>Como referatório, a Plataforma aponta links para parceiros, e<br /> esses recursos podem ser abertos ou fechados.</p> - </div> - </Grid> - </Grid> + <div> + <Slide contrast={contrast}> + <div className="tmpl3"> + <div className="container"> + <Grid className="title" container spacing={1}> + <Grid item xs={12}> + <h3>Os recursos educacionais disponibilizados<br /> podem ser de dois tipos:</h3> + </Grid> + </Grid> + <Grid className="box-text1" container spacing={1}> + <Grid className="text" item xs={8}> + <div className="content"> + <img src={Aberto} alt="Aberto" /> + <p><strong>Abertos</strong>: recursos sem nenhuma restrição de acesso e<br /> com flexibilidade quanto ao uso ou reuso.</p> + </div> + <div className="content"> + <img src={Fechado} alt="Fechado" /> + <p><strong>Fechados</strong>: recursos com alguma restrição de acesso, uso<br /> ou reuso, como aqueles que, para acesso, há demanda de<br /> cadastro ou que têm licenças restritivas.</p> + </div> + </Grid> + <Grid className="box-text2" item xs={4}> + <div className="content"> + <img src={Arrow_down} alt="Arrow_down" /> + <p>Como repositório, a Plataforma hospeda somente Recursos Educacionais Abertos (REA). Todo conteúdo inserido por usuários deve ser aberto.</p> + </div> + <div className="content"> + <img alt="" className="twoArrow" src={Arrow_double} /> + <p>Como referatório, a Plataforma aponta links para parceiros, e<br /> esses recursos podem ser abertos ou fechados.</p> + </div> + </Grid> + </Grid> + </div> + </div> + </Slide> </div> - </div> - </Slide> - </div> - <div> - <Slide contrast={contrast}> - <div class="tmpl4"> - <div class="container"> - <Grid container spacing={5}> - <Grid item xs={6}> - <h2>Como se cadastrar?</h2> - <div> - <p>Para criar uma conta, o usuário deverá clicar no botão “Cadastre-se” na página inicial da Plataforma e fazer um cadastro utilizando um endereço de e-mail e criando uma senha.</p> - </div> - </Grid> - <Grid item xs={2} style={{ alignSelf: "center" }}> <img style={{ width: "150px", height: "150px" }} src={Pessoa} alt="Pessoa" /> </Grid> - <Grid item xs={2} style={{ alignSelf: "center" }}> <img style={{ width: "150px", height: "150px" }} src={Email} alt="Email" /> </Grid> - <Grid item xs={2} style={{ alignSelf: "center" }}> <img style={{ width: "150px", height: "150px" }} src={Seguranca} alt="Seguranca" /> </Grid> - </Grid> + <div> + <Slide contrast={contrast}> + <div class="tmpl4"> + <div class="container"> + <Grid container spacing={5}> + <Grid item xs={6}> + <h2>Como se cadastrar?</h2> + <div> + <p>Para criar uma conta, o usuário deverá clicar no botão “Cadastre-se” na página inicial da Plataforma e fazer um cadastro utilizando um endereço de e-mail e criando uma senha.</p> + </div> + </Grid> + <Grid item xs={2} style={{ alignSelf: "center" }}> <img style={{ width: "150px", height: "150px" }} src={Pessoa} alt="Pessoa" /> </Grid> + <Grid item xs={2} style={{ alignSelf: "center" }}> <img style={{ width: "150px", height: "150px" }} src={Email} alt="Email" /> </Grid> + <Grid item xs={2} style={{ alignSelf: "center" }}> <img style={{ width: "150px", height: "150px" }} src={Seguranca} alt="Seguranca" /> </Grid> + </Grid> + </div> + </div> + </Slide> </div> - </div> - </Slide> - </div> - <div> - <Slide contrast={contrast}> - <div class="tmpl5"> - <div class="container"> - <Grid container justify="space-evenly" spacing={12}> - <Grid style={{ paddingRight: "40px" }} item xs={6}> - <div class="title"> - <img src={Like} alt="Like" /> - <h2>O que publicar?</h2> - </div> - <img src={Line} alt="Line" /> - <div class="box-text"> - <p>Conteúdos de cunho educacional e pertinentes ao assunto no qual estão inseridos, de autoria do usuário, de autoria coletiva (com consentimento dos demais autores) ou que estejam no domínio público. </p> - </div> - </Grid> - <Grid item xs={6}> - <div class="title"> - <img src={Unlike} alt="Unlike" /> - <h2>O que não publicar?</h2> - </div> - <img src={Line} alt="Line" /> - <div class="box-text"> - <p>Materiais ofensivos, pornográficos, relacionados a atividades ilegais, que invadam a privacidade de terceiros, que violem a legislação de Direito Autoral ou os Direitos Humanos. Propagandas, conteúdos com vírus, spam ou comentários abusivos.</p> - </div> - </Grid> - </Grid> + <div> + <Slide contrast={contrast}> + <div class="tmpl5"> + <div class="container"> + <Grid container justify="space-evenly" spacing={12}> + <Grid style={{ paddingRight: "40px" }} item xs={6}> + <div class="title"> + <img src={Like} alt="Like" /> + <h2>O que publicar?</h2> + </div> + <img src={Line} alt="Line" /> + <div class="box-text"> + <p>Conteúdos de cunho educacional e pertinentes ao assunto no qual estão inseridos, de autoria do usuário, de autoria coletiva (com consentimento dos demais autores) ou que estejam no domínio público. </p> + </div> + </Grid> + <Grid item xs={6}> + <div class="title"> + <img src={Unlike} alt="Unlike" /> + <h2>O que não publicar?</h2> + </div> + <img src={Line} alt="Line" /> + <div class="box-text"> + <p>Materiais ofensivos, pornográficos, relacionados a atividades ilegais, que invadam a privacidade de terceiros, que violem a legislação de Direito Autoral ou os Direitos Humanos. Propagandas, conteúdos com vírus, spam ou comentários abusivos.</p> + </div> + </Grid> + </Grid> + </div> + </div> + </Slide> </div> - </div> - </Slide> - </div> - <div> - <Slide contrast={contrast}> - <div className="tmpl6"> - <div className="container"> - <Grid container> - <Grid className="box-text-1" item xs={7}> - <h3>Direitos do autor e licenças de uso</h3> - <p>Ao inserir um novo material de sua autoria no Repositório, o usuário deverá escolher um dos tipos de licença aberta disponíveis na Plataforma:</p> - <div className="licences"> - <Grid className="row" container> - <Grid item xs={6}> - <p>CC-BY</p> - </Grid> - <Grid item xs={6}> - <p>CC-BY-SA</p> - </Grid> - </Grid> - <Grid className="row" container> - <Grid item xs={6}> - <p>CC-BY-NC</p> - </Grid> - <Grid item xs={6}> - <p>CC-BY-NC-SA</p> - </Grid> - </Grid> - </div> - </Grid> - <Grid className="box-text-2" item xs={5}> - <Grid className="row" container> - <Grid item xs={2}> - <p className="licenses_type">CC-BY</p> - </Grid> - <Grid item xs={10}> - <p> significa que o autor permite que distribuam, remixem, adaptem e criem a partir do seu trabalho, desde que lhe atribuam o devido crédito pela criação original</p> - </Grid> - </Grid> - <Grid className="row" container> - <Grid item xs={2}> - <p className="licenses_type">NC</p> - </Grid> - <Grid item xs={10}> - <p> indica que as criações elaboradas a partir do trabalho do autor podem ser utilizadas somente para fins não comerciais (se não houver esta especificação, o novo recurso poderá ser utilizado para fins comerciais)</p> - </Grid> - </Grid> - <Grid className="row" container> - <Grid item xs={2}> - <p className="licenses_type">SA</p> - </Grid> - <Grid item xs={10}> - <p> quer dizer que as novas criações devem ser licenciadas sob termos idênticos aos do trabalho original</p> - </Grid> - </Grid> - </Grid> - </Grid> + <div> + <Slide contrast={contrast}> + <div className="tmpl6"> + <div className="container"> + <Grid container> + <Grid className="box-text-1" item xs={7}> + <h3>Direitos do autor e licenças de uso</h3> + <p>Ao inserir um novo material de sua autoria no Repositório, o usuário deverá escolher um dos tipos de licença aberta disponíveis na Plataforma:</p> + <div className="licences"> + <Grid className="row" container> + <Grid item xs={6}> + <p>CC-BY</p> + </Grid> + <Grid item xs={6}> + <p>CC-BY-SA</p> + </Grid> + </Grid> + <Grid className="row" container> + <Grid item xs={6}> + <p>CC-BY-NC</p> + </Grid> + <Grid item xs={6}> + <p>CC-BY-NC-SA</p> + </Grid> + </Grid> + </div> + </Grid> + <Grid className="box-text-2" item xs={5}> + <Grid className="row" container> + <Grid item xs={2}> + <p className="licenses_type">CC-BY</p> + </Grid> + <Grid item xs={10}> + <p> significa que o autor permite que distribuam, remixem, adaptem e criem a partir do seu trabalho, desde que lhe atribuam o devido crédito pela criação original</p> + </Grid> + </Grid> + <Grid className="row" container> + <Grid item xs={2}> + <p className="licenses_type">NC</p> + </Grid> + <Grid item xs={10}> + <p> indica que as criações elaboradas a partir do trabalho do autor podem ser utilizadas somente para fins não comerciais (se não houver esta especificação, o novo recurso poderá ser utilizado para fins comerciais)</p> + </Grid> + </Grid> + <Grid className="row" container> + <Grid item xs={2}> + <p className="licenses_type">SA</p> + </Grid> + <Grid item xs={10}> + <p> quer dizer que as novas criações devem ser licenciadas sob termos idênticos aos do trabalho original</p> + </Grid> + </Grid> + </Grid> + </Grid> + </div> + </div> + </Slide> </div> - </div> - </Slide> - </div> - <div> - <Slide contrast={contrast}> - <div class="tmpl7"> - <div class="container"> - <Grid container> - <Grid className="title" item xs={4}> - <h2>Respeitamos<br /> a sua privacidade</h2> - </Grid> - <Grid className="box-text" item xs={8}> - <p>Além de solicitar alguns dados pessoais para o cadastro, a Plataforma coleta, de forma automática, os dados não pessoais relativos à interação dos usuários no sistema. Esses dados nunca serão fornecidos para fins comerciais, assim como nunca serão compartilhados quaisquer dados pessoais que possam identificar o usuário.</p> - <p>Os dados anônimos poderão ser utilizados para fins de melhoria da plataforma, transparência e para o uso em pesquisas.</p> - </Grid> - </Grid> - <div class="rodape col-md-12"> - <p>Dúvidas? Leia a íntegra dos <span ng-click="hide()">Termos de Uso</span> ou fale conosco por meio do <a style={{ color: "#fff" }} href="contato">formulário de contato</a>.</p> - </div> + <div> + <Slide contrast={contrast}> + <div class="tmpl7"> + <div class="container"> + <Grid container> + <Grid className="title" item xs={4}> + <h2>Respeitamos<br /> a sua privacidade</h2> + </Grid> + <Grid className="box-text" item xs={8}> + <p>Além de solicitar alguns dados pessoais para o cadastro, a Plataforma coleta, de forma automática, os dados não pessoais relativos à interação dos usuários no sistema. Esses dados nunca serão fornecidos para fins comerciais, assim como nunca serão compartilhados quaisquer dados pessoais que possam identificar o usuário.</p> + <p>Os dados anônimos poderão ser utilizados para fins de melhoria da plataforma, transparência e para o uso em pesquisas.</p> + </Grid> + </Grid> + <div class="rodape col-md-12"> + <p>Dúvidas? Leia a íntegra dos <span ng-click="hide()">Termos de Uso</span> ou fale conosco por meio do <a style={{ color: "#fff" }} href="contato">formulário de contato</a>.</p> + </div> + </div> + </div> + </Slide> </div> - </div> - </Slide> - </div> - </CarouselStyled> - ) + </CarouselStyled> + ) } diff --git a/src/Components/PublicationPermissionsContent.js b/src/Components/PublicationPermissionsContent.js index d235cc3a2b48d6e56484668138708089f542bdbf..a41e89a6c260d88461243fbf924fb19979edcb45 100644 --- a/src/Components/PublicationPermissionsContent.js +++ b/src/Components/PublicationPermissionsContent.js @@ -1,6 +1,5 @@ import React, { useState, useEffect } from 'react'; import Typography from '@material-ui/core/Typography'; -import CardContent from '@material-ui/core/CardContent'; import styled from 'styled-components' import RadioGroup from '@material-ui/core/RadioGroup'; import FormControlLabel from '@material-ui/core/FormControlLabel'; diff --git a/src/Components/TermsPageContent.js b/src/Components/TermsPageContent.js index a71a66b915a70fc0bdaea36918381ba780b95d97..bcdcad410c05a67b7ed12659ab6afdbd245c4f29 100644 --- a/src/Components/TermsPageContent.js +++ b/src/Components/TermsPageContent.js @@ -1,6 +1,5 @@ import React from 'react'; import Typography from '@material-ui/core/Typography'; -import CardContent from '@material-ui/core/CardContent'; export default function TermsPageContent({ contrast }) { return (