@eeacms/volto-datahub 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,12 +4,18 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ ### [1.0.5](https://github.com/eea/volto-datahub/compare/1.0.4...1.0.5) - 2 December 2022
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - Don't show title if onlyLandingPage [Tiberiu Ichim - [`ba6ebfd`](https://github.com/eea/volto-datahub/commit/ba6ebfdc58865bf3870d557097cb0bc409eba7bc)]
12
+ - Use list on landing page [kreafox - [`0f68ed1`](https://github.com/eea/volto-datahub/commit/0f68ed10e611e18a90e02fae4ef4b7851958e588)]
13
+ - Fix error on datasets [kreafox - [`ad9d7eb`](https://github.com/eea/volto-datahub/commit/ad9d7eb5d6f8b4ea284979eecf56611b6960a36d)]
7
14
  ### [1.0.4](https://github.com/eea/volto-datahub/compare/1.0.3...1.0.4) - 29 November 2022
8
15
 
9
16
  #### :hammer_and_wrench: Others
10
17
 
11
18
  - Small improvements [kreafox - [`fd2c67c`](https://github.com/eea/volto-datahub/commit/fd2c67ce73aa716e487331f2db6c04232b59883f)]
12
- - Add isomorphic portal [Tiberiu Ichim - [`8b183b1`](https://github.com/eea/volto-datahub/commit/8b183b1d1fd424055e5f2330b56320d930f903da)]
13
19
  ### [1.0.3](https://github.com/eea/volto-datahub/compare/1.0.2...1.0.3) - 25 November 2022
14
20
 
15
21
  #### :hammer_and_wrench: Others
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-datahub",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "@eeacms/volto-datahub: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import { Icon, List, Accordion } from 'semantic-ui-react';
3
-
4
3
  import servicesSVG from './icons/services.svg';
5
4
  import lockSVG from 'remixicon/icons/System/lock-line.svg';
6
5
 
@@ -315,15 +314,30 @@ const Datasets = (props) => {
315
314
  </span>
316
315
  );
317
316
  })}
318
- {(dataset.linkProtocol || [])
319
- .filter((i) => i.includes('ESRI') || i.includes('OGC'))
320
- .map((item, i) => {
321
- return (
322
- <span className="format-label" key={i}>
323
- {item}
317
+
318
+ {Array.isArray(dataset.linkProtocol) ? (
319
+ <>
320
+ {dataset.linkProtocol
321
+ .filter(
322
+ (i) => i.includes('ESRI') || i.includes('OGC'),
323
+ )
324
+ .map((item, i) => {
325
+ return (
326
+ <span className="format-label" key={i}>
327
+ {item}
328
+ </span>
329
+ );
330
+ })}
331
+ </>
332
+ ) : (
333
+ <>
334
+ {['ESRI', 'OGC'].includes(dataset.linkProtocol) && (
335
+ <span className="format-label">
336
+ {dataset.linkProtocol}
324
337
  </span>
325
- );
326
- })}
338
+ )}
339
+ </>
340
+ )}
327
341
  </span>
328
342
 
329
343
  {is_internal(dataset) && <SVGIcon name={lockSVG} size="18" />}
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { Tab, Card, Menu, Divider } from 'semantic-ui-react';
3
+ import { Tab, Menu, Divider, List } from 'semantic-ui-react';
4
4
  import useDeepCompareEffect from 'use-deep-compare-effect';
5
5
  import { useAtom } from 'jotai';
6
6
 
@@ -52,6 +52,7 @@ const sortedTiles = (tiles, sectionConfig, appConfig) => {
52
52
 
53
53
  const LandingPage = (props) => {
54
54
  const { appConfig, children, setFilter, setSort } = props;
55
+ const { onlyLandingPage = false } = appConfig;
55
56
  // const facetsConfig = appConfig.facets;
56
57
 
57
58
  const {
@@ -176,7 +177,7 @@ const LandingPage = (props) => {
176
177
  return (
177
178
  <Tab.Pane>
178
179
  <div className="landing-page-cards">
179
- <Card.Group itemsPerRow={5}>
180
+ <List>
180
181
  {sortedTiles(tiles, activeSectionConfig, appConfig).map(
181
182
  (topic, index) => {
182
183
  const onClickHandler = () => {
@@ -203,28 +204,20 @@ const LandingPage = (props) => {
203
204
  };
204
205
 
205
206
  return (
206
- <Card onClick={onClickHandler} key={index}>
207
- <Card.Content>
208
- <Card.Header>
209
- {icon ? (
210
- <Icon {...icon} type={topic.value} />
211
- ) : (
212
- ''
213
- )}
214
- <Term term={topic.value} field={activeSection} />
215
- </Card.Header>
216
- </Card.Content>
217
- <Card.Content extra>
207
+ <List.Item onClick={onClickHandler} key={index}>
208
+ <List.Content>
209
+ {icon ? <Icon {...icon} type={topic.value} /> : ''}
210
+ <Term term={topic.value} field={activeSection} />
218
211
  <span className="count">
219
- {topic.count}{' '}
220
- {topic.count === 1 ? 'item' : 'items'}
212
+ ({topic.count}{' '}
213
+ {topic.count === 1 ? 'item' : 'items'})
221
214
  </span>
222
- </Card.Content>
223
- </Card>
215
+ </List.Content>
216
+ </List.Item>
224
217
  );
225
218
  },
226
219
  )}
227
- </Card.Group>
220
+ </List>
228
221
  </div>
229
222
  </Tab.Pane>
230
223
  );
@@ -235,7 +228,7 @@ const LandingPage = (props) => {
235
228
  return (
236
229
  <div className="landing-page-container">
237
230
  <div className="landing-page">
238
- <h4 className="browse-by">Browse by</h4>
231
+ {!onlyLandingPage && <h4 className="browse-by">Browse by</h4>}
239
232
  <Tab
240
233
  className="search-tab"
241
234
  menu={{ secondary: true, pointing: true }}