Skip to content
Snippets Groups Projects
Commit b9ea1de5 authored by lfr20's avatar lfr20
Browse files

Fixing bugs

parent 127bafd3
No related branches found
No related tags found
2 merge requests!57Merge of develop into master,!56Fixed buttons reportar, seguir, compartilhar, guardar and entrar (in comments...
......@@ -51,7 +51,6 @@ export default function SearchEPIdiomas(props) {
{ value: "9", exemplo: "Japonês" },
{ value: "19", exemplo: "LIBRAS" },
{ value: "7", exemplo: "Mandarim" },
{ value: "18", exemplo: "Nenhum" },
{ value: "10", exemplo: "Outro" },
{ value: "1", exemplo: "Português" },
{ value: "8", exemplo: "Russo" }
......
......@@ -10,7 +10,7 @@ import SearchEPTiposRec from "./SearchEPTiposRec";
import SearchEPEtapasEns from "./SesrchEPEtapasEns";
import SearchEPIdiomas from "./SearchEPIdiomas";
import { TextField } from "@material-ui/core";
import Grid from '@material-ui/core/Grid';
import Grid from '@material-ui/core/Grid';
import CircularProgress from '@material-ui/core/CircularProgress';
import './ExpansionPanel.css'
......@@ -70,14 +70,31 @@ const ExpansionPanelDetails = withStyles(theme => ({
export default function SearchExpansionPanel(props) {
const [keyWords, setKeyWords] = useState("");
const [errorInKeyWord, setErrorInKeyWord] = useState({
message: "",
state: false
})
const onKeyPressed = (e) => {
const filterString = "&tags[]=" + keyWords
if (e.key === "Enter")
props.onChange("LearningObject", filterString)
if (e.key === "Enter") {
const filterString = "&tags[]=" + keyWords
if (keyWords.length === 0) {
setErrorInKeyWord({
state: true,
message: "Preencha o campo"
})
}
else
props.onChange("LearningObject", filterString)
}
}
const HandleChangeText = (e) => {
if (errorInKeyWord.state)
setErrorInKeyWord({
state: false,
message: ""
})
setKeyWords(e.target.value);
}
......@@ -94,7 +111,7 @@ export default function SearchExpansionPanel(props) {
id="panel1d-header"
>
<Grid
container
container
direction="row"
justify="space-between"
>
......@@ -110,9 +127,9 @@ export default function SearchExpansionPanel(props) {
</Typography>
</Grid>
<Grid item>
{
props.onFiltering ? <CircularProgress size={24} color="secondary" /> : null
}
{
props.onFiltering ? <CircularProgress size={24} color="secondary" /> : null
}
</Grid>
</Grid>
</ExpansionPanelSummary>
......@@ -183,12 +200,13 @@ export default function SearchExpansionPanel(props) {
</ExpansionPanelSummary>
<ExpansionPanelDetails>
<TextField
label="Palavra chave + ENTER"
label="Palavra chave + enter "
id="outlined-margin-dense"
margin="dense"
variant="outlined"
onChange={e => HandleChangeText(e)}
onKeyDown={e => onKeyPressed(e)}
error={errorInKeyWord.state}
helperText={errorInKeyWord.state ? errorInKeyWord.message : ""}
/>
</ExpansionPanelDetails>
</ExpansionPanel>
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment