Skip to content

Commit 8fefc84

Browse files
committed
fix: hide spatial_coverage components in Prod
1 parent 456e9af commit 8fefc84

File tree

5 files changed

+144
-146
lines changed

5 files changed

+144
-146
lines changed

next/components/molecules/Footer.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,25 +93,24 @@ export default function Footer({ template, ocult = false }) {
9393

9494
if(template === "simple") return (
9595
<VStack
96-
position="relative"
9796
zIndex="10"
9897
width="100%"
9998
spacing={0}
10099
>
101100
<VStack
102101
width="100%"
103-
height={{base: "100%", lg: "96px"}}
104-
justifyContent="center"
102+
height="100%"
105103
backgroundColor="#EEEEEE"
106104
>
107105
<Stack
108106
width="100%"
109107
maxWidth="1440px"
108+
height="100%"
110109
justifyContent="space-between"
111110
direction={{base: "column-reverse", lg: "row"}}
112111
spacing={0}
113112
gridGap={{base: "8px", lg: "40px"}}
114-
padding={{base: "24px", lg: "0"}}
113+
padding="24px"
115114
>
116115
<HStack spacing={4}>
117116
<TextFooterSimple>

next/components/organisms/DatasetSearchCard.js

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -299,31 +299,33 @@ export default function Dataset({
299299
</Text>
300300
</Stack>
301301

302-
<Stack
303-
direction={{ base: "column", lg: "row" }}
304-
spacing={1}
305-
>
306-
<Text
307-
fontFamily="Roboto"
308-
fontWeight="400"
309-
fontSize="14px"
310-
lineHeight="20px"
311-
color="#464A51"
312-
>
313-
{t('spatialCoverage')}:
314-
</Text>
315-
<Text
316-
fontFamily="Roboto"
317-
fontWeight="400"
318-
fontSize="14px"
319-
lineHeight="20px"
320-
color="#71757A"
302+
{process.env.NEXT_PUBLIC_BASE_URL_FRONTEND !== "https://basedosdados.org" &&
303+
<Stack
304+
direction={{ base: "column", lg: "row" }}
305+
spacing={1}
321306
>
322-
{spatialCoverageNames.length > 0
323-
? spatialCoverageNames.join(', ')
324-
: spatialCoverage ? spatialCoverage : t('notProvided')}
325-
</Text>
326-
</Stack>
307+
<Text
308+
fontFamily="Roboto"
309+
fontWeight="400"
310+
fontSize="14px"
311+
lineHeight="20px"
312+
color="#464A51"
313+
>
314+
{t('spatialCoverage')}:
315+
</Text>
316+
<Text
317+
fontFamily="Roboto"
318+
fontWeight="400"
319+
fontSize="14px"
320+
lineHeight="20px"
321+
color="#71757A"
322+
>
323+
{spatialCoverageNames.length > 0
324+
? spatialCoverageNames.join(', ')
325+
: spatialCoverage ? spatialCoverage : t('notProvided')}
326+
</Text>
327+
</Stack>
328+
}
327329

328330
<Stack
329331
direction={{ base: "column", lg: "row" }}

next/components/organisms/TablePage.js

Lines changed: 48 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -326,60 +326,58 @@ export default function TablePage({ id }) {
326326
</SkeletonText>
327327

328328
<Stack spacing="12px" marginBottom="40px !important">
329-
<HStack spacing="40px" align="start">
330-
<Stack spacing="12px" width="100%">
331-
<StackSkeleton width="300px" height="20px">
332-
<Text
333-
fontFamily="Roboto"
334-
fontWeight="500"
335-
fontSize="18px"
336-
lineHeight="20px"
337-
color="#252A32"
338-
>
339-
{t('table.temporalCoverage')}
340-
</Text>
341-
</StackSkeleton>
329+
<StackSkeleton width="300px" height="20px">
330+
<Text
331+
fontFamily="Roboto"
332+
fontWeight="500"
333+
fontSize="18px"
334+
lineHeight="20px"
335+
color="#252A32"
336+
>
337+
{t('table.temporalCoverage')}
338+
</Text>
339+
</StackSkeleton>
342340

343-
<StackSkeleton
344-
width="100%"
345-
height={!isLoading ? "fit-content" : "65px"}
346-
>
347-
<TemporalCoverageBar value={resource?.fullTemporalCoverage}/>
348-
</StackSkeleton>
349-
</Stack>
341+
<StackSkeleton
342+
width="100%"
343+
height={!isLoading ? "fit-content" : "65px"}
344+
>
345+
<TemporalCoverageBar value={resource?.fullTemporalCoverage}/>
346+
</StackSkeleton>
347+
</Stack>
350348

351-
<Stack spacing="12px" width="100%">
352-
<StackSkeleton width="300px" height="20px">
353-
<Text
354-
fontFamily="Roboto"
355-
fontWeight="500"
356-
fontSize="18px"
357-
lineHeight="20px"
358-
color="#252A32"
359-
>
360-
{t('table.spatialCoverage')}
361-
</Text>
362-
</StackSkeleton>
349+
{process.env.NEXT_PUBLIC_BASE_URL_FRONTEND !== "https://basedosdados.org" &&
350+
<Stack spacing="12px" marginBottom="40px !important">
351+
<StackSkeleton width="300px" height="20px">
352+
<Text
353+
fontFamily="Roboto"
354+
fontWeight="500"
355+
fontSize="18px"
356+
lineHeight="20px"
357+
color="#252A32"
358+
>
359+
{t('table.spatialCoverage')}
360+
</Text>
361+
</StackSkeleton>
363362

364-
<StackSkeleton
365-
height="20px"
366-
width={resource?.spatialCoverageNames ? "100%" : "200px"}
363+
<StackSkeleton
364+
height="20px"
365+
width={resource?.spatialCoverageNames ? "100%" : "200px"}
366+
>
367+
<Text
368+
fontFamily="Roboto"
369+
fontWeight="400"
370+
fontSize="14px"
371+
lineHeight="20px"
372+
color="#464A51"
367373
>
368-
<Text
369-
fontFamily="Roboto"
370-
fontWeight="400"
371-
fontSize="14px"
372-
lineHeight="20px"
373-
color="#464A51"
374-
>
375-
{spatialCoverageNames.length > 0
376-
? spatialCoverageNames.join(', ')
377-
: t('table.notProvided')}
378-
</Text>
379-
</StackSkeleton>
380-
</Stack>
381-
</HStack>
382-
</Stack>
374+
{spatialCoverageNames.length > 0
375+
? spatialCoverageNames.join(', ')
376+
: t('table.notProvided')}
377+
</Text>
378+
</StackSkeleton>
379+
</Stack>
380+
}
383381

384382
<Stack spacing="12px" marginBottom="40px !important">
385383
<StackSkeleton width="200px" height="20px">

next/pages/dataset/[dataset].js

Lines changed: 49 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export default function DatasetPage ({ dataset, spatialCoverageNames }) {
142142
spacing={0}
143143
>
144144
<Grid
145-
templateColumns={{ base: "1fr", lg: "296px 1fr" }}
145+
templateColumns={{ base: "1fr", lg: "320px 1fr" }}
146146
width="100%"
147147
gap="24px"
148148
paddingY="24px"
@@ -158,17 +158,17 @@ export default function DatasetPage ({ dataset, spatialCoverageNames }) {
158158
src={dataset?.organizations?.edges?.[0]?.node?.picture ? dataset?.organizations?.edges?.[0]?.node?.picture : `https://storage.googleapis.com/basedosdados-website/equipe/sem_foto.png`}
159159
objectFit="contain"
160160
width="300px"
161-
height="182px"
161+
height="252px"
162162
borderRadius="16px"
163163
/>
164164
</GridItem>
165165

166166
<GridItem>
167167
<Grid
168-
templateColumns="1fr 1fr"
168+
templateColumns="1fr 1fr 1fr 1fr 1fr"
169169
gap="8px"
170170
>
171-
<GridItem colSpan={2}>
171+
<GridItem colSpan={5}>
172172
<BigTitle
173173
width="100%"
174174
overflow="hidden"
@@ -182,42 +182,62 @@ export default function DatasetPage ({ dataset, spatialCoverageNames }) {
182182
</BigTitle>
183183
</GridItem>
184184

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

191-
<Grid
192-
templateColumns={{ base: "1fr", lg: "minmax(250px, 1fr) minmax(250px, 1fr) minmax(250px, 1fr)" }}
193-
gap={{ base: "32px", lg: "48px" }}
194-
width="100%"
195-
marginTop="16px"
196-
maxWidth={{ lg: "1200px" }}
197-
>
198-
<GridItem>
199-
<Text
200-
fontFamily="Roboto"
201-
fontWeight="500"
202-
fontSize="18px"
203-
lineHeight="28px"
204-
color="#252A32"
205-
marginBottom="8px"
206-
>
207-
{t('temporalCoverage')}
208-
</Text>
191+
<GridItem colSpan={5} marginBottom="8px">
192+
<Text
193+
fontFamily="Roboto"
194+
fontWeight="500"
195+
fontSize="18px"
196+
lineHeight="28px"
197+
color="#252A32"
198+
marginBottom="8px"
199+
>
200+
{t('organization')}
201+
</Text>
202+
<Link
203+
href={`/search?organization=${dataset?.organizations?.edges?.[0]?.node?.slug || ""}`}
204+
color="#464A51"
205+
fontWeight="400"
206+
>
209207
<Text
210208
fontFamily="Roboto"
211-
fontWeight="400"
212209
fontSize="14px"
213210
lineHeight="20px"
214-
color="#464A51"
215211
>
216-
{dataset.temporalCoverage || t('notProvided')}
212+
{dataset.organizations?.edges?.[0]?.node?.[`name${capitalize(locale)}`] || dataset.organizations?.edges?.[0]?.node?.name || t('noOrganization')}
217213
</Text>
218-
</GridItem>
214+
</Link>
215+
</GridItem>
216+
217+
<GridItem colSpan={{ base: 5, lg: 2 }} marginBottom="8px">
218+
<Text
219+
fontFamily="Roboto"
220+
fontWeight="500"
221+
fontSize="18px"
222+
lineHeight="28px"
223+
color="#252A32"
224+
marginBottom="8px"
225+
>
226+
{t('temporalCoverage')}
227+
</Text>
228+
<Text
229+
fontFamily="Roboto"
230+
fontWeight="400"
231+
fontSize="14px"
232+
lineHeight="20px"
233+
color="#464A51"
234+
>
235+
{dataset.temporalCoverage || t('notProvided')}
236+
</Text>
237+
</GridItem>
219238

220-
<GridItem>
239+
{process.env.NEXT_PUBLIC_BASE_URL_FRONTEND !== "https://basedosdados.org" &&
240+
<GridItem colSpan={{ base: 5, lg: 3 }} marginBottom="8px">
221241
<Text
222242
fontFamily="Roboto"
223243
fontWeight="500"
@@ -240,33 +260,7 @@ export default function DatasetPage ({ dataset, spatialCoverageNames }) {
240260
: t('notProvided')}
241261
</Text>
242262
</GridItem>
243-
244-
<GridItem>
245-
<Text
246-
fontFamily="Roboto"
247-
fontWeight="500"
248-
fontSize="18px"
249-
lineHeight="28px"
250-
color="#252A32"
251-
marginBottom="8px"
252-
>
253-
{t('organization')}
254-
</Text>
255-
<Link
256-
href={`/search?organization=${dataset?.organizations?.edges?.[0]?.node?.slug || ""}`}
257-
color="#464A51"
258-
fontWeight="400"
259-
>
260-
<Text
261-
fontFamily="Roboto"
262-
fontSize="14px"
263-
lineHeight="20px"
264-
>
265-
{dataset.organizations?.edges?.[0]?.node?.[`name${capitalize(locale)}`] || dataset.organizations?.edges?.[0]?.node?.name || t('noOrganization')}
266-
</Text>
267-
</Link>
268-
</GridItem>
269-
</Grid>
263+
}
270264
</Grid>
271265
</GridItem>
272266
</Grid>

next/pages/search.js

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -664,19 +664,24 @@ export default function SearchDatasetPage() {
664664

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

667-
<CheckboxFilterAccordion
668-
canSearch={true}
669-
isActive={validateActiveFilterAccordin("spatial_coverage")}
670-
choices={aggregations?.spatial_coverages}
671-
valueField="key"
672-
displayField="name"
673-
fieldName={t('spatialCoverage')}
674-
valuesChecked={valuesCheckedFilter("spatial_coverage")}
675-
onChange={(value) => handleSelectFilter(["spatial_coverage",`${value}`])}
676-
isLoading={!isLoading}
677-
/>
678-
679-
<Divider marginY="16px !important" borderColor="#DEDFE0"/>
667+
{process.env.NEXT_PUBLIC_BASE_URL_FRONTEND !== "https://basedosdados.org" ?
668+
<>
669+
<CheckboxFilterAccordion
670+
canSearch={true}
671+
isActive={validateActiveFilterAccordin("spatial_coverage")}
672+
choices={aggregations?.spatial_coverages}
673+
valueField="key"
674+
displayField="name"
675+
fieldName={t('spatialCoverage')}
676+
valuesChecked={valuesCheckedFilter("spatial_coverage")}
677+
onChange={(value) => handleSelectFilter(["spatial_coverage",`${value}`])}
678+
isLoading={!isLoading}
679+
/>
680+
<Divider marginY="16px !important" borderColor="#DEDFE0"/>
681+
</>
682+
:
683+
<></>
684+
}
680685

681686
<CheckboxFilterAccordion
682687
canSearch={true}

0 commit comments

Comments
 (0)