Skip to content

Commit

Permalink
merge: staging for development
Browse files Browse the repository at this point in the history
  • Loading branch information
AldemirLucas committed Aug 6, 2024
2 parents f53fb93 + 8c2aa78 commit 0725e15
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 16 deletions.
32 changes: 22 additions & 10 deletions next/components/molecules/ColumnsTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,11 +307,11 @@ export default function ColumnsTable({
const datasetName = value?.table?.dataset?.name || ""
const tableName = value?.table?.name || ""

if(gcpDatasetID === "br_bd_diretorios_data_tempo") return (
<Text>
Não precisa de tradução
</Text>
)
if(gcpDatasetID === "br_bd_diretorios_data_tempo") return "Não precisa de tradução"
if(gcpDatasetID === "br_bd_diretorios_brasil") {
if(gcpTableId === "empresa" || gcpTableId === "cep") return "Não precisa de tradução"
}
if(value?.name === "ddd") return "Não precisa de tradução"

return (
<Box>
Expand Down Expand Up @@ -480,6 +480,22 @@ export default function ColumnsTable({
)
}

function TranslationColumnException({ value }) {
const cloudValues = value?.node?.directoryPrimaryKey?.table?.cloudTables?.edges?.[0]?.node
const gcpDatasetID = cloudValues?.gcpDatasetId || ""
const gcpTableId = cloudValues?.gcpTableId || ""

if(gcpDatasetID === "br_bd_diretorios_data_tempo") return "Não"
if(gcpDatasetID === "br_bd_diretorios_brasil") {
if(gcpTableId === "empresa" || gcpTableId === "cep") return "Não"
}
if(value?.node?.name === "ddd") return "Não"
if(value?.node?.coveredByDictionary === true) return "Sim"
if(value?.node?.directoryPrimaryKey?._id) return "Sim"
if(value?.node?.coveredByDictionary === false) return "Não"
return "Não informado"
}

if(isError) return (
<Stack justifyContent="center" alignItems="center">
<InternalError
Expand Down Expand Up @@ -619,11 +635,7 @@ export default function ColumnsTable({
dictionary={elm?.node?.coveredByDictionary}
/>
:
elm?.node?.coveredByDictionary === true ? "Sim" :
elm?.node?.directoryPrimaryKey?._id ? "Sim" :
elm?.node?.coveredByDictionary === false ? "Não"
:
"Não informado"
<TranslationColumnException value={elm}/>
}
</TableValue>

Expand Down
7 changes: 3 additions & 4 deletions next/components/molecules/DataInformationQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -881,10 +881,9 @@ bd.read_sql(query = query, billing_project_id = billing_id)`}
width="100%"
isLoaded={!isLoadingCode}
>
<CodeHighlight language="r">{`install.packages("basedosdados")
library("basedosdados")
# Defina o seu projeto no Google Cloud
set_billing_id("<YOUR_PROJECT_ID>")
<CodeHighlight language="r">{`
# Defina o seu projeto no Google Cloud
set_billing_id("<YOUR_PROJECT_ID>")
# Para carregar o dado direto no R
query <- "
Expand Down
18 changes: 17 additions & 1 deletion next/components/organisms/BdmTablePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ export default function BdmTablePage({ id }) {
:
"Não informado"
}: Última vez que atualizaram na fonte original
{resource?.rawDataSource?.[0]?.updates?.[0]?.entity?.slug &&
{resource?.rawDataSource?.[0]?.updates?.[0]?.entity?.slug ?
<Text
backgroundColor="#EEEEEE"
padding="2px 4px"
Expand All @@ -403,6 +403,22 @@ export default function BdmTablePage({ id }) {
>
{getUpdateFormat(resource?.rawDataSource?.[0]?.updates?.[0]?.entity?.slug)}
</Text>
:
!resource?.rawDataSource?.[0]?.updates?.[0] || !resource?.updates?.[0]?.frequency ?
<Text
backgroundColor="#EEEEEE"
padding="2px 4px"
borderRadius="4px"
fontFamily="Roboto"
fontWeight="500"
fontSize="12px"
lineHeight="18px"
color="#252A32"
>
Sem previsão de atualização
</Text>
:
<></>
}
{!resource?.rawDataSource?.[0]?.updates?.[0] || !resource?.updates?.[0]?.frequency &&
<Text
Expand Down
2 changes: 1 addition & 1 deletion next/pages/precos.js
Original file line number Diff line number Diff line change
Expand Up @@ -476,4 +476,4 @@ export default function Price({ username ,isBDPro, isBDEmp }) {
</Stack>
</MainPageTemplate>
)
}
}

0 comments on commit 0725e15

Please sign in to comment.