@eeacms/volto-datahub 1.0.3 → 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,6 +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)]
14
+ ### [1.0.4](https://github.com/eea/volto-datahub/compare/1.0.3...1.0.4) - 29 November 2022
15
+
16
+ #### :hammer_and_wrench: Others
17
+
18
+ - Small improvements [kreafox - [`fd2c67c`](https://github.com/eea/volto-datahub/commit/fd2c67ce73aa716e487331f2db6c04232b59883f)]
7
19
  ### [1.0.3](https://github.com/eea/volto-datahub/compare/1.0.2...1.0.3) - 25 November 2022
8
20
 
9
21
  #### :hammer_and_wrench: Others
@@ -29,11 +41,9 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
29
41
  #### :hammer_and_wrench: Others
30
42
 
31
43
  - Fix eslintrc: add @eeacms/search [kreafox - [`465816f`](https://github.com/eea/volto-datahub/commit/465816feb8f58095ab4b5b3168cd29ebede3a10c)]
32
- - Use latest Volto before yarn 3 [Tiberiu Ichim - [`69f5859`](https://github.com/eea/volto-datahub/commit/69f585980fd9a38ff99d0c7875704671857720f7)]
33
44
  - Reorder sections on landing page [kreafox - [`46fac8d`](https://github.com/eea/volto-datahub/commit/46fac8d821cf93fe1b2c380380719de130c3f1cb)]
34
45
  - Fix project eslintrc [kreafox - [`5baa150`](https://github.com/eea/volto-datahub/commit/5baa1505ec38ed313269f5608c186c6a6a8bbfc4)]
35
46
  - Open dataset links in new tab [kreafox - [`bbed914`](https://github.com/eea/volto-datahub/commit/bbed914dc2edf6c749d1d73d93a423bc642e680c)]
36
- - Add Sonarqube tag using circularity-frontend addons list [EEA Jenkins - [`380a2a9`](https://github.com/eea/volto-datahub/commit/380a2a9625c6f799df7a7c343fad3f3b3d959f96)]
37
47
  ## [1.0.0](https://github.com/eea/volto-datahub/compare/0.1.12...1.0.0) - 28 October 2022
38
48
 
39
49
  #### :nail_care: Enhancements
@@ -58,7 +68,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
58
68
  #### :hammer_and_wrench: Others
59
69
 
60
70
  - fixed query for related items [Zoltan Szabo - [`b66faee`](https://github.com/eea/volto-datahub/commit/b66faee1f8a1922cd22b3a36eccc9c7b92e377d4)]
61
- - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`158fe1a`](https://github.com/eea/volto-datahub/commit/158fe1a0b1767452e2e51a3e2ef97169589a50e8)]
62
71
  ### [0.1.10](https://github.com/eea/volto-datahub/compare/0.1.9...0.1.10) - 21 September 2022
63
72
 
64
73
  #### :hammer_and_wrench: Others
@@ -147,7 +156,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
147
156
  #### :hammer_and_wrench: Others
148
157
 
149
158
  - Hide questions & fix landing page [kreafox - [`a1ef303`](https://github.com/eea/volto-datahub/commit/a1ef3033df0e84f3a72dd0f984c8717dff2a771c)]
150
- - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`910688e`](https://github.com/eea/volto-datahub/commit/910688e3ddf2f8cda4f941595ae9a6ee0ec0ea3b)]
151
159
  ### [0.1.1](https://github.com/eea/volto-datahub/compare/0.1.0...0.1.1) - 10 June 2022
152
160
 
153
161
  ### [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.3",
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
 
@@ -183,7 +182,12 @@ const DatasetList = (props) => {
183
182
  {/* {(item.name || item.description) && (
184
183
  <span className="item-protocol">{item.protocol}:</span>
185
184
  )} */}
186
- <a className="item-link" href={item.url}>
185
+ <a
186
+ className="item-link"
187
+ href={item.url}
188
+ target="_blank"
189
+ rel="noreferrer"
190
+ >
187
191
  {item.protocol} {item.name || item.description}
188
192
  </a>
189
193
  {is_internal_url(item.url) && (
@@ -204,7 +208,12 @@ const DatasetList = (props) => {
204
208
  {/* {(item.name || item.description) && (
205
209
  <span className="item-protocol">{item.protocol}:</span>
206
210
  )} */}
207
- <a className="item-link" href={item.url}>
211
+ <a
212
+ className="item-link"
213
+ href={item.url}
214
+ target="_blank"
215
+ rel="noreferrer"
216
+ >
208
217
  {item.protocol} {item.name || item.description}
209
218
  </a>
210
219
  {is_internal_url(item.url) && (
@@ -305,7 +314,32 @@ const Datasets = (props) => {
305
314
  </span>
306
315
  );
307
316
  })}
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}
337
+ </span>
338
+ )}
339
+ </>
340
+ )}
308
341
  </span>
342
+
309
343
  {is_internal(dataset) && <SVGIcon name={lockSVG} size="18" />}
310
344
  </span>
311
345
  <Icon className="ri-arrow-down-s-line" />
@@ -348,14 +382,14 @@ const Datasets = (props) => {
348
382
 
349
383
  {dataset.resourceType[0] !== 'nonGeographicDataset' && (
350
384
  <div className="dataset-pdf">
351
- <div className="pdf-btn">
385
+ <div className="d-link">
352
386
  <Icon className="file pdf" />
353
387
  <a
354
388
  target="_blank"
355
389
  rel="noreferrer"
356
390
  href={`${appConfig.indexBaseUrl}/catalogue/datahub/api/records/${dataset.metadataIdentifier}/formatters/xsl-view?output=pdf&language=eng&approved=true`}
357
391
  >
358
- SDI Metadata Factsheet
392
+ Metadata Factsheet
359
393
  </a>
360
394
  </div>
361
395
  </div>
@@ -20,6 +20,17 @@ import { setDatahubResult } from '@eeacms/volto-datahub/store';
20
20
 
21
21
  const appName = 'datahub';
22
22
 
23
+ function IsomorphicPortal({ children }) {
24
+ const [isClient, setIsClient] = React.useState();
25
+ React.useEffect(() => setIsClient(true), []);
26
+
27
+ return isClient ? (
28
+ <Portal node={document.getElementById('page-header')}>{children}</Portal>
29
+ ) : (
30
+ children
31
+ );
32
+ }
33
+
23
34
  function ItemView(props) {
24
35
  const { docid, location } = props;
25
36
  const { fromPathname, fromSearch } = location?.state || {};
@@ -84,54 +95,49 @@ function ItemView(props) {
84
95
  handler();
85
96
  }, [item, dispatch, docid, rawTitle]);
86
97
 
87
- const [isClient, setIsClient] = React.useState();
88
- React.useEffect(() => setIsClient(true), []);
89
-
90
98
  return item && item._meta.found ? (
91
99
  <div className="dataset-view">
92
100
  <Helmet title={title?.raw} />
93
- {isClient && (
94
- <Portal node={document.getElementById('page-header')}>
95
- <div className="dataset">
96
- <Banner>
97
- <Banner.Content>
98
- <Banner.Subtitle>
99
- <Link
100
- to={
101
- location?.state
102
- ? { pathname: fromPathname, search: fromSearch }
103
- : {
104
- pathname: '/en/datahub/',
105
- }
106
- }
107
- >
108
- <Icon className="arrow left" />
109
- Datahub overview
110
- </Link>
111
- </Banner.Subtitle>
112
- <Banner.Title>{title?.raw}</Banner.Title>
113
- <Banner.Metadata>
114
- <Banner.MetadataField label="Prod-ID" value={prodID} />
115
- <Banner.MetadataField
116
- label="Published"
117
- type="date"
118
- value={<DateTime format="DATE_MED" value={result.issued} />}
119
- />
120
- <Banner.MetadataField
121
- label="Last modified"
122
- type="date"
123
- value={<DateTime format="DATE_MED" value={changeDate} />}
124
- />
125
- {/* <Banner.MetadataField
101
+ <IsomorphicPortal>
102
+ <div className="dataset">
103
+ <Banner>
104
+ <Banner.Content>
105
+ <Banner.Subtitle>
106
+ <Link
107
+ to={
108
+ location?.state
109
+ ? { pathname: fromPathname, search: fromSearch }
110
+ : {
111
+ pathname: '/en/datahub/',
112
+ }
113
+ }
114
+ >
115
+ <Icon className="arrow left" />
116
+ Datahub overview
117
+ </Link>
118
+ </Banner.Subtitle>
119
+ <Banner.Title>{title?.raw}</Banner.Title>
120
+ <Banner.Metadata>
121
+ <Banner.MetadataField label="Prod-ID" value={prodID} />
122
+ <Banner.MetadataField
123
+ label="Published"
124
+ type="date"
125
+ value={<DateTime format="DATE_MED" value={result.issued} />}
126
+ />
127
+ <Banner.MetadataField
128
+ label="Last modified"
129
+ type="date"
130
+ value={<DateTime format="DATE_MED" value={changeDate} />}
131
+ />
132
+ {/* <Banner.MetadataField
126
133
  label="Reading time"
127
134
  value={readingTime?.raw}
128
135
  /> */}
129
- </Banner.Metadata>
130
- </Banner.Content>
131
- </Banner>
132
- </div>
133
- </Portal>
134
- )}
136
+ </Banner.Metadata>
137
+ </Banner.Content>
138
+ </Banner>
139
+ </div>
140
+ </IsomorphicPortal>
135
141
 
136
142
  <div className="dataset-container">
137
143
  <Callout>{description?.raw}</Callout>
@@ -64,14 +64,25 @@ const MetadataSection = (props) => {
64
64
  </div>
65
65
  )}
66
66
 
67
- <div className="pdf-btn">
67
+ <div className="d-link">
68
68
  <Icon className="file pdf" />
69
69
  <a
70
70
  target="_blank"
71
71
  rel="noreferrer"
72
72
  href={`${appConfig.indexBaseUrl}/catalogue/datahub/api/records/${docid}/formatters/xsl-view?output=pdf&language=eng&approved=true`}
73
73
  >
74
- SDI Metadata Factsheet
74
+ Metadata Factsheet
75
+ </a>
76
+ </div>
77
+
78
+ <div className="d-link">
79
+ <i class="ri-external-link-line"></i>
80
+ <a
81
+ target="_blank"
82
+ rel="noreferrer"
83
+ href={`${appConfig.indexBaseUrl}/catalogue/srv/eng/catalog.search#/metadata/${docid}`}
84
+ >
85
+ Metadata catalogue
75
86
  </a>
76
87
  </div>
77
88
  </div>
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { Tab, Card, Menu } 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 }}
@@ -247,7 +240,7 @@ const LandingPage = (props) => {
247
240
  </div>
248
241
  ) : null}
249
242
  {children}
250
- <hr></hr>
243
+ <Divider />
251
244
  <div className="landing-page-cards">
252
245
  <div className="ui cards">
253
246
  <div