@eeacms/volto-datahub 0.1.2 → 0.1.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,8 +4,41 @@ 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
+ #### [0.1.5](https://github.com/eea/volto-datahub/compare/0.1.4...0.1.5)
8
+
9
+ - Fix merge [`6a8f3d4`](https://github.com/eea/volto-datahub/commit/6a8f3d4f3bfaacb8e0938929d8038f9e31a26ced)
10
+ - Fix layout [`129d480`](https://github.com/eea/volto-datahub/commit/129d4802a63aa346d11ae8e54b323580213c0a71)
11
+ - Fix merge [`3df3a81`](https://github.com/eea/volto-datahub/commit/3df3a8189448dcdd052692b6f5d835a1ea752a50)
12
+ - Add back to search [`b80ce25`](https://github.com/eea/volto-datahub/commit/b80ce250d326fa75c8451d70fe366148f7d49abb)
13
+ - Change datahubitem path [`7ccdbf0`](https://github.com/eea/volto-datahub/commit/7ccdbf0619e45a99e85b096dcdfb2e645e3ecc90)
14
+ - Integrate the Breadcrumb [`bccae64`](https://github.com/eea/volto-datahub/commit/bccae6445b3c46d4715743558343a14b08c7c07f)
15
+
16
+ #### [0.1.4](https://github.com/eea/volto-datahub/compare/0.1.3...0.1.4)
17
+
18
+ > 28 July 2022
19
+
20
+ - Develop [`#5`](https://github.com/eea/volto-datahub/pull/5)
21
+ - Improve temporal coverage [`d0483d4`](https://github.com/eea/volto-datahub/commit/d0483d46259b956a96a66268b9ec305d27456f88)
22
+ - Fix warning message [`305d2d6`](https://github.com/eea/volto-datahub/commit/305d2d61123d1ee23e8a4baf837b1aadc5d9a41f)
23
+ - Hide readingTime for now [`5e508d3`](https://github.com/eea/volto-datahub/commit/5e508d3c2bfd97bcc01dca59894a4f9ad582284b)
24
+ - ESlint fix [`dcfbab4`](https://github.com/eea/volto-datahub/commit/dcfbab4effa23ddcc3d4bf9a61d0b0d101c796b6)
25
+ - Set topics filter always visible [`1c062f4`](https://github.com/eea/volto-datahub/commit/1c062f473c123b5c04055fc6a52ea56bbd00e7b4)
26
+ - Update item view [`a53d297`](https://github.com/eea/volto-datahub/commit/a53d297916bb8d2c5d020acb9de600228e344982)
27
+ - Fix import [`bfa1cbc`](https://github.com/eea/volto-datahub/commit/bfa1cbc04c60009f949ac675278df894b4e1c892)
28
+ - WIP Update dataset's page based on new figma design [`01eecfa`](https://github.com/eea/volto-datahub/commit/01eecfacd482ca6abea81e4fd24eb7871e5365c9)
29
+ - Reconfigure datahub facets [`8636536`](https://github.com/eea/volto-datahub/commit/863653613d05faaa73101943896f05243055c696)
30
+ - Update result item based on new figma design [`eb618a0`](https://github.com/eea/volto-datahub/commit/eb618a0ce441cb9d797b39efad6bf98e4b07c728)
31
+
32
+ #### [0.1.3](https://github.com/eea/volto-datahub/compare/0.1.2...0.1.3)
33
+
34
+ > 30 June 2022
35
+
36
+
7
37
  #### [0.1.2](https://github.com/eea/volto-datahub/compare/0.1.1...0.1.2)
8
38
 
39
+ > 30 June 2022
40
+
41
+ - Release [`#3`](https://github.com/eea/volto-datahub/pull/3)
9
42
  - Hide questions & fix landing page [`a1ef303`](https://github.com/eea/volto-datahub/commit/a1ef3033df0e84f3a72dd0f984c8717dff2a771c)
10
43
 
11
44
  #### [0.1.1](https://github.com/eea/volto-datahub/compare/0.1.0...0.1.1)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-datahub",
3
- "version": "0.1.2",
3
+ "version": "0.1.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,22 +1,15 @@
1
1
  import React from 'react';
2
2
  import {
3
3
  Container,
4
- Grid,
5
4
  Card,
6
5
  Image,
7
6
  Accordion,
8
7
  Icon,
8
+ Tab,
9
9
  } from 'semantic-ui-react';
10
10
  import { Toolbar } from '@plone/volto/components';
11
11
  import { BodyClass } from '@plone/volto/helpers';
12
12
  import { Portal } from 'react-portal';
13
- // import { useResult } from '@eeacms/search/lib/hocs';
14
- // import {
15
- // AppConfigContext,
16
- // SearchContext,
17
- // // useIsMounted,
18
- // } from '@eeacms/search/lib/hocs';
19
- // import { rebind, applyConfigurationSchema } from '@eeacms/search/lib/utils';
20
13
  import {
21
14
  useResult,
22
15
  AppConfigContext,
@@ -24,22 +17,65 @@ import {
24
17
  rebind,
25
18
  applyConfigurationSchema,
26
19
  } from '@eeacms/search';
27
- import { SearchProvider, WithSearch } from '@elastic/react-search-ui'; // ErrorBoundary,
20
+ import { DateTime } from '@eeacms/search';
21
+ import { SearchProvider, WithSearch } from '@elastic/react-search-ui';
28
22
  import { Callout } from '@eeacms/volto-eea-design-system/ui';
23
+ import { useDispatch } from 'react-redux';
29
24
  import config from '@plone/volto/registry';
25
+ import { Link, useLocation } from 'react-router-dom';
30
26
 
31
27
  const appName = 'datahub';
32
28
 
33
29
  function ItemView(props) {
34
- const { docid } = props;
30
+ const { docid, location } = props;
31
+ const { fromPathname, fromSearch } = location?.state || {};
32
+ const dispatch = useDispatch();
33
+ // const content = useSelector((state) => state.content.data);
35
34
  const result = useResult(null, docid);
36
- const item = result ? result._result : {};
37
- const { title, description, id, raw_value, event } = item;
38
- const { contactForResource, contact } = raw_value?.raw || {};
35
+ const item = result ? result._result : null;
36
+ const { title, description, raw_value, event, issued, time_coverage } =
37
+ item || {}; // readingTime
38
+ const rawTitle = title?.raw || '';
39
+
40
+ React.useEffect(() => {
41
+ const handler = async () => {
42
+ if (item) {
43
+ const action = {
44
+ type: 'GET_BREADCRUMBS_SUCCESS',
45
+ result: {
46
+ items: [
47
+ {
48
+ title: 'Datahub',
49
+ '@id': '/en/datahub',
50
+ },
51
+ {
52
+ title: rawTitle,
53
+ '@id': `/en/datahub/view/${docid}`,
54
+ },
55
+ ],
56
+ },
57
+ };
58
+ await dispatch({ type: 'GET_BREADCRUMBS_PENDING' }); // satisfy content load protection
59
+ await dispatch(action);
60
+ }
61
+ };
62
+
63
+ handler();
64
+ }, [item, dispatch, docid, rawTitle]);
65
+ const {
66
+ // contactForResource,
67
+ // contact,
68
+ // resourceTemporalDateRange,
69
+ changeDate,
70
+ } = raw_value?.raw || {};
71
+
39
72
  const relatedItemsData = event?.raw.original;
40
73
  const relatedDatasets =
41
74
  (relatedItemsData && JSON.parse(relatedItemsData)) || {};
42
75
  const { children } = relatedDatasets?.raw_value || {};
76
+ const startTempCoverage = parseInt(time_coverage?.raw.at(0));
77
+ const endTempCoverage = parseInt(time_coverage?.raw.at(-1));
78
+
43
79
  const [activeIndex, setActiveIndex] = React.useState([]);
44
80
 
45
81
  const toggleOpenAccordion = (e, titleProps) => {
@@ -51,216 +87,271 @@ function ItemView(props) {
51
87
 
52
88
  setActiveIndex(newIndex);
53
89
  };
90
+ // console.log('result', result?._result);
54
91
 
55
- // console.log('datahub item', item);
56
- // console.log('related datasets', children);
92
+ const panes = [
93
+ {
94
+ menuItem: 'European data',
95
+ render: () => <Tab.Pane attached={false}>Tab 1 Content</Tab.Pane>,
96
+ },
97
+ {
98
+ menuItem: 'Dataset definition',
99
+ render: () => <Tab.Pane attached={false}>Tab 2 Content</Tab.Pane>,
100
+ },
101
+ ];
57
102
 
58
- return (
59
- <>
60
- {item ? (
61
- <div>
62
- <Portal node={document.getElementById('page-header')}>
63
- <div className="eea banner">
64
- <div className="gradient">
65
- <div className="ui container">
66
- <div className="content">
67
- <h1 className="documentFirstHeading">{title?.raw}</h1>
68
- </div>
69
- </div>
103
+ return item ? (
104
+ <div className="dataset-view">
105
+ <Portal node={document.getElementById('page-header')}>
106
+ <div className="eea banner">
107
+ <div className="gradient">
108
+ <div className="ui container">
109
+ <div className="content">
110
+ <h1 className="documentFirstHeading">Datahub</h1>
70
111
  </div>
71
112
  </div>
72
- </Portal>
73
- <Callout>{description?.raw}</Callout>
74
- <h3>Tabular data</h3>
75
- <Accordion exclusive={false}>
76
- <Accordion.Title
77
- active={activeIndex.includes(0)}
78
- index={0}
79
- onClick={toggleOpenAccordion}
80
- >
81
- Distribution files
82
- <Icon className="ri-arrow-down-s-line" />
83
- </Accordion.Title>
84
- <Accordion.Content active={activeIndex.includes(0)}>
85
- <p></p>
86
- </Accordion.Content>
113
+ </div>
114
+ </div>
115
+ </Portal>
87
116
 
88
- <Accordion.Title
89
- active={activeIndex.includes(1)}
90
- index={1}
91
- onClick={toggleOpenAccordion}
92
- >
93
- Programmatic access (APIs)
94
- <Icon className="ri-arrow-down-s-line" />
95
- </Accordion.Title>
96
- <Accordion.Content active={activeIndex.includes(1)}>
97
- <a
98
- href="https://discodata.eea.europa.eu/#!/"
99
- title="DiscoData REST API call"
100
- rel="noopener noreferrer"
101
- >
102
- DiscoData
103
- </a>
104
- (REST API)
105
- </Accordion.Content>
117
+ <div className="dataset-container">
118
+ {location?.state && (
119
+ <Link
120
+ className="search-link"
121
+ to={{
122
+ pathname: fromPathname,
123
+ search: fromSearch,
124
+ }}
125
+ >
126
+ <i class="ri-arrow-go-back-line"></i>
127
+ Back to search
128
+ </Link>
129
+ )}
130
+ <div className="dataset-header">
131
+ <h1>{title?.raw}</h1>
132
+ <div className="dataset-header-bottom">
133
+ <span className="header-data">Prod-ID: [No data]</span>
134
+ <span className="header-data">
135
+ Created: <DateTime format="DATE_MED" value={issued?.raw} />
136
+ </span>
137
+ <span className="header-data">Published: [No data]</span>
138
+ <span className="header-data">
139
+ Last modified: <DateTime format="DATE_MED" value={changeDate} />
140
+ </span>
141
+ {/*<span className="header-data">
142
+ Reading time: {readingTime?.raw}
143
+ </span>*/}
144
+ </div>
145
+ </div>
146
+ <Callout>{description?.raw}</Callout>
106
147
 
107
- <Accordion.Title
108
- active={activeIndex.includes(2)}
109
- index={2}
110
- onClick={toggleOpenAccordion}
111
- >
112
- Additional information
113
- <Icon className="ri-arrow-down-s-line" />
114
- </Accordion.Title>
115
- <Accordion.Content active={activeIndex.includes(2)}>
116
- {description?.raw}
117
- </Accordion.Content>
148
+ <Tab
149
+ menu={{ secondary: true, pointing: true }}
150
+ panes={panes}
151
+ className="dataset-tab-setion"
152
+ />
153
+ </div>
118
154
 
119
- <Accordion.Title
120
- active={activeIndex.includes(3)}
121
- index={3}
122
- onClick={toggleOpenAccordion}
123
- >
124
- Metadata
125
- <Icon className="ri-arrow-down-s-line" />
126
- </Accordion.Title>
127
- <Accordion.Content active={activeIndex.includes(3)}>
128
- Topics:
129
- <ul>
130
- {raw_value?.raw['allKeywords.th_eea-topics.keywords']?.map(
131
- (topic, i) => {
132
- return (
133
- <li key={i}>
134
- <a href={topic.link} target="_blank" rel="noreferrer">
135
- {topic.default}
136
- </a>
137
- </li>
138
- );
139
- },
140
- )}
141
- </ul>
142
- </Accordion.Content>
143
- </Accordion>
155
+ <div className="info-wrapper">
156
+ <div className="info-content">
157
+ <div className="info-title">More Information for {title?.raw}.</div>
158
+ <p>{description?.raw}</p>
159
+ </div>
160
+ </div>
144
161
 
145
- <h3>Geospatial data</h3>
162
+ {children && children.length > 0 && (
163
+ <div className="related-wrapper">
164
+ <h2>Related content</h2>
165
+ <Card.Group itemsPerRow={4}>
166
+ {children.map((item, index) => {
167
+ return (
168
+ <Card
169
+ href={`/datahub/view/${item.metadataIdentifier}`}
170
+ key={index}
171
+ >
172
+ <Image src={item.overview[0].url} wrapped ui={false} />
173
+ <Card.Content>
174
+ <Card.Description>
175
+ {item.resourceTitleObject.default}
176
+ </Card.Description>
177
+ </Card.Content>
178
+ </Card>
179
+ );
180
+ })}
181
+ </Card.Group>
182
+ </div>
183
+ )}
146
184
 
147
- <h3>Additional information</h3>
148
- <Accordion exclusive={false}>
149
- <Accordion.Title
150
- active={activeIndex.includes(4)}
151
- index={4}
152
- onClick={toggleOpenAccordion}
153
- >
154
- About this dataset
155
- <Icon className="ri-arrow-down-s-line" />
156
- </Accordion.Title>
157
- <Accordion.Content active={activeIndex.includes(4)}>
158
- {description?.raw}
159
- </Accordion.Content>
185
+ <div className="below-content-wrapper">
186
+ <Accordion exclusive={false}>
187
+ <Accordion.Title
188
+ active={activeIndex.includes(0)}
189
+ index={0}
190
+ onClick={toggleOpenAccordion}
191
+ >
192
+ Metadata
193
+ <Icon className="ri-arrow-down-s-line" />
194
+ </Accordion.Title>
195
+ <Accordion.Content active={activeIndex.includes(0)}>
196
+ {!!item?.rod && (
197
+ <div>
198
+ Reporting obligations (ROD):
199
+ <ul>
200
+ {Array.isArray(item.rod?.raw) ? (
201
+ <>
202
+ {item?.rod?.raw.map((item, i) => {
203
+ return <li key={i}>{item}</li>;
204
+ })}
205
+ </>
206
+ ) : (
207
+ <li>{item.rod?.raw}</li>
208
+ )}
209
+ </ul>
210
+ </div>
211
+ )}
160
212
 
161
- <Accordion.Title
162
- active={activeIndex.includes(5)}
163
- index={5}
164
- onClick={toggleOpenAccordion}
165
- >
166
- Contact information
167
- <Icon className="ri-arrow-down-s-line" />
168
- </Accordion.Title>
169
- <Accordion.Content active={activeIndex.includes(5)}>
170
- {contactForResource ? (
171
- <>
172
- {contactForResource.map((c, i) => {
173
- return (
174
- <Grid key={i}>
175
- <Grid.Column width={4}>
176
- <p>{c.role}: </p>
177
- </Grid.Column>
178
- <Grid.Column width={8}>
179
- <a
180
- href="https://www.eea.europa.eu/"
181
- target="_blank"
182
- rel="noreferrer"
183
- >
184
- <strong>{c.organisation}</strong>
185
- </a>
186
- <p>{c.address}</p>
187
- <a href={'mailto:' + c.email}>{c.email}</a>
188
- </Grid.Column>
189
- </Grid>
190
- );
191
- })}
192
- </>
193
- ) : (
194
- <>
195
- {contact &&
196
- contact.length > 0 &&
197
- contact.map((c, i) => {
198
- return (
199
- <Grid key={i}>
200
- <Grid.Column width={4}>
201
- {/*<p>{contact.role}: </p>*/}
202
- <p>Point of contact:</p>
203
- </Grid.Column>
204
- <Grid.Column width={8}>
205
- <a
206
- href="https://www.eea.europa.eu/"
207
- target="_blank"
208
- rel="noreferrer"
209
- >
210
- <strong>{c.organisation}</strong>
211
- </a>
212
- <p>{c.address}</p>
213
- <a href={'mailto:' + c.email}>{c.email}</a>
214
- </Grid.Column>
215
- </Grid>
216
- );
213
+ {!!item?.organisation && (
214
+ <div>
215
+ Organisation:
216
+ <ul>
217
+ {Array.isArray(item?.organisation?.raw) ? (
218
+ <>
219
+ {item?.organisation?.raw.map((item, i) => {
220
+ return <li key={i}>{item}</li>;
221
+ })}
222
+ </>
223
+ ) : (
224
+ <li>{item?.organisation?.raw}</li>
225
+ )}
226
+ </ul>
227
+ </div>
228
+ )}
229
+ </Accordion.Content>
230
+
231
+ <Accordion.Title
232
+ active={activeIndex.includes(1)}
233
+ index={1}
234
+ onClick={toggleOpenAccordion}
235
+ >
236
+ Permalinks
237
+ <Icon className="ri-arrow-down-s-line" />
238
+ </Accordion.Title>
239
+ <Accordion.Content active={activeIndex.includes(1)}>
240
+ [No data]
241
+ </Accordion.Content>
242
+
243
+ <Accordion.Title
244
+ active={activeIndex.includes(2)}
245
+ index={2}
246
+ onClick={toggleOpenAccordion}
247
+ >
248
+ Geographic coverage
249
+ <Icon className="ri-arrow-down-s-line" />
250
+ </Accordion.Title>
251
+ <Accordion.Content active={activeIndex.includes(2)}>
252
+ {item.spatial && (
253
+ <div className="geotags">
254
+ {Array.isArray(item?.spatial?.raw) ? (
255
+ <>
256
+ {item?.spatial?.raw.map((item, i) => {
257
+ return <span key={i}>{item}</span>;
217
258
  })}
218
- </>
219
- )}
220
- </Accordion.Content>
221
- </Accordion>
259
+ </>
260
+ ) : (
261
+ <span>{item?.spatial?.raw}</span>
262
+ )}
263
+ </div>
264
+ )}
265
+ </Accordion.Content>
222
266
 
223
- <h3>Related datasets</h3>
224
- {children && children.length > 0 && (
225
- <Card.Group itemsPerRow={3}>
226
- {children.map((item, index) => {
267
+ <Accordion.Title
268
+ active={activeIndex.includes(3)}
269
+ index={3}
270
+ onClick={toggleOpenAccordion}
271
+ >
272
+ Temporal coverage
273
+ <Icon className="ri-arrow-down-s-line" />
274
+ </Accordion.Title>
275
+ <Accordion.Content active={activeIndex.includes(3)}>
276
+ {/*<ul>
277
+ {resourceTemporalDateRange?.map((temp, i) => {
227
278
  return (
228
- <Card
229
- href={`/datahub/view/${item.metadataIdentifier}`}
230
- key={index}
231
- >
232
- <Image src={item.overview[0].url} wrapped ui={false} />
233
- <Card.Content>
234
- <Card.Header>
235
- {item.resourceTitleObject.default}
236
- </Card.Header>
237
- </Card.Content>
238
- </Card>
279
+ <li key={i}>
280
+ <DateTime format="DATE_MED" value={temp.gte} /> -
281
+ <DateTime format="DATE_MED" value={temp.lte} />
282
+ </li>
239
283
  );
240
284
  })}
241
- </Card.Group>
242
- )}
285
+ </ul>*/}
286
+ {time_coverage?.raw.length > 0 && (
287
+ <div className="temporal-coverage">
288
+ <div className="side-temp">{`${startTempCoverage - 1}`}</div>
289
+ <div className="time-range">
290
+ <span>{startTempCoverage}</span> -
291
+ <span>{endTempCoverage}</span>
292
+ </div>
293
+ <div className="side-temp">{`${endTempCoverage + 1}`}</div>
294
+ </div>
295
+ )}
296
+ </Accordion.Content>
243
297
 
244
- <p>
245
- Source: SDI record{' '}
246
- <a
247
- href={
248
- 'https://galliwasp.eea.europa.eu/catalogue/srv/eng/catalog.search#/metadata/' +
249
- id
250
- }
251
- >
252
- {id}
253
- </a>
254
- </p>
255
- </div>
256
- ) : (
257
- ''
258
- )}
259
- </>
260
- );
298
+ <Accordion.Title
299
+ active={activeIndex.includes(4)}
300
+ index={4}
301
+ onClick={toggleOpenAccordion}
302
+ >
303
+ Topics
304
+ <Icon className="ri-arrow-down-s-line" />
305
+ </Accordion.Title>
306
+ <Accordion.Content active={activeIndex.includes(4)}>
307
+ {item.topic && (
308
+ <>
309
+ {Array.isArray(item?.topic?.raw) ? (
310
+ <>
311
+ {item?.topic?.raw.map((item, i) => {
312
+ return (
313
+ <span className="tag-item" key={i}>
314
+ {item}
315
+ </span>
316
+ );
317
+ })}
318
+ </>
319
+ ) : (
320
+ <span className="tag-item">{item?.topic?.raw}</span>
321
+ )}
322
+ </>
323
+ )}
324
+ </Accordion.Content>
325
+
326
+ <Accordion.Title
327
+ active={activeIndex.includes(5)}
328
+ index={5}
329
+ onClick={toggleOpenAccordion}
330
+ >
331
+ Tags
332
+ <Icon className="ri-arrow-down-s-line" />
333
+ </Accordion.Title>
334
+ <Accordion.Content active={activeIndex.includes(5)}>
335
+ <div className="dataset-tags">
336
+ {raw_value?.raw['allKeywords.th_EEAkeywordlist.keywords']?.map(
337
+ (tag, i) => {
338
+ return (
339
+ <span className="tag-item" key={i}>
340
+ {tag.default}
341
+ </span>
342
+ );
343
+ },
344
+ )}
345
+ </div>
346
+ </Accordion.Content>
347
+ </Accordion>
348
+ </div>
349
+ </div>
350
+ ) : null;
261
351
  }
262
352
 
263
353
  function DatahubItemView(props) {
354
+ const location = useLocation();
264
355
  const [isClient, setIsClient] = React.useState();
265
356
  React.useEffect(() => setIsClient(true), []);
266
357
 
@@ -293,7 +384,7 @@ function DatahubItemView(props) {
293
384
  return (
294
385
  <AppConfigContext.Provider value={appConfigContext}>
295
386
  <SearchContext.Provider value={params}>
296
- <ItemView docid={docid} />
387
+ <ItemView docid={docid} location={location} />
297
388
  </SearchContext.Provider>
298
389
  </AppConfigContext.Provider>
299
390
  );
@@ -1,34 +1,46 @@
1
1
  import React from 'react';
2
2
  import cx from 'classnames';
3
- import { Label, Button, Dropdown } from 'semantic-ui-react';
3
+ import {
4
+ Label,
5
+ // Button,
6
+ // Dropdown
7
+ } from 'semantic-ui-react';
8
+ import { DateTime as FormattedDate, StringList } from '@eeacms/search';
9
+ import { DateTime } from 'luxon';
4
10
  // import { useAppConfig, useWindowDimensions } from '@eeacms/search/lib/hocs';
5
11
  // import { TagsList } from '@eeacms/search/components'; // SegmentedBreadcrumb,
6
12
  // import { firstWords, getTermDisplayValue } from '@eeacms/search/lib/utils';
7
-
8
13
  // import MoreLikeThisTrigger from '@eeacms/search/components/Result/MoreLikeThisTrigger';
9
14
  // import ExternalLink from '@eeacms/search/components/Result/ExternalLink';
10
15
  // import ResultContext from '@eeacms/search/components/Result/ResultContext';
11
16
  // import ContentClusters from '@eeacms/search/components/Result/ContentClusters';
12
17
  import {
13
18
  useAppConfig,
14
- useWindowDimensions,
15
- ContentClusters,
16
- MoreLikeThisTrigger,
17
- TagsList,
18
- // ExternalLink,
19
19
  ResultContext,
20
20
  firstWords,
21
- getTermDisplayValue,
21
+ // ContentClusters,
22
+ // useWindowDimensions,
23
+ // MoreLikeThisTrigger,
24
+ // TagsList,
25
+ // ExternalLink,
26
+ // getTermDisplayValue,
22
27
  } from '@eeacms/search';
23
28
  import { Link } from 'react-router-dom';
24
29
 
25
30
  const DatahubCardItem = (props) => {
26
- const { result, showControls = true } = props;
31
+ const {
32
+ result,
33
+ // showControls = true
34
+ } = props;
27
35
  const { appConfig } = useAppConfig();
28
- const { vocab = {}, debugQuery } = appConfig;
36
+ const {
37
+ // vocab = {},
38
+ debugQuery,
39
+ } = appConfig;
40
+ const { topic } = result._result || [];
29
41
  const [hovered, setHovered] = React.useState(false);
30
42
 
31
- // console.log('result', result.metaTypes, result._result);
43
+ // const { pathname, search } = useLocation();
32
44
 
33
45
  let metaType = result.metaTypes || '';
34
46
  if (metaType.length === 0) {
@@ -36,30 +48,44 @@ const DatahubCardItem = (props) => {
36
48
  }
37
49
 
38
50
  const classColLeft = result.hasImage ? 'col-left' : 'col-left no-image';
39
-
40
- const { width } = useWindowDimensions();
41
- const isSmallScreen = width < 1000;
42
- const clusters = result.clusterInfo;
43
51
  const [resultId] = (result.href || '').split('/').reverse();
44
52
 
53
+ // const { width } = useWindowDimensions();
54
+ // const isSmallScreen = width < 1000;
55
+ // const clusters = result.clusterInfo;
56
+ // console.log('result', result.metaTypes, result._result);
57
+
45
58
  return (
46
59
  <div
47
60
  className={cx('search-result', { hovered })}
48
61
  onMouseEnter={() => setHovered(true)}
49
62
  onMouseLeave={() => setHovered(false)}
50
63
  >
51
- <div className="col-full">
64
+ {/*<div className="col-full">
52
65
  <div className="meta">
53
66
  <ContentClusters clusters={clusters} item={result} />
54
67
  <div className="tags-list">
55
68
  <TagsList value={result.tags} />
56
69
  </div>
57
70
  </div>
58
- </div>
71
+ </div>*/}
59
72
  <div className={classColLeft}>
60
73
  <div className="details">
74
+ <div className="result-info">
75
+ <span className="result-info-title">Author: </span>
76
+ [EEA]
77
+ </div>
61
78
  <h3>
62
- <Link to={`/datahub/view/${resultId}`} title={result.title}>
79
+ <Link
80
+ to={{
81
+ pathname: `/en/datahub/datahubitem-view/${resultId}`,
82
+ state: {
83
+ fromPathname: window.location.pathname,
84
+ fromSearch: window.location.search,
85
+ },
86
+ }}
87
+ title={result.title}
88
+ >
63
89
  {firstWords(result.title, 12)}
64
90
  </Link>
65
91
  {result.isNew && (
@@ -73,7 +99,13 @@ const DatahubCardItem = (props) => {
73
99
  </Label>
74
100
  )}
75
101
  </h3>
76
- <div className="source">
102
+ {/* <SegmentedBreadcrumb */}
103
+ {/* href={result.href} */}
104
+ {/* short={true} */}
105
+ {/* maxChars={40} */}
106
+ {/* /> */}
107
+
108
+ {/*<div className="source">
77
109
  <span>Source: </span>
78
110
  <Link to={`/datahub/view/${resultId}`} title={result.title}>
79
111
  <strong title={result.source} className="source">
@@ -86,11 +118,6 @@ const DatahubCardItem = (props) => {
86
118
  8,
87
119
  )}
88
120
  </strong>
89
- {/* <SegmentedBreadcrumb */}
90
- {/* href={result.href} */}
91
- {/* short={true} */}
92
- {/* maxChars={40} */}
93
- {/* /> */}
94
121
  </Link>
95
122
 
96
123
  {showControls && !isSmallScreen && (
@@ -114,9 +141,31 @@ const DatahubCardItem = (props) => {
114
141
  </Dropdown.Menu>
115
142
  </Dropdown>
116
143
  )}
117
- </div>
144
+ </div>*/}
118
145
 
119
146
  {props.children ? props.children : <ResultContext {...props} />}
147
+
148
+ <div className="result-bottom">
149
+ {topic ? (
150
+ <div className="result-info">
151
+ <span className="result-info-title">Topic: </span>
152
+ <StringList value={topic.raw} />
153
+ </div>
154
+ ) : null}
155
+ <div className="result-info">
156
+ <span className="result-info-title">Last modified: </span>
157
+ <FormattedDate
158
+ format="DATE_MED"
159
+ value={DateTime.fromISO(
160
+ result?._result.raw_value.raw.changeDate,
161
+ )}
162
+ />
163
+ </div>
164
+ <div className="result-info">
165
+ <span className="result-info-title">Available formats: </span>
166
+ [Icons]
167
+ </div>
168
+ </div>
120
169
  </div>
121
170
  {debugQuery && (
122
171
  <div>
@@ -1,70 +1,50 @@
1
1
  import { multiTermFacet, fixedRangeFacet } from '@eeacms/search';
2
- import {
3
- // booleanFacet,
4
- // histogramFacet,
5
- // makeRange,
6
- dateRangeFacet,
7
- } from '@eeacms/search';
2
+ import { dateRangeFacet } from '@eeacms/search';
8
3
 
9
- // import { getTodayWithTime } from '@eeacms/globalsearch/utils';
10
4
  const facets = [
11
5
  multiTermFacet({
12
6
  field: 'rod',
13
7
  isFilterable: true,
14
8
  isMulti: true,
15
9
  label: 'Reporting obligations',
16
- factory: 'MultiTermListFacet',
17
- wrapper: 'ModalFacetWrapper',
18
10
  show: 10000,
19
11
  showAllOptions: true, // show all options (even if 0) in modal facet
20
- // factory: 'sui.Facet',
21
12
  }),
22
13
  multiTermFacet({
23
14
  field: 'topic',
24
15
  isFilterable: true,
25
16
  isMulti: true,
26
17
  label: 'EEA topics',
27
- factory: 'MultiTermListFacet',
28
- wrapper: 'ModalFacetWrapper',
29
18
  show: 10000,
30
19
  showAllOptions: true, // show all options (even if 0) in modal facet
31
- // factory: 'sui.Facet',
20
+ alwaysVisible: true,
32
21
  }),
33
22
  multiTermFacet({
34
23
  field: 'gemet',
35
24
  isFilterable: true,
36
25
  isMulti: true,
37
26
  label: 'GEMET keywords',
38
- factory: 'MultiTermListFacet',
39
- wrapper: 'ModalFacetWrapper',
40
27
  show: 10000,
41
28
  showAllOptions: true, // show all options (even if 0) in modal facet
42
- // factory: 'sui.Facet',
43
29
  }),
44
30
  multiTermFacet({
45
31
  field: 'organisation',
46
32
  isFilterable: true,
47
33
  isMulti: true,
48
34
  label: 'Organisations',
49
- factory: 'MultiTermListFacet',
50
- wrapper: 'ModalFacetWrapper',
51
35
  show: 10000,
52
36
  showAllOptions: true, // show all options (even if 0) in modal facet
53
- // factory: 'sui.Facet',
54
37
  }),
55
38
  multiTermFacet({
56
39
  field: 'spatialRepresentationType',
57
40
  isFilterable: true,
58
41
  isMulti: true,
59
42
  label: 'Spatial Representation Type',
60
- factory: 'MultiTermListFacet',
61
- wrapper: 'ModalFacetWrapper',
62
43
  show: 10000,
63
44
  showAllOptions: true, // show all options (even if 0) in modal facet
64
- // factory: 'sui.Facet',
65
45
  }),
66
46
  fixedRangeFacet({
67
- wrapper: 'ModalFacetWrapper',
47
+ // wrapper: 'ModalFacetWrapper',
68
48
  field: 'resolutionScaleDenominator',
69
49
  label: 'Scales',
70
50
  rangeType: 'fixed',
@@ -76,212 +56,16 @@ const facets = [
76
56
  { from: 10000000, to: 99999999999, key: '10,000,000-*' },
77
57
  // { to: -0.0001, key: 'Unknown' },
78
58
  ],
79
- factory: 'ModalFixedRangeFacet',
80
- // default: {
81
- // values: [{ name: 'All', rangeType: 'fixed' }],
82
- // type: 'any',
83
- // },
59
+ factory: 'FixedRangeFacet',
84
60
  }),
85
- ////////////////////
86
- // booleanFacet(() => ({
87
- // field: 'IncludeArchived',
88
- // label: 'Include archived content',
89
- // id: 'archived-facet',
90
- // showInFacetsList: false,
91
- // showInSecondaryFacetsList: true,
92
- // isFilter: true, // filters don't need facet options to show up
93
-
94
- // // we want this to be applied by default
95
- // // when the facet is checked, then apply the `on` key:
96
- // off: {
97
- // constant_score: {
98
- // filter: {
99
- // bool: {
100
- // should: [
101
- // { bool: { must_not: { exists: { field: 'expires' } } } },
102
- // // Functions should be supported in the buildFilters
103
- // { range: { expires: { gte: getTodayWithTime() } } },
104
- // ],
105
- // },
106
- // },
107
- // },
108
- // },
109
- // on: null,
110
- // })),
111
- // multiTermFacet({
112
- // field: 'moreLikeThis',
113
- // isFilterable: true,
114
- // isMulti: false,
115
- // label: 'More like this',
116
- // showInFacetsList: false,
117
- // filterListComponent: 'MoreLikeThisEntry',
118
- // factory: 'MoreLikeThis',
119
- // condition: 'like',
120
- // queryParams: {
121
- // fields: ['title', 'text'],
122
- // min_term_freq: 1,
123
- // max_query_terms: 12,
124
- // },
125
-
126
- // // registryConfig: 'MoreLikeThis',
127
- // }),
128
- // multiTermFacet({
129
- // field: 'topic',
130
- // isFilterable: true,
131
- // isMulti: true,
132
- // label: 'Topics',
133
- // //blacklist: topicsBlacklist,
134
- // factory: 'MultiTermListFacet',
135
- // wrapper: 'ModalFacetWrapper',
136
- // show: 10000,
137
- // showAllOptions: true, // show all options (even if 0) in modal facet
138
- // // factory: 'sui.Facet',
139
- // }),
140
- // multiTermFacet({
141
- // field: 'spatial',
142
- // isFilterable: true,
143
- // isMulti: true,
144
- // label: 'Countries',
145
- // //whitelist: spatialWhitelist,
146
- // wrapper: 'ModalFacetWrapper',
147
- // show: 10000,
148
- // factory: 'MultiTermListFacet',
149
- // iconsFamily: 'Countries',
150
- // enableExact: true,
151
- // sortOn: 'value',
152
- // }),
153
61
  multiTermFacet({
154
62
  field: 'op_cluster',
155
63
  isFilterable: true,
156
64
  isMulti: true,
157
65
  label: 'Section',
158
- wrapper: 'ModalFacetWrapper',
159
66
  show: 10000,
160
- factory: 'MultiTermListFacet',
161
67
  showInFacetsList: false,
162
68
  }),
163
-
164
- // multiTermFacet({
165
- // field: 'places',
166
- // isFilterable: true,
167
- // isMulti: true,
168
- // label: 'Regions/Places/Cities/Seas...',
169
- // //blacklist: placesBlacklist,
170
- // wrapper: 'ModalFacetWrapper',
171
- // show: 10000,
172
- // factory: 'MultiTermListFacet',
173
- // showAllOptions: true, // show all options (even if 0) in modal facet
174
- // }),
175
- // multiTermFacet({
176
- // field: 'objectProvides',
177
- // isFilterable: false,
178
- // isMulti: true,
179
- // label: 'Content types',
180
- // iconsFamily: 'Content types',
181
- // //whitelist: objectProvidesWhitelist,
182
- // wrapper: 'ModalFacetWrapper',
183
- // factory: 'MultiTermListFacet',
184
- // optionsFilter: 'typesForClustersOptionsFilter',
185
- // }),
186
- multiTermFacet({
187
- field: 'cluster_name',
188
- isFilterable: false,
189
- isMulti: true,
190
- showInFacetsList: false,
191
- label: 'Sources',
192
- wrapper: 'ModalFacetWrapper',
193
- factory: 'MultiTermListFacet',
194
- iconsFamily: 'Sources',
195
- }),
196
- // histogramFacet({
197
- // wrapper: 'ModalFacetWrapper',
198
- // field: 'year',
199
- // // isFilterable: false,
200
- // isMulti: true,
201
- // label: 'Publishing year',
202
- // // TODO: implement split in buckets
203
- // ranges: makeRange({
204
- // step: 1,
205
- // normalRange: [1994, 2022],
206
- // includeOutlierStart: false,
207
- // includeOutlierEnd: false,
208
- // }),
209
- // step: 10,
210
- // // [
211
- // // {
212
- // // to: 1900,
213
- // // },
214
- // // {
215
- // // key: '2001-2010',
216
- // // from: 2001,
217
- // // to: 2010,
218
- // // },
219
- // // {
220
- // // from: 2011,
221
- // // },
222
- // // ]
223
- // // min_max_script:
224
- // //
225
- // //"def vals = doc['year']; if (vals.length == 0){return 2000} else {def ret = [];for (val in vals){def tmp_val = val.substring(0,4);ret.add(tmp_val.toLowerCase() == tmp_val.toUpperCase() ? Integer.parseInt(tmp_val) : 2000);}return ret;}",
226
-
227
- // aggs_script:
228
- // "def vals = doc['year']; if (vals.length == 0){return 2500} else {def ret = [];for (val in vals){def tmp_val = val.substring(0,4);ret.add(tmp_val.toLowerCase() == tmp_val.toUpperCase() ? Integer.parseInt(tmp_val) : 2500);}return ret;}",
229
- // }),
230
-
231
- // histogramFacet({
232
- // wrapper: 'ModalFacetWrapper',
233
- // field: 'time_coverage',
234
- // // isFilterable: false,
235
- // isMulti: true,
236
- // label: 'Time coverage',
237
- // // TODO: implement split in buckets
238
- // ranges: makeRange({
239
- // step: 10,
240
- // normalRange: [1700, 2210],
241
- // includeOutlierStart: false,
242
- // includeOutlierEnd: false,
243
- // }),
244
- // step: 10,
245
- // // [
246
- // // {
247
- // // to: 1900,
248
- // // },
249
- // // {
250
- // // key: '2001-2010',
251
- // // from: 2001,
252
- // // to: 2010,
253
- // // },
254
- // // {
255
- // // from: 2011,
256
- // // },
257
- // // ]
258
- // // min_max_script:
259
- // //
260
- // //"def vals = doc['year']; if (vals.length == 0){return 2000} else {def ret = [];for (val in vals){def tmp_val = val.substring(0,4);ret.add(tmp_val.toLowerCase() == tmp_val.toUpperCase() ? Integer.parseInt(tmp_val) : 2000);}return ret;}",
261
-
262
- // aggs_script:
263
- // "def vals = doc['time_coverage']; if (vals.length == 0){return 2500} else {def ret = [];for (val in vals){def tmp_val = val.substring(0,4);ret.add(tmp_val.toLowerCase() == tmp_val.toUpperCase() ? Integer.parseInt(tmp_val) : 2500);}return ret;}",
264
- // }),
265
-
266
- // fixedRangeFacet({
267
- // wrapper: 'ModalFacetWrapper',
268
- // field: 'readingTime',
269
- // label: 'Reading time (minutes)',
270
- // rangeType: 'fixed',
271
- // isMulti: true,
272
- // ranges: [
273
- // { key: 'All' },
274
- // { from: 0, to: 4.99999, key: 'Short (<5 minutes)' },
275
- // { from: 5, to: 24.9999, key: 'Medium (5-25 minutes)' },
276
- // { from: 25, to: 10000, key: 'Large (25+ minutes)' },
277
- // // { to: -0.0001, key: 'Unknown' },
278
- // ],
279
- // factory: 'ModalFixedRangeFacet',
280
- // default: {
281
- // values: [{ name: 'All', rangeType: 'fixed' }],
282
- // type: 'any',
283
- // },
284
- // }),
285
69
  dateRangeFacet({
286
70
  field: 'issued.date',
287
71
  label: ' ',
@@ -304,67 +88,195 @@ const facets = [
304
88
  type: 'any',
305
89
  },
306
90
  }),
307
- // multiTermFacet({
308
- // wrapper: 'ModalFacetWrapper',
309
- // field: 'language',
310
- // isFilterable: false,
311
- // isMulti: true,
312
- // label: 'Language',
313
- // default: {
314
- // values: ['en'],
315
- // type: 'any',
316
- // },
317
- // factory: 'MultiTermListFacet',
318
- // facetValues: [
319
- // 'ar',
320
- // 'sr',
321
- // 'sq',
322
- // 'bg',
323
- // 'bs',
324
- // 'cs',
325
- // 'hr',
326
- // 'da',
327
- // 'nl',
328
- // 'el',
329
- // 'en',
330
- // 'et',
331
- // 'fi',
332
- // 'fr',
333
- // 'ga',
334
- // 'de',
335
- // 'hu',
336
- // 'is',
337
- // 'it',
338
- // 'lv',
339
- // 'lt',
340
- // 'mk',
341
- // 'mt',
342
- // 'no',
343
- // 'pl',
344
- // 'pt',
345
- // 'ro',
346
- // 'ru',
347
- // 'sh',
348
- // 'sk',
349
- // 'sl',
350
- // 'es',
351
- // 'sv',
352
- // 'tr',
353
- // ],
354
- // sortOn: 'custom',
355
- // sortOnCustomLabel: 'Alphabetical',
356
- // }),
91
+ multiTermFacet({
92
+ field: 'cluster_name',
93
+ isFilterable: false,
94
+ isMulti: true,
95
+ showInFacetsList: false,
96
+ label: 'Sources',
97
+ iconsFamily: 'Sources',
98
+ }),
357
99
  ];
358
100
 
359
101
  export default {
360
102
  facets,
361
103
  };
362
104
 
363
- // default filter values
364
- // TODO: this needs to be removed and the configuration plugged into each of
365
- // the facets
366
- // readingTime: {
367
- // value: { name: 'All', rangeType: 'fixed' },
105
+ // wrapper: 'ModalFacetWrapper',
106
+ // factory: 'MultiTermListFacet',
107
+ // histogramFacet({
108
+ // wrapper: 'ModalFacetWrapper',
109
+ // field: 'year',
110
+ // // isFilterable: false,
111
+ // isMulti: true,
112
+ // label: 'Publishing year',
113
+ // // TODO: implement split in buckets
114
+ // ranges: makeRange({
115
+ // step: 1,
116
+ // normalRange: [1994, 2022],
117
+ // includeOutlierStart: false,
118
+ // includeOutlierEnd: false,
119
+ // }),
120
+ // step: 10,
121
+ // // [
122
+ // // {
123
+ // // to: 1900,
124
+ // // },
125
+ // // {
126
+ // // key: '2001-2010',
127
+ // // from: 2001,
128
+ // // to: 2010,
129
+ // // },
130
+ // // {
131
+ // // from: 2011,
132
+ // // },
133
+ // // ]
134
+ // // min_max_script:
135
+ // //
136
+ // //"def vals = doc['year']; if (vals.length == 0){return 2000} else {def ret = [];for (val in vals){def tmp_val = val.substring(0,4);ret.add(tmp_val.toLowerCase() == tmp_val.toUpperCase() ? Integer.parseInt(tmp_val) : 2000);}return ret;}",
137
+
138
+ // aggs_script:
139
+ // "def vals = doc['year']; if (vals.length == 0){return 2500} else {def ret = [];for (val in vals){def tmp_val = val.substring(0,4);ret.add(tmp_val.toLowerCase() == tmp_val.toUpperCase() ? Integer.parseInt(tmp_val) : 2500);}return ret;}",
140
+ // }),
141
+
142
+ // histogramFacet({
143
+ // wrapper: 'ModalFacetWrapper',
144
+ // field: 'time_coverage',
145
+ // // isFilterable: false,
146
+ // isMulti: true,
147
+ // label: 'Time coverage',
148
+ // // TODO: implement split in buckets
149
+ // ranges: makeRange({
150
+ // step: 10,
151
+ // normalRange: [1700, 2210],
152
+ // includeOutlierStart: false,
153
+ // includeOutlierEnd: false,
154
+ // }),
155
+ // step: 10,
156
+ // // [
157
+ // // {
158
+ // // to: 1900,
159
+ // // },
160
+ // // {
161
+ // // key: '2001-2010',
162
+ // // from: 2001,
163
+ // // to: 2010,
164
+ // // },
165
+ // // {
166
+ // // from: 2011,
167
+ // // },
168
+ // // ]
169
+ // // min_max_script:
170
+ // //
171
+ // //"def vals = doc['year']; if (vals.length == 0){return 2000} else {def ret = [];for (val in vals){def tmp_val = val.substring(0,4);ret.add(tmp_val.toLowerCase() == tmp_val.toUpperCase() ? Integer.parseInt(tmp_val) : 2000);}return ret;}",
172
+
173
+ // aggs_script:
174
+ // "def vals = doc['time_coverage']; if (vals.length == 0){return 2500} else {def ret = [];for (val in vals){def tmp_val = val.substring(0,4);ret.add(tmp_val.toLowerCase() == tmp_val.toUpperCase() ? Integer.parseInt(tmp_val) : 2500);}return ret;}",
175
+ // }),
176
+
177
+ // fixedRangeFacet({
178
+ // wrapper: 'ModalFacetWrapper',
179
+ // field: 'readingTime',
180
+ // label: 'Reading time (minutes)',
181
+ // rangeType: 'fixed',
182
+ // isMulti: true,
183
+ // ranges: [
184
+ // { key: 'All' },
185
+ // { from: 0, to: 4.99999, key: 'Short (<5 minutes)' },
186
+ // { from: 5, to: 24.9999, key: 'Medium (5-25 minutes)' },
187
+ // { from: 25, to: 10000, key: 'Large (25+ minutes)' },
188
+ // // { to: -0.0001, key: 'Unknown' },
189
+ // ],
190
+ // factory: 'ModalFixedRangeFacet',
191
+ // default: {
192
+ // values: [{ name: 'All', rangeType: 'fixed' }],
193
+ // type: 'any',
194
+ // },
195
+ // }),
196
+ ////////////////////
197
+ // booleanFacet(() => ({
198
+ // field: 'IncludeArchived',
199
+ // label: 'Include archived content',
200
+ // id: 'archived-facet',
201
+ // showInFacetsList: false,
202
+ // showInSecondaryFacetsList: true,
203
+ // isFilter: true, // filters don't need facet options to show up
204
+
205
+ // // we want this to be applied by default
206
+ // // when the facet is checked, then apply the `on` key:
207
+ // off: {
208
+ // constant_score: {
209
+ // filter: {
210
+ // bool: {
211
+ // should: [
212
+ // { bool: { must_not: { exists: { field: 'expires' } } } },
213
+ // // Functions should be supported in the buildFilters
214
+ // { range: { expires: { gte: getTodayWithTime() } } },
215
+ // ],
216
+ // },
217
+ // },
218
+ // },
219
+ // },
220
+ // on: null,
221
+ // })),
222
+ // multiTermFacet({
223
+ // field: 'moreLikeThis',
224
+ // isFilterable: true,
225
+ // isMulti: false,
226
+ // label: 'More like this',
227
+ // showInFacetsList: false,
228
+ // filterListComponent: 'MoreLikeThisEntry',
229
+ // factory: 'MoreLikeThis',
230
+ // condition: 'like',
231
+ // queryParams: {
232
+ // fields: ['title', 'text'],
233
+ // min_term_freq: 1,
234
+ // max_query_terms: 12,
235
+ // },
236
+
237
+ // // registryConfig: 'MoreLikeThis',
238
+ // }),
239
+ // multiTermFacet({
240
+ // field: 'topic',
241
+ // isFilterable: true,
242
+ // isMulti: true,
243
+ // label: 'Topics',
244
+ // //blacklist: topicsBlacklist,
245
+ // factory: 'MultiTermListFacet',
246
+ // wrapper: 'ModalFacetWrapper',
247
+ // show: 10000,
248
+ // showAllOptions: true, // show all options (even if 0) in modal facet
249
+ // // factory: 'sui.Facet',
250
+ // }),
251
+ // multiTermFacet({
252
+ // field: 'spatial',
253
+ // isFilterable: true,
254
+ // isMulti: true,
255
+ // label: 'Countries',
256
+ // //whitelist: spatialWhitelist,
257
+ // wrapper: 'ModalFacetWrapper',
258
+ // show: 10000,
259
+ // factory: 'MultiTermListFacet',
260
+ // iconsFamily: 'Countries',
261
+ // enableExact: true,
262
+ // sortOn: 'value',
263
+ // }),
264
+ // factory: 'MultiTermListFacet',
265
+ // wrapper: 'ModalFacetWrapper',
266
+ // factory: 'sui.Facet',
267
+ // factory: 'MultiTermListFacet',
268
+ // wrapper: 'ModalFacetWrapper',
269
+ // factory: 'sui.Facet',
270
+ // factory: 'MultiTermListFacet',
271
+ // wrapper: 'ModalFacetWrapper',
272
+ // factory: 'sui.Facet',
273
+ // factory: 'MultiTermListFacet',
274
+ // wrapper: 'ModalFacetWrapper',
275
+ // factory: 'sui.Facet',
276
+ // factory: 'ModalFixedRangeFacet',
277
+ // default: {
278
+ // values: [{ name: 'All', rangeType: 'fixed' }],
368
279
  // type: 'any',
369
280
  // },
370
- // },
281
+ // wrapper: 'ModalFacetWrapper',
282
+ // factory: 'MultiTermListFacet',
package/src/index.js CHANGED
@@ -30,10 +30,10 @@ const applyConfig = (config) => {
30
30
  datahub.requestBodyModifiers.push(tweakForNLPService);
31
31
  // datahub.resultViews[0].factories.item = "DatahubListingViewItem"
32
32
 
33
- config.settings.nonContentRoutes.push(/\/datahub\/view\/(.*)/);
33
+ config.settings.nonContentRoutes.push(/datahubitem-view\/(.*)/); // \/(.*)\/
34
34
  config.addonRoutes = [
35
35
  {
36
- path: '/datahub/view/:id',
36
+ path: '*/datahubitem-view/:id',
37
37
  component: DatahubItemView,
38
38
  },
39
39