@eeacms/volto-datahub 1.0.20 → 1.0.22
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 +12 -0
- package/package.json +1 -1
- package/src/components/ItemView/Datasets/DatasetItemDownloadList.jsx +3 -3
- package/src/components/ItemView/Datasets/DatasetItemsList.jsx +6 -0
- package/src/components/ItemView/Datasets/DatasetsTab.jsx +13 -1
- package/src/components/ItemView/ItemView.jsx +38 -2
- package/src/components/LandingPage/DatahubLandingPage.jsx +18 -3
- package/src/components/Result/DatahubCardItem.jsx +1 -1
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.22](https://github.com/eea/volto-datahub/compare/1.0.21...1.0.22) - 6 April 2023
|
|
8
|
+
|
|
9
|
+
#### :hammer_and_wrench: Others
|
|
10
|
+
|
|
11
|
+
- Accessibility on datahub view [kreafox - [`4f4fd41`](https://github.com/eea/volto-datahub/commit/4f4fd4163f75269e281c78ea5f973241c5d34fe3)]
|
|
12
|
+
- Removed 'Published' from search results [Zoltan Szabo - [`476ac0f`](https://github.com/eea/volto-datahub/commit/476ac0fc666b425b27de66d5c958f90c84ece1a8)]
|
|
13
|
+
- Refs #250312; remove WebDAV download options [Zoltan Szabo - [`ac6ed90`](https://github.com/eea/volto-datahub/commit/ac6ed90b37b017528f1d2f3acd02365734999533)]
|
|
14
|
+
### [1.0.21](https://github.com/eea/volto-datahub/compare/1.0.20...1.0.21) - 15 March 2023
|
|
15
|
+
|
|
16
|
+
#### :hammer_and_wrench: Others
|
|
17
|
+
|
|
18
|
+
- Add read more for description [kreafox - [`ef255b7`](https://github.com/eea/volto-datahub/commit/ef255b731cfb5c1269006a3f611848bc244ad2bd)]
|
|
7
19
|
### [1.0.20](https://github.com/eea/volto-datahub/compare/1.0.19...1.0.20) - 14 March 2023
|
|
8
20
|
|
|
9
21
|
#### :hammer_and_wrench: Others
|
package/package.json
CHANGED
|
@@ -80,7 +80,7 @@ const DatasetItemDownloadList = (props) => {
|
|
|
80
80
|
);
|
|
81
81
|
})}
|
|
82
82
|
|
|
83
|
-
{(dataset['EEA:FILEPATH'] || []).map((item, i) => {
|
|
83
|
+
{/* {(dataset['EEA:FILEPATH'] || []).map((item, i) => {
|
|
84
84
|
return (
|
|
85
85
|
<List.Item key={i}>
|
|
86
86
|
<List.Content>
|
|
@@ -115,7 +115,7 @@ const DatasetItemDownloadList = (props) => {
|
|
|
115
115
|
target="_blank"
|
|
116
116
|
rel="noreferrer"
|
|
117
117
|
>
|
|
118
|
-
|
|
118
|
+
WebDAV1: {item.name || item.function}
|
|
119
119
|
</a>
|
|
120
120
|
{isInternalURL(item.url) && (
|
|
121
121
|
<SVGIcon name={lockSVG} size="18" />
|
|
@@ -124,7 +124,7 @@ const DatasetItemDownloadList = (props) => {
|
|
|
124
124
|
</List.Content>
|
|
125
125
|
</List.Item>
|
|
126
126
|
);
|
|
127
|
-
})}
|
|
127
|
+
})} */}
|
|
128
128
|
</List>
|
|
129
129
|
</>
|
|
130
130
|
)}
|
|
@@ -39,9 +39,15 @@ const DatasetItemsList = (props) => {
|
|
|
39
39
|
return (
|
|
40
40
|
<React.Fragment key={index}>
|
|
41
41
|
<Accordion.Title
|
|
42
|
+
tabIndex={0}
|
|
42
43
|
active={activeIndex === index}
|
|
43
44
|
index={index}
|
|
44
45
|
onClick={handleClick}
|
|
46
|
+
onKeyDown={(e) => {
|
|
47
|
+
if (e.key === 'Enter') {
|
|
48
|
+
handleClick(e, { index });
|
|
49
|
+
}
|
|
50
|
+
}}
|
|
45
51
|
>
|
|
46
52
|
<span className="dataset-title">
|
|
47
53
|
{dataset.resourceTitleObject.default}
|
|
@@ -10,6 +10,8 @@ const DatasetsTab = (props) => {
|
|
|
10
10
|
defaultAccordionOpenIndex,
|
|
11
11
|
);
|
|
12
12
|
|
|
13
|
+
const [activeTabIndex, setActiveTabIndex] = React.useState(0);
|
|
14
|
+
|
|
13
15
|
React.useEffect(() => {
|
|
14
16
|
if (defaultAccordionOpenIndex !== undefined) {
|
|
15
17
|
setActiveAccordionIndex(defaultAccordionOpenIndex);
|
|
@@ -20,7 +22,16 @@ const DatasetsTab = (props) => {
|
|
|
20
22
|
|
|
21
23
|
const panes = (items || []).map((item, i) => ({
|
|
22
24
|
menuItem: (
|
|
23
|
-
<Menu.Item
|
|
25
|
+
<Menu.Item
|
|
26
|
+
key={i}
|
|
27
|
+
tabIndex={0}
|
|
28
|
+
onClick={() => setActiveTabIndex(i)}
|
|
29
|
+
onKeyDown={(e) => {
|
|
30
|
+
if (e.key === 'Enter') {
|
|
31
|
+
setActiveTabIndex(i);
|
|
32
|
+
}
|
|
33
|
+
}}
|
|
34
|
+
>
|
|
24
35
|
{item.date ? <span>{item.date}</span> : 'No date'}
|
|
25
36
|
</Menu.Item>
|
|
26
37
|
),
|
|
@@ -39,6 +50,7 @@ const DatasetsTab = (props) => {
|
|
|
39
50
|
return (
|
|
40
51
|
<Tab
|
|
41
52
|
className="datasets-tab"
|
|
53
|
+
activeIndex={activeTabIndex}
|
|
42
54
|
menu={{ vertical: true, secondary: true, pointing: true }}
|
|
43
55
|
panes={panes}
|
|
44
56
|
onTabChange={() => {
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { Portal } from 'react-portal';
|
|
3
3
|
import { useDispatch, useSelector } from 'react-redux';
|
|
4
4
|
import { Link, useLocation } from 'react-router-dom';
|
|
5
|
-
import { Container, Icon } from 'semantic-ui-react';
|
|
5
|
+
import { Container, Icon, Button } from 'semantic-ui-react';
|
|
6
6
|
import { Toolbar } from '@plone/volto/components';
|
|
7
7
|
import { BodyClass } from '@plone/volto/helpers';
|
|
8
8
|
import config from '@plone/volto/registry';
|
|
@@ -21,6 +21,21 @@ import { setDatahubResult } from '@eeacms/volto-datahub/store';
|
|
|
21
21
|
import { isObsolete } from './utils.js';
|
|
22
22
|
|
|
23
23
|
const appName = 'datahub';
|
|
24
|
+
const WORD_COUNT = 60;
|
|
25
|
+
|
|
26
|
+
const splitContent = (content, wordCount) => {
|
|
27
|
+
const words = content.split(' ');
|
|
28
|
+
let firstTextPart = '',
|
|
29
|
+
secondTextPart = '';
|
|
30
|
+
words.forEach((word, idx) => {
|
|
31
|
+
if (idx < wordCount) {
|
|
32
|
+
firstTextPart += ' ' + word;
|
|
33
|
+
} else {
|
|
34
|
+
secondTextPart += ' ' + word;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
return [firstTextPart.trim(), secondTextPart.trim()];
|
|
38
|
+
};
|
|
24
39
|
|
|
25
40
|
function IsomorphicPortal({ children }) {
|
|
26
41
|
const [isClient, setIsClient] = React.useState();
|
|
@@ -75,6 +90,13 @@ function ItemView(props) {
|
|
|
75
90
|
|
|
76
91
|
const rawTitle = item && item._meta.found ? title?.raw || '' : docid;
|
|
77
92
|
|
|
93
|
+
const splitDescription = description?.raw.split(' ').length > WORD_COUNT;
|
|
94
|
+
const [firstTextPart, secondTextPart] = splitContent(
|
|
95
|
+
description?.raw,
|
|
96
|
+
WORD_COUNT,
|
|
97
|
+
);
|
|
98
|
+
const [isReadMore, setIsReadMore] = React.useState(false);
|
|
99
|
+
|
|
78
100
|
React.useEffect(() => {
|
|
79
101
|
const handler = async () => {
|
|
80
102
|
if (item) {
|
|
@@ -139,7 +161,21 @@ function ItemView(props) {
|
|
|
139
161
|
</IsomorphicPortal>
|
|
140
162
|
|
|
141
163
|
<div className="dataset-container">
|
|
142
|
-
<Callout>
|
|
164
|
+
<Callout>
|
|
165
|
+
{splitDescription ? (
|
|
166
|
+
<p>
|
|
167
|
+
{firstTextPart} {isReadMore ? secondTextPart : ''}
|
|
168
|
+
<Button
|
|
169
|
+
onClick={() => setIsReadMore(!isReadMore)}
|
|
170
|
+
className={`see-more ${isReadMore ? 'open' : 'close'}`}
|
|
171
|
+
>
|
|
172
|
+
{isReadMore ? 'See less' : ' See more'}
|
|
173
|
+
</Button>
|
|
174
|
+
</p>
|
|
175
|
+
) : (
|
|
176
|
+
<p>{description?.raw}</p>
|
|
177
|
+
)}
|
|
178
|
+
</Callout>
|
|
143
179
|
</div>
|
|
144
180
|
|
|
145
181
|
<DatasetsView item={item} appConfig={appConfig} />
|
|
@@ -164,8 +164,14 @@ const LandingPage = (props) => {
|
|
|
164
164
|
return (
|
|
165
165
|
<React.Fragment key={`tab-${tabIndex}`}>
|
|
166
166
|
<Menu.Item
|
|
167
|
+
tabIndex={0}
|
|
167
168
|
active={activeSection === section.facetField}
|
|
168
169
|
onClick={() => setActiveSection(section.facetField)}
|
|
170
|
+
onKeyDown={(e) => {
|
|
171
|
+
if (e.key === 'Enter') {
|
|
172
|
+
setActiveSection(section.facetField);
|
|
173
|
+
}
|
|
174
|
+
}}
|
|
169
175
|
>
|
|
170
176
|
{section.title}
|
|
171
177
|
</Menu.Item>
|
|
@@ -175,7 +181,7 @@ const LandingPage = (props) => {
|
|
|
175
181
|
},
|
|
176
182
|
render: () => {
|
|
177
183
|
return (
|
|
178
|
-
<Tab.Pane>
|
|
184
|
+
<Tab.Pane tabIndex={0}>
|
|
179
185
|
<div className={`landing-page-cards ${activeSection}`}>
|
|
180
186
|
<List>
|
|
181
187
|
{sortedTiles(tiles, activeSectionConfig, appConfig).map(
|
|
@@ -204,7 +210,16 @@ const LandingPage = (props) => {
|
|
|
204
210
|
};
|
|
205
211
|
|
|
206
212
|
return (
|
|
207
|
-
<List.Item
|
|
213
|
+
<List.Item
|
|
214
|
+
key={index}
|
|
215
|
+
tabIndex={0}
|
|
216
|
+
onClick={onClickHandler}
|
|
217
|
+
onKeyDown={(e) => {
|
|
218
|
+
if (e.key === 'Enter') {
|
|
219
|
+
onClickHandler();
|
|
220
|
+
}
|
|
221
|
+
}}
|
|
222
|
+
>
|
|
208
223
|
<List.Content>
|
|
209
224
|
{icon ? <Icon {...icon} type={topic.value} /> : ''}
|
|
210
225
|
<Term term={topic.value} field={activeSection} />
|
|
@@ -247,7 +262,7 @@ const LandingPage = (props) => {
|
|
|
247
262
|
<List.Content>
|
|
248
263
|
<div
|
|
249
264
|
key="all_series"
|
|
250
|
-
tabIndex="
|
|
265
|
+
tabIndex="0"
|
|
251
266
|
role="button"
|
|
252
267
|
onKeyDown={fixedOnClickHandler}
|
|
253
268
|
onClick={fixedOnClickHandler}
|
|
@@ -32,7 +32,7 @@ const DatahubCardItem = (props) => {
|
|
|
32
32
|
extra: (
|
|
33
33
|
<div className="result-bottom">
|
|
34
34
|
<div className="result-info">
|
|
35
|
-
<span className="result-info-title">Published: </span>
|
|
35
|
+
{/* <span className="result-info-title">Published: </span> */}
|
|
36
36
|
<DateTime format="DATE_MED" value={result.issued} />
|
|
37
37
|
</div>
|
|
38
38
|
{topic ? (
|