diff --git a/src/Components/CollectionDowloadButton.js b/src/Components/CollectionDowloadButton.js index f36eed118e3771b92e2117883d5dd8977cefd91f..d7820da26c20262c585c60eff2723a2d5bc78b52 100644 --- a/src/Components/CollectionDowloadButton.js +++ b/src/Components/CollectionDowloadButton.js @@ -4,6 +4,7 @@ import GetAppIcon from '@material-ui/icons/GetApp'; import Button from '@material-ui/core/Button'; import styled from 'styled-components'; import { apiUrl, apiDomain } from '../env'; +import { getRequest } from './HelperFunctions/getAxiosConfig' const DowloadButton = (props) => { @@ -23,6 +24,19 @@ const DowloadButton = (props) => { } }); }, [props.id]); + + const handleDowloadCollection = () => { + // there is no error controller here because the router + ///:type/:id/download is always returning error + getRequest( + `/collections/${props.id}/download`, + (data, header) => { + }, + (error) => { + } + ) + } + return ( <> <DownloadAnchor href={download_url} > @@ -32,9 +46,9 @@ const DowloadButton = (props) => { startIcon={<GetAppIcon fontSize="large" />} size="small" > - <ButtonText>Baixar Coleção</ButtonText> + <ButtonText onClick={handleDowloadCollection}>Baixar Coleção</ButtonText> </DownloadButton> - </DownloadAnchor> + </DownloadAnchor> </> ) } diff --git a/src/Components/CollectionReview.js b/src/Components/CollectionReview.js index 10cc202c3ff6f3908aeb09c7d0d4fb567505fddb..c9dc801016a770dd65acd4378c9db395b6c4d945 100644 --- a/src/Components/CollectionReview.js +++ b/src/Components/CollectionReview.js @@ -27,7 +27,7 @@ import { Store } from '../Store.js' import ReportModal from './ReportModal.js'; import SignUpModal from './SignUpModal.js'; import LoginModal from './LoginModal.js'; -import {putRequest, getRequest} from './HelperFunctions/getAxiosConfig.js' +import { putRequest, getRequest } from './HelperFunctions/getAxiosConfig.js' export default function CollectionReview(props) { const [likes, setLikes] = useState(0); @@ -38,31 +38,31 @@ export default function CollectionReview(props) { const [log_in_open, setLoginOpen] = useState(false); const { state } = useContext(Store); - function handleSuccessfulGet (data) { - setLikes(Number(data.likes_count)); - setLiked(data.liked); - } + function handleSuccessfulGet(data) { + setLikes(Number(data.likes_count)); + setLiked(data.liked); + } useEffect(() => { - const url = `/collections/${props.id}` + const url = `/collections/${props.id}` - getRequest(url, handleSuccessfulGet, (error) => {console.log(error)}) + getRequest(url, handleSuccessfulGet, (error) => { console.log(error) }) - }, [props.id]); + }, [props.id, state.currentUser.id]); const handleClickReport = () => { setReportOpen(true); } - function handleSuccess (data) { - setLiked(!liked) - setLikes(data.count) - } + function handleSuccess(data) { + setLiked(!liked) + setLikes(data.count) + } const handleLikeClick = () => { if (state.currentUser.id) { - const url = `/collections/${props.id}/like` - putRequest(url, {}, handleSuccess, (error) => {console.log(error)}) + const url = `/collections/${props.id}/like` + putRequest(url, {}, handleSuccess, (error) => { console.log(error) }) } else setSignUpOpen(true); } @@ -91,7 +91,7 @@ export default function CollectionReview(props) { </Grid> <Grid item justify="center" alignItems="center"> <IconButton aria-label="like" onClick={handleLikeClick}> - {likes}<FavoriteIcon style={{fill : liked ? "red" : null}} /> + {likes}<FavoriteIcon style={{ fill: liked ? "red" : null }} /> </IconButton> </Grid> </Grid> diff --git a/src/Components/FollowCollectionButton.js b/src/Components/FollowCollectionButton.js index be01ad44329cfe45b7ca167a4111d721cd8f7e7a..974a56fd3492cf7440b46679794fb061ea237e7a 100644 --- a/src/Components/FollowCollectionButton.js +++ b/src/Components/FollowCollectionButton.js @@ -16,37 +16,77 @@ 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 } from 'react'; +import React, { useState, useEffect, useContext } from 'react'; import Button from '@material-ui/core/Button'; import CheckIcon from '@material-ui/icons/Check'; import AddIcon from '@material-ui/icons/Add'; import styled from 'styled-components'; import SignUpModal from './SignUpModal.js'; -import {getRequest, putRequest} from './HelperFunctions/getAxiosConfig' +import LoginModal from './LoginModal'; +import SnackBarComponent from './SnackbarComponent'; +import { getRequest, putRequest } from './HelperFunctions/getAxiosConfig' +import { Store } from '../Store' export default function FollowCollectionButton(props) { + const { state } = useContext(Store) const [icon, setIcon] = useState(<AddIcon fontSize="large" />); const [button_text, setButtonText] = useState("Seguir Coleção"); const [variant, setVariant] = useState("outlined"); const [sign_up_open, setSignUpOpen] = useState(false); + const [open_login, setOpenLogin] = useState(false); + const [snackInfo, setSnackInfo] = useState({ + open: false, + text: '', + severity: '', + color: '' + }); const [following, setFollowing] = useState(false); //user following collection - function handleSuccessGet (data) { - if(data) - data.map((e) => { - if (e["followable"]["id"] === Number(props.collection_id)){ - setVariant("contained"); - setButtonText("Seguindo"); - setIcon(<CheckIcon fontSize="large" />) - setFollowing(true); - } - return undefined - }) - } + function handleSuccessGet(data) { + if (!data.errors) + data.map((e) => { + if (e["followable"]["id"] === Number(props.collection_id)) { + setVariant("contained"); + setButtonText("Seguindo"); + setIcon(<CheckIcon fontSize="large" />) + setFollowing(true); + } + return undefined + }) + else { + const info = { + open: true, + text: 'Falha ao verificar se o usuário segue a coleção!', + severity: 'error', + color: 'red' + } + + handleSnackInfo(info) + } + } useEffect(() => { - const url = `/users/${props.user_id}/following/Collection` - getRequest(url, handleSuccessGet, (error) => console.log(error)) - }, []); + if (state.currentUser.id) { + const url = `/users/${props.user_id}/following/Collection` + getRequest( + url, + handleSuccessGet, + (error) => { + const info = { + open: true, + text: 'Falha ao verificar se o usuário segue a coleção!', + severity: 'error', + color: 'red' + } + handleSnackInfo(info) + }) + } + else { + setIcon(<AddIcon fontSize="large" />) + setButtonText("Seguir Coleção") + setVariant("outlined") + setFollowing(false) + } + }, [state.currentUser.id]); //handleMouse{Enter, Leave} only do anything when user follows given collection: const handleMouseEnter = () => { @@ -65,33 +105,120 @@ export default function FollowCollectionButton(props) { } } - function handleSuccessfulFollow (data) { - setVariant("contained"); - setButtonText("Seguindo"); - setIcon(<CheckIcon fontSize="large" />) - setFollowing(true); - } - function handleSuccessfulUnfollow (data) { - setVariant("outlined"); - setButtonText("Seguir Coleção"); - setIcon(<AddIcon fontSize="large" />); - setFollowing(false); - } + function handleOpenSnackSignIn() { + const info = { + open: true, + text: 'Você foi logado com sucesso!', + severity: 'success', + color: '', + } + + handleSnackInfo(info) + } + + function handleCloseSnack() { + setSnackInfo({ + open: false, + text: '', + severity: '', + color: '', + }) + } + + function handleSnackInfo(info) { + setSnackInfo({ + ...info + }) + } + + function handleOpenLogin() { + setOpenLogin(true) + } + + function handleOpenSignUp() { + setSignUpOpen(true) + } + + function handleSuccessfulFollow(data) { + if (data.errors) { + setVariant("contained"); + handleFailFollow() + } + else { + const info = { + open: true, + text: 'Sucesso ao seguir a coleção!', + severity: 'success', + color: 'green' + } + handleSnackInfo(info) + setVariant("contained"); + setButtonText("Seguindo"); + setIcon(<CheckIcon fontSize="large" />) + setFollowing(true); + } + } + + function handleFailFollow(err) { + const info = { + open: true, + text: 'Falha ao seguir coleção', + severity: 'fail', + color: 'red', + } + handleSnackInfo(info) + } + + function handleSuccessfulUnfollow(data) { + if (data.errors) + handleFailUnfollow() + else { + const info = { + open: true, + text: 'Sucesso ao deixar de seguir a coleção!', + severity: 'success', + color: 'green' + } + handleSnackInfo(info) + setVariant("outlined"); + setButtonText("Seguir Coleção"); + setIcon(<AddIcon fontSize="large" />); + setFollowing(false); + } + } + + function handleFailUnfollow(err) { + const info = { + open: true, + text: 'Falha ao deixar de seguir coleção', + severity: 'error', + color: 'red', + } + handleSnackInfo(info) + } + const handleClick = () => { - const url = `/collections/${props.collection_id}/follow` + const url = `/collections/${props.collection_id}/follow` if (!props.user_id) setSignUpOpen(true); else if (!following) { - putRequest(url, {}, handleSuccessfulFollow, (error) => {console.log(error)}) + putRequest(url, {}, handleSuccessfulFollow, handleFailFollow) } else { - putRequest(url, {}, handleSuccessfulUnfollow, (error) => {console.log(error)}) + putRequest(url, {}, handleSuccessfulUnfollow, handleFailUnfollow) } }; if (!props.user_is_owner) return ( <div> + <SnackBarComponent + snackbarOpen={snackInfo.open} + handleClose={handleCloseSnack} + severity={snackInfo.severity} + text={snackInfo.text} + color={snackInfo.color} + /> <FollowButton variant={variant} color="primary" @@ -103,7 +230,17 @@ export default function FollowCollectionButton(props) { > <ButtonText>{button_text}</ButtonText> </FollowButton> - <SignUpModal open={sign_up_open} handleClose={() => setSignUpOpen(false)} /> + <SignUpModal + open={sign_up_open} + handleClose={() => setSignUpOpen(false)} + openLogin={handleOpenLogin} + /> + <LoginModal + openSnackbar={handleOpenSnackSignIn} + open={open_login} + handleClose={() => setOpenLogin(false)} + openSignUp={handleOpenSignUp} + /> </div> ); else return (<div></div>); diff --git a/src/Components/ResourceCardOptions.js b/src/Components/ResourceCardOptions.js index 81d9286c5d0671f8885250daf08f2a4e601b3c87..5d2821f3d9a39cc92af23d5ff1fa7c71de868777 100644 --- a/src/Components/ResourceCardOptions.js +++ b/src/Components/ResourceCardOptions.js @@ -40,6 +40,7 @@ import SignUpModal from './SignUpModal' import LoginModal from './LoginModal.js' import Snackbar from '@material-ui/core/Snackbar'; import MuiAlert from '@material-ui/lab/Alert'; +import { getRequest } from './HelperFunctions/getAxiosConfig' export default function ResourceCardOptions(props) { const { state } = useContext(Store) @@ -78,6 +79,13 @@ export default function ResourceCardOptions(props) { const enableDownload = () => { const url = props.downloadableLink window.open(url, '_blank'); + getRequest( + `/learning_objects/${props.learningObjectId}/download`, + (data, header) => { + }, + (error) => { + } + ) toggleSnackbar(true) } diff --git a/src/Components/ResourcePageComponents/Footer.js b/src/Components/ResourcePageComponents/Footer.js index b0a5769cb6a0c268ee52b05f8135600a7a8c0474..98e7fcd119baab3a54029a86ada0860dc0526dd8 100644 --- a/src/Components/ResourcePageComponents/Footer.js +++ b/src/Components/ResourcePageComponents/Footer.js @@ -16,8 +16,8 @@ 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 {Store} from '../../Store.js' +import React, { useState, useContext } from 'react' +import { Store } from '../../Store.js' import styled from 'styled-components' import Grid from '@material-ui/core/Grid'; import { Button } from '@material-ui/core'; @@ -37,18 +37,19 @@ import LoginModal from './../LoginModal.js' import Snackbar from '@material-ui/core/Snackbar'; import SignUpModal from './../SignUpModal' import MuiAlert from '@material-ui/lab/Alert'; +import { getRequest } from '../HelperFunctions/getAxiosConfig' function Alert(props) { return <MuiAlert elevation={6} variant="filled" {...props} />; } -function ReportButton (props) { +function ReportButton(props) { return ( - !props.complained ? + !props.complained ? ( <ButtonGrey onClick={props.userLoggedIn ? props.toggleReport : props.openLogin}> <span className="button-text"> - <ErrorIcon className="icon"/> Reportar abuso ou erro + <ErrorIcon className="icon" /> Reportar abuso ou erro </span> </ButtonGrey> ) @@ -56,46 +57,41 @@ function ReportButton (props) { ( <ButtonGrey> <span className="button-text-report"> - <ErrorIcon className="icon"/> Você já reportou este recurso + <ErrorIcon className="icon" /> Você já reportou este recurso </span> </ButtonGrey> ) ) } -function DownloadButton (props) { +function DownloadButton(props) { return ( - props.downloadableLink ? + props.downloadableLink ? ( - <ButtonOrange onClick={props.enableDownload}> - <span className="text"> - <GetAppIcon className="icon"/> Baixar Recurso + <ButtonOrange onClick={props.enableDownload}> + <span className="text"> + <GetAppIcon className="icon" /> Baixar Recurso </span> - </ButtonOrange> + </ButtonOrange> ) : - props.link ? + props.link ? ( - <ButtonOrange onClick={props.toggleRedirect}> - <span className="text"> - <CallMadeIcon className="icon"/> Abrir Recurso + <ButtonOrange onClick={props.toggleRedirect}> + <span className="text"> + <CallMadeIcon className="icon" /> Abrir Recurso </span> - </ButtonOrange> + </ButtonOrange> ) : ( - <React.Fragment/> + <React.Fragment /> ) ) } -export default function Footer (props) { - const {state} = useContext(Store) - const enableDownload = () => { - const url = props.downloadableLink - window.open(url, '_blank'); - props.handleSnackbar(0) - } +export default function Footer(props) { + const { state } = useContext(Store) let windowWidth = window.innerWidth const [reportOpen, toggleReport] = useState(false) const [shareOpen, toggleShare] = useState(false) @@ -104,9 +100,24 @@ export default function Footer (props) { const [loginOpen, setLogin] = useState(false) const [successfulLoginOpen, handleSuccessfulLogin] = useState(false) const [signUpOpen, setSignUp] = useState(false) - const [anchorEl, setAnchorEl] = React.useState(null); + const enableDownload = () => { + props.handleSnackbar(0) + const url = props.downloadableLink + window.open(url, '_blank'); + + // there is no error controller here because the router + ///:type/:id/download is always returning error + getRequest( + `/learning_objects/${props.recursoId}/download`, + (data, header) => { + }, + (error) => { + } + ) + } + const handleSignUp = () => { setSignUp(!signUpOpen) } @@ -119,16 +130,16 @@ export default function Footer (props) { if (reason === 'clickaway') { return; } - - handleSuccessfulLogin(false); + + handleSuccessfulLogin(false); } function handleClick(event) { - setAnchorEl(event.currentTarget); + setAnchorEl(event.currentTarget); } function handleClose() { - setAnchorEl(null); + setAnchorEl(null); } return ( @@ -139,25 +150,25 @@ export default function Footer (props) { <Alert severity="success" style={{ backgroundColor: "#00acc1" }}>Você está conectado(a)!</Alert> </Snackbar> {/*-------------------------------MODALS---------------------------------------*/} - <ReportModal open={reportOpen} handleClose={() => {toggleReport(false)}} + <ReportModal open={reportOpen} handleClose={() => { toggleReport(false) }} form="recurso" complainableId={props.recursoId} complainableType={"LearningObject"} - /> - <ShareModal open={shareOpen} handleClose={() => {toggleShare(false)}} + /> + <ShareModal open={shareOpen} handleClose={() => { toggleShare(false) }} thumb={props.thumb} title={props.title} link={props.currPageLink} - /> + /> - <GuardarModal open={saveToCol} handleClose={() => {toggleSave(false)}} + <GuardarModal open={saveToCol} handleClose={() => { toggleSave(false) }} thumb={props.thumb} title={props.title} recursoId={props.recursoId} - /> - <RedirectModal open={redirectOpen} handleClose={() => {toggleRedirect(false)}} + /> + <RedirectModal open={redirectOpen} handleClose={() => { toggleRedirect(false) }} link={props.link} - /> + /> <LoginModal open={loginOpen} handleClose={() => setLogin(false)} openSignUp={handleSignUp} openSnackbar={() => { handleSuccessfulLogin(true) }} /> - <SignUpModal open={signUpOpen} handleClose={handleSignUp} openLogin={handleLogin} /> + <SignUpModal open={signUpOpen} handleClose={handleSignUp} openLogin={handleLogin} /> {/*----------------------------------------------------------------------------*/} {/*-----------------------------BUTTONS----------------------------------------*/} @@ -165,97 +176,97 @@ export default function Footer (props) { <StyledGrid container> { windowWidth > 990 ? - ( - <React.Fragment> - {/*Botao Reportar*/} - <Grid item xs={3}> - <ReportButton - userLoggedIn={state.currentUser.id === '' ? false : true} - toggleReport={() => {toggleReport(true)}} - openLogin={handleLogin} - complained={props.complained} - /> - </Grid> - - {/*Botao Compartilhar*/} - <Grid item xs={3}> - <ButtonGrey onClick={state.currentUser.id === '' ? () => handleLogin(true) : () => toggleShare(true)}> - <span className="button-text"> - <ShareIcon className="icon"/> Compartilhar - </span> - </ButtonGrey> - </Grid> - - {/*Botao Guardar*/} - <Grid item xs={3}> - <ButtonGrey onClick={state.currentUser.id === '' ? () => handleLogin(true) : () => toggleSave(true)}> - <span className="button-text"> - <FolderIcon className="icon"/>Guardar - </span> - </ButtonGrey> - </Grid> - - <Grid item xs={3} style={{justifyContent : "right !important"}}> - <DownloadButton - downloadableLink={props.downloadableLink} - link={props.link} - enableDownload={enableDownload} - toggleRedirect={() => {toggleRedirect(true)}} - /> - </Grid> - </React.Fragment> - ) - : - ( - <React.Fragment> - {/*Botao Guardar*/} - <Grid item xs={4}> - <ButtonGrey onClick={state.currentUser.id === '' ? () => handleLogin(true) : () => toggleSave(true)}> - <span className="button-text"> - <FolderIcon className="icon"/>Guardar - </span> - </ButtonGrey> - </Grid> - - <Grid item xs={7}> - <DownloadButton - downloadableLink={props.downloadableLink} - link={props.link} - enableDownload={enableDownload} - toggleRedirect={() => {toggleRedirect(true)}} - /> - </Grid> - - <Grid item xs={1}> - <Button aria-haspopup="true" onClick={handleClick} style={{color : "#666"}}> - <MoreVertIcon/> - </Button> - <Menu - id="simple-menu" - anchorEl={anchorEl} - keepMounted - open={Boolean(anchorEl)} - onClose={handleClose} - > - <MenuItem> + ( + <React.Fragment> + {/*Botao Reportar*/} + <Grid item xs={3}> <ReportButton userLoggedIn={state.currentUser.id === '' ? false : true} - toggleReport={() => {toggleReport(true)}} + toggleReport={() => { toggleReport(true) }} openLogin={handleLogin} complained={props.complained} - /> - </MenuItem> - <MenuItem> + /> + </Grid> + + {/*Botao Compartilhar*/} + <Grid item xs={3}> <ButtonGrey onClick={state.currentUser.id === '' ? () => handleLogin(true) : () => toggleShare(true)}> <span className="button-text"> - <ShareIcon className="icon"/> Compartilhar - </span> + <ShareIcon className="icon" /> Compartilhar + </span> </ButtonGrey> - </MenuItem> - </Menu> - </Grid> - </React.Fragment> - ) + </Grid> + + {/*Botao Guardar*/} + <Grid item xs={3}> + <ButtonGrey onClick={state.currentUser.id === '' ? () => handleLogin(true) : () => toggleSave(true)}> + <span className="button-text"> + <FolderIcon className="icon" />Guardar + </span> + </ButtonGrey> + </Grid> + + <Grid item xs={3} style={{ justifyContent: "right !important" }}> + <DownloadButton + downloadableLink={props.downloadableLink} + link={props.link} + enableDownload={enableDownload} + toggleRedirect={() => { toggleRedirect(true) }} + /> + </Grid> + </React.Fragment> + ) + : + ( + <React.Fragment> + {/*Botao Guardar*/} + <Grid item xs={4}> + <ButtonGrey onClick={state.currentUser.id === '' ? () => handleLogin(true) : () => toggleSave(true)}> + <span className="button-text"> + <FolderIcon className="icon" />Guardar + </span> + </ButtonGrey> + </Grid> + + <Grid item xs={7}> + <DownloadButton + downloadableLink={props.downloadableLink} + link={props.link} + enableDownload={enableDownload} + toggleRedirect={() => { toggleRedirect(true) }} + /> + </Grid> + + <Grid item xs={1}> + <Button aria-haspopup="true" onClick={handleClick} style={{ color: "#666" }}> + <MoreVertIcon /> + </Button> + <Menu + id="simple-menu" + anchorEl={anchorEl} + keepMounted + open={Boolean(anchorEl)} + onClose={handleClose} + > + <MenuItem> + <ReportButton + userLoggedIn={state.currentUser.id === '' ? false : true} + toggleReport={() => { toggleReport(true) }} + openLogin={handleLogin} + complained={props.complained} + /> + </MenuItem> + <MenuItem> + <ButtonGrey onClick={state.currentUser.id === '' ? () => handleLogin(true) : () => toggleShare(true)}> + <span className="button-text"> + <ShareIcon className="icon" /> Compartilhar + </span> + </ButtonGrey> + </MenuItem> + </Menu> + </Grid> + </React.Fragment> + ) } diff --git a/src/Pages/CollectionPage.js b/src/Pages/CollectionPage.js index b0bfdeb7db587ccfa45f4d11ef030f330978322f..3ccb5ab1929d32cc3be204d59fa939664b85596f 100644 --- a/src/Pages/CollectionPage.js +++ b/src/Pages/CollectionPage.js @@ -29,7 +29,7 @@ import Breadcrumbs from "@material-ui/core/Breadcrumbs"; import { Link } from 'react-router-dom'; import FollowCollectionButton from '../Components/FollowCollectionButton'; import { Store } from '../Store.js' -import {getRequest} from '../Components/HelperFunctions/getAxiosConfig.js' +import { getRequest } from '../Components/HelperFunctions/getAxiosConfig.js' export default function CollectionPage(props) { const { state } = useContext(Store); @@ -42,13 +42,13 @@ export default function CollectionPage(props) { const comment_ref = useRef(null); useEffect(() => { - const url = `/collections/${collection_id}` + const url = `/collections/${collection_id}` - getRequest(url, (data) => {setCollection(Object.assign({}, data))}, (error) => {console.log(error)}) + getRequest(url, (data) => { setCollection(Object.assign({}, data)) }, (error) => { console.log(error) }) }, []); const handleScrollToComments = () => { - window.scrollTo(0, comment_ref.current.offsetTop); + comment_ref.current.scrollIntoView({ behavior: 'smooth' }) } return ( <> @@ -78,7 +78,7 @@ export default function CollectionPage(props) { <DowloadButton id={collection.id ? collection.id : 0} /> - <div style={{height : 12}}></div> + <div style={{ height: 12 }}></div> <FollowCollectionButton user_id={state.currentUser.id} collection_id={collection_id} /> @@ -87,7 +87,7 @@ export default function CollectionPage(props) { <VerticalRuler width={1} height={100} color="rgb(238, 238, 238)" /> - <Grid container justify="center" style={{ backgroundColor: '#f4f4f4'}}> + <Grid container justify="center" style={{ backgroundColor: '#f4f4f4' }}> {/* <Grid item xs={1}/> */} <Grid item xs={10}> <ResourceList resources={ @@ -113,7 +113,7 @@ export default function CollectionPage(props) { } /> </Grid> - <Grid container item xs={12} style={{ marginTop: 40, paddingBottom:40 }} ref={comment_ref}> + <Grid container item xs={12} style={{ marginTop: 40, paddingBottom: 40 }} ref={comment_ref}> <CollectionCommentSection id={collection_id} /> </Grid> </Grid> diff --git a/src/Pages/ResourcePage.js b/src/Pages/ResourcePage.js index 834a2c13e37779d62476666f5f5f64a8c5138b21..ff63e4f479a36799c3d8240d5a3afa3e5905eb2c 100644 --- a/src/Pages/ResourcePage.js +++ b/src/Pages/ResourcePage.js @@ -79,7 +79,8 @@ export default function LearningObjectPage(props) { "O Recurso foi guardado na coleção!", "O recurso foi aprovado com sucesso!", "Erro ao aprovar o recurso!", - "Erro ao carregar a página" + "Erro ao carregar a página", + "Erro ao fazer o dowload do recurso", ]; const [snackbarIndex, setIndex] = useState(0); const classes = useStyles(); diff --git a/src/env.js b/src/env.js index 82bf229b11fe78f3cb5ff8a58d096eec156cedf2..b7359157e1c0e9d260976bbe2b2545a2e0ca51b0 100644 --- a/src/env.js +++ b/src/env.js @@ -17,7 +17,7 @@ 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/>.*/ -var apiDomain = 'https://api.portalmectest.c3sl.ufpr.br', +var apiDomain = 'https://api.portalmec.c3sl.ufpr.br', apiVersion = 'v1', apiUrl = apiDomain + '/' + apiVersion;