Skip to content
Snippets Groups Projects
Commit 9485f3df authored by Stephanie Briere Americo's avatar Stephanie Briere Americo
Browse files

Merge branch 'issue/22' into 'development'

Issue #22: Fix answer page form description.

See merge request !24
parents 13a1ee63 ced646cf
Branches
No related tags found
3 merge requests!58Version 1.1,!54Issue #53: Fix password info,!24Issue #22: Fix answer page form description.
...@@ -10,7 +10,7 @@ const useStyles = makeStyles(theme => ({ ...@@ -10,7 +10,7 @@ const useStyles = makeStyles(theme => ({
paper: { paper: {
padding: theme.spacing(3), padding: theme.spacing(3),
width: theme.spacing(100), width: theme.spacing(100),
height: theme.spacing(22), height: "40%",
margin: theme.spacing(2), margin: theme.spacing(2),
color: "#000000", color: "#000000",
["@media (max-width:827px)"]: { ["@media (max-width:827px)"]: {
...@@ -38,10 +38,10 @@ const useStyles = makeStyles(theme => ({ ...@@ -38,10 +38,10 @@ const useStyles = makeStyles(theme => ({
} }
}, },
description: { description: {
fontSize: "30px", fontSize: "25px",
color: "#000000", color: "#000000",
["@media (max-width:827px)"]: { ["@media (max-width:827px)"]: {
fontSize: "25px" fontSize: "20px"
}, },
["@media (max-width:590px)"]: { ["@media (max-width:590px)"]: {
fontSize: "15px" fontSize: "15px"
...@@ -53,7 +53,6 @@ function FormFieldText(props) { ...@@ -53,7 +53,6 @@ function FormFieldText(props) {
const classes = useStyles(); const classes = useStyles();
return ( return (
<Grid>
<Paper className={classes.paper}> <Paper className={classes.paper}>
<Grid container> <Grid container>
<Grid item xs={12} className={classes.questionsGrid}> <Grid item xs={12} className={classes.questionsGrid}>
...@@ -66,11 +65,11 @@ function FormFieldText(props) { ...@@ -66,11 +65,11 @@ function FormFieldText(props) {
{props.title} {props.title}
</Typography> </Typography>
</Grid> </Grid>
<Grid item xs={9} className={classes.questionsGrid}> <Grid item xs={12} className={classes.questionsGrid}>
<Typography <Typography
style={{ wordWrap: "break-word" }} style={{ wordWrap: "break-word" }}
className={classes.description} className={classes.description}
variant="h4" variant="h6"
gutterBottom gutterBottom
> >
{props.description} {props.description}
...@@ -86,7 +85,6 @@ function FormFieldText(props) { ...@@ -86,7 +85,6 @@ function FormFieldText(props) {
></Grid> ></Grid>
</Grid> </Grid>
</Paper> </Paper>
</Grid>
); );
} }
......
...@@ -164,6 +164,10 @@ function AnwserForm() { ...@@ -164,6 +164,10 @@ function AnwserForm() {
.post(`/answer/${id}`, backendTranslation()) .post(`/answer/${id}`, backendTranslation())
.then(function(res) { .then(function(res) {
alert("Formulário respondido!"); alert("Formulário respondido!");
})
.catch(error => {
alert("Ocorreu um erro ao responder seu formulário.");
return;
}); });
} }
...@@ -200,9 +204,21 @@ function AnwserForm() { ...@@ -200,9 +204,21 @@ function AnwserForm() {
* @param id - Form id got from the broswer's URL * @param id - Form id got from the broswer's URL
*/ */
async function getForm(id) { async function getForm(id) {
const res = await api.get(`/form/${id}`).then(function(res) { const res = await api
.get(`/form/${id}`)
.then(function(res) {
setFormData(res.data); setFormData(res.data);
mapInputs(res.data); mapInputs(res.data);
})
.catch(error => {
if (error.response.status === 401) {
alert("Você não está logado.");
return;
}
if (error.response.status === 500) {
alert("Ocorreu um erro: formulário não encontrado.");
return;
}
}); });
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment