Skip to content

Commit

Permalink
fix: hide spatial_coverage components in Prod
Browse files Browse the repository at this point in the history
  • Loading branch information
AldemirLucas committed Nov 5, 2024
1 parent 456e9af commit 8fefc84
Show file tree
Hide file tree
Showing 5 changed files with 144 additions and 146 deletions.
7 changes: 3 additions & 4 deletions next/components/molecules/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,25 +93,24 @@ export default function Footer({ template, ocult = false }) {

if(template === "simple") return (
<VStack
position="relative"
zIndex="10"
width="100%"
spacing={0}
>
<VStack
width="100%"
height={{base: "100%", lg: "96px"}}
justifyContent="center"
height="100%"
backgroundColor="#EEEEEE"
>
<Stack
width="100%"
maxWidth="1440px"
height="100%"
justifyContent="space-between"
direction={{base: "column-reverse", lg: "row"}}
spacing={0}
gridGap={{base: "8px", lg: "40px"}}
padding={{base: "24px", lg: "0"}}
padding="24px"
>
<HStack spacing={4}>
<TextFooterSimple>
Expand Down
50 changes: 26 additions & 24 deletions next/components/organisms/DatasetSearchCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,31 +299,33 @@ export default function Dataset({
</Text>
</Stack>

<Stack
direction={{ base: "column", lg: "row" }}
spacing={1}
>
<Text
fontFamily="Roboto"
fontWeight="400"
fontSize="14px"
lineHeight="20px"
color="#464A51"
>
{t('spatialCoverage')}:
</Text>
<Text
fontFamily="Roboto"
fontWeight="400"
fontSize="14px"
lineHeight="20px"
color="#71757A"
{process.env.NEXT_PUBLIC_BASE_URL_FRONTEND !== "https://basedosdados.org" &&
<Stack
direction={{ base: "column", lg: "row" }}
spacing={1}
>
{spatialCoverageNames.length > 0
? spatialCoverageNames.join(', ')
: spatialCoverage ? spatialCoverage : t('notProvided')}
</Text>
</Stack>
<Text
fontFamily="Roboto"
fontWeight="400"
fontSize="14px"
lineHeight="20px"
color="#464A51"
>
{t('spatialCoverage')}:
</Text>
<Text
fontFamily="Roboto"
fontWeight="400"
fontSize="14px"
lineHeight="20px"
color="#71757A"
>
{spatialCoverageNames.length > 0
? spatialCoverageNames.join(', ')
: spatialCoverage ? spatialCoverage : t('notProvided')}
</Text>
</Stack>
}

<Stack
direction={{ base: "column", lg: "row" }}
Expand Down
98 changes: 48 additions & 50 deletions next/components/organisms/TablePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,60 +326,58 @@ export default function TablePage({ id }) {
</SkeletonText>

<Stack spacing="12px" marginBottom="40px !important">
<HStack spacing="40px" align="start">
<Stack spacing="12px" width="100%">
<StackSkeleton width="300px" height="20px">
<Text
fontFamily="Roboto"
fontWeight="500"
fontSize="18px"
lineHeight="20px"
color="#252A32"
>
{t('table.temporalCoverage')}
</Text>
</StackSkeleton>
<StackSkeleton width="300px" height="20px">
<Text
fontFamily="Roboto"
fontWeight="500"
fontSize="18px"
lineHeight="20px"
color="#252A32"
>
{t('table.temporalCoverage')}
</Text>
</StackSkeleton>

<StackSkeleton
width="100%"
height={!isLoading ? "fit-content" : "65px"}
>
<TemporalCoverageBar value={resource?.fullTemporalCoverage}/>
</StackSkeleton>
</Stack>
<StackSkeleton
width="100%"
height={!isLoading ? "fit-content" : "65px"}
>
<TemporalCoverageBar value={resource?.fullTemporalCoverage}/>
</StackSkeleton>
</Stack>

<Stack spacing="12px" width="100%">
<StackSkeleton width="300px" height="20px">
<Text
fontFamily="Roboto"
fontWeight="500"
fontSize="18px"
lineHeight="20px"
color="#252A32"
>
{t('table.spatialCoverage')}
</Text>
</StackSkeleton>
{process.env.NEXT_PUBLIC_BASE_URL_FRONTEND !== "https://basedosdados.org" &&
<Stack spacing="12px" marginBottom="40px !important">
<StackSkeleton width="300px" height="20px">
<Text
fontFamily="Roboto"
fontWeight="500"
fontSize="18px"
lineHeight="20px"
color="#252A32"
>
{t('table.spatialCoverage')}
</Text>
</StackSkeleton>

<StackSkeleton
height="20px"
width={resource?.spatialCoverageNames ? "100%" : "200px"}
<StackSkeleton
height="20px"
width={resource?.spatialCoverageNames ? "100%" : "200px"}
>
<Text
fontFamily="Roboto"
fontWeight="400"
fontSize="14px"
lineHeight="20px"
color="#464A51"
>
<Text
fontFamily="Roboto"
fontWeight="400"
fontSize="14px"
lineHeight="20px"
color="#464A51"
>
{spatialCoverageNames.length > 0
? spatialCoverageNames.join(', ')
: t('table.notProvided')}
</Text>
</StackSkeleton>
</Stack>
</HStack>
</Stack>
{spatialCoverageNames.length > 0
? spatialCoverageNames.join(', ')
: t('table.notProvided')}
</Text>
</StackSkeleton>
</Stack>
}

<Stack spacing="12px" marginBottom="40px !important">
<StackSkeleton width="200px" height="20px">
Expand Down
104 changes: 49 additions & 55 deletions next/pages/dataset/[dataset].js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export default function DatasetPage ({ dataset, spatialCoverageNames }) {
spacing={0}
>
<Grid
templateColumns={{ base: "1fr", lg: "296px 1fr" }}
templateColumns={{ base: "1fr", lg: "320px 1fr" }}
width="100%"
gap="24px"
paddingY="24px"
Expand All @@ -158,17 +158,17 @@ export default function DatasetPage ({ dataset, spatialCoverageNames }) {
src={dataset?.organizations?.edges?.[0]?.node?.picture ? dataset?.organizations?.edges?.[0]?.node?.picture : `https://storage.googleapis.com/basedosdados-website/equipe/sem_foto.png`}
objectFit="contain"
width="300px"
height="182px"
height="252px"
borderRadius="16px"
/>
</GridItem>

<GridItem>
<Grid
templateColumns="1fr 1fr"
templateColumns="1fr 1fr 1fr 1fr 1fr"
gap="8px"
>
<GridItem colSpan={2}>
<GridItem colSpan={5}>
<BigTitle
width="100%"
overflow="hidden"
Expand All @@ -182,42 +182,62 @@ export default function DatasetPage ({ dataset, spatialCoverageNames }) {
</BigTitle>
</GridItem>

<GridItem colSpan={2} minHeight="60px" marginBottom="8px">
<GridItem colSpan={5} minHeight="60px" marginBottom="8px">
<ReadMore id="readLessDataset">
{dataset[`description${capitalize(locale)}`] || dataset.description || t('noDescription')}
</ReadMore>
</GridItem>

<Grid
templateColumns={{ base: "1fr", lg: "minmax(250px, 1fr) minmax(250px, 1fr) minmax(250px, 1fr)" }}
gap={{ base: "32px", lg: "48px" }}
width="100%"
marginTop="16px"
maxWidth={{ lg: "1200px" }}
>
<GridItem>
<Text
fontFamily="Roboto"
fontWeight="500"
fontSize="18px"
lineHeight="28px"
color="#252A32"
marginBottom="8px"
>
{t('temporalCoverage')}
</Text>
<GridItem colSpan={5} marginBottom="8px">
<Text
fontFamily="Roboto"
fontWeight="500"
fontSize="18px"
lineHeight="28px"
color="#252A32"
marginBottom="8px"
>
{t('organization')}
</Text>
<Link
href={`/search?organization=${dataset?.organizations?.edges?.[0]?.node?.slug || ""}`}
color="#464A51"
fontWeight="400"
>
<Text
fontFamily="Roboto"
fontWeight="400"
fontSize="14px"
lineHeight="20px"
color="#464A51"
>
{dataset.temporalCoverage || t('notProvided')}
{dataset.organizations?.edges?.[0]?.node?.[`name${capitalize(locale)}`] || dataset.organizations?.edges?.[0]?.node?.name || t('noOrganization')}
</Text>
</GridItem>
</Link>
</GridItem>

<GridItem colSpan={{ base: 5, lg: 2 }} marginBottom="8px">
<Text
fontFamily="Roboto"
fontWeight="500"
fontSize="18px"
lineHeight="28px"
color="#252A32"
marginBottom="8px"
>
{t('temporalCoverage')}
</Text>
<Text
fontFamily="Roboto"
fontWeight="400"
fontSize="14px"
lineHeight="20px"
color="#464A51"
>
{dataset.temporalCoverage || t('notProvided')}
</Text>
</GridItem>

<GridItem>
{process.env.NEXT_PUBLIC_BASE_URL_FRONTEND !== "https://basedosdados.org" &&
<GridItem colSpan={{ base: 5, lg: 3 }} marginBottom="8px">
<Text
fontFamily="Roboto"
fontWeight="500"
Expand All @@ -240,33 +260,7 @@ export default function DatasetPage ({ dataset, spatialCoverageNames }) {
: t('notProvided')}
</Text>
</GridItem>

<GridItem>
<Text
fontFamily="Roboto"
fontWeight="500"
fontSize="18px"
lineHeight="28px"
color="#252A32"
marginBottom="8px"
>
{t('organization')}
</Text>
<Link
href={`/search?organization=${dataset?.organizations?.edges?.[0]?.node?.slug || ""}`}
color="#464A51"
fontWeight="400"
>
<Text
fontFamily="Roboto"
fontSize="14px"
lineHeight="20px"
>
{dataset.organizations?.edges?.[0]?.node?.[`name${capitalize(locale)}`] || dataset.organizations?.edges?.[0]?.node?.name || t('noOrganization')}
</Text>
</Link>
</GridItem>
</Grid>
}
</Grid>
</GridItem>
</Grid>
Expand Down
31 changes: 18 additions & 13 deletions next/pages/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -664,19 +664,24 @@ export default function SearchDatasetPage() {

<Divider marginY="16px !important" borderColor="#DEDFE0"/>

<CheckboxFilterAccordion
canSearch={true}
isActive={validateActiveFilterAccordin("spatial_coverage")}
choices={aggregations?.spatial_coverages}
valueField="key"
displayField="name"
fieldName={t('spatialCoverage')}
valuesChecked={valuesCheckedFilter("spatial_coverage")}
onChange={(value) => handleSelectFilter(["spatial_coverage",`${value}`])}
isLoading={!isLoading}
/>

<Divider marginY="16px !important" borderColor="#DEDFE0"/>
{process.env.NEXT_PUBLIC_BASE_URL_FRONTEND !== "https://basedosdados.org" ?
<>
<CheckboxFilterAccordion
canSearch={true}
isActive={validateActiveFilterAccordin("spatial_coverage")}
choices={aggregations?.spatial_coverages}
valueField="key"
displayField="name"
fieldName={t('spatialCoverage')}
valuesChecked={valuesCheckedFilter("spatial_coverage")}
onChange={(value) => handleSelectFilter(["spatial_coverage",`${value}`])}
isLoading={!isLoading}
/>
<Divider marginY="16px !important" borderColor="#DEDFE0"/>
</>
:
<></>
}

<CheckboxFilterAccordion
canSearch={true}
Expand Down

0 comments on commit 8fefc84

Please sign in to comment.