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" }
......
......@@ -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) => {
if (e.key === "Enter") {
const filterString = "&tags[]=" + keyWords
if (e.key === "Enter")
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);
}
......@@ -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>
......
......@@ -241,7 +241,6 @@ export default function Search(props) {
onClick={() => {
setLoadingMoreData(true);
setResultsPerPage(resultsPerPage + 12)
// collectStuff("Collection", "");
}}
>
{
......@@ -323,12 +322,28 @@ export default function Search(props) {
</button>
</div>
</Grid>
</GridBuscaResource> :
<Grid container direction="row" justify="center" alignItems="center">
<Grid item>
<img src={RecursoVazio} alt="recurso vazio" />
</GridBuscaResource>
:
<GridBuscaResource container spacing={2}>
<Grid item xs={12} md={2}>
<Grid container >
<Grid item xs={12}>
<Paper elevation={4} square>
<SearchExpansionPanel onChange={collectStuff} onFiltering={isFiltering} />
</Paper>
</Grid>
</Grid>
</Grid>
<Grid item xs={12} md={10}>
<Grid container direction="row" justify="center" alignItems="center" style={{height: "100%", width:"100%" }}>
<Grid>
<img src={RecursoVazio} alt="coleção vazia"/>
</Grid>
</Grid>
</Grid>
</GridBuscaResource>
) :
optionResult === "User" && (
<GridBuscaUser container spacing={2}>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment