Skip to content

Commit

Permalink
Merge pull request #711 from basedosdados/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
AldemirLucas authored Oct 11, 2023
2 parents 2bff6b8 + f103273 commit 10926ce
Show file tree
Hide file tree
Showing 20 changed files with 831 additions and 566 deletions.
2 changes: 1 addition & 1 deletion next/components/molecules/ColumnDatasets.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ function TableDatasets({ headers, values }) {
return (
<div style={{display:"flex", alignItems:"center", gap:"10px"}}>
{newDirectoryColumn}
<a target={"_blank"} href={`/dataset/${dataset?._id}?bdm_tables=${table?._id}`}>
<a target={"_blank"} href={`/dataset/${dataset?._id}?table=${table?._id}`}>
<RedirectIcon
alt="hiperlink"
fill="#42B0FF"
Expand Down
1 change: 0 additions & 1 deletion next/components/organisms/BdmTablePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ export default function BdmTablePage({ id }) {
}

const PublishedOrDataCleanedBy = ({ resource }) => {
if(resource.firstName === "Ricardo" && resource.lastName === "Dahis") return <SectionText marginRight="4px !important">Equipe Dados</SectionText>

return (
<>
Expand Down
12 changes: 6 additions & 6 deletions next/components/organisms/DatasetResource.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,13 @@ export default function DatasetResource({
}

useEffect(() => {
const dataset_tables = dataset?.tables?.edges.map((elm) => elm.node) || []
const raw_data_sources = dataset?.rawDataSources?.edges.map((elm) => elm.node) || []
const information_request = dataset?.informationRequests?.edges.map((elm) => elm.node) || []
const dataset_tables = dataset?.tables?.edges.map((elm) => elm.node).filter((elm) => elm?.status?.slug !== "under_review").sort(sortElements) || []
const raw_data_sources = dataset?.rawDataSources?.edges.map((elm) => elm.node).filter((elm) => elm?.status?.slug !== "under_review").sort(sortElements) || []
const information_request = dataset?.informationRequests?.edges.map((elm) => elm.node).filter((elm) => elm?.status?.slug !== "under_review").sort(sortElements) || []

setTables(dataset_tables.filter((elm) => elm?.status?.slug !== "under_review").sort(sortElements))
setRawDataSources(raw_data_sources.filter((elm) => elm?.status?.slug !== "under_review").sort(sortElements))
setInformationRequests(information_request.filter((elm) => elm?.status?.slug !== "under_review").sort(sortElements))
setTables(dataset_tables)
setRawDataSources(raw_data_sources)
setInformationRequests(information_request)

const queryParams = new URLSearchParams(window.location.search)

Expand Down
8 changes: 4 additions & 4 deletions next/content/FAQ.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const QuestionFAQ = [
question: "O que são tabelas tratadas BD+?",
answer: function() {
return (
<div id="bdm-tables" style={{display: "flex", flexDirection: "column"}}>
<div id="tables" style={{display: "flex", flexDirection: "column"}}>
<p>
São tabelas completas, já tratadas e prontas para análise, disponíveis no nosso <i>datalake</i> público.
A limpeza das tabelas envolve um rigoroso processo de padronização e compatibilização de dados,
Expand All @@ -71,7 +71,7 @@ export const QuestionFAQ = [
},
categories: ["Dados"],
keywords: "tratada, tratado, BD+, tabela, datalake, cruzar, cruzamento, padronização, compatibilização",
id: "bdm-tables"
id: "tables"
},
{
question: "O que são fontes originais?",
Expand Down Expand Up @@ -110,7 +110,7 @@ export const QuestionFAQ = [
question: "Como acessar as tabelas tratadas BD+?",
answer: function() {
return (
<div id="access-bdm-tables" style={{display: "flex", flexDirection: "column"}}>
<div id="access-tables" style={{display: "flex", flexDirection: "column"}}>
<p>
Você pode consultar as tabelas tratadas BD+ de diferentes maneiras.
Além de fazer o download direto na plataforma,
Expand All @@ -121,7 +121,7 @@ export const QuestionFAQ = [
},
categories: ["Dados"],
keywords: "acesso, consulta, tratada, tratado, BD+, download, baixar, pacote, SQL, BigQuery, Python, R, Stata",
id: "access-bdm-tables"
id: "access-tables"
},
{
question: "Como acessar as fontes originais?",
Expand Down
14 changes: 7 additions & 7 deletions next/content/caseStudies.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export function CaseStudiesPaged() {
const CaseStudiesResumed = CaseStudiesCotent
const CaseStudiesResumed = CaseStudiesContent

CaseStudiesResumed.map((elm) => {
delete elm.thumbnail
Expand All @@ -13,7 +13,7 @@ export function CaseStudiesPaged() {
return CaseStudiesResumed
}

export const CaseStudiesCotent = [
export const CaseStudiesContent = [
{
id: "fundacao-lemann",
displayTitle: "Fundação Lemann",
Expand Down Expand Up @@ -157,10 +157,10 @@ export const CaseStudiesCotent = [
<div class="highlightsBox" style="margin-top: 48px">
<p>Os dados dos principais indicadores educacionais tratados pela BD são abertos a todos:</p>
<ul>
<li><a href="https://basedosdados.org/dataset/br-inep-saeb?bdm_table=dicionario" target="_blank">Sistema de Avaliação da Educação Básica (Saeb)</a></li>
<li><a href="https://basedosdados.org/dataset/br-inep-ana?bdm_table=dicionario" target="_blank">Avaliação Nacional de Alfabetização (ANA)</a></li>
<li><a href="https://basedosdados.org/dataset/br-ibge-pnad?bdm_table=dicionario" target="_blank">Pesquisa Nacional por Amostra de Domicílios (PNAD)</a></li>
<li><a href="https://basedosdados.org/dataset/br-inep-censo-escolar?bdm_table=turma" target="_blank">Censo da Educação Básica</a></li>
<li><a href="https://basedosdados.org/dataset/e083c9a2-1cee-4342-bedc-535cbad6f3cd?table=0308fbe0-270c-4135-9115-ea1100f400f6" target="_blank">Sistema de Avaliação da Educação Básica (Saeb)</a></li>
<li><a href="https://basedosdados.org/dataset/140554cd-8062-4c9c-80fa-363cee3603e3?table=99597e72-0796-4de3-8542-f4fd8f3ccfa4" target="_blank">Avaliação Nacional de Alfabetização (ANA)</a></li>
<li><a href="https://basedosdados.org/dataset/0cde957f-1b58-425a-b6cd-ba1208515537?table=83062c5c-6b1f-4d54-8cf2-9f541e835bf0" target="_blank">Pesquisa Nacional por Amostra de Domicílios (PNAD)</a></li>
<li><a href="https://basedosdados.org/dataset/dae21af4-4b6a-42f4-b94a-4c2061ea9de5?table=62f7bef8-36f3-4c9b-bc79-882a2ebbed8f" target="_blank">Censo da Educação Básica</a></li>
</ul>
</div>
Expand Down Expand Up @@ -329,7 +329,7 @@ export const CaseStudiesCotent = [
</p>
<p class="bodyText">
Acesse os dados atualizados das <a href="https://basedosdados.org/dataset/br-tse-eleicoes?bdm_table=bens_candidato" target="_blank">eleições brasileiras</a>.
Acesse os dados atualizados das <a href="https://basedosdados.org/dataset/eef764df-bde8-4905-b115-6fc23b6ba9d6?table=2e204854-e453-4257-9fef-5e10f3ff1f56" target="_blank">eleições brasileiras</a>.
</p>
</div>
</div>
Expand Down
50 changes: 50 additions & 0 deletions next/pages/api/team/getAllPeople.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import axios from "axios";

const API_URL= `${process.env.NEXT_PUBLIC_API_URL}/api/v1/graphql`

export default async function getAllPeople() {
try {
const res = await axios({
url: API_URL,
method: "POST",
data: {
query: `
query {
allAccount (profile: A_1){
edges {
node {
firstName
lastName
description
website
email
twitter
linkedin
github
picture
isActiveStaff
careers {
edges {
node {
_id
team
role
startAt
endAt
}
}
}
}
}
edgeCount
}
}
`
}
})
const data = res?.data?.data?.allAccount?.edges
return data
} catch (error) {
console.error(error)
}
}
39 changes: 39 additions & 0 deletions next/pages/api/team/getAllTeams.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import axios from "axios";

const API_URL= `${process.env.NEXT_PUBLIC_API_URL}/api/v1/graphql`

export default async function getAllTeams() {
try {
const res = await axios({
url: API_URL,
method: "POST",
data: {
query: `
query {
allCareer {
edges {
node {
team
}
}
}
}
`
}
})
const result = res?.data?.data?.allCareer?.edges
const teamsSet = new Set()

result.forEach(item => {
const team = item.node.team.trim()
if (team !== "") {
teamsSet.add(team)
}
})

const data = Array.from(teamsSet)
return data
} catch (error) {
console.error(error)
}
}
48 changes: 48 additions & 0 deletions next/pages/api/team/getCareerPeople.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import axios from "axios";

const API_URL= `${process.env.NEXT_PUBLIC_API_URL}/api/v1/graphql`

export default async function getCareerPeople(team) {
try {
const res = await axios({
url: API_URL,
method: "POST",
data: {
query: `
query {
allAccount (careers_Team: "${team}", profile: A_1){
edges {
node {
firstName
lastName
description
website
email
twitter
linkedin
github
picture
careers {
edges {
node {
_id
team
role
startAt
endAt
}
}
}
}
}
}
}
`
}
})
const data = res?.data?.data?.allAccount?.edges
return data
} catch (error) {
console.error(error)
}
}
12 changes: 9 additions & 3 deletions next/pages/api/team/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import getTeams from "./getTeams"
import getPeople from "./getPeople"
import getTeams from "./getTeams";
import getPeople from "./getPeople";
import getAllPeople from "./getAllPeople";
import getCareerPeople from "./getCareerPeople";
import getAllTeams from "./getAllTeams";

export {
getTeams,
getPeople
getPeople,
getAllPeople,
getCareerPeople,
getAllTeams
}
5 changes: 2 additions & 3 deletions next/pages/api/user/registerAccount.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ import axios from "axios";
const API_URL= `${process.env.NEXT_PUBLIC_API_URL}/api/v1/graphql`

export default async function registerAccount({
userName,
firstName,
lastName,
lastName = "",
email,
password,
}) {
Expand All @@ -21,7 +20,7 @@ export default async function registerAccount({
mutation {
CreateUpdateAccount (input:
{
username : "${userName}"
username : "${email}"
email: "${email}"
firstName: "${firstName}"
lastName: "${lastName}"
Expand Down
6 changes: 3 additions & 3 deletions next/pages/estudos-de-caso/[id].js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Head from "next/head";

import { MainPageTemplate } from "../../components/templates/main";
import { useCheckMobile } from "../../hooks/useCheckMobile.hook";
import { CaseStudiesCotent } from "../../content/caseStudies";
import { CaseStudiesContent } from "../../content/caseStudies";
import Link from "../../components/atoms/Link";
import SectionText from "../../components/atoms/SectionText";
import Display from "../../components/atoms/Display";
Expand All @@ -21,13 +21,13 @@ import styles from "../../styles/caseStudies.module.css";

export async function getStaticProps(context) {
return {
props : CaseStudiesCotent.find((res) => res.id === context.params.id)
props : CaseStudiesContent.find((res) => res.id === context.params.id)
}
}

export async function getStaticPaths(context) {
return {
paths: CaseStudiesCotent.map((elm) => {
paths: CaseStudiesContent.map((elm) => {
return {params: { id : elm.id }}
}),
fallback: false
Expand Down
4 changes: 2 additions & 2 deletions next/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import BDLogoPlusImage from "../public/img/logos/bd_logo_plus";
import BDLogoEduImage from "../public/img/logos/bd_logo_edu";

function Hero() {
const [search, setSearch] = useState();
const [search, setSearch] = useState("");
const [tags, setTags] = useState([])
const [mediumQuery] = useMediaQuery("(max-width: 1366px)")

Expand Down Expand Up @@ -287,7 +287,7 @@ function Products() {

<SectionLink
marginTop="24px !important"
href={"/dataset?resource_type=bdm_table&order_by=score"}
href={"/dataset?contains=tables"}
>
Veja os dados disponíveis
</SectionLink>
Expand Down
31 changes: 17 additions & 14 deletions next/pages/precos.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,22 +80,25 @@ export default function Price() {
<ServiceTermsBDPro/>
</ModalBody>

<ModalFooter>
{linkStripe === "" ?
<RoundedButton onClick={onClose} borderRadius="12px">
Fechar
</RoundedButton>
:
<RoundedButton onClick={() => {
onClose()
window.open(linkStripe, "_blank")
setLinkStripe("")
}}
borderRadius="12px"
<ModalFooter gap="16px">
<RoundedButton
onClick={onClose}
backgroundColor={linkStripe !== "" ? "#FFF" : "#42B0FF"}
color={linkStripe !== "" ? "#42B0FF" : "#FFF"}
border={linkStripe !== "" && "1px solid #42B0FF"}
>
Concordar
Fechar
</RoundedButton>
}
{linkStripe !== "" &&
<RoundedButton onClick={() => {
onClose()
window.open(linkStripe, "_blank")
setLinkStripe("")
}}
>
Concordar
</RoundedButton>
}
</ModalFooter>
</ModalContent>
</Modal>
Expand Down
Loading

0 comments on commit 10926ce

Please sign in to comment.