@eeacms/volto-cca-policy 0.2.25 → 0.2.27

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.
Files changed (23) hide show
  1. package/CHANGELOG.md +34 -8
  2. package/package.json +1 -1
  3. package/src/cntrg.data +39487 -1
  4. package/src/components/manage/Blocks/CollectionStatistics/CollectionStatsView.jsx +9 -1
  5. package/src/components/manage/Blocks/CollectionStatistics/index.js +7 -7
  6. package/src/components/manage/Blocks/CollectionStatistics/styles.less +1 -1
  7. package/src/components/manage/Blocks/ContentLinks/DropdownListView.test.jsx +78 -0
  8. package/src/components/manage/Blocks/CountryMapProfile/Interactions.jsx +7 -0
  9. package/src/components/manage/Blocks/CountryMapProfile/OLView.jsx +7 -2
  10. package/src/components/manage/Blocks/CountryMapProfile/mapstyle.js +4 -4
  11. package/src/components/manage/Blocks/CountryMapProfile/styles.less +10 -0
  12. package/src/components/manage/Blocks/FilterAceContent/FilterAceContentView.jsx +151 -43
  13. package/src/components/manage/Blocks/FilterAceContent/schema.js +1 -0
  14. package/src/components/manage/Blocks/FilterAceContent/style.less +16 -0
  15. package/src/components/manage/Blocks/Listing/DropdownListingView.test.jsx +67 -0
  16. package/src/components/manage/Blocks/RelevantAceContent/RelevantAceContentView.jsx +17 -11
  17. package/src/components/manage/Blocks/SearchAceContent/SearchAceContentView.jsx +13 -7
  18. package/src/helpers/country_map/countryMap.js +15 -49
  19. package/theme/globals/blocks.less +90 -0
  20. package/theme/globals/site.overrides +1 -0
  21. package/theme/globals/site.variables +2 -2
  22. package/src/components/manage/Blocks/CountryMapHeatIndex/euro-countries-simplified.js +0 -46195
  23. package/src/components/manage/Blocks/CountryMapProfile/euro-countries-simplified.js +0 -46195
