@eeacms/volto-globalsearch 1.0.22 → 1.1.0
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 +9 -0
- package/README.md +37 -0
- package/package.json +1 -1
- package/src/config/facets.js +53 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,15 @@ 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.1.0](https://github.com/eea/volto-globalsearch/compare/1.0.22...1.1.0) - 16 January 2024
|
|
8
|
+
|
|
9
|
+
#### :hammer_and_wrench: Others
|
|
10
|
+
|
|
11
|
+
- Release 1.1.0 [Alin Voinea - [`822ac10`](https://github.com/eea/volto-globalsearch/commit/822ac1049228c132637fd019f233ae7bc63ff9a8)]
|
|
12
|
+
- updated facets [Zoltan Szabo - [`7206aed`](https://github.com/eea/volto-globalsearch/commit/7206aed30bf3a178c4660a4a280821bee5e4a19b)]
|
|
13
|
+
- added facet for publisher [Zoltan Szabo - [`68dc66a`](https://github.com/eea/volto-globalsearch/commit/68dc66a612286a7767bbed289e1743aac23adc4e)]
|
|
14
|
+
- updated default facets config [Zoltan Szabo - [`adbd434`](https://github.com/eea/volto-globalsearch/commit/adbd434c6baedaf98cd3145e75e368c92101758d)]
|
|
15
|
+
- added new facets [Zoltan Szabo - [`acc6ba8`](https://github.com/eea/volto-globalsearch/commit/acc6ba8e4ee8c911343ac129f4ae3fcc99355ff7)]
|
|
7
16
|
### [1.0.22](https://github.com/eea/volto-globalsearch/compare/1.0.21...1.0.22) - 12 December 2023
|
|
8
17
|
|
|
9
18
|
#### :house: Internal changes
|
package/README.md
CHANGED
|
@@ -76,6 +76,43 @@ Go to http://localhost:3000
|
|
|
76
76
|
|
|
77
77
|
1. Happy editing!
|
|
78
78
|
|
|
79
|
+
# Customizing the volto-searchblock
|
|
80
|
+
|
|
81
|
+
## Modifying Clusters
|
|
82
|
+
|
|
83
|
+
To customize the behavior of the `volto-searchblock` in your volto theme addon, you can modify clusters by following these steps:
|
|
84
|
+
|
|
85
|
+
1. Find or create `index.js` in the `src/config`
|
|
86
|
+
|
|
87
|
+
In your theme addon, create the `src/config/index.js` file. You can refer to the [example file](https://github.com/eea/volto-marine-theme/blob/eea-design/src/config/index.js) in the `volto-marine-theme` repository.
|
|
88
|
+
|
|
89
|
+
2. Locate and Modify Clusters
|
|
90
|
+
|
|
91
|
+
Clusters are found in `config.searchui.<name_of_search>.runtime_mappings`. For example, in the case of the `volto-marine-theme`, the `<name_of_search>` was `marinemeasure`, and clusters are located in `config.searchui.marinemeasure.runtime_mappings`.
|
|
92
|
+
|
|
93
|
+
3. Use `build_runtime_mappings`
|
|
94
|
+
|
|
95
|
+
You have to pass the clusters transformed by build_runtime_mappings function. Import the `build_runtime_mappings` as follows:
|
|
96
|
+
|
|
97
|
+
```javascript
|
|
98
|
+
import { build_runtime_mappings } from '@eeacms/volto-globalsearch/utils';
|
|
99
|
+
```
|
|
100
|
+
5. Default Clusters
|
|
101
|
+
|
|
102
|
+
Default clusters are defined [here](https://github.com/eea/volto-globalsearch/blob/master/src/config/clusters.js). Decide whether you want to override all clusters or modify specific ones.
|
|
103
|
+
If you decided to modify them, you can import them in your addon as follows:
|
|
104
|
+
```javascript
|
|
105
|
+
import { clusters } from '@eeacms/volto-globalsearch/config/clusters';
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
6. Example Modification
|
|
109
|
+
|
|
110
|
+
Here's an example of how the Publications cluster was modified in the CountryFactsheet by keeping the rest as default: https://github.com/eea/volto-marine-theme/pull/43/files.
|
|
111
|
+
|
|
112
|
+
7. Cluster Structure
|
|
113
|
+
|
|
114
|
+
Be aware that a cluster contains the `values` key that holds the `content types` on which the cluster will act.
|
|
115
|
+
|
|
79
116
|
## Release
|
|
80
117
|
|
|
81
118
|
See [RELEASE.md](https://github.com/eea/volto-globalsearch/blob/master/RELEASE.md).
|
package/package.json
CHANGED
package/src/config/facets.js
CHANGED
|
@@ -12,6 +12,7 @@ import topicsBlacklist from './json/topicsBlacklist.json';
|
|
|
12
12
|
import { getTodayWithTime } from '../utils';
|
|
13
13
|
|
|
14
14
|
const languageCodes = [
|
|
15
|
+
'en',
|
|
15
16
|
'ar',
|
|
16
17
|
'sr',
|
|
17
18
|
'sq',
|
|
@@ -22,7 +23,6 @@ const languageCodes = [
|
|
|
22
23
|
'da',
|
|
23
24
|
'nl',
|
|
24
25
|
'el',
|
|
25
|
-
'en',
|
|
26
26
|
'et',
|
|
27
27
|
'fi',
|
|
28
28
|
'fr',
|
|
@@ -273,6 +273,58 @@ const facets = [
|
|
|
273
273
|
facetValues: languageCodes,
|
|
274
274
|
sortOn: 'custom',
|
|
275
275
|
sortOnCustomLabel: 'Alphabetical',
|
|
276
|
+
sortOrder: 'ascending',
|
|
277
|
+
}),
|
|
278
|
+
multiTermFacet({
|
|
279
|
+
field: 'dpsir.keyword',
|
|
280
|
+
isFilterable: false,
|
|
281
|
+
isMulti: true,
|
|
282
|
+
label: 'DPSIR',
|
|
283
|
+
}),
|
|
284
|
+
multiTermFacet({
|
|
285
|
+
field: 'typology.keyword',
|
|
286
|
+
isFilterable: false,
|
|
287
|
+
isMulti: true,
|
|
288
|
+
label: 'Typology',
|
|
289
|
+
}),
|
|
290
|
+
multiTermFacet({
|
|
291
|
+
field: 'un_sdgs.keyword',
|
|
292
|
+
isFilterable: false,
|
|
293
|
+
isMulti: true,
|
|
294
|
+
label: 'UN SDGs',
|
|
295
|
+
}),
|
|
296
|
+
multiTermFacet({
|
|
297
|
+
field: 'data_provenances_organisations.keyword',
|
|
298
|
+
isFilterable: true,
|
|
299
|
+
isMulti: true,
|
|
300
|
+
label: 'Data sources',
|
|
301
|
+
}),
|
|
302
|
+
multiTermFacet({
|
|
303
|
+
field: 'creators.keyword',
|
|
304
|
+
isFilterable: true,
|
|
305
|
+
isMulti: true,
|
|
306
|
+
label: 'Creators',
|
|
307
|
+
authOnly: true,
|
|
308
|
+
}),
|
|
309
|
+
multiTermFacet({
|
|
310
|
+
field: 'contributors.keyword',
|
|
311
|
+
isFilterable: true,
|
|
312
|
+
isMulti: true,
|
|
313
|
+
label: 'Contributors',
|
|
314
|
+
}),
|
|
315
|
+
multiTermFacet({
|
|
316
|
+
field: 'subject.keyword_lc',
|
|
317
|
+
isFilterable: true,
|
|
318
|
+
isMulti: true,
|
|
319
|
+
label: 'Tags',
|
|
320
|
+
sortOn: 'value',
|
|
321
|
+
sortOrder: 'ascending',
|
|
322
|
+
}),
|
|
323
|
+
multiTermFacet({
|
|
324
|
+
field: 'publishers.keyword',
|
|
325
|
+
isFilterable: false,
|
|
326
|
+
isMulti: true,
|
|
327
|
+
label: 'Publishers',
|
|
276
328
|
}),
|
|
277
329
|
];
|
|
278
330
|
|