From 5252135f3dafff51d722e76c6a2737614a26a7fa Mon Sep 17 00:00:00 2001 From: Luis Felipe Risch <lfr20@inf.ufpr.br> Date: Thu, 17 Jun 2021 17:45:41 -0300 Subject: [PATCH 1/6] Fixing search page --- src/Components/AreasSubPagesFunction.js | 4 +- src/Components/CollectionCommentSection.js | 2 - src/Components/HomeScreenSearchBar.js | 6 +- src/Components/SearchBar.js | 4 +- .../CollectionTemplate.js | 122 ++ .../SearchPageComponents/HeaderFilters.js | 132 ++ .../SearchPageComponents/ResourceTemplate.js | 122 ++ .../SearchPageComponents/UserTemplate.js | 117 ++ src/Pages/CollectionPage.js | 15 +- src/Pages/PublicUserPage.js | 2 +- src/Pages/ResourcePage.js | 2 +- src/Pages/Search.js | 1097 ++++++++++------- 12 files changed, 1151 insertions(+), 474 deletions(-) create mode 100644 src/Components/SearchPageComponents/CollectionTemplate.js create mode 100644 src/Components/SearchPageComponents/HeaderFilters.js create mode 100644 src/Components/SearchPageComponents/ResourceTemplate.js create mode 100644 src/Components/SearchPageComponents/UserTemplate.js diff --git a/src/Components/AreasSubPagesFunction.js b/src/Components/AreasSubPagesFunction.js index f0883269..2c3ca8e0 100644 --- a/src/Components/AreasSubPagesFunction.js +++ b/src/Components/AreasSubPagesFunction.js @@ -223,7 +223,7 @@ function TabRecurso() { { window.innerWidth <= 501 && <div style={{ display: "flex", justifyContent: "center" }}> - <Link to={`/busca?query=*&search_class=LearningObject`} className="button-ver">VER RECURSOS</Link> + <Link to={`/busca?page=0&results_per_page=12&order=review_average&query=*&search_class=LearningObject`} className="button-ver">VER RECURSOS</Link> </div> } </StyledTab> @@ -320,7 +320,7 @@ function TabColecoes() { { window.innerWidth <= 501 && <div style={{ display: "flex", justifyContent: "center" }}> - <Link to={`/busca?query=*&search_class=Collection`} className="button-ver">VER COLEÇÕES</Link> + <Link to={`/busca?page=0&results_per_page=12&order=review_average&query=*&search_class=Collection`} className="button-ver">VER COLEÇÕES</Link> </div> } </StyledTab> diff --git a/src/Components/CollectionCommentSection.js b/src/Components/CollectionCommentSection.js index 3b5b07b4..fae20e40 100644 --- a/src/Components/CollectionCommentSection.js +++ b/src/Components/CollectionCommentSection.js @@ -33,8 +33,6 @@ import SignUpModal from './SignUpModal.js'; import LoginModal from './LoginModal.js'; import SnackBarComponent from './SnackbarComponent'; import CircularProgress from '@material-ui/core/CircularProgress'; -import IconButton from '@material-ui/core/IconButton'; -import KeyboardArrowDownIcon from '@material-ui/icons/KeyboardArrowDown'; export default function CollectionCommentSection(props) { const [post_snack_open, setPostSnackOpen] = useState(false); diff --git a/src/Components/HomeScreenSearchBar.js b/src/Components/HomeScreenSearchBar.js index ef12b7cc..634b625e 100644 --- a/src/Components/HomeScreenSearchBar.js +++ b/src/Components/HomeScreenSearchBar.js @@ -92,9 +92,9 @@ export default function HomeScreenSearchBar(props) { const WIDTH = window.innerWidth; return ( - - <StyledGrid container> - {goSearch && <Redirect to={`/busca?query=${state.search.query}&search_class=${state.search.class}`} />} + + <StyledGrid container> + {goSearch && <Redirect to={`/busca?page=0&results_per_page=12&order=review_average&query=${state.search.query}&search_class=${state.search.class}`} />} <Grid item md={7} xs={12} className="first white"> <StyledTextField id="standard-search" diff --git a/src/Components/SearchBar.js b/src/Components/SearchBar.js index 1c36964e..8e0ea969 100644 --- a/src/Components/SearchBar.js +++ b/src/Components/SearchBar.js @@ -139,7 +139,7 @@ export default function SearchBar(props) { } const linkTarget = { - pathname: `/busca?query=${state.search.query}&search_class=${state.search.class}`, + pathname: `/busca?page=0&results_per_page=12&order=review_average&query=${state.search.query}&search_class=${state.search.class}`, key: uuidv4(), // we could use Math.random, but that's not guaranteed unique. state: { applied: true @@ -149,7 +149,7 @@ export default function SearchBar(props) { return ( <Grid container> <Grid container item xs={12} sm={6} md={6} lg={6} xl={6}> - {goSearch && <Redirect to={`/busca?query=${state.search.query}&search_class=${state.search.class}`} />} + {goSearch && <Redirect to={`/busca?page=0&results_per_page=12&order=review_average&query=${state.search.query}&search_class=${state.search.class}`} />} <TextFieldStyled id="standard-search" label="O que você está buscando" diff --git a/src/Components/SearchPageComponents/CollectionTemplate.js b/src/Components/SearchPageComponents/CollectionTemplate.js new file mode 100644 index 00000000..5d1b3ffe --- /dev/null +++ b/src/Components/SearchPageComponents/CollectionTemplate.js @@ -0,0 +1,122 @@ +import React, { useEffect } from 'react'; +import Paper from '@material-ui/core/Paper'; +import styled from 'styled-components'; +import Grid from '@material-ui/core/Grid'; +import LoadingSpinner from '../LoadingSpinner'; +import noCollections from '../../img/Pagina_vazia_colecao.png'; +import CollectionCardFunction from '../CollectionCardFunction'; +import IconButton from '@material-ui/core/IconButton'; +import ArrowBackIcon from '@material-ui/icons/ArrowBack'; +import ArrowForwardIcon from '@material-ui/icons/ArrowForward'; + +export default function ResourceTemplate({ isLoading, resources, totalResources, currPage, handlePreviousPage, handleNextPage }) { + const totalPages = Math.ceil(totalResources / 12); //Dividing by 12 because i want to cath total pages, and results per page is 12 + const topRef = React.useRef(); + + useEffect(() => { + topRef.current.scrollIntoView() + }, [isLoading]) + + return ( + <ResourcePaper elevation={4} square> + <div ref={topRef} /> + <Title> + Coleções encontradas ({totalResources}) + </Title> + { + isLoading ? + <LoadingSpinner text='Carregando Coleções...' /> + : + <Grid container justify='center' alignItems='center' spacing={3}> + { + resources.length >= 1 ? + resources.map((card) => { + return <Grid item key={new Date().toISOString() + card.id} > + <CollectionCardFunction + name={card.name} + tags={card.tags} + rating={card.review_average} + id={card.id} + author={card.owner ? card.owner.name : ""} + description={card.description} + thumbnails={card.items_thumbnails} + avatar={card.owner ? card.owner.avatar : ""} + likeCount={card.likes_count} + followed={card.followed} + liked={card.liked} + collections={card.collection_items} + authorID={card.owner.id} + /> + </Grid> + }) + : + <NoContentDiv> + <h3> + Desculpe, não há dados nessa página. + </h3> + <img src={noCollections} alt='No cards' /> + </NoContentDiv> + } + </Grid> + } + { + !isLoading && + <Grid container direction='row' alignItems='center' justify='center' spacing={3}> + <Grid item> + <StyledIconButton elevation={4} disabled={currPage === 0}> + <IconButton onClick={handlePreviousPage} disabled={currPage === 0}> + <ArrowBackIcon className='icon' /> + </IconButton> + </StyledIconButton> + </Grid> + <Grid item> + <ActualPage> + {currPage} + </ActualPage>...{totalPages} + </Grid> + <Grid item> + <StyledIconButton elevation={4} disabled={currPage === totalPages}> + <IconButton onClick={handleNextPage} disabled={currPage === totalPages}> + <ArrowForwardIcon className='icon' /> + </IconButton> + </StyledIconButton> + </Grid> + </Grid> + } + </ResourcePaper> + ) +}; + +const Title = styled.h4` + text-align: left; + color: #673ab7; +` +const NoContentDiv = styled.div` + >h3{ + color: #673ab7; + text-align: center; + } +` +const ActualPage = styled.span` + color: #673ab7; +` +const StyledIconButton = styled(Paper)` + border-radius: 50% !important; + background-color: ${props => props.disabled ? "#666" : "#673ab7"} !important; + .icon{ + color: ${props => props.disabled ? "#d4d4d4" : "white"}; + } +` + +const ResourcePaper = styled(Paper)` + /* height: 150px; */ + text-align: center; + background-color: #fff; + margin-top: 5px; + margin-bottom: 30px; + padding: 0.5em 1em; + color: #666; + .textInfo{ + text-align: start; + } +`; \ No newline at end of file diff --git a/src/Components/SearchPageComponents/HeaderFilters.js b/src/Components/SearchPageComponents/HeaderFilters.js new file mode 100644 index 00000000..ce6ea347 --- /dev/null +++ b/src/Components/SearchPageComponents/HeaderFilters.js @@ -0,0 +1,132 @@ +import React from 'react'; +import styled from 'styled-components'; +import Paper from '@material-ui/core/Paper'; +import Grid from '@material-ui/core/Grid'; +import TextField from '@material-ui/core/TextField'; +import MenuItem from '@material-ui/core/MenuItem' + +export default function HeaderFilters({ options, orders, currOption, currOrder, handleChangeOption, handleChangeOrder }) { + + if (currOption !== 'User') + return ( + <FiltersPaper elevation={4} square> + <Grid container direction='row' spacing={2} alignItems='center'> + <Grid item xs={12} sm={6}> + <Grid container alignItems='center'> + <Grid item xs={12} md={2}> + <Label> + Buscar por: + </Label> + </Grid> + <Grid item xs={12} md={10}> + <TextField + select + fullWidth + value={currOption} + onChange={handleChangeOption} + variant="outlined" + > + {options.map((option) => ( + <MenuItem + key={option.value} + value={option.name} + name={option.value} + > + <span style={{ color: option.color }}> + {option.value} + </span> + </MenuItem> + ))} + </TextField> + </Grid> + </Grid> + </Grid> + + <Grid item xs={12} sm={6}> + <Grid container alignItems='center'> + <Grid item xs={12} md={2}> + <Label> + Ordenar por: + </Label> + </Grid> + <Grid item xs={12} md={10}> + <TextField + select + fullWidth + value={currOrder} + onChange={handleChangeOrder} + variant="outlined" + > + {orders.map((option) => ( + <MenuItem + key={option.value} + value={option.name} + name={option.value} + > + {option.value} + </MenuItem> + ))} + </TextField> + </Grid> + </Grid> + </Grid> + </Grid> + </FiltersPaper> + ) + else + return ( + <FiltersPaper elevation={4} square> + <Grid container direction='row' alignItems='center'> + <Grid item xs={12}> + <Grid container alignItems='center'> + <Grid item xs={12} md={2}> + <Label> + Buscar por: + </Label> + </Grid> + <Grid item xs={12} md={10}> + <TextField + select + fullWidth + value={currOption} + onChange={handleChangeOption} + variant="outlined" + > + {options.map((option) => ( + <MenuItem + key={option.value} + value={option.name} + name={option.value} + > + <span style={{ color: option.color }}> + {option.value} + </span> + </MenuItem> + ))} + </TextField> + </Grid> + </Grid> + </Grid> + </Grid> + </FiltersPaper> + ) +} + +const Label = styled.p` + text-align: center; + font-weight: 600; +` + + +const FiltersPaper = styled(Paper)` + /* height: 150px; */ + text-align: center; + background-color: #fff; + margin-top: 5px; + margin-bottom: 30px; + padding: 0.5em 1em; + color: #666; + .textInfo{ + text-align: start; + } +`; \ No newline at end of file diff --git a/src/Components/SearchPageComponents/ResourceTemplate.js b/src/Components/SearchPageComponents/ResourceTemplate.js new file mode 100644 index 00000000..7a2b6da0 --- /dev/null +++ b/src/Components/SearchPageComponents/ResourceTemplate.js @@ -0,0 +1,122 @@ +import React, { useEffect } from 'react'; +import Paper from '@material-ui/core/Paper'; +import styled from 'styled-components'; +import Grid from '@material-ui/core/Grid'; +import LoadingSpinner from '../LoadingSpinner'; +import noResources from '../../img/Pagina_vazia_Sem_publicar.png'; +import ResourceCardFunction from '../ResourceCardFunction'; +import IconButton from '@material-ui/core/IconButton'; +import ArrowBackIcon from '@material-ui/icons/ArrowBack'; +import ArrowForwardIcon from '@material-ui/icons/ArrowForward'; + +export default function ResourceTemplate({ isLoading, resources, totalResources, currPage, handlePreviousPage, handleNextPage }) { + const totalPages = Math.ceil(totalResources / 12); //Dividing by 12 because i want to cath total pages, and results per page is 12 + const topRef = React.useRef(); + + useEffect(() => { + topRef.current.scrollIntoView(); + }, [isLoading]) + + return ( + <ResourcePaper elevation={4} square> + <div ref={topRef} /> + <Title> + Recursos encontrados ({totalResources}) + </Title> + { + isLoading ? + <LoadingSpinner text='Carregando recursos...' /> + : + <Grid container justify='center' alignItems='center' spacing={3}> + { + resources.length >= 1 ? + resources.map((card) => { + return <Grid item key={new Date().toISOString() + card.id} > + <ResourceCardFunction + avatar={card.publisher ? card.publisher.avatar : ""} + id={card.id} + thumbnail={card.thumbnail} + type={card.object_type ? card.object_type : "Outros"} + title={card.name} + published={card.state === "published" ? true : false} + likeCount={card.likes_count} + liked={card.liked} + rating={card.review_average} + author={card.author} + tags={card.educational_stages} + href={"/recurso/" + card.id} + downloadableLink={card.default_attachment_location} + /> + </Grid> + }) + : + <NoContentDiv> + <h3> + Desculpe, não há dados nessa página. + </h3> + <img src={noResources} alt='No cards' /> + </NoContentDiv> + } + </Grid> + } + { + !isLoading && + <Grid container direction='row' alignItems='center' justify='center' spacing={3}> + <Grid item> + <StyledIconButton elevation={4} disabled={currPage === 0}> + <IconButton onClick={handlePreviousPage} disabled={currPage === 0}> + <ArrowBackIcon className='icon' /> + </IconButton> + </StyledIconButton> + </Grid> + <Grid item> + <ActualPage> + {currPage} + </ActualPage>...{totalPages} + </Grid> + <Grid item> + <StyledIconButton elevation={4} disabled={currPage === totalPages}> + <IconButton onClick={handleNextPage} disabled={currPage === totalPages}> + <ArrowForwardIcon className='icon' /> + </IconButton> + </StyledIconButton> + </Grid> + </Grid> + } + </ResourcePaper> + ) +}; + +const Title = styled.h4` + text-align: left; + color: #ff7f00; +` +const NoContentDiv = styled.div` + >h3{ + color: #ff7f00; + text-align: center; + } +` +const ActualPage = styled.span` + color: #ff7f00; +` +const StyledIconButton = styled(Paper)` + border-radius: 50% !important; + background-color: ${props => props.disabled ? "#666" : "#ff7f00"} !important; + .icon{ + color: ${props => props.disabled ? "#d4d4d4" : "white"}; + } +` + +const ResourcePaper = styled(Paper)` + /* height: 150px; */ + text-align: center; + background-color: #fff; + margin-top: 5px; + margin-bottom: 30px; + padding: 0.5em 1em; + color: #666; + .textInfo{ + text-align: start; + } +`; \ No newline at end of file diff --git a/src/Components/SearchPageComponents/UserTemplate.js b/src/Components/SearchPageComponents/UserTemplate.js new file mode 100644 index 00000000..c92296f7 --- /dev/null +++ b/src/Components/SearchPageComponents/UserTemplate.js @@ -0,0 +1,117 @@ +import React, { useEffect } from 'react'; +import Paper from '@material-ui/core/Paper'; +import styled from 'styled-components'; +import Grid from '@material-ui/core/Grid'; +import LoadingSpinner from '../LoadingSpinner'; +import ContactCard from '../ContactCard'; +import IconButton from '@material-ui/core/IconButton'; +import ArrowBackIcon from '@material-ui/icons/ArrowBack'; +import ArrowForwardIcon from '@material-ui/icons/ArrowForward'; +import { apiDomain } from '../../env'; + +export default function ResourceTemplate({ isLoading, resources, totalResources, currPage, handlePreviousPage, handleNextPage }) { + const totalPages = Math.ceil(totalResources / 12); //Dividing by 12 because i want to cath total pages, and results per page is 12 + const topRef = React.useRef(); + + useEffect(() => { + topRef.current.scrollIntoView() + }, [isLoading]) + + return ( + <ResourcePaper elevation={4} square> + <div ref={topRef} /> + <Title> + Usuários encontrados ({totalResources}) + </Title> + { + isLoading ? + <LoadingSpinner text='Carregando recursos...' /> + : + <Grid container justify='center' alignItems='center' spacing={3}> + { + resources.length >= 1 ? + resources.map((card) => { + return <Grid item key={new Date().toISOString() + card.id} > + <ContactCard + name={card.name} + avatar={card.avatar ? apiDomain + card.avatar : null} + cover={card.cover ? apiDomain + card.cover : null} + numCollections={card.collections_count} + numLearningObjects={card.learning_objects_count} + follow_count={card.follows_count} + followed={card.followed || null} + followerID={card.id} + href={'/usuario-publico/' + card.id} + /> + </Grid> + }) + : + <NoContentDiv> + <h3> + Desculpe, não há dados nessa página. + </h3> + </NoContentDiv> + } + </Grid> + } + { + !isLoading && + <Grid container direction='row' alignItems='center' justify='center' spacing={3}> + <Grid item> + <StyledIconButton elevation={4} disabled={currPage === 0}> + <IconButton onClick={handlePreviousPage} disabled={currPage === 0}> + <ArrowBackIcon className='icon' /> + </IconButton> + </StyledIconButton> + </Grid> + <Grid item> + <ActualPage> + {currPage} + </ActualPage>...{totalPages} + </Grid> + <Grid item> + <StyledIconButton elevation={4} disabled={currPage === totalPages}> + <IconButton onClick={handleNextPage} disabled={currPage === totalPages}> + <ArrowForwardIcon className='icon' /> + </IconButton> + </StyledIconButton> + </Grid> + </Grid> + } + </ResourcePaper> + ) +}; + +const Title = styled.h4` + text-align: left; + color: #00bcd4; +` +const NoContentDiv = styled.div` + >h3{ + color: #00bcd4; + text-align: center; + } +` +const ActualPage = styled.span` + color: #00bcd4; +` +const StyledIconButton = styled(Paper)` + border-radius: 50% !important; + background-color: ${props => props.disabled ? "#666" : "#00bcd4"} !important; + .icon{ + color: ${props => props.disabled ? "#d4d4d4" : "white"}; + } +` + +const ResourcePaper = styled(Paper)` + /* height: 150px; */ + text-align: center; + background-color: #fff; + margin-top: 5px; + margin-bottom: 30px; + padding: 0.5em 1em; + color: #666; + .textInfo{ + text-align: start; + } +`; \ No newline at end of file diff --git a/src/Pages/CollectionPage.js b/src/Pages/CollectionPage.js index 51c8ba5c..0c60a960 100644 --- a/src/Pages/CollectionPage.js +++ b/src/Pages/CollectionPage.js @@ -64,17 +64,18 @@ export default function CollectionPage(props) { </p> </Grid> <Grid item> - <Link className="link" to="/busca?query=*&search_class=Collection"> + + <Link className="link" to={`/busca?page=0&results_per_page=12&order=review_average&query=*&search_class=Collection`}> <Button - variant='contained' - className="back-button" - > - Voltar para a busca de coleções. + variant='contained' + className="back-button" + > + Voltar para a busca de coleções. </Button> </Link> - </Grid> </Grid> - </CollectionNotFound> + </Grid> + </CollectionNotFound > if (loading) return <LoadingSpinner text="Carregando coleção..." /> else diff --git a/src/Pages/PublicUserPage.js b/src/Pages/PublicUserPage.js index 9b561ab6..e853439a 100644 --- a/src/Pages/PublicUserPage.js +++ b/src/Pages/PublicUserPage.js @@ -174,7 +174,7 @@ export default function PublicUserPage(props) { </p> </Grid> <Grid item> - <Link className="link" to="/busca?query=*&search_class=User"> + <Link className="link" to={`/busca?page=0&results_per_page=12&query=*&search_class=User`}> <Button variant='contained' className="back-button" diff --git a/src/Pages/ResourcePage.js b/src/Pages/ResourcePage.js index 4fdc717e..317663da 100644 --- a/src/Pages/ResourcePage.js +++ b/src/Pages/ResourcePage.js @@ -150,7 +150,7 @@ export default function LearningObjectPage(props) { </p> </Grid> <Grid item> - <Link className="link" to="/busca?query=*&search_class=LearningObject"> + <Link className="link" to={`/busca?page=0&results_per_page=12&order=review_average&query=*&search_class=LearningObject`}> <Button variant='contained' className="back-button" diff --git a/src/Pages/Search.js b/src/Pages/Search.js index 5e5fcbd8..3e657bf8 100644 --- a/src/Pages/Search.js +++ b/src/Pages/Search.js @@ -1,121 +1,120 @@ -/*Copyright (C) 2019 Centro de Computacao Cientifica e Software Livre -Departamento de Informatica - Universidade Federal do Parana - -This file is part of Plataforma Integrada MEC. - -Plataforma Integrada MEC is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -Plataforma Integrada MEC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -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, { useEffect, useState, useContext } from "react"; -import { apiDomain } from '../env'; -import { Link, useHistory } from "react-router-dom"; -import styled from "styled-components"; -import Paper from "@material-ui/core/Paper"; -import LoadingSpinner from '../Components/LoadingSpinner'; -import Breadcrumbs from "@material-ui/core/Breadcrumbs"; -import "./Styles/Home.css"; -import { Store } from "../Store"; -import { Grid } from "@material-ui/core"; -import Dropdown from "react-dropdown"; -import "react-dropdown/style.css"; -import SearchExpansionPanel from "../Components/SearchExpansionPanel/SearchExpansionPanel"; -import ResourceCardFunction from "../Components/ResourceCardFunction"; -import CollectionCardFunction from "../Components/CollectionCardFunction"; -import ContactCard from "../Components/ContactCard"; -import CircularProgress from '@material-ui/core/CircularProgress'; -import { getRequest } from '../Components/HelperFunctions/getAxiosConfig' -import ColecaoVazia from '../img/Pagina_vazia_colecao.png' -import RecursoVazio from '../img/Pagina_vazia_Sem_publicar.png' - - -let order = "review_average"; -let currFilter = ""; -let currOption; - -export default function Search(props) { - const history = useHistory() - - const { state, dispatch } = useContext(Store); - const [resultsResource, setResultsResource] = useState([]); - const [resultsCollection, setResultsCollection] = useState([]); - const [resultsUser, setResultsUser] = useState([]); - const [currOrder, setCurrOrder] = useState(order); - const [page, setPage] = useState(0); - const [isloading, setIsLoading] = useState(false); - const [loadingMoreData, setLoadingMoreData] = useState(false); - const [isFiltering, setIsFiltering] = useState(false); - const [resultsPerPage] = useState(12); - const [showingResults, setShowingResults] = useState(0); - const [totalResults, setTotalResults] = useState(0); - const [options] = React.useState([ - { label: "Recursos", value: "LearningObject" }, - { label: "Coleções", value: "Collection" }, - { label: "Usuários", value: "User" }, - ]); - const [ordenar] = useState([ - { label: "Mais Estrelas", value: "review_average" }, - { label: "Mais Relevante", value: "score" }, - { label: "Mais Baixados", value: "downloads" }, - { label: "Mais Favoritados", value: "likes" }, - { label: "Mais Recentes", value: "publicationdesc" }, - { label: "Ordem Alfabética", value: "title" }, - ]); - - const [option, setOption] = useState( - new URLSearchParams(window.location.search).get("search_class") - ); - const [optionResult, setOptionResult] = useState(option); - currOption = option; - - function handleSuccessfulGet(data, headers) { - if (currOption === "LearningObject") { - setResultsResource((previousData) => previousData.concat(data)); - } - else if (currOption === "Collection") { - setResultsCollection((previousData) => previousData.concat(data)); +// /*Copyright (C) 2019 Centro de Computacao Cientifica e Software Livre +// Departamento de Informatica - Universidade Federal do Parana + +// This file is part of Plataforma Integrada MEC. + +// Plataforma Integrada MEC is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Plataforma Integrada MEC is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// 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, { useEffect, useState } from 'react'; +import styled from 'styled-components'; +import { Link } from 'react-router-dom'; +import Breadcrumbs from '@material-ui/core/Breadcrumbs'; +import HeaderFilters from '../Components/SearchPageComponents/HeaderFilters'; +import ResourceTemplate from '../Components/SearchPageComponents/ResourceTemplate'; +import CollectionTemplate from '../Components/SearchPageComponents/CollectionTemplate'; +import UserTemplate from '../Components/SearchPageComponents/UserTemplate'; +import { getRequest } from '../Components/HelperFunctions/getAxiosConfig'; +import { useHistory } from 'react-router-dom'; + +export default function Search() { + const history = useHistory(); + + const [currOption, setCurrOption] = useState(''); + const [currOrder, serCurrOrder] = useState('review_average'); + const [currQuery, setCurrQuery] = useState(''); + const [currPage, setCurrPage] = useState(0); + const [isLoading, setIsLoading] = useState(false); + + const [resourcesArray, setResourcesArray] = useState([]); + const [totalResources, setTotalResources] = useState(0); + + const [collectionsArray, setCollectionsArray] = useState([]) + const [totalCollections, setTotalCollections] = useState(0); + + const [usersArray, setUsersArray] = useState([]) + const [totalUsers, setTotalUsers] = useState(0); + + const options = [ + { value: 'Recursos', name: 'LearningObject', color: '#ff7f00' }, + { value: 'Coleções', name: 'Collection', color: '#673ab7' }, + { value: 'Usuários', name: 'User', color: '#00bcd4' }, + ]; + const orders = [ + { value: 'Mais Estrelas', name: 'review_average' }, + { value: 'Mais Relevante', name: 'score' }, + { value: 'Mais Baixados', name: 'downloads' }, + { value: 'Mais Favoritados', name: 'likes' }, + { value: 'Mais Recentes', name: 'publicationdesc' }, + { value: 'Ordem Alfabética', name: 'title' }, + ]; + + function handleChangeOption(e) { + const value = e.target.value; + setCurrOption(value); + let url; + + if (value !== 'User') + url = `/busca?page=0&results_per_page=12&order=review_average&query=*&search_class=${value}` + else + url = `/busca?page=0&results_per_page=12&query=*&search_class=${value}` + + history.push(url); + } + + function handleChangeOrder(e) { + serCurrOrder(e.target.value); + } + + function handleNextPage() { + const nextPage = currPage + 1; + const url = `/busca?page=${nextPage}&results_per_page=12&order=${currOrder}&query=${currQuery}&search_class=${currOption}` + history.push(url); + } + + function handlePreviousPage() { + const previousPage = currPage - 1; + const url = `/busca?page=${previousPage}&results_per_page=12&order=${currOrder}&query=${currQuery}&search_class=${currOption}` + history.push(url); + } + + function handleSuccess(data, headers, option) { + console.log(option) + if (option === 'LearningObject') { + setResourcesArray(data) + if (headers.has('X-Total-Count')) { + setTotalResources(headers.get('X-Total-Count')); + } } - else if (currOption === "User") { - setResultsUser((previousData) => previousData.concat(data)); + else if (option === 'Collection') { + setCollectionsArray(data) + if (headers.has('X-Total-Count')) { + setTotalCollections(headers.get('X-Total-Count')); + } } - dispatch({ - type: "SAVE_SEARCH", - newSearch: { - query: state.search.query, - class: currOption, - }, - }); - if (headers.has('X-Total-Count')) { - setTotalResults(headers.get('X-Total-Count')); + else { + setUsersArray(data); + if (headers.has('X-Total-Count')) { + setTotalUsers(headers.get('X-Total-Count')); + } } - setShowingResults((previousSize) => data.length + previousSize) setIsLoading(false); - setIsFiltering(false); - setLoadingMoreData(false); } - const collectStuff = (tipoBusca, filtro) => { - - const urlParams = new URLSearchParams(window.location.search); - const query = urlParams.get("query"); - const searchClass = urlParams.get("search_class"); - - if (!loadingMoreData) // this line prevents resetting filter when loading more data - currFilter = filtro; - if (filtro) - setIsFiltering(true); - const url = `/search?page=${page}&results_per_page=${resultsPerPage}&order=${order}&query=${query}${currFilter ? currFilter : ""}&search_class=${searchClass}` - getRequest(url, handleSuccessfulGet, (error) => { console.log(error) }) - }; + function handleFail() { + setIsLoading(false); + } useEffect(() => { setIsLoading(true) @@ -123,353 +122,87 @@ export default function Search(props) { const urlParams = new URLSearchParams(window.location.search); const query = urlParams.get("query"); const searchClass = urlParams.get("search_class"); + const page = parseInt(urlParams.get("page")); + const order = urlParams.get("order"); - if (state.search.query !== query || state.search.class !== searchClass) { - dispatch({ - type: "SAVE_SEARCH", - newSearch: { - query: query, - class: searchClass, - }, - }); - state.search.query = query - state.search.class = searchClass - } - currOption = searchClass - setOption(searchClass) - setOptionResult(searchClass) - collectStuff(searchClass) - - return () => - dispatch({ - type: "HANDLE_SEARCH_BAR", - opened: false, - }); - }, [window.history.state === null ? true : window.history.state.key, state.currentUser.id]) + setCurrOption(searchClass); + setCurrQuery(query); + setCurrPage(page); + serCurrOrder(order); - useEffect(() => { - if (page > 0) { - setIsLoading(true); - collectStuff(option); - } - }, [page]); + let url - return ( - <div style={{ backgroundColor: "#f4f4f4" }}> - <Principal> - <BreadCrumbsDiv style={{ margin: "15px 2%", }}> - <StyledBreadCrumbs> - <Link to="/">Página Inicial</Link> - <span>Busca</span> - </StyledBreadCrumbs> - </BreadCrumbsDiv> - - <div style={{ margin: "15px 2%", }}> - <HeaderFilters elevation={4} square> - <Grid container spacing={0} style={{ height: "100%" }}> - <Grid item xs style={{ display: "flex", flexDirection: "column", justifyContent: "center", paddingLeft: 20 }}> - <div style={{ marginRight: 5, marginTop: 15 }}> - <div className="textInfo"> - <span style={{ fontWeight: "bold" }}> - MOSTRAR - </span> - </div> - <Dropdown options={options} value={optionResult} - onChange={(e) => { - setResultsCollection([]); - setResultsResource([]); - setResultsUser([]); - setShowingResults(0); - setPage(0); - setIsLoading(true); - currOption = e.value; - history.push(`/busca?query=${state.search.query}&search_class=${currOption}`) - setOption(currOption); - // collectStuff(currOption, ""); - }} - placeholder="Selecione um tipo" - /> - </div> - </Grid> - - { - optionResult === "User" ? null : - <Grid item xs style={{ display: "flex", flexDirection: "column", justifyContent: "center", paddingRight: 20, }}> - <div style={{ marginLeft: 5, marginTop: 15 }}> - <div className="textInfo"> - <span style={{ fontWeight: "bold" }}> - ORDENAR POR - </span> - </div> - <Dropdown options={ordenar} value={currOrder} onChange={(e) => { - order = e.value; - setCurrOrder(e.label) - collectStuff(optionResult, currFilter); - }} - placeholder="Selecione uma opção" - /> - </div> - </Grid> - } - <Grid item xs={12}> - <div style={{ display: "flex", flexDirection: "column", justifyContent: "center" }}> - <div style={{ textAlign: "center", paddingTop: 10, fontWeight: "bolder" }}> - Exibindo {showingResults === 0 ? 0 : showingResults} resultados de {totalResults} encontrados - </div> - </div> - </Grid> - </Grid> - </HeaderFilters> - - { - isloading ? <LoadingSpinner text="Carregando..." /> : - optionResult === "Collection" ? ( - resultsCollection.length >= 1 ? - <GridBuscaCollection container direction="row" spacing={2}> - <Grid item xs> - <Grid container justify="center" alignItems="center" spacing={2}> - {resultsCollection.map((card) => ( - <Grid container item xs justify="center" alignItems="center" key={card.id}> - <CollectionCardFunction - name={card.name} - tags={card.tags} - rating={card.review_average} - id={card.id} - author={card.owner ? card.owner.name : ""} - description={card.description} - thumbnails={card.items_thumbnails} - avatar={card.owner ? card.owner.avatar : ""} - likeCount={card.likes_count} - followed={card.followed} - liked={card.liked} - collections={card.collection_items} - authorID={card.owner.id} - /> - - </Grid> - ))} - </Grid> - <div style={{ display: "flex", flexDirection: "row", justifyContent: "center", }}> - <button - style={{ - height: 36, backgroundColor: "#ff7f00", marginBottom: 50, marginTop: 50, fontSize: 14, - color: "white", borderRadius: 4, border: "none", - }} - onClick={() => { - setLoadingMoreData(true); - setPage(page + 1) - }} - > - { - loadingMoreData ? <CircularProgress size={24} color="inherit" /> : "Carregar mais 12" - } - </button> - </div> - </Grid> - </GridBuscaCollection> : - <Grid container direction="row" justify="center" alignItems="center"> - <Grid item> - <img src={ColecaoVazia} alt="coleção vazia" /> - </Grid> - </Grid> - - ) : - - optionResult === "LearningObject" ? ( - resultsResource.length >= 1 ? - <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> - <Grid container justify="center" spacing={3} alignItems="center" > - {resultsResource.map((card) => ( - <Grid container justify="center" alignItems="center" item xs={12} sm={6} md={4} lg={3} key={card.id}> - <ResourceCardFunction - avatar={card.publisher ? card.publisher.avatar : ""} - id={card.id} - thumbnail={card.thumbnail} - type={card.object_type ? card.object_type : "Outros"} - title={card.name} - published={card.state === "published" ? true : false} - likeCount={card.likes_count} - liked={card.liked} - rating={card.review_average} - author={card.author} - tags={card.educational_stages} - href={"/recurso/" + card.id} - downloadableLink={card.default_attachment_location} - /> - </Grid> - ))} - </Grid> - <div - style={{ - display: "flex", - flexDirection: "row", - justifyContent: "center", - }} - > - <button - style={{ - height: 36, - backgroundColor: "#ff7f00", - marginBottom: 50, - marginTop: 50, - fontSize: 14, - color: "white", - borderRadius: 4, - border: "none", - }} - onClick={() => { - setLoadingMoreData(true); - setPage(page + 1) - // collectStuff("LearningObject", ""); - }} - > - { - loadingMoreData ? <CircularProgress size={24} color="inherit" /> : "Carregar mais 12" - } - </button> - </div> - </Grid> - </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}> - <Grid item xs > - <Grid container spacing={2} justify="center" alignItems="center"> - {resultsUser.map((card) => ( - <Grid container justify="center" alignItems="center" item xs key={card.id}> - <ContactCard - name={card.name} - avatar={card.avatar ? apiDomain + card.avatar : null} - cover={card.cover ? apiDomain + card.cover : null} - numCollections={card.collections_count} - numLearningObjects={card.learning_objects_count} - follow_count={card.follows_count} - followed={card.followed || null} - followerID={card.id} - href={'/usuario-publico/' + card.id} - /> - </Grid> - ))} - </Grid> - <div - style={{ - display: "flex", - flexDirection: "row", - justifyContent: "center", - }} - > - <button - style={{ - height: 36, - backgroundColor: "#ff7f00", - marginBottom: 50, - marginTop: 50, - fontSize: 14, - color: "white", - borderRadius: 4, - border: "none", - }} - onClick={() => { - setLoadingMoreData(true); - setPage(page + 1) - // collectStuff("User", ""); - }} - > - { - loadingMoreData ? <CircularProgress color="inherit" size={24} /> : "Carregar mais 12" - } - </button> - </div> - </Grid> - </GridBuscaUser> - ) - } - </div> - </Principal> - </div> - ); -} + if (searchClass !== 'User') + url = `/search?page=${page}&results_per_page=12&order=${order}&query=${query}&search_class=${searchClass}` + else + url = `/search?page=${page}&results_per_page=12&query=${query}&search_class=${searchClass}` -const GridBuscaCollection = styled(Grid)` - color: #666; - ${'' /* background-color: green; */} + getRequest( + url, + (data, headers) => { handleSuccess(data, headers, searchClass) }, + handleFail, + ); + }, [window.history.state === null ? true : window.history.state.key]) - h4 { - padding: 0 15px; - font-size: 18px; - margin-block: 10px; - text-transform: uppercase; - } -`; -const GridBuscaResource = styled(Grid)` - color: #666; - ${'' /* background-color: red; */} - - h4 { - padding: 0 15px; - font-size: 18px; - margin-block: 10px; - text-transform: uppercase; - } -`; -const GridBuscaUser = styled(Grid)` - color: #666; - ${'' /* background-color: blue; */} - - h4 { - padding: 0 15px; - font-size: 18px; - margin-block: 10px; - text-transform: uppercase; - } -`; + return ( + <MainPage> + <StyledBreadCrumbs> + <Link to='/'>Página Inicial</Link> + <span>Busca</span> + </StyledBreadCrumbs> + <HeaderFilters + options={options} + orders={orders} + currOption={currOption} + currOrder={currOrder} + handleChangeOption={handleChangeOption} + handleChangeOrder={handleChangeOrder} + /> + { + currOption === 'LearningObject' && + <ResourceTemplate + handleNextPage={handleNextPage} + handlePreviousPage={handlePreviousPage} + isLoading={isLoading} + currPage={currPage} + resources={resourcesArray} + totalResources={totalResources} + /> + } + { + currOption === 'Collection' && + <CollectionTemplate + handleNextPage={handleNextPage} + handlePreviousPage={handlePreviousPage} + isLoading={isLoading} + currPage={currPage} + resources={collectionsArray} + totalResources={totalCollections} + /> + } + { + currOption === 'User' && + <UserTemplate + handleNextPage={handleNextPage} + handlePreviousPage={handlePreviousPage} + isLoading={isLoading} + currPage={currPage} + resources={usersArray} + totalResources={totalUsers} + /> + } + </MainPage> + ) +} -const HeaderFilters = styled(Paper)` - height: 150px; - text-align: center; - background-color: #fff; - margin-bottom: 30px; - color: #666; - .textInfo{ - text-align: start; - } -`; +const MainPage = styled.div` + width: 90%; + margin: 1em auto; +` const StyledBreadCrumbs = styled(Breadcrumbs)` display: flex; justify-content: flex-start; - max-width: 1170px; span { color: #a5a5a5; } @@ -479,11 +212,463 @@ const StyledBreadCrumbs = styled(Breadcrumbs)` } `; -const BreadCrumbsDiv = styled.div` - padding: 10px; - display: flex; -`; -const Principal = styled.div` - margin-inline: auto; -`; +// import React, { useEffect, useState, useContext } from "react"; +// import { apiDomain } from '../env'; +// import { Link, useHistory } from "react-router-dom"; +// import styled from "styled-components"; +// import Paper from "@material-ui/core/Paper"; +// import LoadingSpinner from '../Components/LoadingSpinner'; +// import Breadcrumbs from "@material-ui/core/Breadcrumbs"; +// import "./Styles/Home.css"; +// import { Store } from "../Store"; +// import { Grid } from "@material-ui/core"; +// import Dropdown from "react-dropdown"; +// import "react-dropdown/style.css"; +// import SearchExpansionPanel from "../Components/SearchExpansionPanel/SearchExpansionPanel"; +// import ResourceCardFunction from "../Components/ResourceCardFunction"; +// import CollectionCardFunction from "../Components/CollectionCardFunction"; +// import ContactCard from "../Components/ContactCard"; +// import CircularProgress from '@material-ui/core/CircularProgress'; +// import { getRequest } from '../Components/HelperFunctions/getAxiosConfig' +// import ColecaoVazia from '../img/Pagina_vazia_colecao.png' +// import RecursoVazio from '../img/Pagina_vazia_Sem_publicar.png' + + +// let order = "review_average"; +// let currFilter = ""; +// let currOption; + +// export default function Search(props) { +// const history = useHistory() + +// const { state, dispatch } = useContext(Store); +// const [resultsResource, setResultsResource] = useState([]); +// const [resultsCollection, setResultsCollection] = useState([]); +// const [resultsUser, setResultsUser] = useState([]); +// const [currOrder, setCurrOrder] = useState(order); +// const [page, setPage] = useState(0); +// const [isloading, setIsLoading] = useState(false); +// const [loadingMoreData, setLoadingMoreData] = useState(false); +// const [isFiltering, setIsFiltering] = useState(false); +// const [resultsPerPage] = useState(12); +// const [showingResults, setShowingResults] = useState(0); +// const [totalResults, setTotalResults] = useState(0); +// const [options] = React.useState([ +// { label: "Recursos", value: "LearningObject" }, +// { label: "Coleções", value: "Collection" }, +// { label: "Usuários", value: "User" }, +// ]); +// const [ordenar] = useState([ +// { label: "Mais Estrelas", value: "review_average" }, +// { label: "Mais Relevante", value: "score" }, +// { label: "Mais Baixados", value: "downloads" }, +// { label: "Mais Favoritados", value: "likes" }, +// { label: "Mais Recentes", value: "publicationdesc" }, +// { label: "Ordem Alfabética", value: "title" }, +// ]); + +// const [option, setOption] = useState( +// new URLSearchParams(window.location.search).get("search_class") +// ); +// const [optionResult, setOptionResult] = useState(option); +// currOption = option; + +// function handleSuccessfulGet(data, headers) { +// if (currOption === "LearningObject" && page > 0) { +// setResultsResource((previousData) => previousData.concat(data)); +// } +// else { +// setResultsResource(data); +// } +// if (currOption === "Collection" && page > 0) { +// setResultsCollection((previousData) => previousData.concat(data)); +// } +// else { +// setResultsCollection(data); +// } +// if (currOption === "User" && page > 0) { +// setResultsUser((previousData) => previousData.concat(data)); +// } +// else { +// setResultsUser(data); +// } +// dispatch({ +// type: "SAVE_SEARCH", +// newSearch: { +// query: state.search.query, +// class: currOption, +// }, +// }); +// if (headers.has('X-Total-Count')) { +// setTotalResults(headers.get('X-Total-Count')); +// } +// if (page > 0) +// setShowingResults((previousSize) => data.length + previousSize) +// else +// setShowingResults(data.length) +// setIsLoading(false); +// setIsFiltering(false); +// setLoadingMoreData(false); +// } + +// const collectStuff = (tipoBusca, filtro) => { + +// const urlParams = new URLSearchParams(window.location.search); +// const query = urlParams.get("query"); +// const searchClass = urlParams.get("search_class"); + +// if (!loadingMoreData) // this line prevents resetting filter when loading more data +// currFilter = filtro; +// if (filtro) +// setIsFiltering(true); +// const url = `/search?page=${page}&results_per_page=${resultsPerPage}&order=${order}&query=${query}${currFilter ? currFilter : ""}&search_class=${searchClass}` +// getRequest(url, handleSuccessfulGet, (error) => { console.log(error) }) +// }; + +// useEffect(() => { +// setIsLoading(true) + +// const urlParams = new URLSearchParams(window.location.search); +// const query = urlParams.get("query"); +// const searchClass = urlParams.get("search_class"); + +// if (state.search.query !== query || state.search.class !== searchClass) { +// dispatch({ +// type: "SAVE_SEARCH", +// newSearch: { +// query: query, +// class: searchClass, +// }, +// }); +// state.search.query = query +// state.search.class = searchClass +// } +// currOption = searchClass +// setOption(searchClass) +// setOptionResult(searchClass) +// collectStuff(searchClass) + +// return () => +// dispatch({ +// type: "HANDLE_SEARCH_BAR", +// opened: false, +// }); +// }, [state.currentUser.id, window.history.state === null ? true : window.history.state.key]) + +// useEffect(() => { +// if (page > 0) { +// setIsLoading(true); +// collectStuff(option); +// } +// }, [page]); + +// return ( +// <div style={{ backgroundColor: "#f4f4f4" }}> +// <Principal> +// <BreadCrumbsDiv style={{ margin: "15px 2%", }}> +// <StyledBreadCrumbs> +// <Link to="/">Página Inicial</Link> +// <span>Busca</span> +// </StyledBreadCrumbs> +// </BreadCrumbsDiv> + +// <div style={{ margin: "15px 2%", }}> +// <HeaderFilters elevation={4} square> +// <Grid container spacing={0} style={{ height: "100%" }}> +// <Grid item xs style={{ display: "flex", flexDirection: "column", justifyContent: "center", paddingLeft: 20 }}> +// <div style={{ marginRight: 5, marginTop: 15 }}> +// <div className="textInfo"> +// <span style={{ fontWeight: "bold" }}> +// MOSTRAR +// </span> +// </div> +// <Dropdown options={options} value={optionResult} +// onChange={(e) => { +// setResultsCollection([]); +// setResultsResource([]); +// setResultsUser([]); +// setShowingResults(0); +// setPage(0); +// setIsLoading(true); +// currOption = e.value; +// history.push(`/busca?query=${state.search.query}&search_class=${currOption}`) +// setOption(currOption); +// // collectStuff(currOption, ""); +// }} +// placeholder="Selecione um tipo" +// /> +// </div> +// </Grid> + +// { +// optionResult === "User" ? null : +// <Grid item xs style={{ display: "flex", flexDirection: "column", justifyContent: "center", paddingRight: 20, }}> +// <div style={{ marginLeft: 5, marginTop: 15 }}> +// <div className="textInfo"> +// <span style={{ fontWeight: "bold" }}> +// ORDENAR POR +// </span> +// </div> +// <Dropdown options={ordenar} value={currOrder} onChange={(e) => { +// order = e.value; +// setCurrOrder(e.label) +// collectStuff(optionResult, currFilter); +// }} +// placeholder="Selecione uma opção" +// /> +// </div> +// </Grid> +// } +// <Grid item xs={12}> +// <div style={{ display: "flex", flexDirection: "column", justifyContent: "center" }}> +// <div style={{ textAlign: "center", paddingTop: 10, fontWeight: "bolder" }}> +// Exibindo {showingResults === 0 ? 0 : showingResults} resultados de {totalResults} encontrados +// </div> +// </div> +// </Grid> +// </Grid> +// </HeaderFilters> + +// { +// isloading ? <LoadingSpinner text="Carregando..." /> : +// optionResult === "Collection" ? ( +// resultsCollection.length >= 1 ? +// <GridBuscaCollection container direction="row" spacing={2}> +// <Grid item xs> +// <Grid container justify="center" alignItems="center" spacing={2}> +// {resultsCollection.map((card) => ( +// <Grid container item xs justify="center" alignItems="center" key={card.id}> +// <CollectionCardFunction +// name={card.name} +// tags={card.tags} +// rating={card.review_average} +// id={card.id} +// author={card.owner ? card.owner.name : ""} +// description={card.description} +// thumbnails={card.items_thumbnails} +// avatar={card.owner ? card.owner.avatar : ""} +// likeCount={card.likes_count} +// followed={card.followed} +// liked={card.liked} +// collections={card.collection_items} +// authorID={card.owner.id} +// /> + +// </Grid> +// ))} +// </Grid> +// <div style={{ display: "flex", flexDirection: "row", justifyContent: "center", }}> +// <button +// style={{ +// height: 36, backgroundColor: "#ff7f00", marginBottom: 50, marginTop: 50, fontSize: 14, +// color: "white", borderRadius: 4, border: "none", +// }} +// onClick={() => { +// setLoadingMoreData(true); +// setPage(page + 1) +// }} +// > +// { +// loadingMoreData ? <CircularProgress size={24} color="inherit" /> : "Carregar mais 12" +// } +// </button> +// </div> +// </Grid> +// </GridBuscaCollection> : +// <Grid container direction="row" justify="center" alignItems="center"> +// <Grid item> +// <img src={ColecaoVazia} alt="coleção vazia" /> +// </Grid> +// </Grid> + +// ) : + +// optionResult === "LearningObject" ? ( +// resultsResource.length >= 1 ? +// <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> +// <Grid container justify="center" spacing={3} alignItems="center" > +// {resultsResource.map((card) => ( +// <Grid container justify="center" alignItems="center" item xs={12} sm={6} md={4} lg={3} key={card.id}> +// <ResourceCardFunction +// avatar={card.publisher ? card.publisher.avatar : ""} +// id={card.id} +// thumbnail={card.thumbnail} +// type={card.object_type ? card.object_type : "Outros"} +// title={card.name} +// published={card.state === "published" ? true : false} +// likeCount={card.likes_count} +// liked={card.liked} +// rating={card.review_average} +// author={card.author} +// tags={card.educational_stages} +// href={"/recurso/" + card.id} +// downloadableLink={card.default_attachment_location} +// /> +// </Grid> +// ))} +// </Grid> +// <div +// style={{ +// display: "flex", +// flexDirection: "row", +// justifyContent: "center", +// }} +// > +// <button +// style={{ +// height: 36, +// backgroundColor: "#ff7f00", +// marginBottom: 50, +// marginTop: 50, +// fontSize: 14, +// color: "white", +// borderRadius: 4, +// border: "none", +// }} +// onClick={() => { +// setLoadingMoreData(true); +// setPage(page + 1) +// // collectStuff("LearningObject", ""); +// }} +// > +// { +// loadingMoreData ? <CircularProgress size={24} color="inherit" /> : "Carregar mais 12" +// } +// </button> +// </div> +// </Grid> +// </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}> +// <Grid item xs > +// <Grid container spacing={2} justify="center" alignItems="center"> +// {resultsUser.map((card) => ( +// <Grid container justify="center" alignItems="center" item xs key={card.id}> +// <ContactCard + // name={card.name} + // avatar={card.avatar ? apiDomain + card.avatar : null} + // cover={card.cover ? apiDomain + card.cover : null} + // numCollections={card.collections_count} + // numLearningObjects={card.learning_objects_count} + // follow_count={card.follows_count} + // followed={card.followed || null} + // followerID={card.id} + // href={'/usuario-publico/' + card.id} +// /> +// </Grid> +// ))} +// </Grid> +// <div +// style={{ +// display: "flex", +// flexDirection: "row", +// justifyContent: "center", +// }} +// > +// <button +// style={{ +// height: 36, +// backgroundColor: "#ff7f00", +// marginBottom: 50, +// marginTop: 50, +// fontSize: 14, +// color: "white", +// borderRadius: 4, +// border: "none", +// }} +// onClick={() => { +// setLoadingMoreData(true); +// setPage(page + 1) +// // collectStuff("User", ""); +// }} +// > +// { +// loadingMoreData ? <CircularProgress color="inherit" size={24} /> : "Carregar mais 12" +// } +// </button> +// </div> +// </Grid> +// </GridBuscaUser> +// ) +// } +// </div> +// </Principal> +// </div> +// ); +// } + +// const GridBuscaCollection = styled(Grid)` +// color: #666; +// ${'' /* background-color: green; */} + +// h4 { +// padding: 0 15px; +// font-size: 18px; +// margin-block: 10px; +// text-transform: uppercase; +// } +// `; +// const GridBuscaResource = styled(Grid)` +// color: #666; +// ${'' /* background-color: red; */} + +// h4 { +// padding: 0 15px; +// font-size: 18px; +// margin-block: 10px; +// text-transform: uppercase; +// } +// `; +// const GridBuscaUser = styled(Grid)` +// color: #666; +// ${'' /* background-color: blue; */} + +// h4 { +// padding: 0 15px; +// font-size: 18px; +// margin-block: 10px; +// text-transform: uppercase; +// } +// ` + +// const BreadCrumbsDiv = styled.div` +// padding: 10px; +// display: flex; +// `; + +// const Principal = styled.div` +// margin-inline: auto; +// `; -- GitLab From e51de206dfb20586f29707461f02e6e553c6c79b Mon Sep 17 00:00:00 2001 From: Luis Felipe Risch <lfr20@inf.ufpr.br> Date: Thu, 17 Jun 2021 23:53:10 -0300 Subject: [PATCH 2/6] Fixing search page --- .../SearchEPCompCurriculum.js | 25 +-- .../SearchExpansionPanel/SearchEPIdiomas.js | 25 +-- .../SearchExpansionPanel/SearchEPTiposRec.js | 25 +-- .../SearchExpansionPanel.js | 23 ++- .../SearchExpansionPanel/SesrchEPEtapasEns.js | 25 ++- .../CollectionTemplate.js | 4 +- .../SearchPageComponents/FilterSummary.js | 192 ++++++++++++++++++ .../SearchPageComponents/ResourceTemplate.js | 4 +- .../SearchPageComponents/UserTemplate.js | 4 +- src/Pages/Search.js | 136 +++++++++++-- src/env.js | 2 +- 11 files changed, 390 insertions(+), 75 deletions(-) create mode 100644 src/Components/SearchPageComponents/FilterSummary.js diff --git a/src/Components/SearchExpansionPanel/SearchEPCompCurriculum.js b/src/Components/SearchExpansionPanel/SearchEPCompCurriculum.js index 180eaeef..8d5e2312 100644 --- a/src/Components/SearchExpansionPanel/SearchEPCompCurriculum.js +++ b/src/Components/SearchExpansionPanel/SearchEPCompCurriculum.js @@ -19,28 +19,29 @@ const useStyles = makeStyles(theme => ({ export default function SearchEPCompCurriculum(props) { const classes = useStyles(); - const [checked, setChecked] = React.useState([0]); + const [checked, setChecked] = React.useState([]); + const [checkedWithLabel, setCheckedWithLabel] = React.useState([]); - const handleToggle = value => () => { + const handleToggle = (value, label) => () => { const currentIndex = checked.indexOf(value); const newChecked = [...checked]; + const newCheckedWithLabel = [...checkedWithLabel]; if (currentIndex === -1) { newChecked.push(value); + newCheckedWithLabel.push({ + label: label, + value: value, + }); } else { newChecked.splice(currentIndex, 1); + newCheckedWithLabel.splice(currentIndex, 1); } - let filterString = ""; - setChecked(newChecked); - for(let i = 0; i < newChecked.length; i++){ - if(newChecked[i] !== 0){ - filterString = filterString + `&subjects[]=${newChecked[i]}` - console.log(filterString) - } - } - props.onChange("LearningObject", filterString) + setCheckedWithLabel(newCheckedWithLabel) + + props.onChange("curriculum", newCheckedWithLabel) }; const filtrosComponente = [ { exemplo: "Arte", value: "3" }, @@ -81,7 +82,7 @@ export default function SearchEPCompCurriculum(props) { role={undefined} dense button - onClick={handleToggle(item.value)} + onClick={handleToggle(item.value, item.exemplo)} > <ListItemIcon> <Checkbox diff --git a/src/Components/SearchExpansionPanel/SearchEPIdiomas.js b/src/Components/SearchExpansionPanel/SearchEPIdiomas.js index b32f032c..94b36f12 100644 --- a/src/Components/SearchExpansionPanel/SearchEPIdiomas.js +++ b/src/Components/SearchExpansionPanel/SearchEPIdiomas.js @@ -19,28 +19,29 @@ const useStyles = makeStyles(theme => ({ export default function SearchEPIdiomas(props) { const classes = useStyles(); - const [checked, setChecked] = React.useState([0]); + const [checked, setChecked] = React.useState([]); + const [checkedWithLabel, setCheckedWithLabel] = React.useState([]); - const handleToggle = value => () => { + const handleToggle = (value, label) => () => { const currentIndex = checked.indexOf(value); const newChecked = [...checked]; + const newCheckedWithLabel = [...checkedWithLabel]; if (currentIndex === -1) { newChecked.push(value); + newCheckedWithLabel.push({ + label: label, + value: value, + }); } else { newChecked.splice(currentIndex, 1); + newCheckedWithLabel.splice(currentIndex, 1); } setChecked(newChecked); - let filterString = ""; - - for(let i = 0; i < newChecked.length; i++){ - if(newChecked[i] !== 0){ - filterString = filterString + `&languages[]=${newChecked[i]}` - console.log(filterString) - } - } - props.onChange("LearningObject", filterString) + setCheckedWithLabel(newCheckedWithLabel) + + props.onChange("languages", newCheckedWithLabel) }; const filtrosIdiomas = [ { value: "5", exemplo: "Alemão" }, @@ -67,7 +68,7 @@ export default function SearchEPIdiomas(props) { role={undefined} dense button - onClick={handleToggle(item.value)} + onClick={handleToggle(item.value, item.exemplo)} > <ListItemIcon> <Checkbox diff --git a/src/Components/SearchExpansionPanel/SearchEPTiposRec.js b/src/Components/SearchExpansionPanel/SearchEPTiposRec.js index 8dc4fcf6..85c4a0bc 100644 --- a/src/Components/SearchExpansionPanel/SearchEPTiposRec.js +++ b/src/Components/SearchExpansionPanel/SearchEPTiposRec.js @@ -19,28 +19,29 @@ const useStyles = makeStyles(theme => ({ export default function SearchEPTiposRec(props) { const classes = useStyles(); - const [checked, setChecked] = React.useState([0]); + const [checked, setChecked] = React.useState([]); + const [checkedWithLabel, setCheckedWithLabel] = React.useState([]); - const handleToggle = value => () => { + const handleToggle = (value, label) => () => { const currentIndex = checked.indexOf(value); const newChecked = [...checked]; + const newCheckedWithLabel = [...checkedWithLabel]; if (currentIndex === -1) { newChecked.push(value); + newCheckedWithLabel.push({ + label: label, + value: value, + }); } else { newChecked.splice(currentIndex, 1); + newCheckedWithLabel.splice(currentIndex, 1); } - let filterString = ""; - setChecked(newChecked); - for(let i = 0; i < newChecked.length; i++){ - if(newChecked[i] !== 0){ - filterString = filterString + `&object_types[]=${newChecked[i]}` - console.log(filterString) - } - } - props.onChange("LearningObject", filterString) + setCheckedWithLabel(newCheckedWithLabel) + + props.onChange("types", newCheckedWithLabel) }; const filtrosTipos = [ { value: "5", exemplo: "Animação" }, @@ -72,7 +73,7 @@ export default function SearchEPTiposRec(props) { role={undefined} dense button - onClick={handleToggle(item.value)} + onClick={handleToggle(item.value, item.exemplo)} > <ListItemIcon> <Checkbox diff --git a/src/Components/SearchExpansionPanel/SearchExpansionPanel.js b/src/Components/SearchExpansionPanel/SearchExpansionPanel.js index 7ebfc2c9..7d8e07d1 100644 --- a/src/Components/SearchExpansionPanel/SearchExpansionPanel.js +++ b/src/Components/SearchExpansionPanel/SearchExpansionPanel.js @@ -12,6 +12,8 @@ import SearchEPIdiomas from "./SearchEPIdiomas"; import { TextField } from "@material-ui/core"; import Grid from '@material-ui/core/Grid'; import CircularProgress from '@material-ui/core/CircularProgress'; +import Paper from '@material-ui/core/Paper'; +import styled from 'styled-components'; import './ExpansionPanel.css' @@ -77,7 +79,6 @@ export default function SearchExpansionPanel(props) { const onKeyPressed = (e) => { if (e.key === "Enter") { - const filterString = "&tags[]=" + keyWords if (keyWords.length === 0) { setErrorInKeyWord({ state: true, @@ -85,7 +86,7 @@ export default function SearchExpansionPanel(props) { }) } else - props.onChange("LearningObject", filterString) + props.onChange("tag", keyWords) } } @@ -99,7 +100,7 @@ export default function SearchExpansionPanel(props) { } return ( - <div> + <MainPaper square elevation={4}> <link href="https://fonts.googleapis.com/css?family=Roboto:400,500&display=swap" rel="stylesheet" @@ -136,7 +137,7 @@ export default function SearchExpansionPanel(props) { </ExpansionPanel> <ExpansionPanel square> - <ExpansionPanelSummary + <ExpansionPanelSummary expandIcon={<ExpandMoreIcon />} aria-controls="panel2d-content" @@ -210,6 +211,18 @@ export default function SearchExpansionPanel(props) { /> </ExpansionPanelDetails> </ExpansionPanel> - </div> + </MainPaper> ); } + +const MainPaper = styled(Paper)` + /* height: 150px; */ + text-align: center; + background-color: #fff; + margin-top: 5px; + margin-bottom: 30px; + color: #666; + .textInfo{ + text-align: start; + } +`; diff --git a/src/Components/SearchExpansionPanel/SesrchEPEtapasEns.js b/src/Components/SearchExpansionPanel/SesrchEPEtapasEns.js index b08fdb68..5848efe7 100644 --- a/src/Components/SearchExpansionPanel/SesrchEPEtapasEns.js +++ b/src/Components/SearchExpansionPanel/SesrchEPEtapasEns.js @@ -19,30 +19,29 @@ const useStyles = makeStyles(theme => ({ export default function SearchEPEtapasEns(props) { const classes = useStyles(); - const [checked, setChecked] = React.useState([0]); + const [checked, setChecked] = React.useState([]); + const [checkedWithLabel, setCheckedWithLabel] = React.useState([]); - const handleToggle = value => () => { + const handleToggle = (value, label) => () => { const currentIndex = checked.indexOf(value); const newChecked = [...checked]; + const newCheckedWithLabel = [...checkedWithLabel]; if (currentIndex === -1) { newChecked.push(value); + newCheckedWithLabel.push({ + label: label, + value: value, + }); } else { newChecked.splice(currentIndex, 1); + newCheckedWithLabel.splice(currentIndex, 1); } setChecked(newChecked); - let filterString = ""; + setCheckedWithLabel(newCheckedWithLabel) - for(let i = 0; i < newChecked.length; i++){ - if(newChecked[i] !== 0){ - filterString = filterString + `&educational_stages[]=${newChecked[i]}` - } - } - if(filterString) - props.onChange("LearningObject", filterString) - else - props.onChange("LearningObject", "") + props.onChange("stages", newCheckedWithLabel) }; const filtrosEtapas = [ { value: "1", exemplo: "Educação Infantil" }, @@ -64,7 +63,7 @@ export default function SearchEPEtapasEns(props) { role={undefined} dense button - onClick={handleToggle(item.value)} + onClick={handleToggle(item.value, item.exemplo)} > <ListItemIcon> <Checkbox diff --git a/src/Components/SearchPageComponents/CollectionTemplate.js b/src/Components/SearchPageComponents/CollectionTemplate.js index 5d1b3ffe..4b14e6b0 100644 --- a/src/Components/SearchPageComponents/CollectionTemplate.js +++ b/src/Components/SearchPageComponents/CollectionTemplate.js @@ -10,7 +10,7 @@ import ArrowBackIcon from '@material-ui/icons/ArrowBack'; import ArrowForwardIcon from '@material-ui/icons/ArrowForward'; export default function ResourceTemplate({ isLoading, resources, totalResources, currPage, handlePreviousPage, handleNextPage }) { - const totalPages = Math.ceil(totalResources / 12); //Dividing by 12 because i want to cath total pages, and results per page is 12 + const totalPages = Math.ceil(totalResources / 12) - 1; //Dividing by 12 because i want to cath total pages, and results per page is 12 const topRef = React.useRef(); useEffect(() => { @@ -88,6 +88,8 @@ export default function ResourceTemplate({ isLoading, resources, totalResources, }; const Title = styled.h4` + text-transform: uppercase; + font-weight: 500; text-align: left; color: #673ab7; ` diff --git a/src/Components/SearchPageComponents/FilterSummary.js b/src/Components/SearchPageComponents/FilterSummary.js new file mode 100644 index 00000000..3b67e58f --- /dev/null +++ b/src/Components/SearchPageComponents/FilterSummary.js @@ -0,0 +1,192 @@ +import React from 'react'; +import styled from 'styled-components'; +import Paper from '@material-ui/core/Paper'; +import Grid from '@material-ui/core/Grid'; +import Chip from '@material-ui/core/Chip'; +import Button from "@material-ui/core/Button"; + +export default function FilterSummary + ({ curriculumComponents, typeOfResources, languages, teachingStage, tag, onButtonClicked }) { + return ( + <FilterSummaryPaper square elevation={4}> + <h3 className="title"> + Resumo dos filtros colocados + </h3> + <Grid container direction='column' spacing={2}> + { + curriculumComponents.length >= 1 ? + <Grid item> + <Grid container direction='row' spacing={1} alignItems='center'> + <Grid item> + Componentes curriculares: + </Grid> + <Grid item> + { + curriculumComponents.map((item) => { + return ( + <StyledChip key={new Date().toISOString() + item.value} size="small" label={item.label} /> + ) + }) + } + </Grid> + </Grid> + </Grid> + : + <Grid item> + <Grid container direction='row' spacing={1} alignItems='center'> + <Grid item> + Componentes curriculares: + </Grid> + <Grid item> + <StyledChip size="small" label="Nenhum selecionado" /> + </Grid> + </Grid> + </Grid> + } + { + typeOfResources.length >= 1 ? + <Grid item> + <Grid container direction='row' spacing={1} alignItems='center'> + <Grid item> + Tipos de recursos: + </Grid> + <Grid item> + { + typeOfResources.map((item) => { + return ( + <StyledChip key={new Date().toISOString() + item.value} size="small" label={item.label} /> + ) + }) + } + </Grid> + </Grid> + </Grid> + : + <Grid item> + <Grid container direction='row' spacing={1} alignItems='center'> + <Grid item> + Tipos de recursos: + </Grid> + <Grid item> + <StyledChip size="small" label="Nenhum selecionado" /> + </Grid> + </Grid> + </Grid> + } + { + teachingStage.length >= 1 ? + <Grid item> + <Grid container direction='row' spacing={1} alignItems='center'> + <Grid item> + Etapas de ensino: + </Grid> + <Grid item> + { + teachingStage.map((item) => { + return ( + <StyledChip key={new Date().toISOString() + item.value} size="small" label={item.label} /> + ) + }) + } + </Grid> + </Grid> + </Grid> + : + <Grid item> + <Grid container direction='row' spacing={1} alignItems='center'> + <Grid item> + Etapas de ensino: + </Grid> + <Grid item> + <StyledChip size="small" label="Nenhum selecionado" /> + </Grid> + </Grid> + </Grid> + } + { + languages.length >= 1 ? + <Grid item> + <Grid container direction='row' spacing={1} alignItems='center'> + <Grid item> + Idiomas: + </Grid> + <Grid item> + { + languages.map((item) => { + return ( + <StyledChip key={new Date().toISOString() + item.value} size="small" label={item.label} /> + ) + }) + } + </Grid> + </Grid> + </Grid> + : + <Grid item> + <Grid container direction='row' spacing={1} alignItems='center'> + <Grid item> + Idiomas: + </Grid> + <Grid item> + <StyledChip size="small" label="Nenhum selecionado" /> + </Grid> + </Grid> + </Grid> + } + { + tag.length >= 1 ? + <Grid item> + <Grid container direction='row' spacing={1} alignItems='center'> + <Grid item> + Palavra chave: + </Grid> + <Grid item> + <StyledChip size="small" label={tag} /> + </Grid> + </Grid> + </Grid> + : + <Grid item> + <Grid container direction='row' spacing={1} alignItems='center'> + <Grid item> + Palavra chave: + </Grid> + <Grid item> + <StyledChip size="small" label="Nenhum selecionado" /> + </Grid> + </Grid> + </Grid> + } + <Grid item> + <StyledButton variant="contained" onClick={onButtonClicked}> + <span className="text"> + Aplicar filtro + </span> + </StyledButton> + </Grid> + </Grid> + </FilterSummaryPaper> + ) +} + +const FilterSummaryPaper = styled(Paper)` + background-color: #fff; + margin-top: 5px; + margin-bottom: 30px; + padding: 0.5em 1em; + .title{ + text-transform: uppercase; + color: #666; + font-weight: 500; + } +` +const StyledButton = styled(Button)` + background-color: #ff7f00 !important; + .text{ + color: white; + } +` + +const StyledChip = styled(Chip)` + margin: 0.2em +` diff --git a/src/Components/SearchPageComponents/ResourceTemplate.js b/src/Components/SearchPageComponents/ResourceTemplate.js index 7a2b6da0..28651ca0 100644 --- a/src/Components/SearchPageComponents/ResourceTemplate.js +++ b/src/Components/SearchPageComponents/ResourceTemplate.js @@ -10,7 +10,7 @@ import ArrowBackIcon from '@material-ui/icons/ArrowBack'; import ArrowForwardIcon from '@material-ui/icons/ArrowForward'; export default function ResourceTemplate({ isLoading, resources, totalResources, currPage, handlePreviousPage, handleNextPage }) { - const totalPages = Math.ceil(totalResources / 12); //Dividing by 12 because i want to cath total pages, and results per page is 12 + const totalPages = Math.ceil(totalResources / 12) - 1; //Dividing by 12 because i want to cath total pages, and results per page is 12 const topRef = React.useRef(); useEffect(() => { @@ -88,6 +88,8 @@ export default function ResourceTemplate({ isLoading, resources, totalResources, }; const Title = styled.h4` + text-transform: uppercase; + font-weight: 500; text-align: left; color: #ff7f00; ` diff --git a/src/Components/SearchPageComponents/UserTemplate.js b/src/Components/SearchPageComponents/UserTemplate.js index c92296f7..45ebb66f 100644 --- a/src/Components/SearchPageComponents/UserTemplate.js +++ b/src/Components/SearchPageComponents/UserTemplate.js @@ -10,7 +10,7 @@ import ArrowForwardIcon from '@material-ui/icons/ArrowForward'; import { apiDomain } from '../../env'; export default function ResourceTemplate({ isLoading, resources, totalResources, currPage, handlePreviousPage, handleNextPage }) { - const totalPages = Math.ceil(totalResources / 12); //Dividing by 12 because i want to cath total pages, and results per page is 12 + const totalPages = Math.ceil(totalResources / 12) - 1; //Dividing by 12 because i want to cath total pages, and results per page is 12 const topRef = React.useRef(); useEffect(() => { @@ -83,6 +83,8 @@ export default function ResourceTemplate({ isLoading, resources, totalResources, }; const Title = styled.h4` + text-transform: uppercase; + font-weight: 500; text-align: left; color: #00bcd4; ` diff --git a/src/Pages/Search.js b/src/Pages/Search.js index 3e657bf8..d58b73a7 100644 --- a/src/Pages/Search.js +++ b/src/Pages/Search.js @@ -17,7 +17,7 @@ // along with Plataforma Integrada MEC. If not, see <http://www.gnu.org/licenses/>.*/ -import React, { useEffect, useState } from 'react'; +import React, { useEffect, useState, Fragment } from 'react'; import styled from 'styled-components'; import { Link } from 'react-router-dom'; import Breadcrumbs from '@material-ui/core/Breadcrumbs'; @@ -27,6 +27,8 @@ import CollectionTemplate from '../Components/SearchPageComponents/CollectionTem import UserTemplate from '../Components/SearchPageComponents/UserTemplate'; import { getRequest } from '../Components/HelperFunctions/getAxiosConfig'; import { useHistory } from 'react-router-dom'; +import SearchExpansionPanel from '../Components/SearchExpansionPanel/SearchExpansionPanel'; +import FilterSummary from '../Components/SearchPageComponents/FilterSummary'; export default function Search() { const history = useHistory(); @@ -37,6 +39,12 @@ export default function Search() { const [currPage, setCurrPage] = useState(0); const [isLoading, setIsLoading] = useState(false); + const [curriculumComponents, setCurriculumComponents] = useState([]); + const [typeOfResources, setTypeOfResources] = useState([]); + const [teachingStage, setTeachingStage] = useState([]); + const [languages, setLanguages] = useState([]); + const [tag, setTag] = useState(''); + const [resourcesArray, setResourcesArray] = useState([]); const [totalResources, setTotalResources] = useState(0); @@ -60,6 +68,60 @@ export default function Search() { { value: 'Ordem Alfabética', name: 'title' }, ]; + function onButtonClicked() { + const curriculumValues = []; + const typeOfResourcesValues = []; + const teachingStageValues = []; + const languagesValues = []; + const tagsValue = []; + + for (let index = 0; index < curriculumComponents.length; index++) { + const element = curriculumComponents[index]; + curriculumValues.push(element.value); + } + + for (let index = 0; index < typeOfResources.length; index++) { + const element = typeOfResources[index]; + typeOfResourcesValues.push(element.value); + } + + for (let index = 0; index < teachingStage.length; index++) { + const element = teachingStage[index]; + teachingStageValues.push(element.value); + } + + for (let index = 0; index < languages.length; index++) { + const element = languages[index]; + languagesValues.push(element.value); + } + tagsValue.push(tag) + const url = `/busca?page=0&results_per_page=12&order=${currOrder}&query=${currQuery}&search_class=${currOption}&subjects=${curriculumValues}&object_types=${typeOfResourcesValues}&educational_stages=${teachingStageValues}&languages=${languagesValues}&tags=${tagsValue}` + + history.push(url) + } + + function onChangeFilter(type, content) { + switch (type) { + case "curriculum": + setCurriculumComponents(content) + break; + case "languages": + setLanguages(content) + break; + case "stages": + setTeachingStage(content) + break; + case "types": + setTypeOfResources(content) + break; + case "tag": + setTag(content) + break; + default: + break; + } + } + function handleChangeOption(e) { const value = e.target.value; setCurrOption(value); @@ -74,7 +136,17 @@ export default function Search() { } function handleChangeOrder(e) { - serCurrOrder(e.target.value); + const value = e.target.value; + serCurrOrder(value); + + let url; + + if (currOption !== 'User') + url = `/busca?page=0&results_per_page=12&order=${value}&query=${currQuery}&search_class=${currOption}` + else + url = `/busca?page=0&results_per_page=12&query=${currQuery}&search_class=${currOption}` + + history.push(url); } function handleNextPage() { @@ -90,7 +162,6 @@ export default function Search() { } function handleSuccess(data, headers, option) { - console.log(option) if (option === 'LearningObject') { setResourcesArray(data) if (headers.has('X-Total-Count')) { @@ -124,18 +195,36 @@ export default function Search() { const searchClass = urlParams.get("search_class"); const page = parseInt(urlParams.get("page")); const order = urlParams.get("order"); + const subjects = urlParams.get("subjects"); + const objectTypes = urlParams.get("object_types"); + const educationalStages = urlParams.get("educational_stages"); + const languages = urlParams.get("languages"); + const tags = urlParams.get("tags"); + + console.log(subjects) setCurrOption(searchClass); setCurrQuery(query); setCurrPage(page); serCurrOrder(order); - let url - - if (searchClass !== 'User') - url = `/search?page=${page}&results_per_page=12&order=${order}&query=${query}&search_class=${searchClass}` - else - url = `/search?page=${page}&results_per_page=12&query=${query}&search_class=${searchClass}` + let url = `/search?page=${page}&results_per_page=12&query=${query}&search_class=${searchClass}` + + if (searchClass !== 'User') { + url = url + `&order=${order}` + if (searchClass === 'LearningObject') { + if (subjects) + url = url + `&subjects[]=${subjects}` + if (objectTypes) + url = url + `&object_types[]=${objectTypes}` + if (educationalStages) + url = url + `&educational_stages[]=${educationalStages}` + if (languages) + url = url + `&languages[]=${languages}` + if (tags) + url = url + `&tags[]=${tags}` + } + } getRequest( url, @@ -160,14 +249,27 @@ export default function Search() { /> { currOption === 'LearningObject' && - <ResourceTemplate - handleNextPage={handleNextPage} - handlePreviousPage={handlePreviousPage} - isLoading={isLoading} - currPage={currPage} - resources={resourcesArray} - totalResources={totalResources} - /> + <Fragment> + <SearchExpansionPanel onChange={onChangeFilter} /> + { + <FilterSummary + curriculumComponents={curriculumComponents} + typeOfResources={typeOfResources} + languages={languages} + teachingStage={teachingStage} + tag={tag} + onButtonClicked={onButtonClicked} + /> + } + <ResourceTemplate + handleNextPage={handleNextPage} + handlePreviousPage={handlePreviousPage} + isLoading={isLoading} + currPage={currPage} + resources={resourcesArray} + totalResources={totalResources} + /> + </Fragment> } { currOption === 'Collection' && diff --git a/src/env.js b/src/env.js index 7284c427..95815e96 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; -- GitLab From b3c2530ee71d20157dd58648a8f6b916ebfcb9d2 Mon Sep 17 00:00:00 2001 From: Luis Felipe Risch <lfr20@inf.ufpr.br> Date: Mon, 21 Jun 2021 13:21:12 -0300 Subject: [PATCH 3/6] fixing search page --- .../SearchEPCompCurriculum.js | 118 ++++------- .../SearchExpansionPanel/SearchEPIdiomas.js | 104 ++++------ .../SearchExpansionPanel/SearchEPTiposRec.js | 109 ++++------ .../SearchExpansionPanel.js | 24 ++- .../SearchExpansionPanel/SesrchEPEtapasEns.js | 99 ++++----- .../SearchPageComponents/FilterSummary.js | 28 +-- .../SearchPageComponents/filters.js | 74 +++++++ src/Pages/Search.js | 194 +++++++++++++++--- 8 files changed, 429 insertions(+), 321 deletions(-) create mode 100644 src/Components/SearchPageComponents/filters.js diff --git a/src/Components/SearchExpansionPanel/SearchEPCompCurriculum.js b/src/Components/SearchExpansionPanel/SearchEPCompCurriculum.js index 8d5e2312..43941d03 100644 --- a/src/Components/SearchExpansionPanel/SearchEPCompCurriculum.js +++ b/src/Components/SearchExpansionPanel/SearchEPCompCurriculum.js @@ -17,89 +17,45 @@ const useStyles = makeStyles(theme => ({ } })); -export default function SearchEPCompCurriculum(props) { +export default function SearchEPCompCurriculum({ onChange, curriculumComponents, setCurriculum }) { const classes = useStyles(); - const [checked, setChecked] = React.useState([]); - const [checkedWithLabel, setCheckedWithLabel] = React.useState([]); - const handleToggle = (value, label) => () => { - const currentIndex = checked.indexOf(value); - const newChecked = [...checked]; - const newCheckedWithLabel = [...checkedWithLabel]; - - if (currentIndex === -1) { - newChecked.push(value); - newCheckedWithLabel.push({ - label: label, - value: value, - }); - } else { - newChecked.splice(currentIndex, 1); - newCheckedWithLabel.splice(currentIndex, 1); - } - - setChecked(newChecked); - setCheckedWithLabel(newCheckedWithLabel) - - props.onChange("curriculum", newCheckedWithLabel) + const handleToggle = (index) => () => { + const newCurriculumComponents = [...curriculumComponents]; + newCurriculumComponents[index].isChecked = !newCurriculumComponents[index].isChecked + setCurriculum(newCurriculumComponents); }; - const filtrosComponente = [ - { exemplo: "Arte", value: "3" }, - { exemplo: "Biologia", value: "5" }, - { exemplo: "Ciências da Natureza", value: "6" }, - { exemplo: "Direitos Humanos", value: "20" }, - { exemplo: "Educação Ambiental", value: "21" }, - { exemplo: "Educação do Campo", value: "22" }, - { exemplo: "Educação Especial", value: "23" }, - { exemplo: "Educação FÃsica", value: "7" }, - { exemplo: "Educação IndÃgena", value: "24" }, - { exemplo: "Educação Quilombola", value: "25" }, - { exemplo: "Educação Sexual", value: "26" }, - { exemplo: "Ensino Religioso", value: "16" }, - { exemplo: "Filosofia", value: "8" }, - { exemplo: "FÃsica", value: "9" }, - { exemplo: "Geografia", value: "10" }, - { exemplo: "História", value: "11" }, - { exemplo: "Informática", value: "18" }, - { exemplo: "LÃngua Espanhola", value: "1" }, - { exemplo: "LÃngua Inglesa", value: "2" }, - { exemplo: "LÃngua Portuguesa", value: "4" }, - { exemplo: "Matemática", value: "12" }, - { exemplo: "Outras LÃnguas", value: "15" }, - { exemplo: "Outros", value: "17" }, - { exemplo: "QuÃmica", value: "13" }, - { exemplo: "Sociologia", value: "14" } - ]; - - return ( - <List className={classes.root}> - {filtrosComponente.map(item => { - const labelId = `checkbox-list-label-${item.value}`; - return ( - <ListItem - key={item.exemplo} - role={undefined} - dense - button - onClick={handleToggle(item.value, item.exemplo)} - > - <ListItemIcon> - <Checkbox - edge="start" - checked={checked.indexOf(item.value) !== -1} - tabIndex={-1} - disableRipple - inputProps={{ "aria-labelledby": labelId }} - /> - </ListItemIcon> - <ListItemText id={labelId} primary={item.exemplo} /> - <ListItemSecondaryAction> - <IconButton edge="end" aria-label="comments"></IconButton> - </ListItemSecondaryAction> - </ListItem> - ); - })} - </List> - ); + if (curriculumComponents) + return ( + <List className={classes.root}> + {curriculumComponents.map((item, index) => { + const labelId = `checkbox-list-label-${item.value}`; + + return ( + <ListItem + key={item.exemplo} + role={undefined} + dense + button + onClick={handleToggle(index)} + > + <ListItemIcon> + <Checkbox + edge="start" + checked={item.isChecked} + tabIndex={-1} + disableRipple + inputProps={{ "aria-labelledby": labelId }} + /> + </ListItemIcon> + <ListItemText id={labelId} primary={item.exemplo} /> + <ListItemSecondaryAction> + <IconButton edge="end" aria-label="comments"></IconButton> + </ListItemSecondaryAction> + </ListItem> + ); + })} + </List> + ); } diff --git a/src/Components/SearchExpansionPanel/SearchEPIdiomas.js b/src/Components/SearchExpansionPanel/SearchEPIdiomas.js index 94b36f12..06715e46 100644 --- a/src/Components/SearchExpansionPanel/SearchEPIdiomas.js +++ b/src/Components/SearchExpansionPanel/SearchEPIdiomas.js @@ -17,75 +17,45 @@ const useStyles = makeStyles(theme => ({ } })); -export default function SearchEPIdiomas(props) { +export default function SearchEPIdiomas({ languages, setLanguages }) { const classes = useStyles(); - const [checked, setChecked] = React.useState([]); - const [checkedWithLabel, setCheckedWithLabel] = React.useState([]); - const handleToggle = (value, label) => () => { - const currentIndex = checked.indexOf(value); - const newChecked = [...checked]; - const newCheckedWithLabel = [...checkedWithLabel]; - - if (currentIndex === -1) { - newChecked.push(value); - newCheckedWithLabel.push({ - label: label, - value: value, - }); - } else { - newChecked.splice(currentIndex, 1); - newCheckedWithLabel.splice(currentIndex, 1); - } - - setChecked(newChecked); - setCheckedWithLabel(newCheckedWithLabel) - - props.onChange("languages", newCheckedWithLabel) + const handleToggle = (index) => () => { + const newLanguages = [...languages]; + newLanguages[index].isChecked = !newLanguages[index].isChecked + setLanguages(newLanguages); }; - const filtrosIdiomas = [ - { value: "5", exemplo: "Alemão" }, - { value: "3", exemplo: "Espanhol" }, - { value: "4", exemplo: "Francês" }, - { value: "2", exemplo: "Inglês" }, - { value: "6", exemplo: "Italiano" }, - { value: "9", exemplo: "Japonês" }, - { value: "19", exemplo: "LIBRAS" }, - { value: "7", exemplo: "Mandarim" }, - { value: "10", exemplo: "Outro" }, - { value: "1", exemplo: "Português" }, - { value: "8", exemplo: "Russo" } - ]; - - return ( - <List className={classes.root}> - {filtrosIdiomas.map(item => { - const labelId = `checkbox-list-label-${item.value}`; - return ( - <ListItem - key={item.exemplo} - role={undefined} - dense - button - onClick={handleToggle(item.value, item.exemplo)} - > - <ListItemIcon> - <Checkbox - edge="start" - checked={checked.indexOf(item.value) !== -1} - tabIndex={-1} - disableRipple - inputProps={{ "aria-labelledby": labelId }} - /> - </ListItemIcon> - <ListItemText id={labelId} primary={item.exemplo} /> - <ListItemSecondaryAction> - <IconButton edge="end" aria-label="comments"></IconButton> - </ListItemSecondaryAction> - </ListItem> - ); - })} - </List> - ); + if (languages) + return ( + <List className={classes.root}> + {languages.map((item, index) => { + const labelId = `checkbox-list-label-${item.value}`; + + return ( + <ListItem + key={item.exemplo} + role={undefined} + dense + button + onClick={handleToggle(index)} + > + <ListItemIcon> + <Checkbox + edge="start" + checked={item.isChecked} + tabIndex={-1} + disableRipple + inputProps={{ "aria-labelledby": labelId }} + /> + </ListItemIcon> + <ListItemText id={labelId} primary={item.exemplo} /> + <ListItemSecondaryAction> + <IconButton edge="end" aria-label="comments"></IconButton> + </ListItemSecondaryAction> + </ListItem> + ); + })} + </List> + ); } diff --git a/src/Components/SearchExpansionPanel/SearchEPTiposRec.js b/src/Components/SearchExpansionPanel/SearchEPTiposRec.js index 85c4a0bc..41b77adf 100644 --- a/src/Components/SearchExpansionPanel/SearchEPTiposRec.js +++ b/src/Components/SearchExpansionPanel/SearchEPTiposRec.js @@ -17,80 +17,45 @@ const useStyles = makeStyles(theme => ({ } })); -export default function SearchEPTiposRec(props) { +export default function SearchEPCompCurriculum({ onChange, typeOfResources, setTypeRes }) { const classes = useStyles(); - const [checked, setChecked] = React.useState([]); - const [checkedWithLabel, setCheckedWithLabel] = React.useState([]); - const handleToggle = (value, label) => () => { - const currentIndex = checked.indexOf(value); - const newChecked = [...checked]; - const newCheckedWithLabel = [...checkedWithLabel]; - - if (currentIndex === -1) { - newChecked.push(value); - newCheckedWithLabel.push({ - label: label, - value: value, - }); - } else { - newChecked.splice(currentIndex, 1); - newCheckedWithLabel.splice(currentIndex, 1); - } - - setChecked(newChecked); - setCheckedWithLabel(newCheckedWithLabel) - - props.onChange("types", newCheckedWithLabel) + const handleToggle = (index) => () => { + const newTypeOfRes = [...typeOfResources]; + newTypeOfRes[index].isChecked = !newTypeOfRes[index].isChecked + setTypeRes(newTypeOfRes); }; - const filtrosTipos = [ - { value: "5", exemplo: "Animação" }, - { value: "20", exemplo: "Aplicativo móvel" }, - { value: "17", exemplo: "Apresentação" }, - { value: "7", exemplo: "Ãudio" }, - { value: "4", exemplo: "Experimento prático" }, - { value: "1", exemplo: "Imagem" }, - { value: "18", exemplo: "Infográfico" }, - { value: "19", exemplo: "Jogo" }, - { value: "21", exemplo: "Livro digital" }, - { value: "2", exemplo: "Mapa" }, - { value: "15", exemplo: "Outros" }, - { value: "3", exemplo: "Software Educacional" }, - { value: "6", exemplo: "Texto" }, - { value: "8", exemplo: "VÃdeo" }, - { value: "13", exemplo: "Website externo" }, - { value: "22", exemplo: "Plano de Aula" }, - ]; - - return ( - <List className={classes.root}> - {filtrosTipos.map(item => { - const labelId = `checkbox-list-label-${item.value}`; - return ( - <ListItem - key={item.exemplo} - role={undefined} - dense - button - onClick={handleToggle(item.value, item.exemplo)} - > - <ListItemIcon> - <Checkbox - edge="start" - checked={checked.indexOf(item.value) !== -1} - tabIndex={-1} - disableRipple - inputProps={{ "aria-labelledby": labelId }} - /> - </ListItemIcon> - <ListItemText id={labelId} primary={item.exemplo} /> - <ListItemSecondaryAction> - <IconButton edge="end" aria-label="comments"></IconButton> - </ListItemSecondaryAction> - </ListItem> - ); - })} - </List> - ); + if (typeOfResources) + return ( + <List className={classes.root}> + {typeOfResources.map((item, index) => { + const labelId = `checkbox-list-label-${item.value}`; + + return ( + <ListItem + key={item.exemplo} + role={undefined} + dense + button + onClick={handleToggle(index)} + > + <ListItemIcon> + <Checkbox + edge="start" + checked={item.isChecked} + tabIndex={-1} + disableRipple + inputProps={{ "aria-labelledby": labelId }} + /> + </ListItemIcon> + <ListItemText id={labelId} primary={item.exemplo} /> + <ListItemSecondaryAction> + <IconButton edge="end" aria-label="comments"></IconButton> + </ListItemSecondaryAction> + </ListItem> + ); + })} + </List> + ); } diff --git a/src/Components/SearchExpansionPanel/SearchExpansionPanel.js b/src/Components/SearchExpansionPanel/SearchExpansionPanel.js index 7d8e07d1..677d24d4 100644 --- a/src/Components/SearchExpansionPanel/SearchExpansionPanel.js +++ b/src/Components/SearchExpansionPanel/SearchExpansionPanel.js @@ -147,7 +147,11 @@ export default function SearchExpansionPanel(props) { </ExpansionPanelSummary> <ExpansionPanelDetails> <div> - <SearchEPCompCurriculum onChange={props.onChange} /> + <SearchEPCompCurriculum + onChange={props.onChange} + curriculumComponents={props.curriculumComponents} + setCurriculum={props.setCurriculum} + /> </div> </ExpansionPanelDetails> </ExpansionPanel> @@ -161,7 +165,11 @@ export default function SearchExpansionPanel(props) { <Typography>Tipos de Recurso</Typography> </ExpansionPanelSummary> <ExpansionPanelDetails> - <SearchEPTiposRec onChange={props.onChange} /> + <SearchEPTiposRec + onChange={props.onChange} + typeOfResources={props.typeOfResources} + setTypeRes={props.setTypeRes} + /> </ExpansionPanelDetails> </ExpansionPanel> @@ -174,7 +182,11 @@ export default function SearchExpansionPanel(props) { <Typography>Etapas de Ensino</Typography> </ExpansionPanelSummary> <ExpansionPanelDetails> - <SearchEPEtapasEns onChange={props.onChange} /> + <SearchEPEtapasEns + onChange={props.onChange} + teachingStage={props.teachingStage} + setTeachingStage={props.setTeachingStage} + /> </ExpansionPanelDetails> </ExpansionPanel> @@ -187,7 +199,11 @@ export default function SearchExpansionPanel(props) { <Typography>Idiomas</Typography> </ExpansionPanelSummary> <ExpansionPanelDetails> - <SearchEPIdiomas onChange={props.onChange} /> + <SearchEPIdiomas + onChange={props.onChange} + languages={props.languages} + setLanguages={props.setLanguages} + /> </ExpansionPanelDetails> </ExpansionPanel> diff --git a/src/Components/SearchExpansionPanel/SesrchEPEtapasEns.js b/src/Components/SearchExpansionPanel/SesrchEPEtapasEns.js index 5848efe7..632009ae 100644 --- a/src/Components/SearchExpansionPanel/SesrchEPEtapasEns.js +++ b/src/Components/SearchExpansionPanel/SesrchEPEtapasEns.js @@ -17,70 +17,45 @@ const useStyles = makeStyles(theme => ({ } })); -export default function SearchEPEtapasEns(props) { +export default function SearchEPEtapasEns({ teachingStage, setTeachingStage }) { const classes = useStyles(); - const [checked, setChecked] = React.useState([]); - const [checkedWithLabel, setCheckedWithLabel] = React.useState([]); - const handleToggle = (value, label) => () => { - const currentIndex = checked.indexOf(value); - const newChecked = [...checked]; - const newCheckedWithLabel = [...checkedWithLabel]; - - if (currentIndex === -1) { - newChecked.push(value); - newCheckedWithLabel.push({ - label: label, - value: value, - }); - } else { - newChecked.splice(currentIndex, 1); - newCheckedWithLabel.splice(currentIndex, 1); - } - - setChecked(newChecked); - setCheckedWithLabel(newCheckedWithLabel) - - props.onChange("stages", newCheckedWithLabel) + const handleToggle = (index) => () => { + const newTypeTeachingStage = [...teachingStage]; + newTypeTeachingStage[index].isChecked = !newTypeTeachingStage[index].isChecked + setTeachingStage(newTypeTeachingStage); }; - const filtrosEtapas = [ - { value: "1", exemplo: "Educação Infantil" }, - { value: "2", exemplo: "Ensino Fundamental I (1º até o 5º ano )" }, - { value: "3", exemplo: "Ensino Fundamental II (do 6º até o 9º ano)" }, - { value: "4", exemplo: "Ensino Médio" }, - { value: "5", exemplo: "Ensino Superior" }, - { value: "6", exemplo: "Outros" } - ]; - - return ( - <List className={classes.root}> - {filtrosEtapas.map(item => { - const labelId = `checkbox-list-label-${item.value}`; - return ( - <ListItem - key={item.exemplo} - role={undefined} - dense - button - onClick={handleToggle(item.value, item.exemplo)} - > - <ListItemIcon> - <Checkbox - edge="start" - checked={checked.indexOf(item.value) !== -1} - tabIndex={-1} - disableRipple - inputProps={{ "aria-labelledby": labelId }} - /> - </ListItemIcon> - <ListItemText id={labelId} primary={item.exemplo} /> - <ListItemSecondaryAction> - <IconButton edge="end" aria-label="comments"></IconButton> - </ListItemSecondaryAction> - </ListItem> - ); - })} - </List> - ); + if (teachingStage) + return ( + <List className={classes.root}> + {teachingStage.map((item, index) => { + const labelId = `checkbox-list-label-${item.value}`; + + return ( + <ListItem + key={item.exemplo} + role={undefined} + dense + button + onClick={handleToggle(index)} + > + <ListItemIcon> + <Checkbox + edge="start" + checked={item.isChecked} + tabIndex={-1} + disableRipple + inputProps={{ "aria-labelledby": labelId }} + /> + </ListItemIcon> + <ListItemText id={labelId} primary={item.exemplo} /> + <ListItemSecondaryAction> + <IconButton edge="end" aria-label="comments"></IconButton> + </ListItemSecondaryAction> + </ListItem> + ); + })} + </List> + ); } diff --git a/src/Components/SearchPageComponents/FilterSummary.js b/src/Components/SearchPageComponents/FilterSummary.js index 3b67e58f..51578277 100644 --- a/src/Components/SearchPageComponents/FilterSummary.js +++ b/src/Components/SearchPageComponents/FilterSummary.js @@ -23,9 +23,10 @@ export default function FilterSummary <Grid item> { curriculumComponents.map((item) => { - return ( - <StyledChip key={new Date().toISOString() + item.value} size="small" label={item.label} /> - ) + if (item.isChecked) + return ( + <StyledChip key={new Date().toISOString() + item.value} size="small" label={item.exemplo} /> + ); }) } </Grid> @@ -53,9 +54,10 @@ export default function FilterSummary <Grid item> { typeOfResources.map((item) => { - return ( - <StyledChip key={new Date().toISOString() + item.value} size="small" label={item.label} /> - ) + if (item.isChecked) + return ( + <StyledChip key={new Date().toISOString() + item.value} size="small" label={item.exemplo} /> + ) }) } </Grid> @@ -83,9 +85,10 @@ export default function FilterSummary <Grid item> { teachingStage.map((item) => { - return ( - <StyledChip key={new Date().toISOString() + item.value} size="small" label={item.label} /> - ) + if (item.isChecked) + return ( + <StyledChip key={new Date().toISOString() + item.value} size="small" label={item.exemplo} /> + ) }) } </Grid> @@ -113,9 +116,10 @@ export default function FilterSummary <Grid item> { languages.map((item) => { - return ( - <StyledChip key={new Date().toISOString() + item.value} size="small" label={item.label} /> - ) + if (item.isChecked) + return ( + <StyledChip key={new Date().toISOString() + item.value} size="small" label={item.exemplo} /> + ) }) } </Grid> diff --git a/src/Components/SearchPageComponents/filters.js b/src/Components/SearchPageComponents/filters.js new file mode 100644 index 00000000..822ea5cd --- /dev/null +++ b/src/Components/SearchPageComponents/filters.js @@ -0,0 +1,74 @@ +const filtersCurriculum = [ + { exemplo: "Arte", value: "3", isChecked: false }, + { exemplo: "Biologia", value: "5", isChecked: false }, + { exemplo: "Ciências da Natureza", value: "6", isChecked: false }, + { exemplo: "Direitos Humanos", value: "20", isChecked: false }, + { exemplo: "Educação Ambiental", value: "21", isChecked: false }, + { exemplo: "Educação do Campo", value: "22", isChecked: false }, + { exemplo: "Educação Especial", value: "23", isChecked: false }, + { exemplo: "Educação FÃsica", value: "7", isChecked: false }, + { exemplo: "Educação IndÃgena", value: "24", isChecked: false }, + { exemplo: "Educação Quilombola", value: "25", isChecked: false }, + { exemplo: "Educação Sexual", value: "26", isChecked: false }, + { exemplo: "Ensino Religioso", value: "16", isChecked: false }, + { exemplo: "Filosofia", value: "8", isChecked: false }, + { exemplo: "FÃsica", value: "9", isChecked: false }, + { exemplo: "Geografia", value: "10", isChecked: false }, + { exemplo: "História", value: "11", isChecked: false }, + { exemplo: "Informática", value: "18", isChecked: false }, + { exemplo: "LÃngua Espanhola", value: "1", isChecked: false }, + { exemplo: "LÃngua Inglesa", value: "2", isChecked: false }, + { exemplo: "LÃngua Portuguesa", value: "4", isChecked: false }, + { exemplo: "Matemática", value: "12", isChecked: false }, + { exemplo: "Outras LÃnguas", value: "15", isChecked: false }, + { exemplo: "Outros", value: "17", isChecked: false }, + { exemplo: "QuÃmica", value: "13", isChecked: false }, + { exemplo: "Sociologia", value: "14", isChecked: false } +]; + +const filtersTypes = [ + { value: "5", exemplo: "Animação", isChecked: false }, + { value: "20", exemplo: "Aplicativo móvel", isChecked: false }, + { value: "17", exemplo: "Apresentação", isChecked: false }, + { value: "7", exemplo: "Ãudio", isChecked: false }, + { value: "4", exemplo: "Experimento prático", isChecked: false }, + { value: "1", exemplo: "Imagem", isChecked: false }, + { value: "18", exemplo: "Infográfico", isChecked: false }, + { value: "19", exemplo: "Jogo", isChecked: false }, + { value: "21", exemplo: "Livro digital", isChecked: false }, + { value: "2", exemplo: "Mapa", isChecked: false }, + { value: "15", exemplo: "Outros", isChecked: false }, + { value: "3", exemplo: "Software Educacional", isChecked: false }, + { value: "6", exemplo: "Texto", isChecked: false }, + { value: "8", exemplo: "VÃdeo", isChecked: false }, + { value: "13", exemplo: "Website externo", isChecked: false }, + { value: "22", exemplo: "Plano de Aula", isChecked: false }, +]; + +const filtersStages = [ + { value: "1", exemplo: "Educação Infantil", isChecked: false }, + { value: "2", exemplo: "Ensino Fundamental I (1º até o 5º ano )", isChecked: false }, + { value: "3", exemplo: "Ensino Fundamental II (do 6º até o 9º ano)", isChecked: false }, + { value: "4", exemplo: "Ensino Médio", isChecked: false }, + { value: "5", exemplo: "Ensino Superior", isChecked: false }, + { value: "6", exemplo: "Outros", isChecked: false } +]; + +const filtersLanguages = [ + { value: "5", exemplo: "Alemão", isChecked: false }, + { value: "3", exemplo: "Espanhol", isChecked: false }, + { value: "4", exemplo: "Francês", isChecked: false }, + { value: "2", exemplo: "Inglês", isChecked: false }, + { value: "6", exemplo: "Italiano", isChecked: false }, + { value: "9", exemplo: "Japonês", isChecked: false }, + { value: "19", exemplo: "LIBRAS", isChecked: false }, + { value: "7", exemplo: "Mandarim", isChecked: false }, + { value: "10", exemplo: "Outro", isChecked: false }, + { value: "1", exemplo: "Português", isChecked: false }, + { value: "8", exemplo: "Russo", isChecked: false } +]; + +export { filtersCurriculum }; +export { filtersTypes }; +export { filtersStages }; +export { filtersLanguages }; diff --git a/src/Pages/Search.js b/src/Pages/Search.js index d58b73a7..f6f49d2c 100644 --- a/src/Pages/Search.js +++ b/src/Pages/Search.js @@ -29,6 +29,7 @@ import { getRequest } from '../Components/HelperFunctions/getAxiosConfig'; import { useHistory } from 'react-router-dom'; import SearchExpansionPanel from '../Components/SearchExpansionPanel/SearchExpansionPanel'; import FilterSummary from '../Components/SearchPageComponents/FilterSummary'; +import { filtersCurriculum, filtersTypes, filtersStages, filtersLanguages } from '../Components/SearchPageComponents/filters'; export default function Search() { const history = useHistory(); @@ -37,8 +38,14 @@ export default function Search() { const [currOrder, serCurrOrder] = useState('review_average'); const [currQuery, setCurrQuery] = useState(''); const [currPage, setCurrPage] = useState(0); + const [currCurriculumValues, setCurrCurriculumValues] = useState(''); + const [currTypeOfResValues, setCurrTypeOfResValues] = useState(''); + const [currTeachingStageValues, setCurrTeachingStageValues] = useState(''); + const [currLanguagesValues, setCurrLanguagesValues] = useState(''); + const [currTag, setCurrTag] = useState(''); const [isLoading, setIsLoading] = useState(false); + const [curriculumComponents, setCurriculumComponents] = useState([]); const [typeOfResources, setTypeOfResources] = useState([]); const [teachingStage, setTeachingStage] = useState([]); @@ -59,6 +66,7 @@ export default function Search() { { value: 'Coleções', name: 'Collection', color: '#673ab7' }, { value: 'Usuários', name: 'User', color: '#00bcd4' }, ]; + const orders = [ { value: 'Mais Estrelas', name: 'review_average' }, { value: 'Mais Relevante', name: 'score' }, @@ -77,26 +85,31 @@ export default function Search() { for (let index = 0; index < curriculumComponents.length; index++) { const element = curriculumComponents[index]; - curriculumValues.push(element.value); + if (element.isChecked) + curriculumValues.push(element.value); } for (let index = 0; index < typeOfResources.length; index++) { const element = typeOfResources[index]; - typeOfResourcesValues.push(element.value); + if (element.isChecked) + typeOfResourcesValues.push(element.value); } for (let index = 0; index < teachingStage.length; index++) { const element = teachingStage[index]; - teachingStageValues.push(element.value); + if (element.isChecked) + teachingStageValues.push(element.value); } for (let index = 0; index < languages.length; index++) { const element = languages[index]; - languagesValues.push(element.value); + if (element.isChecked) + languagesValues.push(element.value); } + tagsValue.push(tag) - const url = `/busca?page=0&results_per_page=12&order=${currOrder}&query=${currQuery}&search_class=${currOption}&subjects=${curriculumValues}&object_types=${typeOfResourcesValues}&educational_stages=${teachingStageValues}&languages=${languagesValues}&tags=${tagsValue}` + const url = `/busca?page=0&results_per_page=12&order=${currOrder}&query=${currQuery}&search_class=${currOption}&subjects=${curriculumValues}&object_types=${typeOfResourcesValues}&educational_stages=${teachingStageValues}&languages=${languagesValues}&tags=${tagsValue}` history.push(url) } @@ -124,7 +137,6 @@ export default function Search() { function handleChangeOption(e) { const value = e.target.value; - setCurrOption(value); let url; if (value !== 'User') @@ -137,27 +149,80 @@ export default function Search() { function handleChangeOrder(e) { const value = e.target.value; - serCurrOrder(value); - - let url; - - if (currOption !== 'User') - url = `/busca?page=0&results_per_page=12&order=${value}&query=${currQuery}&search_class=${currOption}` - else - url = `/busca?page=0&results_per_page=12&query=${currQuery}&search_class=${currOption}` + let url = `/busca?page=0&results_per_page=12&query=${currQuery}&search_class=${currOption}` + + if (currOption !== 'User') { + url = url + `&order=${value}` + if (currOption === 'LearningObject') { + if (currCurriculumValues) { + url = url + `&subjects=${currCurriculumValues}` + } + if (currTypeOfResValues) { + url = url + `&object_types=${currTypeOfResValues}` + } + if (currTeachingStageValues) { + url = url + `&educational_stages=${currTeachingStageValues}` + } + if (currLanguagesValues) { + url = url + `&languages=${currLanguagesValues}` + } + if (currTag) + url = url + `&tags=${currTag}` + } + } history.push(url); } function handleNextPage() { const nextPage = currPage + 1; - const url = `/busca?page=${nextPage}&results_per_page=12&order=${currOrder}&query=${currQuery}&search_class=${currOption}` + let url = `/busca?page=${nextPage}&results_per_page=12&query=${currQuery}&search_class=${currOption}` + + if (currOption !== 'User') { + url = url + `&order=${currOrder}` + if (currOption === 'LearningObject') { + if (currCurriculumValues) { + url = url + `&subjects=${currCurriculumValues}` + } + if (currTypeOfResValues) { + url = url + `&object_types=${currTypeOfResValues}` + } + if (currTeachingStageValues) { + url = url + `&educational_stages=${currTeachingStageValues}` + } + if (currLanguagesValues) { + url = url + `&languages=${currLanguagesValues}` + } + if (currTag) + url = url + `&tags=${currTag}` + } + } history.push(url); } function handlePreviousPage() { const previousPage = currPage - 1; - const url = `/busca?page=${previousPage}&results_per_page=12&order=${currOrder}&query=${currQuery}&search_class=${currOption}` + let url = `/search?page=${previousPage}&results_per_page=12&query=${currQuery}&search_class=${currOption}` + + if (currOption !== 'User') { + url = url + `&order=${currOrder}` + if (currOption === 'LearningObject') { + if (currCurriculumValues) { + url = url + `&subjects=${currCurriculumValues}` + } + if (currTypeOfResValues) { + url = url + `&object_types=${currTypeOfResValues}` + } + if (currTeachingStageValues) { + url = url + `&educational_stages=${currTeachingStageValues}` + } + if (currLanguagesValues) { + url = url + `&languages=${currLanguagesValues}` + } + if (currTag) + url = url + `&tags=${currTag}` + } + } history.push(url); } @@ -187,6 +252,66 @@ export default function Search() { setIsLoading(false); } + function handleSubjects(subjectsString) { + if (subjectsString) { + const selectedSubjects = subjectsString.split(','); + + for (let i = 0; i < selectedSubjects.length; i++) { + const elementOfSelectedSubs = selectedSubjects[i]; + for (let j = 0; j < filtersCurriculum.length; j++) { + if (elementOfSelectedSubs === filtersCurriculum[j].value) + filtersCurriculum[j].isChecked = true; + } + } + } + setCurriculumComponents(filtersCurriculum); + } + + function handleObjectTypes(objectTypesString) { + if (objectTypesString) { + const selectedObjectTypes = objectTypesString.split(','); + + for (let i = 0; i < selectedObjectTypes.length; i++) { + const elementOfSelectedObjectTypes = selectedObjectTypes[i]; + for (let j = 0; j < filtersTypes.length; j++) { + if (elementOfSelectedObjectTypes === filtersTypes[j].value) + filtersTypes[j].isChecked = true; + } + } + } + setTypeOfResources(filtersTypes); + } + + function handleLanguages(languagesString) { + if (languagesString) { + const selectedLanguages = languagesString.split(','); + + for (let i = 0; i < selectedLanguages.length; i++) { + const elementOfSelectedLanguages = selectedLanguages[i]; + for (let j = 0; j < filtersLanguages.length; j++) { + if (elementOfSelectedLanguages === filtersLanguages[j].value) + filtersLanguages[j].isChecked = true; + } + } + } + setLanguages(filtersLanguages); + } + + function handleStages(stagesString) { + if (stagesString) { + const selectedStages = stagesString.split(','); + + for (let i = 0; i < selectedStages.length; i++) { + const elementOfSelectedStages = selectedStages[i]; + for (let j = 0; j < filtersStages.length; j++) { + if (elementOfSelectedStages === filtersStages[j].value) + filtersStages[j].isChecked = true; + } + } + } + setTeachingStage(filtersStages); + } + useEffect(() => { setIsLoading(true) @@ -201,26 +326,38 @@ export default function Search() { const languages = urlParams.get("languages"); const tags = urlParams.get("tags"); - console.log(subjects) - setCurrOption(searchClass); setCurrQuery(query); setCurrPage(page); serCurrOrder(order); + setCurrCurriculumValues(subjects); + setCurrLanguagesValues(languages); + setCurrTeachingStageValues(educationalStages); + setCurrTypeOfResValues(objectTypes); + setCurrTag(tags); + + handleSubjects(subjects); + handleObjectTypes(objectTypes); + handleStages(educationalStages); + handleLanguages(languages); let url = `/search?page=${page}&results_per_page=12&query=${query}&search_class=${searchClass}` if (searchClass !== 'User') { url = url + `&order=${order}` if (searchClass === 'LearningObject') { - if (subjects) + if (subjects) { url = url + `&subjects[]=${subjects}` - if (objectTypes) + } + if (objectTypes) { url = url + `&object_types[]=${objectTypes}` - if (educationalStages) + } + if (educationalStages) { url = url + `&educational_stages[]=${educationalStages}` - if (languages) + } + if (languages) { url = url + `&languages[]=${languages}` + } if (tags) url = url + `&tags[]=${tags}` } @@ -231,6 +368,7 @@ export default function Search() { (data, headers) => { handleSuccess(data, headers, searchClass) }, handleFail, ); + }, [window.history.state === null ? true : window.history.state.key]) return ( @@ -250,7 +388,17 @@ export default function Search() { { currOption === 'LearningObject' && <Fragment> - <SearchExpansionPanel onChange={onChangeFilter} /> + <SearchExpansionPanel + onChange={onChangeFilter} + curriculumComponents={curriculumComponents} + setCurriculum={(array) => { setCurriculumComponents(array) }} + typeOfResources={typeOfResources} + setTypeRes={(array) => { setTypeOfResources(array) }} + teachingStage={teachingStage} + setTeachingStage={(array) => { setTeachingStage(array) }} + languages={languages} + setLanguages={(array) => { setLanguages(array) }} + /> { <FilterSummary curriculumComponents={curriculumComponents} -- GitLab From 86d4feb171753226a7a2d84c1e5a98e655b52671 Mon Sep 17 00:00:00 2001 From: Luis Felipe Risch <lfr20@inf.ufpr.br> Date: Tue, 22 Jun 2021 12:07:59 -0300 Subject: [PATCH 4/6] fixed search --- .../SearchExpansionPanel.js | 2 +- .../SearchPageComponents/FilterSummary.js | 190 ++----- src/Pages/Search.js | 538 ++---------------- 3 files changed, 111 insertions(+), 619 deletions(-) diff --git a/src/Components/SearchExpansionPanel/SearchExpansionPanel.js b/src/Components/SearchExpansionPanel/SearchExpansionPanel.js index 677d24d4..8df336aa 100644 --- a/src/Components/SearchExpansionPanel/SearchExpansionPanel.js +++ b/src/Components/SearchExpansionPanel/SearchExpansionPanel.js @@ -86,7 +86,7 @@ export default function SearchExpansionPanel(props) { }) } else - props.onChange("tag", keyWords) + props.setTag(keyWords) } } diff --git a/src/Components/SearchPageComponents/FilterSummary.js b/src/Components/SearchPageComponents/FilterSummary.js index 51578277..f11e0a32 100644 --- a/src/Components/SearchPageComponents/FilterSummary.js +++ b/src/Components/SearchPageComponents/FilterSummary.js @@ -13,154 +13,88 @@ export default function FilterSummary Resumo dos filtros colocados </h3> <Grid container direction='column' spacing={2}> - { - curriculumComponents.length >= 1 ? + <Grid item> + <Grid container direction='row' spacing={1} alignItems='center'> <Grid item> - <Grid container direction='row' spacing={1} alignItems='center'> - <Grid item> - Componentes curriculares: - </Grid> - <Grid item> - { - curriculumComponents.map((item) => { - if (item.isChecked) - return ( - <StyledChip key={new Date().toISOString() + item.value} size="small" label={item.exemplo} /> - ); - }) - } - </Grid> - </Grid> + Componentes curriculares: </Grid> - : <Grid item> - <Grid container direction='row' spacing={1} alignItems='center'> - <Grid item> - Componentes curriculares: - </Grid> - <Grid item> - <StyledChip size="small" label="Nenhum selecionado" /> - </Grid> - </Grid> + { + curriculumComponents.map((item) => { + return ( + item.isChecked && + <StyledChip key={new Date().toISOString() + item.value} size="small" label={item.exemplo} /> + ); + + }) + } </Grid> - } - { - typeOfResources.length >= 1 ? + </Grid> + </Grid> + <Grid item> + <Grid container direction='row' spacing={1} alignItems='center'> <Grid item> - <Grid container direction='row' spacing={1} alignItems='center'> - <Grid item> - Tipos de recursos: - </Grid> - <Grid item> - { - typeOfResources.map((item) => { - if (item.isChecked) - return ( - <StyledChip key={new Date().toISOString() + item.value} size="small" label={item.exemplo} /> - ) - }) - } - </Grid> - </Grid> + Tipos de recursos: </Grid> - : <Grid item> - <Grid container direction='row' spacing={1} alignItems='center'> - <Grid item> - Tipos de recursos: - </Grid> - <Grid item> - <StyledChip size="small" label="Nenhum selecionado" /> - </Grid> - </Grid> + { + typeOfResources.map((item) => { + return ( + item.isChecked && + <StyledChip key={new Date().toISOString() + item.value} size="small" label={item.exemplo} /> + ); + }) + } </Grid> - } - { - teachingStage.length >= 1 ? + </Grid> + </Grid> + <Grid item> + <Grid container direction='row' spacing={1} alignItems='center'> <Grid item> - <Grid container direction='row' spacing={1} alignItems='center'> - <Grid item> - Etapas de ensino: - </Grid> - <Grid item> - { - teachingStage.map((item) => { - if (item.isChecked) - return ( - <StyledChip key={new Date().toISOString() + item.value} size="small" label={item.exemplo} /> - ) - }) - } - </Grid> - </Grid> + Etapas de ensino: </Grid> - : <Grid item> - <Grid container direction='row' spacing={1} alignItems='center'> - <Grid item> - Etapas de ensino: - </Grid> - <Grid item> - <StyledChip size="small" label="Nenhum selecionado" /> - </Grid> - </Grid> + { + teachingStage.map((item) => { + return ( + item.isChecked && + <StyledChip key={new Date().toISOString() + item.value} size="small" label={item.exemplo} /> + ); + }) + } </Grid> - } - { - languages.length >= 1 ? + </Grid> + </Grid> + <Grid item> + <Grid container direction='row' spacing={1} alignItems='center'> <Grid item> - <Grid container direction='row' spacing={1} alignItems='center'> - <Grid item> - Idiomas: - </Grid> - <Grid item> - { - languages.map((item) => { - if (item.isChecked) - return ( - <StyledChip key={new Date().toISOString() + item.value} size="small" label={item.exemplo} /> - ) - }) - } - </Grid> - </Grid> + Idiomas: </Grid> - : <Grid item> - <Grid container direction='row' spacing={1} alignItems='center'> - <Grid item> - Idiomas: - </Grid> - <Grid item> - <StyledChip size="small" label="Nenhum selecionado" /> - </Grid> - </Grid> + { + languages.map((item) => { + return ( + item.isChecked && + <StyledChip key={new Date().toISOString() + item.value} size="small" label={item.exemplo} /> + ); + }) + } </Grid> - } - { - tag.length >= 1 ? + </Grid> + </Grid> + <Grid item> + <Grid container direction='row' spacing={1} alignItems='center'> <Grid item> - <Grid container direction='row' spacing={1} alignItems='center'> - <Grid item> - Palavra chave: - </Grid> - <Grid item> - <StyledChip size="small" label={tag} /> - </Grid> - </Grid> + Palavra chave: </Grid> - : <Grid item> - <Grid container direction='row' spacing={1} alignItems='center'> - <Grid item> - Palavra chave: - </Grid> - <Grid item> - <StyledChip size="small" label="Nenhum selecionado" /> - </Grid> - </Grid> + { + tag && + <StyledChip size="small" label={tag} /> + } </Grid> - } + </Grid> + </Grid> <Grid item> <StyledButton variant="contained" onClick={onButtonClicked}> <span className="text"> diff --git a/src/Pages/Search.js b/src/Pages/Search.js index f6f49d2c..a2783f65 100644 --- a/src/Pages/Search.js +++ b/src/Pages/Search.js @@ -29,7 +29,12 @@ import { getRequest } from '../Components/HelperFunctions/getAxiosConfig'; import { useHistory } from 'react-router-dom'; import SearchExpansionPanel from '../Components/SearchExpansionPanel/SearchExpansionPanel'; import FilterSummary from '../Components/SearchPageComponents/FilterSummary'; -import { filtersCurriculum, filtersTypes, filtersStages, filtersLanguages } from '../Components/SearchPageComponents/filters'; +import { + filtersCurriculum, + filtersTypes, + filtersStages, + filtersLanguages, +} from '../Components/SearchPageComponents/filters'; export default function Search() { const history = useHistory(); @@ -45,7 +50,6 @@ export default function Search() { const [currTag, setCurrTag] = useState(''); const [isLoading, setIsLoading] = useState(false); - const [curriculumComponents, setCurriculumComponents] = useState([]); const [typeOfResources, setTypeOfResources] = useState([]); const [teachingStage, setTeachingStage] = useState([]); @@ -81,7 +85,6 @@ export default function Search() { const typeOfResourcesValues = []; const teachingStageValues = []; const languagesValues = []; - const tagsValue = []; for (let index = 0; index < curriculumComponents.length; index++) { const element = curriculumComponents[index]; @@ -107,32 +110,49 @@ export default function Search() { languagesValues.push(element.value); } - tagsValue.push(tag) + let url = `/busca?page=0&results_per_page=12&query=${currQuery}&search_class=${currOption}` + + if (currOption !== 'User') { + url = url + `&order=${currOrder}` + if (currOption === 'LearningObject') { + if (curriculumValues.length >= 1) { + url = url + `&subjects=${curriculumValues}` + } + if (typeOfResourcesValues.length >= 1) { + url = url + `&object_types=${typeOfResourcesValues}` + } + if (teachingStageValues.length >= 1) { + url = url + `&educational_stages=${teachingStageValues}` + } + if (languagesValues.length >= 1) { + url = url + `&languages=${languagesValues}` + } + if (tag.length >= 1) + url = url + `&tags=${tag}` + } + } - const url = `/busca?page=0&results_per_page=12&order=${currOrder}&query=${currQuery}&search_class=${currOption}&subjects=${curriculumValues}&object_types=${typeOfResourcesValues}&educational_stages=${teachingStageValues}&languages=${languagesValues}&tags=${tagsValue}` - history.push(url) + history.push(url); } - function onChangeFilter(type, content) { - switch (type) { - case "curriculum": - setCurriculumComponents(content) - break; - case "languages": - setLanguages(content) - break; - case "stages": - setTeachingStage(content) - break; - case "types": - setTypeOfResources(content) - break; - case "tag": - setTag(content) - break; - default: - break; + function resetFilters() { + for (let index = 0; index < filtersCurriculum.length; index++) { + if (filtersCurriculum[index].isChecked) + filtersCurriculum[index].isChecked = false; + } + for (let index = 0; index < filtersLanguages.length; index++) { + if (filtersLanguages[index].isChecked) + filtersLanguages[index].isChecked = false; + } + for (let index = 0; index < filtersStages.length; index++) { + if (filtersStages[index].isChecked) + filtersStages[index].isChecked = false; } + for (let index = 0; index < filtersTypes.length; index++) { + if (filtersTypes[index].isChecked) + filtersTypes[index].isChecked = false; + } + setTag('') } function handleChangeOption(e) { @@ -144,6 +164,7 @@ export default function Search() { else url = `/busca?page=0&results_per_page=12&query=*&search_class=${value}` + resetFilters() history.push(url); } @@ -202,7 +223,7 @@ export default function Search() { function handlePreviousPage() { const previousPage = currPage - 1; - let url = `/search?page=${previousPage}&results_per_page=12&query=${currQuery}&search_class=${currOption}` + let url = `/busca?page=${previousPage}&results_per_page=12&query=${currQuery}&search_class=${currOption}` if (currOption !== 'User') { url = url + `&order=${currOrder}` @@ -255,7 +276,6 @@ export default function Search() { function handleSubjects(subjectsString) { if (subjectsString) { const selectedSubjects = subjectsString.split(','); - for (let i = 0; i < selectedSubjects.length; i++) { const elementOfSelectedSubs = selectedSubjects[i]; for (let j = 0; j < filtersCurriculum.length; j++) { @@ -270,7 +290,6 @@ export default function Search() { function handleObjectTypes(objectTypesString) { if (objectTypesString) { const selectedObjectTypes = objectTypesString.split(','); - for (let i = 0; i < selectedObjectTypes.length; i++) { const elementOfSelectedObjectTypes = selectedObjectTypes[i]; for (let j = 0; j < filtersTypes.length; j++) { @@ -389,7 +408,7 @@ export default function Search() { currOption === 'LearningObject' && <Fragment> <SearchExpansionPanel - onChange={onChangeFilter} + setTag={(tag) => setTag(tag)} curriculumComponents={curriculumComponents} setCurriculum={(array) => { setCurriculumComponents(array) }} typeOfResources={typeOfResources} @@ -461,464 +480,3 @@ const StyledBreadCrumbs = styled(Breadcrumbs)` text-decoration: none; } `; - - -// import React, { useEffect, useState, useContext } from "react"; -// import { apiDomain } from '../env'; -// import { Link, useHistory } from "react-router-dom"; -// import styled from "styled-components"; -// import Paper from "@material-ui/core/Paper"; -// import LoadingSpinner from '../Components/LoadingSpinner'; -// import Breadcrumbs from "@material-ui/core/Breadcrumbs"; -// import "./Styles/Home.css"; -// import { Store } from "../Store"; -// import { Grid } from "@material-ui/core"; -// import Dropdown from "react-dropdown"; -// import "react-dropdown/style.css"; -// import SearchExpansionPanel from "../Components/SearchExpansionPanel/SearchExpansionPanel"; -// import ResourceCardFunction from "../Components/ResourceCardFunction"; -// import CollectionCardFunction from "../Components/CollectionCardFunction"; -// import ContactCard from "../Components/ContactCard"; -// import CircularProgress from '@material-ui/core/CircularProgress'; -// import { getRequest } from '../Components/HelperFunctions/getAxiosConfig' -// import ColecaoVazia from '../img/Pagina_vazia_colecao.png' -// import RecursoVazio from '../img/Pagina_vazia_Sem_publicar.png' - - -// let order = "review_average"; -// let currFilter = ""; -// let currOption; - -// export default function Search(props) { -// const history = useHistory() - -// const { state, dispatch } = useContext(Store); -// const [resultsResource, setResultsResource] = useState([]); -// const [resultsCollection, setResultsCollection] = useState([]); -// const [resultsUser, setResultsUser] = useState([]); -// const [currOrder, setCurrOrder] = useState(order); -// const [page, setPage] = useState(0); -// const [isloading, setIsLoading] = useState(false); -// const [loadingMoreData, setLoadingMoreData] = useState(false); -// const [isFiltering, setIsFiltering] = useState(false); -// const [resultsPerPage] = useState(12); -// const [showingResults, setShowingResults] = useState(0); -// const [totalResults, setTotalResults] = useState(0); -// const [options] = React.useState([ -// { label: "Recursos", value: "LearningObject" }, -// { label: "Coleções", value: "Collection" }, -// { label: "Usuários", value: "User" }, -// ]); -// const [ordenar] = useState([ -// { label: "Mais Estrelas", value: "review_average" }, -// { label: "Mais Relevante", value: "score" }, -// { label: "Mais Baixados", value: "downloads" }, -// { label: "Mais Favoritados", value: "likes" }, -// { label: "Mais Recentes", value: "publicationdesc" }, -// { label: "Ordem Alfabética", value: "title" }, -// ]); - -// const [option, setOption] = useState( -// new URLSearchParams(window.location.search).get("search_class") -// ); -// const [optionResult, setOptionResult] = useState(option); -// currOption = option; - -// function handleSuccessfulGet(data, headers) { -// if (currOption === "LearningObject" && page > 0) { -// setResultsResource((previousData) => previousData.concat(data)); -// } -// else { -// setResultsResource(data); -// } -// if (currOption === "Collection" && page > 0) { -// setResultsCollection((previousData) => previousData.concat(data)); -// } -// else { -// setResultsCollection(data); -// } -// if (currOption === "User" && page > 0) { -// setResultsUser((previousData) => previousData.concat(data)); -// } -// else { -// setResultsUser(data); -// } -// dispatch({ -// type: "SAVE_SEARCH", -// newSearch: { -// query: state.search.query, -// class: currOption, -// }, -// }); -// if (headers.has('X-Total-Count')) { -// setTotalResults(headers.get('X-Total-Count')); -// } -// if (page > 0) -// setShowingResults((previousSize) => data.length + previousSize) -// else -// setShowingResults(data.length) -// setIsLoading(false); -// setIsFiltering(false); -// setLoadingMoreData(false); -// } - -// const collectStuff = (tipoBusca, filtro) => { - -// const urlParams = new URLSearchParams(window.location.search); -// const query = urlParams.get("query"); -// const searchClass = urlParams.get("search_class"); - -// if (!loadingMoreData) // this line prevents resetting filter when loading more data -// currFilter = filtro; -// if (filtro) -// setIsFiltering(true); -// const url = `/search?page=${page}&results_per_page=${resultsPerPage}&order=${order}&query=${query}${currFilter ? currFilter : ""}&search_class=${searchClass}` -// getRequest(url, handleSuccessfulGet, (error) => { console.log(error) }) -// }; - -// useEffect(() => { -// setIsLoading(true) - -// const urlParams = new URLSearchParams(window.location.search); -// const query = urlParams.get("query"); -// const searchClass = urlParams.get("search_class"); - -// if (state.search.query !== query || state.search.class !== searchClass) { -// dispatch({ -// type: "SAVE_SEARCH", -// newSearch: { -// query: query, -// class: searchClass, -// }, -// }); -// state.search.query = query -// state.search.class = searchClass -// } -// currOption = searchClass -// setOption(searchClass) -// setOptionResult(searchClass) -// collectStuff(searchClass) - -// return () => -// dispatch({ -// type: "HANDLE_SEARCH_BAR", -// opened: false, -// }); -// }, [state.currentUser.id, window.history.state === null ? true : window.history.state.key]) - -// useEffect(() => { -// if (page > 0) { -// setIsLoading(true); -// collectStuff(option); -// } -// }, [page]); - -// return ( -// <div style={{ backgroundColor: "#f4f4f4" }}> -// <Principal> -// <BreadCrumbsDiv style={{ margin: "15px 2%", }}> -// <StyledBreadCrumbs> -// <Link to="/">Página Inicial</Link> -// <span>Busca</span> -// </StyledBreadCrumbs> -// </BreadCrumbsDiv> - -// <div style={{ margin: "15px 2%", }}> -// <HeaderFilters elevation={4} square> -// <Grid container spacing={0} style={{ height: "100%" }}> -// <Grid item xs style={{ display: "flex", flexDirection: "column", justifyContent: "center", paddingLeft: 20 }}> -// <div style={{ marginRight: 5, marginTop: 15 }}> -// <div className="textInfo"> -// <span style={{ fontWeight: "bold" }}> -// MOSTRAR -// </span> -// </div> -// <Dropdown options={options} value={optionResult} -// onChange={(e) => { -// setResultsCollection([]); -// setResultsResource([]); -// setResultsUser([]); -// setShowingResults(0); -// setPage(0); -// setIsLoading(true); -// currOption = e.value; -// history.push(`/busca?query=${state.search.query}&search_class=${currOption}`) -// setOption(currOption); -// // collectStuff(currOption, ""); -// }} -// placeholder="Selecione um tipo" -// /> -// </div> -// </Grid> - -// { -// optionResult === "User" ? null : -// <Grid item xs style={{ display: "flex", flexDirection: "column", justifyContent: "center", paddingRight: 20, }}> -// <div style={{ marginLeft: 5, marginTop: 15 }}> -// <div className="textInfo"> -// <span style={{ fontWeight: "bold" }}> -// ORDENAR POR -// </span> -// </div> -// <Dropdown options={ordenar} value={currOrder} onChange={(e) => { -// order = e.value; -// setCurrOrder(e.label) -// collectStuff(optionResult, currFilter); -// }} -// placeholder="Selecione uma opção" -// /> -// </div> -// </Grid> -// } -// <Grid item xs={12}> -// <div style={{ display: "flex", flexDirection: "column", justifyContent: "center" }}> -// <div style={{ textAlign: "center", paddingTop: 10, fontWeight: "bolder" }}> -// Exibindo {showingResults === 0 ? 0 : showingResults} resultados de {totalResults} encontrados -// </div> -// </div> -// </Grid> -// </Grid> -// </HeaderFilters> - -// { -// isloading ? <LoadingSpinner text="Carregando..." /> : -// optionResult === "Collection" ? ( -// resultsCollection.length >= 1 ? -// <GridBuscaCollection container direction="row" spacing={2}> -// <Grid item xs> -// <Grid container justify="center" alignItems="center" spacing={2}> -// {resultsCollection.map((card) => ( -// <Grid container item xs justify="center" alignItems="center" key={card.id}> -// <CollectionCardFunction -// name={card.name} -// tags={card.tags} -// rating={card.review_average} -// id={card.id} -// author={card.owner ? card.owner.name : ""} -// description={card.description} -// thumbnails={card.items_thumbnails} -// avatar={card.owner ? card.owner.avatar : ""} -// likeCount={card.likes_count} -// followed={card.followed} -// liked={card.liked} -// collections={card.collection_items} -// authorID={card.owner.id} -// /> - -// </Grid> -// ))} -// </Grid> -// <div style={{ display: "flex", flexDirection: "row", justifyContent: "center", }}> -// <button -// style={{ -// height: 36, backgroundColor: "#ff7f00", marginBottom: 50, marginTop: 50, fontSize: 14, -// color: "white", borderRadius: 4, border: "none", -// }} -// onClick={() => { -// setLoadingMoreData(true); -// setPage(page + 1) -// }} -// > -// { -// loadingMoreData ? <CircularProgress size={24} color="inherit" /> : "Carregar mais 12" -// } -// </button> -// </div> -// </Grid> -// </GridBuscaCollection> : -// <Grid container direction="row" justify="center" alignItems="center"> -// <Grid item> -// <img src={ColecaoVazia} alt="coleção vazia" /> -// </Grid> -// </Grid> - -// ) : - -// optionResult === "LearningObject" ? ( -// resultsResource.length >= 1 ? -// <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> -// <Grid container justify="center" spacing={3} alignItems="center" > -// {resultsResource.map((card) => ( -// <Grid container justify="center" alignItems="center" item xs={12} sm={6} md={4} lg={3} key={card.id}> -// <ResourceCardFunction -// avatar={card.publisher ? card.publisher.avatar : ""} -// id={card.id} -// thumbnail={card.thumbnail} -// type={card.object_type ? card.object_type : "Outros"} -// title={card.name} -// published={card.state === "published" ? true : false} -// likeCount={card.likes_count} -// liked={card.liked} -// rating={card.review_average} -// author={card.author} -// tags={card.educational_stages} -// href={"/recurso/" + card.id} -// downloadableLink={card.default_attachment_location} -// /> -// </Grid> -// ))} -// </Grid> -// <div -// style={{ -// display: "flex", -// flexDirection: "row", -// justifyContent: "center", -// }} -// > -// <button -// style={{ -// height: 36, -// backgroundColor: "#ff7f00", -// marginBottom: 50, -// marginTop: 50, -// fontSize: 14, -// color: "white", -// borderRadius: 4, -// border: "none", -// }} -// onClick={() => { -// setLoadingMoreData(true); -// setPage(page + 1) -// // collectStuff("LearningObject", ""); -// }} -// > -// { -// loadingMoreData ? <CircularProgress size={24} color="inherit" /> : "Carregar mais 12" -// } -// </button> -// </div> -// </Grid> -// </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}> -// <Grid item xs > -// <Grid container spacing={2} justify="center" alignItems="center"> -// {resultsUser.map((card) => ( -// <Grid container justify="center" alignItems="center" item xs key={card.id}> -// <ContactCard - // name={card.name} - // avatar={card.avatar ? apiDomain + card.avatar : null} - // cover={card.cover ? apiDomain + card.cover : null} - // numCollections={card.collections_count} - // numLearningObjects={card.learning_objects_count} - // follow_count={card.follows_count} - // followed={card.followed || null} - // followerID={card.id} - // href={'/usuario-publico/' + card.id} -// /> -// </Grid> -// ))} -// </Grid> -// <div -// style={{ -// display: "flex", -// flexDirection: "row", -// justifyContent: "center", -// }} -// > -// <button -// style={{ -// height: 36, -// backgroundColor: "#ff7f00", -// marginBottom: 50, -// marginTop: 50, -// fontSize: 14, -// color: "white", -// borderRadius: 4, -// border: "none", -// }} -// onClick={() => { -// setLoadingMoreData(true); -// setPage(page + 1) -// // collectStuff("User", ""); -// }} -// > -// { -// loadingMoreData ? <CircularProgress color="inherit" size={24} /> : "Carregar mais 12" -// } -// </button> -// </div> -// </Grid> -// </GridBuscaUser> -// ) -// } -// </div> -// </Principal> -// </div> -// ); -// } - -// const GridBuscaCollection = styled(Grid)` -// color: #666; -// ${'' /* background-color: green; */} - -// h4 { -// padding: 0 15px; -// font-size: 18px; -// margin-block: 10px; -// text-transform: uppercase; -// } -// `; -// const GridBuscaResource = styled(Grid)` -// color: #666; -// ${'' /* background-color: red; */} - -// h4 { -// padding: 0 15px; -// font-size: 18px; -// margin-block: 10px; -// text-transform: uppercase; -// } -// `; -// const GridBuscaUser = styled(Grid)` -// color: #666; -// ${'' /* background-color: blue; */} - -// h4 { -// padding: 0 15px; -// font-size: 18px; -// margin-block: 10px; -// text-transform: uppercase; -// } -// ` - -// const BreadCrumbsDiv = styled.div` -// padding: 10px; -// display: flex; -// `; - -// const Principal = styled.div` -// margin-inline: auto; -// `; -- GitLab From 7074c8609db41b54823416703209ed1daaa91e6f Mon Sep 17 00:00:00 2001 From: Luis Felipe Risch <lfr20@inf.ufpr.br> Date: Wed, 23 Jun 2021 10:49:34 -0300 Subject: [PATCH 5/6] fixed seragch --- .../CollectionTemplate.js | 2 +- src/Components/SearchPageComponents/Error.js | 30 +++ .../SearchPageComponents/FilterSummary.js | 2 +- .../SearchPageComponents/ResourceTemplate.js | 2 +- .../SearchPageComponents/UserTemplate.js | 2 +- src/Pages/Search.js | 206 ++++++++++++------ 6 files changed, 172 insertions(+), 72 deletions(-) create mode 100644 src/Components/SearchPageComponents/Error.js diff --git a/src/Components/SearchPageComponents/CollectionTemplate.js b/src/Components/SearchPageComponents/CollectionTemplate.js index 4b14e6b0..c3bcb3ee 100644 --- a/src/Components/SearchPageComponents/CollectionTemplate.js +++ b/src/Components/SearchPageComponents/CollectionTemplate.js @@ -10,8 +10,8 @@ import ArrowBackIcon from '@material-ui/icons/ArrowBack'; import ArrowForwardIcon from '@material-ui/icons/ArrowForward'; export default function ResourceTemplate({ isLoading, resources, totalResources, currPage, handlePreviousPage, handleNextPage }) { - const totalPages = Math.ceil(totalResources / 12) - 1; //Dividing by 12 because i want to cath total pages, and results per page is 12 const topRef = React.useRef(); + const totalPages = parseInt(totalResources) === 0 ? 0 : Math.ceil(totalResources / 12) - 1; //Dividing by 12 because i want to cath total pages, and results per page is 12 useEffect(() => { topRef.current.scrollIntoView() diff --git a/src/Components/SearchPageComponents/Error.js b/src/Components/SearchPageComponents/Error.js new file mode 100644 index 00000000..7cb9d98c --- /dev/null +++ b/src/Components/SearchPageComponents/Error.js @@ -0,0 +1,30 @@ +import React from 'react'; +import styled from 'styled-components'; +import Paper from '@material-ui/core/Paper'; + +export default function Error() { + return <ResourcePaper square elevation={4}> + <Title> + Houve um erro durante a obtenção de dados :( + </Title> + </ResourcePaper> +} + +const ResourcePaper = styled(Paper)` + /* height: 150px; */ + text-align: center; + background-color: #fff; + margin-top: 5px; + margin-bottom: 30px; + padding: 0.5em 1em; + color: #666; + width: 100%; +`; + +const Title = styled.h4` + text-transform: uppercase; + font-weight: 500; + text-align: left; + color: #666; + text-align: center; +` \ No newline at end of file diff --git a/src/Components/SearchPageComponents/FilterSummary.js b/src/Components/SearchPageComponents/FilterSummary.js index f11e0a32..9cc1a9ae 100644 --- a/src/Components/SearchPageComponents/FilterSummary.js +++ b/src/Components/SearchPageComponents/FilterSummary.js @@ -10,7 +10,7 @@ export default function FilterSummary return ( <FilterSummaryPaper square elevation={4}> <h3 className="title"> - Resumo dos filtros colocados + Resumo dos filtros selecionados </h3> <Grid container direction='column' spacing={2}> <Grid item> diff --git a/src/Components/SearchPageComponents/ResourceTemplate.js b/src/Components/SearchPageComponents/ResourceTemplate.js index 28651ca0..01f74736 100644 --- a/src/Components/SearchPageComponents/ResourceTemplate.js +++ b/src/Components/SearchPageComponents/ResourceTemplate.js @@ -10,7 +10,7 @@ import ArrowBackIcon from '@material-ui/icons/ArrowBack'; import ArrowForwardIcon from '@material-ui/icons/ArrowForward'; export default function ResourceTemplate({ isLoading, resources, totalResources, currPage, handlePreviousPage, handleNextPage }) { - const totalPages = Math.ceil(totalResources / 12) - 1; //Dividing by 12 because i want to cath total pages, and results per page is 12 + const totalPages = parseInt(totalResources) === 0 ? 0 : Math.ceil(totalResources / 12) - 1; //Dividing by 12 because i want to cath total pages, and results per page is 12 const topRef = React.useRef(); useEffect(() => { diff --git a/src/Components/SearchPageComponents/UserTemplate.js b/src/Components/SearchPageComponents/UserTemplate.js index 45ebb66f..991a31d3 100644 --- a/src/Components/SearchPageComponents/UserTemplate.js +++ b/src/Components/SearchPageComponents/UserTemplate.js @@ -10,7 +10,7 @@ import ArrowForwardIcon from '@material-ui/icons/ArrowForward'; import { apiDomain } from '../../env'; export default function ResourceTemplate({ isLoading, resources, totalResources, currPage, handlePreviousPage, handleNextPage }) { - const totalPages = Math.ceil(totalResources / 12) - 1; //Dividing by 12 because i want to cath total pages, and results per page is 12 + const totalPages = parseInt(totalResources) === 0 ? 0 : Math.ceil(totalResources / 12) - 1; //Dividing by 12 because i want to cath total pages, and results per page is 12 const topRef = React.useRef(); useEffect(() => { diff --git a/src/Pages/Search.js b/src/Pages/Search.js index a2783f65..15628592 100644 --- a/src/Pages/Search.js +++ b/src/Pages/Search.js @@ -17,7 +17,7 @@ // along with Plataforma Integrada MEC. If not, see <http://www.gnu.org/licenses/>.*/ -import React, { useEffect, useState, Fragment } from 'react'; +import React, { useEffect, useState, Fragment, useContext } from 'react'; import styled from 'styled-components'; import { Link } from 'react-router-dom'; import Breadcrumbs from '@material-ui/core/Breadcrumbs'; @@ -25,6 +25,7 @@ import HeaderFilters from '../Components/SearchPageComponents/HeaderFilters'; import ResourceTemplate from '../Components/SearchPageComponents/ResourceTemplate'; import CollectionTemplate from '../Components/SearchPageComponents/CollectionTemplate'; import UserTemplate from '../Components/SearchPageComponents/UserTemplate'; +import Error from '../Components/SearchPageComponents/Error'; import { getRequest } from '../Components/HelperFunctions/getAxiosConfig'; import { useHistory } from 'react-router-dom'; import SearchExpansionPanel from '../Components/SearchExpansionPanel/SearchExpansionPanel'; @@ -35,9 +36,17 @@ import { filtersStages, filtersLanguages, } from '../Components/SearchPageComponents/filters'; +import Snackbar from '@material-ui/core/Snackbar'; +import MuiAlert from '@material-ui/lab/Alert'; +import { Store } from '../Store' + +function Alert(props) { + return <MuiAlert elevation={6} variant="filled" {...props} />; +} export default function Search() { const history = useHistory(); + const { state } = useContext(Store) const [currOption, setCurrOption] = useState(''); const [currOrder, serCurrOrder] = useState('review_average'); @@ -49,6 +58,12 @@ export default function Search() { const [currLanguagesValues, setCurrLanguagesValues] = useState(''); const [currTag, setCurrTag] = useState(''); const [isLoading, setIsLoading] = useState(false); + const [error, setError] = useState(false); + const [snackInfo, setSnackInfo] = useState({ + open: false, + text: "", + severity: "", + }); const [curriculumComponents, setCurriculumComponents] = useState([]); const [typeOfResources, setTypeOfResources] = useState([]); @@ -80,6 +95,19 @@ export default function Search() { { value: 'Ordem Alfabética', name: 'title' }, ]; + function handleSnackInfo(info) { + setSnackInfo({ ...info }) + } + + function handleCloseSnack() { + const snackInfo = { + open: false, + text: "", + severity: "", + } + handleSnackInfo(snackInfo) + } + function onButtonClicked() { const curriculumValues = []; const typeOfResourcesValues = []; @@ -127,7 +155,7 @@ export default function Search() { if (languagesValues.length >= 1) { url = url + `&languages=${languagesValues}` } - if (tag.length >= 1) + if (tag && tag.length >= 1) url = url + `&tags=${tag}` } } @@ -270,6 +298,13 @@ export default function Search() { } function handleFail() { + const snackInfo = { + open: true, + text: "Houve um erro ao carregar os dados!", + severity: "warning", + } + handleSnackInfo(snackInfo) + setError(true); setIsLoading(false); } @@ -354,6 +389,7 @@ export default function Search() { setCurrTeachingStageValues(educationalStages); setCurrTypeOfResValues(objectTypes); setCurrTag(tags); + setTag(tags); handleSubjects(subjects); handleObjectTypes(objectTypes); @@ -388,87 +424,121 @@ export default function Search() { handleFail, ); - }, [window.history.state === null ? true : window.history.state.key]) - - return ( - <MainPage> - <StyledBreadCrumbs> - <Link to='/'>Página Inicial</Link> - <span>Busca</span> - </StyledBreadCrumbs> - <HeaderFilters - options={options} - orders={orders} - currOption={currOption} - currOrder={currOrder} - handleChangeOption={handleChangeOption} - handleChangeOrder={handleChangeOrder} - /> - { - currOption === 'LearningObject' && - <Fragment> - <SearchExpansionPanel - setTag={(tag) => setTag(tag)} - curriculumComponents={curriculumComponents} - setCurriculum={(array) => { setCurriculumComponents(array) }} - typeOfResources={typeOfResources} - setTypeRes={(array) => { setTypeOfResources(array) }} - teachingStage={teachingStage} - setTeachingStage={(array) => { setTeachingStage(array) }} - languages={languages} - setLanguages={(array) => { setLanguages(array) }} - /> - { - <FilterSummary + }, [window.history.state === null ? true : window.history.state.key, state.currentUser.id]) + + if (error) + return ( + <MainPageError> + <Snackbar + open={snackInfo.open} + autoHideDuration={6000} + onClose={handleCloseSnack} + anchorOrigin={{ vertical: 'top', horizontal: 'right' }} + > + <Alert onClose={handleCloseSnack} severity={snackInfo.severity}> + {snackInfo.text} + </Alert> + </Snackbar> + <Error /> + </MainPageError> + ) + else + return ( + <MainPage> + <Snackbar + open={snackInfo.open} + autoHideDuration={6000} + onClose={handleCloseSnack} + anchorOrigin={{ vertical: 'top', horizontal: 'right' }} + > + <Alert onClose={handleCloseSnack} severity={snackInfo.severity}> + {snackInfo.text} + </Alert> + </Snackbar> + <StyledBreadCrumbs> + <Link to='/'>Página Inicial</Link> + <span>Busca</span> + </StyledBreadCrumbs> + <HeaderFilters + options={options} + orders={orders} + currOption={currOption} + currOrder={currOrder} + handleChangeOption={handleChangeOption} + handleChangeOrder={handleChangeOrder} + /> + { + currOption === 'LearningObject' && + <Fragment> + <SearchExpansionPanel + setTag={(tag) => setTag(tag)} curriculumComponents={curriculumComponents} + setCurriculum={(array) => { setCurriculumComponents(array) }} typeOfResources={typeOfResources} - languages={languages} + setTypeRes={(array) => { setTypeOfResources(array) }} teachingStage={teachingStage} - tag={tag} - onButtonClicked={onButtonClicked} + setTeachingStage={(array) => { setTeachingStage(array) }} + languages={languages} + setLanguages={(array) => { setLanguages(array) }} /> - } - <ResourceTemplate + { + <FilterSummary + curriculumComponents={curriculumComponents} + typeOfResources={typeOfResources} + languages={languages} + teachingStage={teachingStage} + tag={tag} + onButtonClicked={onButtonClicked} + /> + } + <ResourceTemplate + handleNextPage={handleNextPage} + handlePreviousPage={handlePreviousPage} + isLoading={isLoading} + currPage={currPage} + resources={resourcesArray} + totalResources={totalResources} + /> + </Fragment> + } + { + currOption === 'Collection' && + <CollectionTemplate handleNextPage={handleNextPage} handlePreviousPage={handlePreviousPage} isLoading={isLoading} currPage={currPage} - resources={resourcesArray} - totalResources={totalResources} + resources={collectionsArray} + totalResources={totalCollections} /> - </Fragment> - } - { - currOption === 'Collection' && - <CollectionTemplate - handleNextPage={handleNextPage} - handlePreviousPage={handlePreviousPage} - isLoading={isLoading} - currPage={currPage} - resources={collectionsArray} - totalResources={totalCollections} - /> - } - { - currOption === 'User' && - <UserTemplate - handleNextPage={handleNextPage} - handlePreviousPage={handlePreviousPage} - isLoading={isLoading} - currPage={currPage} - resources={usersArray} - totalResources={totalUsers} - /> - } - </MainPage> - ) + } + { + currOption === 'User' && + <UserTemplate + handleNextPage={handleNextPage} + handlePreviousPage={handlePreviousPage} + isLoading={isLoading} + currPage={currPage} + resources={usersArray} + totalResources={totalUsers} + /> + } + </MainPage> + ) } const MainPage = styled.div` width: 90%; margin: 1em auto; ` - +const MainPageError = styled.div` + width: 90%; + margin: 1em auto; + display: flex; + justify-content: center; + align-items: center; + padding: 1em; +` const StyledBreadCrumbs = styled(Breadcrumbs)` display: flex; justify-content: flex-start; -- GitLab From d78d4441e18eb073efbdad06d74ac7a592d06732 Mon Sep 17 00:00:00 2001 From: Luis Felipe Risch <lfr20@inf.ufpr.br> Date: Thu, 24 Jun 2021 12:03:47 -0300 Subject: [PATCH 6/6] installed all packages again, because it was getting error in the production --- package-lock.json | 681 ++++++++++++++++++++++++++-------------------- 1 file changed, 381 insertions(+), 300 deletions(-) diff --git a/package-lock.json b/package-lock.json index 895b0bb9..aabd8520 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2965,9 +2965,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -3916,14 +3916,32 @@ } }, "browserslist": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.12.0.tgz", - "integrity": "sha512-UH2GkcEDSI0k/lRkuDSzFl9ZZ87skSy9w2XAn1MsZnL+4c4rqbBd3e82UWHbYDpztABrPBhZsTEeuxVfHppqDg==", + "version": "4.16.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.6.tgz", + "integrity": "sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ==", "requires": { - "caniuse-lite": "^1.0.30001043", - "electron-to-chromium": "^1.3.413", - "node-releases": "^1.1.53", - "pkg-up": "^2.0.0" + "caniuse-lite": "^1.0.30001219", + "colorette": "^1.2.2", + "electron-to-chromium": "^1.3.723", + "escalade": "^3.1.1", + "node-releases": "^1.1.71" + }, + "dependencies": { + "caniuse-lite": { + "version": "1.0.30001239", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001239.tgz", + "integrity": "sha512-cyBkXJDMeI4wthy8xJ2FvDU6+0dtcZSJW3voUF8+e9f1bBeuvyZfc3PNbkOETyhbR+dGCPzn9E7MA3iwzusOhQ==" + }, + "electron-to-chromium": { + "version": "1.3.755", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.755.tgz", + "integrity": "sha512-BJ1s/kuUuOeo1bF/EM2E4yqW9te0Hpof3wgwBx40AWJE18zsD1Tqo0kr7ijnOc+lRsrlrqKPauJAHqaxOItoUA==" + }, + "node-releases": { + "version": "1.1.73", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.73.tgz", + "integrity": "sha512-uW7fodD6pyW2FZNZnp/Z3hvWKeEW1Y8R1+1CnErE8cXFXzl5blBOoVB41CvMer6P6Q0S5FXDwcHgFd1Wj0U9zg==" + } } }, "bser": { @@ -4008,9 +4026,9 @@ }, "dependencies": { "y18n": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==" + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" } } }, @@ -4469,6 +4487,11 @@ "simple-swizzle": "^0.2.2" } }, + "colorette": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz", + "integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==" + }, "colornames": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/colornames/-/colornames-1.1.1.tgz", @@ -4817,9 +4840,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -4861,9 +4884,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -4900,9 +4923,9 @@ "integrity": "sha512-MsCAG1z9lPdoO/IUMLSBWBSVxVtJ1395VGIQ+Fc2gNdkQ1hNDnQdw3YhA71WJCBW1vdwA0cAnk/DnW6bqoEUYg==" }, "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -4962,9 +4985,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -5117,9 +5140,9 @@ } }, "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -5184,9 +5207,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -5227,9 +5250,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -5634,9 +5657,9 @@ "integrity": "sha1-s55/HabrCnW6nBcySzR1PEfgZU0=" }, "dns-packet": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-1.3.1.tgz", - "integrity": "sha512-0UxfQkMhYAUaZI+xrNZOz/as5KgDU0M/fQ9b6SpkyLbk3GEswDi6PADJVaYJradtRVsRIlF1zLyOodbcTCDzUg==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-1.3.4.tgz", + "integrity": "sha512-BQ6F4vycLXBvdrJZ6S3gZewt6rcrks9KBgM9vrhW+knGRqc8uEdT7fuCwloc7nny5xNoMJ17HGH0R/6fpo8ECA==", "requires": { "ip": "^1.1.0", "safe-buffer": "^5.0.1" @@ -5722,11 +5745,18 @@ } }, "domhandler": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz", - "integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.2.0.tgz", + "integrity": "sha512-zk7sgt970kzPks2Bf+dwT/PLzghLnsivb9CcxkvR8Mzr66Olr0Ofd8neSbglHJHaHa2MadfoSdNlKYAaafmWfA==", "requires": { - "domelementtype": "1" + "domelementtype": "^2.2.0" + }, + "dependencies": { + "domelementtype": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.2.0.tgz", + "integrity": "sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A==" + } } }, "domutils": { @@ -5981,6 +6011,11 @@ "is-symbol": "^1.0.2" } }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" + }, "escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -8257,9 +8292,9 @@ "integrity": "sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg==" }, "handlebars": { - "version": "4.7.6", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.6.tgz", - "integrity": "sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA==", + "version": "4.7.7", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", + "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", "requires": { "minimist": "^1.2.5", "neo-async": "^2.6.0", @@ -8274,13 +8309,10 @@ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" }, "uglify-js": { - "version": "3.9.4", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.9.4.tgz", - "integrity": "sha512-8RZBJq5smLOa7KslsNsVcSH+KOXf1uDU8yqLeNuVKwmT0T3FA0ZoXlinQfRad7SDcbZZRZE4ov+2v71EnxNyCA==", - "optional": true, - "requires": { - "commander": "~2.20.3" - } + "version": "3.13.9", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.9.tgz", + "integrity": "sha512-wZbyTQ1w6Y7fHdt8sJnHfSIuWeDgk6B5rCb4E/AM6QNNPbOMIZph21PW5dRB3h7Df0GszN+t7RuUH6sWK5bF0g==", + "optional": true } } }, @@ -8456,9 +8488,9 @@ "integrity": "sha512-HRcs+2mr52W0K+x8RzcLzuPPmVIKMSv97RGHy0Ea9y/mpcaK+xTrjICA04KAHi4GRzxliNqNJEFYWHghy3rSfQ==" }, "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==" + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==" }, "hpack.js": { "version": "2.1.6", @@ -8596,22 +8628,40 @@ } }, "htmlparser2": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz", - "integrity": "sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==", - "requires": { - "domelementtype": "^1.3.1", - "domhandler": "^2.3.0", - "domutils": "^1.5.1", - "entities": "^1.1.1", - "inherits": "^2.0.1", - "readable-stream": "^3.1.1" + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-6.1.0.tgz", + "integrity": "sha512-gyyPk6rgonLFEDGoeRgQNaEUvdJ4ktTmmUh/h2t7s+M8oPpIPxgNACWa+6ESR57kXstwqPiCut0V8NRpcwgU7A==", + "requires": { + "domelementtype": "^2.0.1", + "domhandler": "^4.0.0", + "domutils": "^2.5.2", + "entities": "^2.0.0" }, "dependencies": { - "entities": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", - "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==" + "dom-serializer": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.3.2.tgz", + "integrity": "sha512-5c54Bk5Dw4qAxNOI1pFEizPSjVsx5+bpJKmL2kPn8JhBUq2q09tTCa3mjijun2NfK78NMouDYNMBkOrPZiS+ig==", + "requires": { + "domelementtype": "^2.0.1", + "domhandler": "^4.2.0", + "entities": "^2.0.0" + } + }, + "domelementtype": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.2.0.tgz", + "integrity": "sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A==" + }, + "domutils": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.7.0.tgz", + "integrity": "sha512-8eaHa17IwJUPAiB+SoTYBo5mCdeMgdcAoXJ59m6DT1vw+5iLS3gNoqYaRowaBKtGVrOF1Jz4yDTgYKLK2kvfJg==", + "requires": { + "dom-serializer": "^1.0.1", + "domelementtype": "^2.2.0", + "domhandler": "^4.2.0" + } } } }, @@ -10587,9 +10637,9 @@ } }, "lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, "lodash-es": { "version": "4.17.21", @@ -10866,9 +10916,9 @@ } }, "merge-deep": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/merge-deep/-/merge-deep-3.0.2.tgz", - "integrity": "sha512-T7qC8kg4Zoti1cFd8Cr0M+qaZfOwjlPDEdZIIPPB2JZctjaPM4fX+i7HOId69tAti2fvO6X5ldfYUONDODsrkA==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/merge-deep/-/merge-deep-3.0.3.tgz", + "integrity": "sha512-qtmzAS6t6grwEkNrunqTBdn0qKwFgNWvlxUbAV8es9M7Ot1EbyApytCnvE0jALPa46ZpKDUo527kKiaWplmlFA==", "requires": { "arr-union": "^3.1.0", "clone-deep": "^0.2.4", @@ -13827,9 +13877,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -13862,9 +13912,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -13901,9 +13951,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -13936,9 +13986,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -13970,9 +14020,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -14005,9 +14055,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -14039,9 +14089,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -14076,9 +14126,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -14110,9 +14160,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -14143,9 +14193,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -14177,9 +14227,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -14216,9 +14266,9 @@ "integrity": "sha512-MsCAG1z9lPdoO/IUMLSBWBSVxVtJ1395VGIQ+Fc2gNdkQ1hNDnQdw3YhA71WJCBW1vdwA0cAnk/DnW6bqoEUYg==" }, "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -14265,9 +14315,9 @@ "integrity": "sha512-MsCAG1z9lPdoO/IUMLSBWBSVxVtJ1395VGIQ+Fc2gNdkQ1hNDnQdw3YhA71WJCBW1vdwA0cAnk/DnW6bqoEUYg==" }, "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -14308,9 +14358,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -14341,9 +14391,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -14374,9 +14424,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -14407,9 +14457,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -14441,9 +14491,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -14475,9 +14525,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -14508,9 +14558,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -14541,9 +14591,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -14574,9 +14624,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -14607,9 +14657,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -14640,9 +14690,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -14674,9 +14724,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -14708,9 +14758,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -14743,9 +14793,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -14833,9 +14883,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -14866,9 +14916,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -14899,9 +14949,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -14935,9 +14985,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -14973,9 +15023,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -15017,9 +15067,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -15053,9 +15103,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -15091,9 +15141,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -15127,9 +15177,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -15205,9 +15255,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -15238,9 +15288,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -15273,9 +15323,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -15309,9 +15359,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -15345,9 +15395,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -15380,9 +15430,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -15415,9 +15465,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -15450,9 +15500,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -15486,9 +15536,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -15520,9 +15570,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -15555,9 +15605,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -15588,9 +15638,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -15621,9 +15671,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -15655,9 +15705,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -15724,9 +15774,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -15763,9 +15813,9 @@ "integrity": "sha512-MsCAG1z9lPdoO/IUMLSBWBSVxVtJ1395VGIQ+Fc2gNdkQ1hNDnQdw3YhA71WJCBW1vdwA0cAnk/DnW6bqoEUYg==" }, "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -15809,9 +15859,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -15845,9 +15895,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -15878,9 +15928,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -15911,9 +15961,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -15945,9 +15995,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -15979,9 +16029,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -16025,9 +16075,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -16060,9 +16110,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -16306,9 +16356,9 @@ "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=" }, "querystringify": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.1.tgz", - "integrity": "sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA==" + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==" }, "raf": { "version": "3.4.1", @@ -17902,40 +17952,65 @@ "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=" }, "renderkid": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/renderkid/-/renderkid-2.0.3.tgz", - "integrity": "sha512-z8CLQp7EZBPCwCnncgf9C4XAi3WR0dv+uWu/PjIyhhAb5d6IJ/QZqlHFprHeKT+59//V6BNUsLbvN8+2LarxGA==", + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/renderkid/-/renderkid-2.0.7.tgz", + "integrity": "sha512-oCcFyxaMrKsKcTY59qnCAtmDVSLfPbrv6A3tVbPdFMMrv5jaK10V6m40cKsoPNhAqN6rmHW9sswW4o3ruSrwUQ==", "requires": { - "css-select": "^1.1.0", - "dom-converter": "^0.2", - "htmlparser2": "^3.3.0", - "strip-ansi": "^3.0.0", - "utila": "^0.4.0" + "css-select": "^4.1.3", + "dom-converter": "^0.2.0", + "htmlparser2": "^6.1.0", + "lodash": "^4.17.21", + "strip-ansi": "^3.0.1" }, "dependencies": { "css-select": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", - "integrity": "sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-4.1.3.tgz", + "integrity": "sha512-gT3wBNd9Nj49rAbmtFHj1cljIAOLYSX1nZ8CB7TBO3INYckygm5B7LISU/szY//YmdiSLbJvDLOx9VnMVpMBxA==", "requires": { - "boolbase": "~1.0.0", - "css-what": "2.1", - "domutils": "1.5.1", - "nth-check": "~1.0.1" + "boolbase": "^1.0.0", + "css-what": "^5.0.0", + "domhandler": "^4.2.0", + "domutils": "^2.6.0", + "nth-check": "^2.0.0" } }, "css-what": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.3.tgz", - "integrity": "sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==" + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-5.0.1.tgz", + "integrity": "sha512-FYDTSHb/7KXsWICVsxdmiExPjCfRC4qRFBdVwv7Ax9hMnvMmEjP9RfxTEZ3qPZGmADDn2vAKSo9UcN1jKVYscg==" + }, + "dom-serializer": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.3.2.tgz", + "integrity": "sha512-5c54Bk5Dw4qAxNOI1pFEizPSjVsx5+bpJKmL2kPn8JhBUq2q09tTCa3mjijun2NfK78NMouDYNMBkOrPZiS+ig==", + "requires": { + "domelementtype": "^2.0.1", + "domhandler": "^4.2.0", + "entities": "^2.0.0" + } + }, + "domelementtype": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.2.0.tgz", + "integrity": "sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A==" }, "domutils": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", - "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.7.0.tgz", + "integrity": "sha512-8eaHa17IwJUPAiB+SoTYBo5mCdeMgdcAoXJ59m6DT1vw+5iLS3gNoqYaRowaBKtGVrOF1Jz4yDTgYKLK2kvfJg==", "requires": { - "dom-serializer": "0", - "domelementtype": "1" + "dom-serializer": "^1.0.1", + "domelementtype": "^2.2.0", + "domhandler": "^4.2.0" + } + }, + "nth-check": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.0.0.tgz", + "integrity": "sha512-i4sc/Kj8htBrAiH1viZ0TgU8Y5XqCaV/FziYK6TBczxmeKm3AEFWqqF3195yKudrarqy7Zu80Ra5dobFjn9X/Q==", + "requires": { + "boolbase": "^1.0.0" } } } @@ -19156,9 +19231,9 @@ } }, "ssri": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz", - "integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.2.tgz", + "integrity": "sha512-cepbSq/neFK7xB6A50KHN0xHDotYzq58wWCa5LeWqnPrHG8GzfEjO/4O8kpmcGW+oaxkvhEJCWgbgNk4/ZV93Q==", "requires": { "figgy-pudding": "^3.5.1" } @@ -19541,9 +19616,9 @@ }, "dependencies": { "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -19777,9 +19852,9 @@ } }, "y18n": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==" + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" } } }, @@ -20233,9 +20308,9 @@ } }, "url-parse": { - "version": "1.4.7", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.7.tgz", - "integrity": "sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.1.tgz", + "integrity": "sha512-HOfCOUJt7iSYzEx/UqgtwKRMC6EU91NFhsCHMv9oM03VJcVo2Qrp8T8kI9D7amFf1cu+/3CEhgb3rF9zL7k85Q==", "requires": { "querystringify": "^2.1.1", "requires-port": "^1.0.0" @@ -20436,9 +20511,9 @@ "optional": true }, "glob-parent": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", - "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "optional": true, "requires": { "is-glob": "^4.0.1" @@ -21346,9 +21421,9 @@ } }, "ws": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.2.tgz", - "integrity": "sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==", + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.3.tgz", + "integrity": "sha512-jZArVERrMsKUatIdnLzqvcfydI85dvd/Fp1u/VOpfdDWQ4c9qWXe+VIeAbQ5FrDwciAkr+lzofXLz3Kuf26AOA==", "requires": { "async-limiter": "~1.0.0" } @@ -21370,8 +21445,7 @@ }, "y18n": { "version": "3.2.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" + "resolved": "" }, "yallist": { "version": "3.1.1", @@ -21400,6 +21474,13 @@ "which-module": "^2.0.0", "y18n": "^3.2.1", "yargs-parser": "^9.0.2" + }, + "dependencies": { + "y18n": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz", + "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==" + } } }, "yargs-parser": { -- GitLab