@@ -69,7 +69,15 @@ const makeSearchBlockQuery = ({ base, query, field, value }) => {
69
69
  const makeEEASearchQuery = ({ base, field, value }) => {
70
70
  // TODO: don't hardcode the language
71
71
  const rest =
72
- 'filters[1][field]=issued.date&filters[1][values][0]=Last 5 years&filters[1][type]=any&filters[2][field]=language&filters[2][values][0]=en&filters[2][type]=any&sort-field=issued.date&sort-direction=desc';
72
+ 'filters[1][field]=issued.date' +
73
+ '&filters[1][values][0]=Last 5 years' +
74
+ '&filters[1][type]=any' +
75
+ '&filters[2][field]=language' +
76
+ '&filters[2][values][0]=en' +
77
+ '&filters[2][type]=any' +
78
+ '&sort-field=issued.date' +
79
+ '&sort-direction=desc';
80
+
73
81
  const filter = `filters[0][field]=${field}&filters[0][type]=any&filters[0][values][0]=${value}`;
74
82
 
75
83
  return `${base}?size=n_10_n&${filter}&${rest}`;
@@ -20,19 +20,19 @@ const healthImpactIcons = {
20
20
  };
21
21
 
22
22
  const portalTypeIcons = {
23
+ 'Adaptation option': 'cogs',
23
24
  'Case study': 'file text',
24
25
  Guidance: 'compass',
25
26
  Indicator: 'area chart',
26
27
  'Information portal': 'info circle',
27
- 'Publication reference': 'newspaper',
28
+ Organisation: 'sitemap',
29
+ 'Publication and report': 'newspaper',
28
30
  'Research and knowledge project': 'university',
29
31
  Tool: 'wrench',
30
- Video: 'video play',
32
+ 'Video and podcast': 'video play',
31
33
  // 'eea.climateadapt.aceproject': '',
32
- // 'eea.climateadapt.adaptationoption': '',
33
34
  // 'eea.climateadapt.c3sindicator': '',
34
35
  // 'eea.climateadapt.mapgraphdataset': '',
35
- // 'eea.climateadapt.organisation': '',
36
36
  };
37
37
 
38
38
  const portalTypesToSearchTypes = {
@@ -42,15 +42,15 @@ const portalTypesToSearchTypes = {
42
42
  'eea.climateadapt.indicator': 'Indicator',
43
43
  'eea.climateadapt.c3sindicator': 'Indicator',
44
44
  'eea.climateadapt.informationportal': 'Information portal',
45
- 'eea.climateadapt.publicationreport': 'Publication reference',
45
+ 'eea.climateadapt.organisation': 'Organisation',
46
+ 'eea.climateadapt.publicationreport': 'Publication and report',
46
47
  'eea.climateadapt.aceproject': 'Research and knowledge project',
47
48
  'eea.climateadapt.researchproject': 'Research and knowledge project',
48
49
  'eea.climateadapt.tool': 'Tool',
49
- 'eea.climateadapt.video': 'Video',
50
+ 'eea.climateadapt.video': 'Video and podcast',
50
51
  // TODO: what about these?
51
52
  // 'eea.climateadapt.aceproject': '',
52
53
  // 'eea.climateadapt.mapgraphdataset': '',
53
- // 'eea.climateadapt.organisation': '',
54
54
  };
55
55
 
56
56
  export default function installCollectionStatsBlock(config) {
@@ -8,7 +8,7 @@
8
8
  flex-direction: row;
9
9
  flex-wrap: wrap;
10
10
  margin: 1em 0;
11
- gap: 1em;
11
+ gap: 0.7em;
12
12
 
13
13
  .semantic-icon {
14
14
  i.icon {
@@ -0,0 +1,78 @@
1
+ import React from 'react';
2
+ import { MemoryRouter } from 'react-router-dom';
3
+ import configureStore from 'redux-mock-store';
4
+ import renderer from 'react-test-renderer';
5
+ import '@testing-library/jest-dom/extend-expect';
6
+ import { Provider } from 'react-intl-redux';
7
+ import DropdownListView from './DropdownListView';
8
+ import config from '@plone/volto/registry';
9
+
10
+ config.blocks = {
11
+ blocksConfig: {
12
+ contentLinks: {
13
+ variations: [
14
+ {
15
+ id: 'default',
16
+ title: 'Simple list (default)',
17
+ isDefault: true,
18
+ },
19
+ {
20
+ id: 'navigationList',
21
+ title: 'Navigation list',
22
+ isDefault: false,
23
+ },
24
+ ],
25
+ },
26
+ },
27
+ };
28
+
29
+ const mockStore = configureStore();
30
+
31
+ describe('DropdownListView', () => {
32
+ it('should render the component', () => {
33
+ const data = {
34
+ '@type': 'contentLinks',
35
+ items: [
36
+ {
37
+ item_title: 'Item 1',
38
+ source: [
39
+ {
40
+ '@id': '/item-1',
41
+ title: 'Item 1',
42
+ },
43
+ ],
44
+ },
45
+ {
46
+ item_title: 'Item 2',
47
+ source: [
48
+ {
49
+ '@id': '/item-2',
50
+ title: 'Item 2',
51
+ },
52
+ ],
53
+ },
54
+ ],
55
+ show_share_btn: false,
56
+ title: 'Navigation',
57
+ variation: 'default',
58
+ };
59
+
60
+ const store = mockStore({
61
+ userSession: { token: '1234' },
62
+ intl: {
63
+ locale: 'en',
64
+ messages: {},
65
+ },
66
+ });
67
+
68
+ const component = renderer.create(
69
+ <Provider store={store}>
70
+ <MemoryRouter>
71
+ <DropdownListView {...data} />
72
+ </MemoryRouter>
73
+ </Provider>,
74
+ );
75
+ const json = component.toJSON();
76
+ expect(json).toMatchSnapshot();
77
+ });
78
+ });
@@ -5,6 +5,7 @@ import {
5
5
  setTooltipVisibility,
6
6
  getClosestFeatureToCoordinate,
7
7
  } from '@eeacms/volto-cca-policy/helpers/country_map/countryMap';
8
+ import { openlayers as ol } from '@eeacms/volto-openlayers-map';
8
9
  import { useMapContext } from '@eeacms/volto-openlayers-map/api';
9
10
 
10
11
  export const Interactions = ({
@@ -30,7 +31,12 @@ export const Interactions = ({
30
31
  const feature = getClosestFeatureToCoordinate(
31
32
  evt.coordinate,
32
33
  euCountryFeatures.current,
34
+ ol,
33
35
  );
36
+ if (!feature) {
37
+ const node = tooltipRef.current;
38
+ node.style.visibility = 'hidden';
39
+ }
34
40
  const domEvt = evt.originalEvent;
35
41
 
36
42
  if (
@@ -105,6 +111,7 @@ Information is available
105
111
  const feature = getClosestFeatureToCoordinate(
106
112
  evt.coordinate,
107
113
  euCountryFeatures.current,
114
+ ol,
108
115
  );
109
116
 
110
117
  highlight.current = feature && feature.get('na');
@@ -113,7 +113,12 @@ const View = (props) => {
113
113
  new ol.source.TileWMS({
114
114
  url: 'https://gisco-services.ec.europa.eu/maps/service',
115
115
  params: {
116
- // LAYERS: 'OSMBlossomComposite', OSMCartoComposite, OSMPositronComposite
116
+ // LAYERS: 'OSMBlossomComposite',
117
+ // LAYERS: 'OSMCartoComposite',
118
+ // LAYERS: 'OSMPositronComposite',
119
+ // LAYERS: 'GreyEarth',
120
+ // LAYERS: 'OSMCarto',
121
+ // LAYERS: 'NaturalEarth',
117
122
  LAYERS: 'OSMBrightBackground',
118
123
  TILED: true,
119
124
  },
@@ -137,7 +142,7 @@ const View = (props) => {
137
142
  // console.log('filtered', euCountriesSource?.getFeatures() || 'NOT SET YET');
138
143
 
139
144
  return (
140
- <div>
145
+ <div className="ol-country-map">
141
146
  <Grid columns="12">
142
147
  <Grid.Column mobile={12} tablet={12} computer={10} className="col-left">
143
148
  {tileWMSSources ? (
@@ -33,7 +33,7 @@ export const makeStyles = (highlight) => {
33
33
  const fill = new ol.style.Fill({ color: 'rgb(251,250,230, 0.8)' });
34
34
  const stroke = new ol.style.Stroke({
35
35
  // color: 'rgba(255,255,255,0.8)',
36
- color: '#d1d1d1',
36
+ color: '#333333',
37
37
  width: 1,
38
38
  });
39
39
 
@@ -43,13 +43,13 @@ export const makeStyles = (highlight) => {
43
43
 
44
44
  const getFillColor = (feature) => {
45
45
  if (feature.get('fillBlue') === 'blue1') {
46
- return new ol.style.Fill({ color: 'rgb(0, 75, 127, 0.8)' });
46
+ return new ol.style.Fill({ color: 'rgb(0, 75, 127, 1)' });
47
47
  }
48
48
  if (feature.get('fillBlue') === 'blue2') {
49
- return new ol.style.Fill({ color: 'rgb(10, 153, 255, 0.8)' });
49
+ return new ol.style.Fill({ color: 'rgb(10, 153, 255, 1)' });
50
50
  }
51
51
  if (feature.get('fillBlue') === 'blue3') {
52
- return new ol.style.Fill({ color: 'rgb(120, 217, 252, 0.8)' });
52
+ return new ol.style.Fill({ color: 'rgb(120, 217, 252, 1)' });
53
53
  }
54
54
  // console.log(feature.get('fillBlue'));
55
55
  return fill;
@@ -1,4 +1,14 @@
1
+ @height: 600px;
2
+
1
3
  .countryMapProfile {
4
+ height: @height;
5
+ min-height: @height;
6
+
7
+ .ol-map-wrapper,
8
+ .ol-map {
9
+ height: @height;
10
+ }
11
+
2
12
  &.sized-wrapper {
3
13
  width: 100%;
4
14
  height: 100%;
@@ -4,6 +4,7 @@ import ListingBody from '@plone/volto/components/manage/Blocks/Listing/ListingBo
4
4
  import { useSelector, useDispatch } from 'react-redux';
5
5
  import { getVocabulary } from '@plone/volto/actions';
6
6
  import { OTHER_REGIONS } from '@eeacms/volto-cca-policy/helpers';
7
+ import { Link } from 'react-router-dom';
7
8
  import {
8
9
  Option,
9
10
  DropdownIndicator,
@@ -19,6 +20,7 @@ const Select = loadable(() => import('react-select'));
19
20
 
20
21
  const IMPACTS = 'eea.climateadapt.aceitems_climateimpacts';
21
22
  const SECTORS = 'eea.climateadapt.aceitems_sectors';
23
+ const KEY_TYPE = 'eea.climateadapt.aceitems_key_type_measures_short';
22
24
 
23
25
  const FIELDS = [
24
26
  'bio_regions',
@@ -68,7 +70,14 @@ const sectors_no_value = [
68
70
  },
69
71
  ];
70
72
 
71
- const applyQuery = (id, data, currentLang, impacts, sectors) => {
73
+ const measures_no_value = [
74
+ {
75
+ label: 'All key type measures',
76
+ value: '',
77
+ },
78
+ ];
79
+
80
+ const applyQuery = (id, data, currentLang, impacts, sectors, measures) => {
72
81
  const defaultQuery = Object.entries(data)
73
82
  .filter(
74
83
  ([field, value]) => FIELDS.includes(field) && value && value.length > 0,
@@ -95,20 +104,73 @@ const applyQuery = (id, data, currentLang, impacts, sectors) => {
95
104
  v: currentLang,
96
105
  });
97
106
 
107
+ defaultQuery.push({
108
+ i: 'review_state',
109
+ o: 'plone.app.querystring.operation.selection.any',
110
+ v: 'published',
111
+ });
112
+
98
113
  if (impacts) defaultQuery.push(impacts);
99
114
  if (sectors) defaultQuery.push(sectors);
115
+ if (measures) defaultQuery.push(measures);
100
116
 
117
+ const sort_on = data.sortBy || 'effective';
101
118
  return {
102
119
  block: id,
103
120
  limit: data.nr_items,
104
121
  query: defaultQuery,
105
- sort_on: data.sortBy,
106
- sort_order: 'descending',
122
+ sort_on,
123
+ sort_order: sort_on === 'getId' ? 'ascending' : 'descending',
107
124
  template: 'summary',
108
125
  itemModel: { '@type': 'simpleItem' },
109
126
  };
110
127
  };
111
128
 
129
+ const eeaSearchFieldMap = {
130
+ impacts: 'cca_climate_impacts.keyword',
131
+ sectors: 'cca_adaptation_sectors.keyword',
132
+ measures: 'cca_key_type_measure.keyword',
133
+ };
134
+
135
+ function toLabel(value, key, vocab) {
136
+ if (key === 'measures') {
137
+ return value;
138
+ }
139
+ return vocab.find(({ value: v }) => value === v).label;
140
+ }
141
+
142
+ function buildQueryUrl({ vocabs, ...data }) {
143
+ let filters = Object.keys(data).reduce((acc, key) => {
144
+ const name = eeaSearchFieldMap[key];
145
+ const ploneFilter = data[key];
146
+ if (ploneFilter) {
147
+ const value = toLabel(ploneFilter.v, key, vocabs[key]);
148
+ const filter = [
149
+ `filters[$index][field]=${name}`,
150
+ `filters[$index][type]=any`,
151
+ `filters[$index][values][]=${encodeURIComponent(value)}`,
152
+ ].join('&');
153
+ acc.push(filter);
154
+ }
155
+ return acc;
156
+ }, []);
157
+ filters = filters
158
+ .map((line, index) => line.replaceAll('$index', index))
159
+ .join('&');
160
+
161
+ return `/en/data-and-downloads?size=n_10&${filters}`;
162
+ }
163
+
164
+ const vocabImpactsAction = getVocabulary({
165
+ vocabNameOrURL: IMPACTS,
166
+ });
167
+ const vocabSectorsAction = getVocabulary({
168
+ vocabNameOrURL: SECTORS,
169
+ });
170
+ const vocabMeasuresAction = getVocabulary({
171
+ vocabNameOrURL: KEY_TYPE,
172
+ });
173
+
112
174
  const FilterAceContentView = (props) => {
113
175
  const { data, id, mode = 'view' } = props;
114
176
  const dispatch = useDispatch();
@@ -123,22 +185,20 @@ const FilterAceContentView = (props) => {
123
185
  ? state.vocabularies[SECTORS].items
124
186
  : [],
125
187
  );
188
+ const measuresVocabItems = useSelector((state) =>
189
+ state.vocabularies[KEY_TYPE]?.loaded
190
+ ? state.vocabularies[KEY_TYPE].items
191
+ : [],
192
+ );
126
193
 
127
194
  const [impactsQuery, setImpactsQueryQuery] = React.useState();
128
195
  const [sectorsQuery, setSectorsQuery] = React.useState();
196
+ const [measuresQuery, setMeasuresQuery] = React.useState();
129
197
 
130
198
  React.useEffect(() => {
131
- const action = getVocabulary({
132
- vocabNameOrURL: IMPACTS,
133
- });
134
- dispatch(action);
135
- }, [dispatch]);
136
-
137
- React.useEffect(() => {
138
- const action = getVocabulary({
139
- vocabNameOrURL: SECTORS,
140
- });
141
- dispatch(action);
199
+ dispatch(vocabImpactsAction);
200
+ dispatch(vocabSectorsAction);
201
+ dispatch(vocabMeasuresAction);
142
202
  }, [dispatch]);
143
203
 
144
204
  const listingBodyData = applyQuery(
@@ -147,41 +207,54 @@ const FilterAceContentView = (props) => {
147
207
  currentLang,
148
208
  impactsQuery,
149
209
  sectorsQuery,
210
+ measuresQuery,
150
211
  );
212
+ const viewAllUrl = buildQueryUrl({
213
+ impacts: impactsQuery,
214
+ sectors: sectorsQuery,
215
+ measures: measuresQuery,
216
+ vocabs: {
217
+ sectors: sectorsVocabItems,
218
+ measures: measuresVocabItems,
219
+ impacts: impactsVocabItems,
220
+ },
221
+ });
151
222
 
152
223
  return (
153
224
  <div className="block filter-acecontent-block">
154
- {data.title && <h3>{data.title}</h3>}
155
- <h5>
225
+ {data.title && <h4>{data.title}</h4>}
226
+ <span className="filter-title">
156
227
  <FormattedMessage id="Climate impact" defaultMessage="Climate impact" />
157
- </h5>
158
- <Select
159
- id="field-impacts"
160
- name="impacts"
161
- disabled={false}
162
- className="react-select-container"
163
- classNamePrefix="react-select"
164
- options={[impacts_no_value[0], ...(impactsVocabItems || [])]}
165
- styles={customSelectStyles}
166
- theme={selectTheme}
167
- components={{ DropdownIndicator, Option }}
168
- defaultValue={impacts_no_value}
169
- onChange={({ value }) => {
170
- if (value) {
171
- setImpactsQueryQuery({
172
- i: 'climate_impacts',
173
- o: 'plone.app.querystring.operation.selection.any',
174
- v: value,
175
- });
176
- } else {
177
- setImpactsQueryQuery(null);
178
- }
179
- }}
180
- />
228
+ </span>
229
+ <div>
230
+ <Select
231
+ id="field-impacts"
232
+ name="impacts"
233
+ disabled={false}
234
+ className="react-select-container"
235
+ classNamePrefix="react-select"
236
+ options={[impacts_no_value[0], ...(impactsVocabItems || [])]}
237
+ styles={customSelectStyles}
238
+ theme={selectTheme}
239
+ components={{ DropdownIndicator, Option }}
240
+ defaultValue={impacts_no_value}
241
+ onChange={({ value }) => {
242
+ if (value) {
243
+ setImpactsQueryQuery({
244
+ i: 'climate_impacts',
245
+ o: 'plone.app.querystring.operation.selection.any',
246
+ v: value,
247
+ });
248
+ } else {
249
+ setImpactsQueryQuery(null);
250
+ }
251
+ }}
252
+ />
253
+ </div>
181
254
 
182
- <h5>
255
+ <span className="filter-title">
183
256
  <FormattedMessage id="Sector" defaultMessage="Sector" />
184
- </h5>
257
+ </span>
185
258
  <Select
186
259
  id="field-sectors"
187
260
  name="sectors"
@@ -198,13 +271,45 @@ const FilterAceContentView = (props) => {
198
271
  setSectorsQuery({
199
272
  i: 'sectors',
200
273
  o: 'plone.app.querystring.operation.selection.any',
201
- v: value,
274
+ v: value.toUpperCase(),
202
275
  });
203
276
  } else {
204
277
  setSectorsQuery(null);
205
278
  }
206
279
  }}
207
280
  />
281
+
282
+ <div id="key-type-measure">
283
+ <span className="filter-title">
284
+ <FormattedMessage
285
+ id="Key Type Measure"
286
+ defaultMessage="Key Type Measure"
287
+ />
288
+ </span>
289
+ <Select
290
+ id="field-measure"
291
+ name="measure"
292
+ disabled={false}
293
+ className="react-select-container"
294
+ classNamePrefix="react-select"
295
+ options={[measures_no_value[0], ...(measuresVocabItems || [])]}
296
+ styles={customSelectStyles}
297
+ theme={selectTheme}
298
+ components={{ DropdownIndicator, Option }}
299
+ defaultValue={measures_no_value}
300
+ onChange={({ value }) => {
301
+ if (value) {
302
+ setMeasuresQuery({
303
+ i: 'key_type_measures',
304
+ o: 'plone.app.querystring.operation.selection.any',
305
+ v: value,
306
+ });
307
+ } else {
308
+ setMeasuresQuery(null);
309
+ }
310
+ }}
311
+ />
312
+ </div>
208
313
  <div className="listing-wrapper">
209
314
  <ListingBody
210
315
  id={id}
@@ -213,6 +318,9 @@ const FilterAceContentView = (props) => {
213
318
  isEditMode={mode === 'edit'}
214
319
  />
215
320
  </div>
321
+ <Link className="ui button secondary inverted" to={viewAllUrl}>
322
+ View all
323
+ </Link>
216
324
  </div>
217
325
  );
218
326
  };
@@ -18,6 +18,7 @@ const FilterSchema = (data, macro_regions) => {
18
18
  'bio_regions',
19
19
  'funding_programme',
20
20
  'nr_items',
21
+ 'sortBy',
21
22
  ],
22
23
  },
23
24
  ],
@@ -1,3 +1,19 @@
1
1
  .listing-wrapper {
2
2
  margin-top: 1.5em;
3
3
  }
4
+
5
+ .filter-title {
6
+ display: block;
7
+ margin: 0.7em 0 0.3em 0;
8
+ font-size: 16px;
9
+ font-weight: 600;
10
+ }
11
+
12
+ #key-type-measure {
13
+ display: none;
14
+ }
15
+
16
+ body.section-adaptation-options #key-type-measure,
17
+ body.section-adaptation-support-tool.section-step-3-1 #key-type-measure {
18
+ display: block !important;
19
+ }
@@ -0,0 +1,67 @@
1
+ import React from 'react';
2
+ import { MemoryRouter } from 'react-router-dom';
3
+ import configureStore from 'redux-mock-store';
4
+ import renderer from 'react-test-renderer';
5
+ import '@testing-library/jest-dom/extend-expect';
6
+ import { Provider } from 'react-intl-redux';
7
+ import DropdownListingView from './DropdownListingView';
8
+ import config from '@plone/volto/registry';
9
+
10
+ config.blocks = {
11
+ blocksConfig: {
12
+ contentLinks: {
13
+ variations: [
14
+ {
15
+ id: 'default',
16
+ title: 'Simple list (default)',
17
+ isDefault: true,
18
+ },
19
+ {
20
+ id: 'navigationList',
21
+ title: 'Navigation list',
22
+ isDefault: false,
23
+ },
24
+ ],
25
+ },
26
+ },
27
+ };
28
+
29
+ const mockStore = configureStore();
30
+
31
+ describe('DropdownListingView', () => {
32
+ it('should render the component', () => {
33
+ const data = {
34
+ '@type': 'listing',
35
+ items: [
36
+ {
37
+ '@id': '/item-1',
38
+ title: 'Item 1',
39
+ id: 'item-1',
40
+ },
41
+ {
42
+ '@id': '/item-2',
43
+ title: 'Item 2',
44
+ id: 'item-2',
45
+ },
46
+ ],
47
+ };
48
+
49
+ const store = mockStore({
50
+ userSession: { token: '1234' },
51
+ intl: {
52
+ locale: 'en',
53
+ messages: {},
54
+ },
55
+ });
56
+
57
+ const component = renderer.create(
58
+ <Provider store={store}>
59
+ <MemoryRouter>
60
+ <DropdownListingView {...data} />
61
+ </MemoryRouter>
62
+ </Provider>,
63
+ );
64
+ const json = component.toJSON();
65
+ expect(json).toMatchSnapshot();
66
+ });
67
+ });
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { List } from 'semantic-ui-react';
2
+ import { List, ListItem, ListContent, ListIcon } from 'semantic-ui-react';
3
3
  import { Link } from 'react-router-dom';
4
4
  import { flattenToAppURL } from '@plone/volto/helpers';
5
5
 
@@ -24,14 +24,20 @@ const RelevantAceContentView = (props) => {
24
24
  const showBlock = (items && items.length > 0) || results.length > 0;
25
25
 
26
26
  const itemList = (items || []).map((item, index) => (
27
- <List.Item key={index}>
28
- <Link to={flattenToAppURL(item.link)}>{item.item_title}</Link>
29
- </List.Item>
27
+ <ListItem key={index}>
28
+ <ListIcon name="angle right" />
29
+ <ListContent>
30
+ <Link to={flattenToAppURL(item.link)}>{item.item_title}</Link>
31
+ </ListContent>
32
+ </ListItem>
30
33
  ));
31
34
  const resultsList = results.map((result, index) => (
32
- <List.Item key={index} title={result[1]}>
33
- <Link to={flattenToAppURL(result[4])}>{result[0]}</Link>
34
- </List.Item>
35
+ <ListItem key={index} title={result[1]}>
36
+ <ListIcon name="angle right" />
37
+ <ListContent>
38
+ <Link to={flattenToAppURL(result[4])}>{result[0]}</Link>
39
+ </ListContent>
40
+ </ListItem>
35
41
  ));
36
42
  const showResults = hasAnyFilter || search_text != null;
37
43
 
@@ -40,14 +46,14 @@ const RelevantAceContentView = (props) => {
40
46
  {title && <h4>{title}</h4>}
41
47
 
42
48
  {combine_results ? (
43
- <>
49
+ <List>
44
50
  {itemList}
45
51
  {!isEdit && showResults && resultsList}
46
- </>
52
+ </List>
47
53
  ) : items && items.length > 0 ? (
48
- itemList
54
+ <List>{itemList}</List>
49
55
  ) : (
50
- !isEdit && showResults && resultsList
56
+ <List>{!isEdit && showResults && resultsList}</List>
51
57
  )}
52
58
  </div>
53
59
  ) : (