@eeacms/volto-datahub 1.0.4 → 1.0.6

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,23 @@ 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.6](https://github.com/eea/volto-datahub/compare/1.0.5...1.0.6) - 29 December 2022
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - test(Jenkins): Run tests and cypress with latest canary @plone/volto [Alin Voinea - [`9e5dee2`](https://github.com/eea/volto-datahub/commit/9e5dee2052462d8ee06da0195bcb34b0e26d34d2)]
12
+ ### [1.0.5](https://github.com/eea/volto-datahub/compare/1.0.4...1.0.5) - 2 December 2022
13
+
14
+ #### :hammer_and_wrench: Others
15
+
16
+ - Don't show title if onlyLandingPage [Tiberiu Ichim - [`ba6ebfd`](https://github.com/eea/volto-datahub/commit/ba6ebfdc58865bf3870d557097cb0bc409eba7bc)]
17
+ - Use list on landing page [kreafox - [`0f68ed1`](https://github.com/eea/volto-datahub/commit/0f68ed10e611e18a90e02fae4ef4b7851958e588)]
18
+ - Fix error on datasets [kreafox - [`ad9d7eb`](https://github.com/eea/volto-datahub/commit/ad9d7eb5d6f8b4ea284979eecf56611b6960a36d)]
7
19
  ### [1.0.4](https://github.com/eea/volto-datahub/compare/1.0.3...1.0.4) - 29 November 2022
8
20
 
9
21
  #### :hammer_and_wrench: Others
10
22
 
11
23
  - 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
24
  ### [1.0.3](https://github.com/eea/volto-datahub/compare/1.0.2...1.0.3) - 25 November 2022
14
25
 
15
26
  #### :hammer_and_wrench: Others
@@ -35,9 +46,11 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
35
46
  #### :hammer_and_wrench: Others
36
47
 
37
48
  - Fix eslintrc: add @eeacms/search [kreafox - [`465816f`](https://github.com/eea/volto-datahub/commit/465816feb8f58095ab4b5b3168cd29ebede3a10c)]
49
+ - Use latest Volto before yarn 3 [Tiberiu Ichim - [`69f5859`](https://github.com/eea/volto-datahub/commit/69f585980fd9a38ff99d0c7875704671857720f7)]
38
50
  - Reorder sections on landing page [kreafox - [`46fac8d`](https://github.com/eea/volto-datahub/commit/46fac8d821cf93fe1b2c380380719de130c3f1cb)]
39
51
  - Fix project eslintrc [kreafox - [`5baa150`](https://github.com/eea/volto-datahub/commit/5baa1505ec38ed313269f5608c186c6a6a8bbfc4)]
40
52
  - Open dataset links in new tab [kreafox - [`bbed914`](https://github.com/eea/volto-datahub/commit/bbed914dc2edf6c749d1d73d93a423bc642e680c)]
53
+ - Add Sonarqube tag using circularity-frontend addons list [EEA Jenkins - [`380a2a9`](https://github.com/eea/volto-datahub/commit/380a2a9625c6f799df7a7c343fad3f3b3d959f96)]
41
54
  ## [1.0.0](https://github.com/eea/volto-datahub/compare/0.1.12...1.0.0) - 28 October 2022
42
55
 
43
56
  #### :nail_care: Enhancements
@@ -62,6 +75,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
62
75
  #### :hammer_and_wrench: Others
63
76
 
64
77
  - fixed query for related items [Zoltan Szabo - [`b66faee`](https://github.com/eea/volto-datahub/commit/b66faee1f8a1922cd22b3a36eccc9c7b92e377d4)]
78
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`158fe1a`](https://github.com/eea/volto-datahub/commit/158fe1a0b1767452e2e51a3e2ef97169589a50e8)]
65
79
  ### [0.1.10](https://github.com/eea/volto-datahub/compare/0.1.9...0.1.10) - 21 September 2022
66
80
 
67
81
  #### :hammer_and_wrench: Others
@@ -150,6 +164,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
150
164
  #### :hammer_and_wrench: Others
151
165
 
152
166
  - Hide questions & fix landing page [kreafox - [`a1ef303`](https://github.com/eea/volto-datahub/commit/a1ef3033df0e84f3a72dd0f984c8717dff2a771c)]
167
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`910688e`](https://github.com/eea/volto-datahub/commit/910688e3ddf2f8cda4f941595ae9a6ee0ec0ea3b)]
153
168
  ### [0.1.1](https://github.com/eea/volto-datahub/compare/0.1.0...0.1.1) - 10 June 2022
154
169
 
155
170
  ### [0.1.0](https://github.com/eea/volto-datahub/compare/0.0.1...0.1.0) - 9 June 2022
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.6",
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" />}
@@ -32,11 +32,15 @@ function IsomorphicPortal({ children }) {
32
32
  }
33
33
 
34
34
  function ItemView(props) {
35
- const { docid, location } = props;
35
+ const { docid, location, staticContext } = props;
36
36
  const { fromPathname, fromSearch } = location?.state || {};
37
37
  const dispatch = useDispatch();
38
38
  // const content = useSelector((state) => state.content.data);
39
39
  let result = useSelector((state) => state.datahub_results?.[docid]);
40
+ if (__SERVER__ && !result?._original?.found) {
41
+ staticContext.error_code = 404;
42
+ staticContext.error = 'NotFound';
43
+ }
40
44
  const registry = config.settings.searchlib;
41
45
  const appConfig = React.useMemo(
42
46
  () => applyConfigurationSchema(rebind(registry.searchui[appName])),
@@ -171,6 +175,7 @@ function DatahubItemView(props) {
171
175
  React.useEffect(() => setIsClient(true), []);
172
176
 
173
177
  const docid = props.match?.params?.id;
178
+ const { staticContext = {} } = props;
174
179
 
175
180
  return (
176
181
  <div id="view">
@@ -178,7 +183,11 @@ function DatahubItemView(props) {
178
183
  {/* Body class if displayName in component is set */}
179
184
  <BodyClass className="view-datahub-item" />
180
185
  <Container className="view-wrapper">
181
- <ItemView docid={docid} location={location} />
186
+ <ItemView
187
+ docid={docid}
188
+ location={location}
189
+ staticContext={staticContext}
190
+ />
182
191
  </Container>
183
192
  {isClient && (
184
193
  <Portal node={document.getElementById('toolbar')}>
@@ -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 }}