Skip to content

Commit

Permalink
Merge pull request #708 from basedosdados/fix/migrate-bdm-refs
Browse files Browse the repository at this point in the history
fix: migrate bdm table references
  • Loading branch information
AldemirLucas authored Oct 6, 2023
2 parents 3844940 + 90da447 commit 4248745
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 22 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
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
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
2 changes: 1 addition & 1 deletion next/pages/index.js
Original file line number Diff line number Diff line change
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
6 changes: 0 additions & 6 deletions next/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@ export function limitTextSize(text, size) {
return text;
}

export function isBdPlus(dataset) {
return (dataset?.resources || [])
.filter((r) => r && r?.resource_type)
.some((r) => r && r?.resource_type === "bdm_table");
}

export function translate(keyTranslations, valueTranslations, object) {
const formatObject = (value) => {
if(typeof value === "object") {
Expand Down

0 comments on commit 4248745

Please sign in to comment.