@eeacms/volto-clms-theme 1.1.104 → 1.1.106

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,32 @@ 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.106](https://github.com/eea/volto-clms-theme/compare/1.1.105...1.1.106) - 29 January 2024
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - CLMS-2973 modify the search count and filter selection [Ion Lizarazu - [`3ee3256`](https://github.com/eea/volto-clms-theme/commit/3ee3256ef79596527714ccde0e729bfbb29c10f0)]
12
+ - lint fix [Unai - [`bc53b09`](https://github.com/eea/volto-clms-theme/commit/bc53b09f0f6907c421d58effadac3c98b390bf69)]
13
+ - CLMS-2990 add support for uid based pagination for listing block contained by tabs [Ion Lizarazu - [`03d0b96`](https://github.com/eea/volto-clms-theme/commit/03d0b9698195f30a111a0fa740611c8f9aa566c1)]
14
+ - add original usePagination to modify [Ion Lizarazu - [`71554ef`](https://github.com/eea/volto-clms-theme/commit/71554ef26be1bfa0604e1fff351432ac61ef5d03)]
15
+ - more legible variation name [Unai - [`f6eec2b`](https://github.com/eea/volto-clms-theme/commit/f6eec2bd0aa2b9ee4f81e39deb560777e4c926d0)]
16
+ - bgImage card block edition [Unai - [`b2b101e`](https://github.com/eea/volto-clms-theme/commit/b2b101e6917e4fd0c3469ec86fe72a75d71c62f7)]
17
+ ### [1.1.105](https://github.com/eea/volto-clms-theme/compare/1.1.104...1.1.105) - 25 January 2024
18
+
19
+ #### :bug: Bug Fixes
20
+
21
+ - fix: CLMS-2970 redirect to dataset page [Unai - [`df6898f`](https://github.com/eea/volto-clms-theme/commit/df6898f37b79f4c309764928fb943b6f8076affb)]
22
+ - fix: CLMS-2982 [Unai - [`2b3226b`](https://github.com/eea/volto-clms-theme/commit/2b3226bd6020da1dab5d0544604ec6907b440d99)]
23
+ - fix: CLMS-3026 [Unai - [`6616839`](https://github.com/eea/volto-clms-theme/commit/66168397ff68cd96f861e22424c144a7218a00ac)]
24
+ - fix: CLMS-3026 [Unai - [`2a0edb9`](https://github.com/eea/volto-clms-theme/commit/2a0edb936adffdfd20a61fbef69f86fa85954eb2)]
25
+
26
+ #### :hammer_and_wrench: Others
27
+
28
+ - lint [Unai - [`79e0512`](https://github.com/eea/volto-clms-theme/commit/79e0512de5f15b307859e949b3c491792178e208)]
29
+ - lint [Unai - [`3b65686`](https://github.com/eea/volto-clms-theme/commit/3b65686e7f5b4d1b1fd20e72a3fada723ac88a84)]
30
+ - dataset extras removed from homeBgImageBlock & white variation still working [Unai - [`9707e63`](https://github.com/eea/volto-clms-theme/commit/9707e632877bbee38d208f0eb2d5b58d88e5e15e)]
31
+ - new listing card variation [Unai - [`b34ddb4`](https://github.com/eea/volto-clms-theme/commit/b34ddb40c79014cae7f2fe68513a9c12462cfc52)]
32
+ - Revert "fix: CLMS-3026" [Unai - [`36c450d`](https://github.com/eea/volto-clms-theme/commit/36c450db7351bef129241dcd2816c0bc1d4a1a44)]
7
33
  ### [1.1.104](https://github.com/eea/volto-clms-theme/compare/1.1.103...1.1.104) - 19 January 2024
8
34
 
9
35
  #### :bug: Bug Fixes
@@ -210,6 +236,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
210
236
 
211
237
  - to render nothing, return null [Mikel Larreategi - [`2fb3580`](https://github.com/eea/volto-clms-theme/commit/2fb35802b23e3aba5fd166aeefd103c929ffb5d1)]
212
238
  - simplify condtioin [Mikel Larreategi - [`f9b43da`](https://github.com/eea/volto-clms-theme/commit/f9b43da91d360e0028402f9a7ba762f16b0d9b22)]
239
+ - test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`7c6e9ca`](https://github.com/eea/volto-clms-theme/commit/7c6e9cac9da0c06d0f24711303404f5055fba7d1)]
213
240
  ### [1.1.80](https://github.com/eea/volto-clms-theme/compare/1.1.79...1.1.80) - 17 November 2023
214
241
 
215
242
  #### :bug: Bug Fixes
@@ -220,6 +247,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
220
247
 
221
248
  #### :hammer_and_wrench: Others
222
249
 
250
+ - test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`37c3299`](https://github.com/eea/volto-clms-theme/commit/37c3299dd19c95057e70d48152bfef2365f2416c)]
223
251
  - CLMS-2509 (Bug): Lint [Urkorue - [`1bbc011`](https://github.com/eea/volto-clms-theme/commit/1bbc011481c0ee1feb68d0cf57c4a5a9f4c224ca)]
224
252
  - CLMS-2509 (Bug): Timeseries icon centered [Urkorue - [`fc38685`](https://github.com/eea/volto-clms-theme/commit/fc3868598ab592f01bb3ee23f985ada5c11227d4)]
225
253
  ### [1.1.78](https://github.com/eea/volto-clms-theme/compare/1.1.77...1.1.78) - 16 November 2023
@@ -272,14 +300,17 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
272
300
 
273
301
  #### :hammer_and_wrench: Others
274
302
 
303
+ - test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`c55db1c`](https://github.com/eea/volto-clms-theme/commit/c55db1c20cfef1eb34c587343a4822fa4bde3c54)]
275
304
  ### [1.1.73](https://github.com/eea/volto-clms-theme/compare/1.1.72...1.1.73) - 6 November 2023
276
305
 
277
306
  #### :hammer_and_wrench: Others
278
307
 
308
+ - test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`3a543b9`](https://github.com/eea/volto-clms-theme/commit/3a543b9000c1168d54edfb8003eb08dfa7c85031)]
279
309
  - comment Integration tests [Ion Lizarazu - [`74713f8`](https://github.com/eea/volto-clms-theme/commit/74713f8f78d77ba193d8c27462cc8787d698ab81)]
280
310
  - uncomment cypress tests [Ion Lizarazu - [`3526a5c`](https://github.com/eea/volto-clms-theme/commit/3526a5c46481667b0518c6cce0927e67726c6f6c)]
281
311
  - use chrome instead of chromium to run cypress tests [Ion Lizarazu - [`6ae3a06`](https://github.com/eea/volto-clms-theme/commit/6ae3a06dbec1914c06a55c0dcb826c49b75f9739)]
282
312
  - ccltabs activeTab condition having first child [Ion Lizarazu - [`3cf9376`](https://github.com/eea/volto-clms-theme/commit/3cf9376d55f5f41b7e42c25e5925cd871ec71d81)]
313
+ - test: [JENKINS] Improve cypress time [valentinab25 - [`f41ecfe`](https://github.com/eea/volto-clms-theme/commit/f41ecfea8b5a1e409303ffcc7befe7f51316d652)]
283
314
  ### [1.1.72](https://github.com/eea/volto-clms-theme/compare/1.1.71...1.1.72) - 2 November 2023
284
315
 
285
316
  ### [1.1.71](https://github.com/eea/volto-clms-theme/compare/1.1.70...1.1.71) - 31 October 2023
@@ -290,6 +321,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
290
321
 
291
322
  #### :house: Internal changes
292
323
 
324
+ - chore: [JENKINS] Refactor automated testing [valentinab25 - [`67ca3bb`](https://github.com/eea/volto-clms-theme/commit/67ca3bb111f34842569c12b9c87a2a91bd14b09e)]
293
325
 
294
326
  #### :hammer_and_wrench: Others
295
327
 
@@ -386,6 +418,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
386
418
 
387
419
  - readme [Mikel Larreategi - [`3c0ab05`](https://github.com/eea/volto-clms-theme/commit/3c0ab051981a4efad7712bc46182eed9d79fd10f)]
388
420
  - remove from addons [Mikel Larreategi - [`89c2e7d`](https://github.com/eea/volto-clms-theme/commit/89c2e7d793193e6bb64642f0b06a01cd3c81108a)]
421
+ - yarn.lock added after running yarn [Unai - [`ad307be`](https://github.com/eea/volto-clms-theme/commit/ad307be72bbfe753f7571ea4d784a09978e0f7f2)]
389
422
  - prettier issue fix [Unai - [`8bc0650`](https://github.com/eea/volto-clms-theme/commit/8bc0650918f9fa1065d19d2c15ce153a5fc5abbb)]
390
423
  - set a limit of 5 items in the download queue [Mikel Larreategi - [`b81cc83`](https://github.com/eea/volto-clms-theme/commit/b81cc8383165bafbbff52fbeeb365d413051802e)]
391
424
  - adjust logo size [Mikel Larreategi - [`b90a72c`](https://github.com/eea/volto-clms-theme/commit/b90a72c07102025a7e90607b25d34611ddd4f4f6)]
@@ -527,6 +560,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
527
560
 
528
561
  - fix cart items concat function [Ion Lizarazu - [`4b72249`](https://github.com/eea/volto-clms-theme/commit/4b72249ef17a0cda22661809fce5be7c2d1f6649)]
529
562
  - revert Jenkinsfile [Ion Lizarazu - [`64f6cd0`](https://github.com/eea/volto-clms-theme/commit/64f6cd08100357843b507c00d3286d7debe0ef04)]
563
+ - yarn.lock file [Ion Lizarazu - [`8444ad1`](https://github.com/eea/volto-clms-theme/commit/8444ad1606b3939e4609bdd186e5ace2252588a8)]
530
564
  - packages.json versions order [Ion Lizarazu - [`4fd7a86`](https://github.com/eea/volto-clms-theme/commit/4fd7a86ab43238841b421e1ed10ebd52ab420a15)]
531
565
  - downloadablefilestablewidget param modification [Ion Lizarazu - [`5dd794a`](https://github.com/eea/volto-clms-theme/commit/5dd794a33a8eddd042a753b7ab47e7d2a323b011)]
532
566
  - add technical_documents_accordion_text field to the dataset view [Ion Lizarazu - [`96ed1e5`](https://github.com/eea/volto-clms-theme/commit/96ed1e5e2c2b501bd303bc76b333a70ad1614c16)]
@@ -651,6 +685,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
651
685
 
652
686
  - remove NUTS text for area naming in the cart [ionlizarazu - [`062e0a3`](https://github.com/eea/volto-clms-theme/commit/062e0a375f5352bc13c18ff7ec33fad4bcc59f2f)]
653
687
  - dependencies [ionlizarazu - [`405ef96`](https://github.com/eea/volto-clms-theme/commit/405ef96090fe7bd4af73a49d3285a92fad712e3b)]
688
+ - yarn.lock [ionlizarazu - [`7132119`](https://github.com/eea/volto-clms-theme/commit/71321195c4dd4fceed67f2f0872f3e24bba61c17)]
654
689
  - volto-blocks-grid module mapping [ionlizarazu - [`4fec3ca`](https://github.com/eea/volto-clms-theme/commit/4fec3cabc437322ad92ed90d682250bd123ccaaf)]
655
690
  - volto-blocks-grid v7.0.2 [ionlizarazu - [`2557e60`](https://github.com/eea/volto-clms-theme/commit/2557e6039d3cea33ca0bd11a0a3ef4764c611f78)]
656
691
  - remove styling from teaser block [ionlizarazu - [`879e684`](https://github.com/eea/volto-clms-theme/commit/879e684057c88f52f60f0fa54cbaa155c7d14688)]
@@ -738,6 +773,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
738
773
 
739
774
  #### :house: Internal changes
740
775
 
776
+ - chore: [JENKINS] Remove alpha testing version [valentinab25 - [`b4cbf65`](https://github.com/eea/volto-clms-theme/commit/b4cbf6557fbc67f7fc4cea5aa2cb19804f3d7e3c)]
741
777
 
742
778
  #### :hammer_and_wrench: Others
743
779
 
@@ -1936,6 +1972,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
1936
1972
  #### :hammer_and_wrench: Others
1937
1973
 
1938
1974
  - related products and datasets added to news and meeting views and login-plone route created [Unai - [`5704a1a`](https://github.com/eea/volto-clms-theme/commit/5704a1a766148746162b60efaf232ea90dc20cf4)]
1975
+ - Revert "[JENKINS] Use eeacms/plone-backend and Volto alpha version- Refs #151967" [Mikel Larreategi - [`46eb694`](https://github.com/eea/volto-clms-theme/commit/46eb69415280a3c982405299135027ae4221426a)]
1939
1976
  - sort items according to the lowercased label and put those with special meaning at the end [Mikel Larreategi - [`6410abe`](https://github.com/eea/volto-clms-theme/commit/6410abe096f60dcad54dced2026c9df9b7946d68)]
1940
1977
  - lint fix [Unai - [`1264a7a`](https://github.com/eea/volto-clms-theme/commit/1264a7adfe8d679fea1bd821ad087add20f4271d)]
1941
1978
  - footer newsletter subscription change, global search maxLength change from 8000 to 200 and /login design change [Unai - [`a09d24a`](https://github.com/eea/volto-clms-theme/commit/a09d24adbb6fa053fb2a2cc0071506b906593b42)]
@@ -2086,6 +2123,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
2086
2123
  - search block new features [ionlizarazu - [`8e814cb`](https://github.com/eea/volto-clms-theme/commit/8e814cbd359782540c21fe37b37ef146d331f0d6)]
2087
2124
  - language selector cookie management [ionlizarazu - [`1385ac9`](https://github.com/eea/volto-clms-theme/commit/1385ac95795702206d3623ba6e780faa43a89e0a)]
2088
2125
  - toolbar cookie management [ionlizarazu - [`5c23200`](https://github.com/eea/volto-clms-theme/commit/5c23200790b20e1d4f1bc966463c37bf4c808f47)]
2126
+ - Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`0316a0d`](https://github.com/eea/volto-clms-theme/commit/0316a0d8b6fb0fa14af13002415f3c95d9f8ede3)]
2089
2127
  ### [1.0.84](https://github.com/eea/volto-clms-theme/compare/1.0.83...1.0.84) - 18 March 2022
2090
2128
 
2091
2129
  #### :hammer_and_wrench: Others
@@ -2990,11 +3028,13 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
2990
3028
  #### :hammer_and_wrench: Others
2991
3029
 
2992
3030
  - replace @collective/volto-dropdownmenu with volto-dropdownmenu [ionlizarazu - [`07f004f`](https://github.com/eea/volto-clms-theme/commit/07f004fe0219e403fb51bc045c83d34f3b981f76)]
3031
+ - yarn.lock [ionlizarazu - [`fe1ca04`](https://github.com/eea/volto-clms-theme/commit/fe1ca04889d29fe7b653db4c69af2751b84b8a1a)]
2993
3032
  - add NODE_ENV parameter [ionlizarazu - [`101f27c`](https://github.com/eea/volto-clms-theme/commit/101f27c25b8fbd192e1b11865e95cf5ffee08c1b)]
2994
3033
  - upgrade volto-dropdownmenu version [ionlizarazu - [`2081855`](https://github.com/eea/volto-clms-theme/commit/2081855301f4c708776e0dbab39db143cee00dbc)]
2995
3034
  - HomeSearch block missing url behaviour [ionlizarazu - [`d20a378`](https://github.com/eea/volto-clms-theme/commit/d20a378ce3f254b8343692348f314bf281974542)]
2996
3035
  - babel configuration [ionlizarazu - [`203ea2d`](https://github.com/eea/volto-clms-theme/commit/203ea2de07f99ca3403e4ca220ca74d7ce69b61d)]
2997
3036
  - prettier [ionlizarazu - [`e79e26b`](https://github.com/eea/volto-clms-theme/commit/e79e26bf2fa40ba7b4eb53a24dabd87928221c28)]
3037
+ - add yarn lock [ionlizarazu - [`e1ab28b`](https://github.com/eea/volto-clms-theme/commit/e1ab28b060d5a74431c368b0de82a68dabce1eab)]
2998
3038
  - Jenkinsfile cypress test [ionlizarazu - [`b385d65`](https://github.com/eea/volto-clms-theme/commit/b385d65986f717c60f8c434a08fc11b829d08eb4)]
2999
3039
  - cypress [ionlizarazu - [`a243cf0`](https://github.com/eea/volto-clms-theme/commit/a243cf0182fa3dd113c16ff495c71e310252d83b)]
3000
3040
  - some fixes [ionlizarazu - [`046279b`](https://github.com/eea/volto-clms-theme/commit/046279b9d05bea8a64eca03eed493e02621534c9)]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-clms-theme",
3
- "version": "1.1.104",
3
+ "version": "1.1.106",
4
4
  "description": "volto-clms-theme: Volto theme for CLMS site",
5
5
  "main": "src/index.js",
6
6
  "author": "CodeSyntax for the European Environment Agency",
@@ -22,35 +22,71 @@ export const CardContainerSchema = () => ({
22
22
  required: ['variation', 'cardOrigin'],
23
23
  });
24
24
 
25
- export const CardBlockSchema = () => ({
26
- title: 'Card block',
27
- fieldsets: [
28
- {
29
- id: 'default',
30
- title: 'Default',
31
- fields: ['title', 'description', 'url'],
32
- },
33
- ],
34
- properties: {
35
- title: {
36
- title: 'Title',
37
- description: 'Card title',
38
- type: 'string',
39
- placeholder: 'Card title here',
40
- },
41
- image: {
42
- title: 'Card image',
43
- },
44
- description: {
45
- title: 'Product description',
46
- type: 'string',
47
- },
48
- url: {
49
- title: 'url',
50
- widget: 'object_browser',
51
- mode: 'link',
52
- allowExternals: true,
25
+ export const CardBlockSchema = (hasButton) => {
26
+ const hasButtonFieldset = hasButton
27
+ ? [
28
+ {
29
+ id: 'buttonStyle',
30
+ title: 'Button style',
31
+ fields: ['buttonTitle', 'style', 'disabled'],
32
+ },
33
+ ]
34
+ : [];
35
+
36
+ return {
37
+ title: 'Card block',
38
+ fieldsets: [
39
+ {
40
+ id: 'default',
41
+ title: 'Default',
42
+ fields: ['title', 'description', 'url'],
43
+ },
44
+ ...hasButtonFieldset,
45
+ ],
46
+ properties: {
47
+ title: {
48
+ title: 'Title',
49
+ description: 'Card title',
50
+ type: 'string',
51
+ placeholder: 'Card title here',
52
+ },
53
+ image: {
54
+ title: 'Card image',
55
+ },
56
+ description: {
57
+ title: 'Description',
58
+ type: 'string',
59
+ },
60
+ url: {
61
+ title: 'URL',
62
+ widget: 'object_browser',
63
+ mode: 'link',
64
+ allowExternals: true,
65
+ },
66
+ // hasButton: {
67
+ // title: 'Button',
68
+ // type: 'boolean',
69
+ // default: false,
70
+ // },
71
+ buttonTitle: {
72
+ title: 'Title',
73
+ description: 'Add button text',
74
+ type: 'string',
75
+ },
76
+ style: {
77
+ title: 'Button style',
78
+ choices: [
79
+ ['default', 'Default'],
80
+ ['filled', 'Filled'],
81
+ ],
82
+ default: 'default',
83
+ },
84
+ disabled: {
85
+ title: 'Disabled',
86
+ type: 'boolean',
87
+ default: false,
88
+ },
53
89
  },
54
- },
55
- required: [],
56
- });
90
+ required: [],
91
+ };
92
+ };
@@ -1,19 +1,23 @@
1
- import { CardBlockSchema, CardContainerSchema } from './CardContainerSchema';
2
1
  import React, { useState } from 'react';
3
- import { emptyCard, getPanels } from '../utils';
2
+ import { injectIntl } from 'react-intl';
3
+ import { defineMessages } from 'react-intl';
4
+ import { compose } from 'redux';
4
5
 
5
- import CclCard from '@eeacms/volto-clms-theme/components/CclCard/CclCard';
6
6
  import { SidebarPortal, BlockDataForm } from '@plone/volto/components'; // BlocksForm, Icon,
7
- import { addExtensionFieldToSchema } from '@plone/volto/helpers/Extensions/withBlockSchemaEnhancer';
8
- import { compose } from 'redux';
9
- import { injectIntl } from 'react-intl';
10
- import { isEmpty } from 'lodash';
11
7
  import withObjectBrowser from '@plone/volto/components/manage/Sidebar/ObjectBrowser';
12
- import CclImageEditor from '@eeacms/volto-clms-theme/components/CclImageEditor/CclImageEditor';
13
- import { defineMessages } from 'react-intl';
8
+ import { addExtensionFieldToSchema } from '@plone/volto/helpers/Extensions/withBlockSchemaEnhancer';
14
9
  import config from '@plone/volto/registry';
10
+ import CclHomeImageEditor from '@eeacms/volto-clms-theme/components/Blocks/CclHomeBgImageBlock/CclHomeImageEditor';
11
+ import { HomeBgImg } from '@eeacms/volto-clms-theme/components/Blocks/CclHomeBgImageBlock/HomeBgImg';
12
+ import CclCard from '@eeacms/volto-clms-theme/components/CclCard/CclCard';
13
+ import CclImageEditor from '@eeacms/volto-clms-theme/components/CclImageEditor/CclImageEditor';
14
+
15
+ import { emptyCard, getPanels } from '../utils';
16
+ import { CardBlockSchema, CardContainerSchema } from './CardContainerSchema';
15
17
  import getListingBodyVariation from './utils.js';
16
18
 
19
+ import { isEmpty } from 'lodash';
20
+
17
21
  const messages = defineMessages({
18
22
  template: {
19
23
  id: 'Variation',
@@ -64,12 +68,16 @@ const CclCardContainerBlockEdit = ({
64
68
 
65
69
  const variation = getListingBodyVariation(data);
66
70
  let containerClass = '';
67
- if (['news', 'event'].includes(variation.templateID)) {
71
+ if (data.variation === 'cardWithBgImage') {
72
+ containerClass = 'home-map-container';
73
+ } else if (['news', 'event'].includes(variation.templateID)) {
68
74
  containerClass = 'ccl-container';
69
75
  } else if (!['line', 'doc', 'globalSearch'].includes(variation.templateID)) {
70
76
  containerClass = 'card-container';
71
77
  }
72
78
 
79
+ let hasButton = data.variation === 'cardWithBgImage' ? true : false;
80
+
73
81
  return (
74
82
  <>
75
83
  <div
@@ -83,32 +91,62 @@ const CclCardContainerBlockEdit = ({
83
91
  {data.title || 'Card container'}
84
92
  </div>
85
93
  <div className={containerClass}>
86
- {panels.map(([uid, panel], index) => (
87
- <CclCard
88
- key={index}
89
- type={variation?.templateID || 'doc'}
90
- card={panel}
91
- onClickImage={() => {
92
- setSelectedCardBlock(uid);
93
- }}
94
- isCustomCard={true}
95
- CclImageEditor={
96
- <CclImageEditor
97
- block={block}
98
- data={data}
99
- editable={editable}
100
- imageUrl={panel?.image?.url}
101
- onChangeBlock={onChangeBlock}
102
- openObjectBrowser={openObjectBrowser}
103
- pathname={pathname}
104
- selected={selected}
105
- selectedCardBlock={selectedCardBlock}
106
- setSelectedCardBlock={setSelectedCardBlock}
107
- uid={uid}
94
+ {variation?.id === 'cardWithBgImage' ? (
95
+ <>
96
+ <CclHomeImageEditor
97
+ data={data}
98
+ openObjectBrowser={openObjectBrowser}
99
+ selected={selected}
100
+ block={block}
101
+ editable={editable}
102
+ pathname={pathname}
103
+ onChangeBlock={onChangeBlock}
104
+ />
105
+ <HomeBgImg url={data?.image?.url} alt={data?.image?.alt} />
106
+ <div className="ccl-container">
107
+ {panels.map(([uid, panel], index) => (
108
+ <CclCard
109
+ key={index}
110
+ type={variation?.templateID || 'doc'}
111
+ card={panel}
112
+ onClickImage={() => {
113
+ setSelectedCardBlock(uid);
114
+ }}
115
+ isCustomCard={true}
116
+ />
117
+ ))}
118
+ </div>
119
+ </>
120
+ ) : (
121
+ <>
122
+ {panels.map(([uid, panel], index) => (
123
+ <CclCard
124
+ key={index}
125
+ type={variation?.templateID || 'doc'}
126
+ card={panel}
127
+ onClickImage={() => {
128
+ setSelectedCardBlock(uid);
129
+ }}
130
+ isCustomCard={true}
131
+ CclImageEditor={
132
+ <CclImageEditor
133
+ block={block}
134
+ data={data}
135
+ editable={editable}
136
+ imageUrl={panel?.image?.url}
137
+ onChangeBlock={onChangeBlock}
138
+ openObjectBrowser={openObjectBrowser}
139
+ pathname={pathname}
140
+ selected={selected}
141
+ selectedCardBlock={selectedCardBlock}
142
+ setSelectedCardBlock={setSelectedCardBlock}
143
+ uid={uid}
144
+ />
145
+ }
108
146
  />
109
- }
110
- />
111
- ))}
147
+ ))}
148
+ </>
149
+ )}
112
150
  </div>
113
151
  <SidebarPortal selected={selected && selectedCardBlock === -1}>
114
152
  <BlockDataForm
@@ -129,7 +167,7 @@ const CclCardContainerBlockEdit = ({
129
167
  }
130
168
  >
131
169
  <BlockDataForm
132
- schema={CardBlockSchema()}
170
+ schema={CardBlockSchema(hasButton)}
133
171
  title="Card block"
134
172
  onChangeField={(id, value) => {
135
173
  onChangeBlock(block, {
@@ -1,5 +1,8 @@
1
- import CclCard from '@eeacms/volto-clms-theme/components/CclCard/CclCard';
2
1
  import React from 'react';
2
+
3
+ import { HomeBgImg } from '@eeacms/volto-clms-theme/components/Blocks/CclHomeBgImageBlock/HomeBgImg';
4
+ import CclCard from '@eeacms/volto-clms-theme/components/CclCard/CclCard';
5
+
3
6
  import getListingBodyVariation from './utils.js';
4
7
 
5
8
  const CclCardContainerBlockView = (props) => {
@@ -11,23 +14,45 @@ const CclCardContainerBlockView = (props) => {
11
14
  const variation = getListingBodyVariation(data);
12
15
 
13
16
  let containerClass = '';
14
- if (['news', 'event'].includes(variation.templateID)) {
17
+ if (data.variation === 'cardWithBgImage') {
18
+ containerClass = 'home-map-container';
19
+ } else if (['news', 'event'].includes(variation.templateID)) {
15
20
  containerClass = 'ccl-container';
16
21
  } else if (!['line', 'doc', 'globalSearch'].includes(variation.templateID)) {
17
22
  containerClass = 'card-container';
18
23
  }
24
+
19
25
  return (
20
- <div className={containerClass}>
21
- {cards &&
22
- cards.map((card, index) => (
23
- <CclCard
24
- key={index}
25
- type={variation.templateID}
26
- card={card}
27
- isCustomCard={true}
28
- />
29
- ))}
30
- </div>
26
+ <>
27
+ {containerClass === 'home-map-container' ? (
28
+ <div className={containerClass}>
29
+ <HomeBgImg url={data?.image?.url} alt={data?.image?.alt} />
30
+ <div className="ccl-container">
31
+ {cards &&
32
+ cards.map((card, index) => (
33
+ <CclCard
34
+ key={index}
35
+ type={variation.templateID}
36
+ card={card}
37
+ isCustomCard={true}
38
+ />
39
+ ))}
40
+ </div>
41
+ </div>
42
+ ) : (
43
+ <div className={containerClass}>
44
+ {cards &&
45
+ cards.map((card, index) => (
46
+ <CclCard
47
+ key={index}
48
+ type={variation.templateID}
49
+ card={card}
50
+ isCustomCard={true}
51
+ />
52
+ ))}
53
+ </div>
54
+ )}
55
+ </>
31
56
  );
32
57
  };
33
58
 
@@ -31,6 +31,7 @@ const CclHomeBgImageBlockEdit = (props) => {
31
31
  });
32
32
  /* eslint-disable-next-line */
33
33
  }, []);
34
+
34
35
  return (
35
36
  <>
36
37
  <BodyTemplate
@@ -44,7 +45,6 @@ const CclHomeBgImageBlockEdit = (props) => {
44
45
  config,
45
46
  data.hasButton,
46
47
  data.hasLocationInfo,
47
- data.hasDatasetButton,
48
48
  )}
49
49
  title="Carousel Div block"
50
50
  onChangeField={(id, value) => {
@@ -1,9 +1,4 @@
1
- export const HomeBgImageSchema = (
2
- config,
3
- hasButton,
4
- hasLocationInfo,
5
- hasDatasetButton,
6
- ) => {
1
+ export const HomeBgImageSchema = (config, hasButton, hasLocationInfo) => {
7
2
  const variationsConfig = config.blocks.blocksConfig['homeBgImage'].variations;
8
3
  const variations = Object.keys(variationsConfig).map((variation) => [
9
4
  variationsConfig[variation].id,
@@ -18,20 +13,6 @@ export const HomeBgImageSchema = (
18
13
  },
19
14
  ]
20
15
  : [];
21
- const hasDatasetButtonFieldset = hasDatasetButton
22
- ? [
23
- {
24
- id: 'datasetButtonStyle',
25
- title: 'Dataset button style',
26
- fields: [
27
- 'dataset_buttonTitle',
28
- 'dataset_href',
29
- 'dataset_style',
30
- 'dataset_disabled',
31
- ],
32
- },
33
- ]
34
- : [];
35
16
  const hasLocationFieldset = hasLocationInfo
36
17
  ? [
37
18
  {
@@ -55,15 +36,10 @@ export const HomeBgImageSchema = (
55
36
  'location',
56
37
  'hasLocationInfo',
57
38
  'hasButton',
58
- 'dataset_title',
59
- 'dataset_subtitle',
60
- 'dataset_description',
61
- 'hasDatasetButton',
62
39
  ],
63
40
  },
64
41
  ...hasLocationFieldset,
65
42
  ...hasButtonFieldset,
66
- ...hasDatasetButtonFieldset,
67
43
  ],
68
44
  properties: {
69
45
  title: {
@@ -146,52 +122,6 @@ export const HomeBgImageSchema = (
146
122
  type: 'boolean',
147
123
  default: false,
148
124
  },
149
- dataset_title: {
150
- title: 'Dataset title',
151
- description: 'Dataset div title',
152
- type: 'string',
153
- },
154
- dataset_subtitle: {
155
- title: 'Dataset subTitle',
156
- description: 'Dataset div Subtitle',
157
- type: 'string',
158
- },
159
- dataset_description: {
160
- title: 'Dataset description',
161
- description: 'Dataset div description',
162
- type: 'string',
163
- },
164
- hasDatasetButton: {
165
- title: 'Dataset button',
166
- type: 'boolean',
167
- default: false,
168
- },
169
- dataset_buttonTitle: {
170
- title: 'Title',
171
- description: 'Add button text',
172
- type: 'string',
173
- },
174
- dataset_href: {
175
- title: 'URL',
176
- description: 'Select site content or paste external url',
177
- widget: 'object_browser',
178
- mode: 'link',
179
- selectedItemAttrs: ['Title', 'Description', '@type', '@id'],
180
- allowExternals: true,
181
- },
182
- dataset_style: {
183
- title: 'Button style',
184
- choices: [
185
- ['default', 'Default'],
186
- ['filled', 'Filled'],
187
- ],
188
- default: 'default',
189
- },
190
- dataset_disabled: {
191
- title: 'Disabled',
192
- type: 'boolean',
193
- default: false,
194
- },
195
125
  },
196
126
  required: [],
197
127
  };
@@ -58,24 +58,34 @@ const FilterList = (props) => {
58
58
  // if (choices?.length > 0) {
59
59
  // options = structure_taxonomy_terms(choices);
60
60
  // }
61
- let currentFiltersToCount = {};
62
- Object.keys(currentFilters).forEach((filterKey) => {
63
- if (typeof currentFilters[filterKey] === 'object') {
64
- currentFiltersToCount[filterKey] =
65
- (baseFacets.filter((facet) => facet.field.value === filterKey).length >
66
- 0 &&
67
- baseFacets.filter((facet) => facet.field.value === filterKey)[0]
68
- .type === 'doubleRangeFacet') ||
69
- (baseFacets.filter((facet) => facet.field.value === filterKey).length >
70
- 0 &&
71
- baseFacets.filter((facet) => facet.field.value === filterKey)[0]
72
- .type === 'doubleRangeSpatialFacet')
73
- ? ['placeholder']
74
- : currentFilters[filterKey].filter((filter) => {
61
+ const rangeFacets = ['doubleRangeFacet', 'doubleRangeSpatialFacet'];
62
+ const currentFiltersToCount = Object.keys(currentFilters).reduce((acc, f) => {
63
+ if (typeof currentFilters[f] === 'object') {
64
+ const queryDefinedFilter =
65
+ data?.query?.query?.length > 0
66
+ ? data?.query?.query.find((q) => q.i === f)
67
+ : null;
68
+ if (
69
+ !isEditMode &&
70
+ queryDefinedFilter?.v &&
71
+ currentFilters[f] &&
72
+ queryDefinedFilter.v.sort().toString() ===
73
+ currentFilters[f].sort().toString()
74
+ ) {
75
+ return acc;
76
+ }
77
+ acc[f] =
78
+ baseFacets.find((facet) => facet.field.value === f) &&
79
+ rangeFacets.includes(
80
+ baseFacets.filter((facet) => facet.field.value === f)[0].type,
81
+ )
82
+ ? ['rangeFacet']
83
+ : currentFilters[f].filter((filter) => {
75
84
  return !filtersToAvoidSet.has(filter);
76
85
  });
77
86
  }
78
- });
87
+ return acc;
88
+ }, {});
79
89
  // const totalFilters = [].concat.apply([], Object.values(currentFilters))
80
90
  // .length;
81
91
 
@@ -165,6 +165,12 @@ const availableVariations = [
165
165
  true,
166
166
  ),
167
167
  listingVariation('CclGlobalSearch', false, 'Global search', 'globalSearch'),
168
+ listingVariation(
169
+ 'cardWithBgImage',
170
+ false,
171
+ 'Card with background image',
172
+ 'cardWithBgImage',
173
+ ),
168
174
  ];
169
175
 
170
176
  const customBlocks = (config) => ({
@@ -1,31 +1,42 @@
1
- // import { flattenToAppURL } from '@plone/volto/helpers';
2
- // import { Redirect } from 'react-router-dom';
3
- // import { useSelector } from 'react-redux';
1
+ import { useSelector } from 'react-redux';
2
+ import { Redirect } from 'react-router-dom';
3
+
4
4
  import DefaultView from '@plone/volto/components/theme/View/DefaultView';
5
+ import { flattenToAppURL } from '@plone/volto/helpers';
5
6
 
6
7
  const CLMSDataSetAccordionView = (props) => {
7
- // const { content } = props;
8
+ const { content } = props;
8
9
  // const parent_url = content?.parent?.['@id'];
9
- // const userSession = useSelector((state) => state.userSession);
10
- // const isLoggedIn = userSession?.token;
10
+ const userSession = useSelector((state) => state.userSession);
11
+ const isLoggedIn = userSession?.token;
11
12
 
12
13
  // if (!__SERVER__) {
13
14
  // window.location.href = flattenToAppURL(parent_url);
14
15
  // }
15
16
 
16
- // if (isLoggedIn) {
17
- return (
18
- <DefaultView
19
- key={props.content['@id']}
20
- content={props.content}
21
- location={props.location}
22
- token={props.token}
23
- history={props.history}
24
- />
25
- );
26
- // } else {
27
- // return <Redirect to={flattenToAppURL(parent_url)} />;
28
- // }
17
+ if (isLoggedIn) {
18
+ return (
19
+ <DefaultView
20
+ key={props.content['@id']}
21
+ content={props.content}
22
+ location={props.location}
23
+ token={props.token}
24
+ history={props.history}
25
+ />
26
+ );
27
+ } else {
28
+ return (
29
+ // <Redirect to={flattenToAppURL(parent_url)} />
30
+ <Redirect
31
+ to={flattenToAppURL(
32
+ content.previous_item['@id'].substring(
33
+ 0,
34
+ content.previous_item['@id'].lastIndexOf('/') + 1,
35
+ ),
36
+ )}
37
+ />
38
+ );
39
+ }
29
40
  };
30
41
 
31
42
  export default CLMSDataSetAccordionView;
@@ -349,7 +349,7 @@ const DataSetInfoContent = (props) => {
349
349
  </Accordion>
350
350
  )}
351
351
 
352
- {props.jrc_show_related_datasets && (
352
+ {props.jrc_show_related_datasets && props.datasets.length > 0 && (
353
353
  <Accordion fluid styled>
354
354
  <Accordion.Title
355
355
  as={'h2'}
@@ -11,6 +11,7 @@ import { When } from '@eeacms/volto-clms-theme/components/CclWhen/CclWhen';
11
11
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
12
12
 
13
13
  import { portal_types_labels } from '../Blocks/CustomTemplates/VoltoSearchBlock';
14
+ // import { HomeBgImg } from '@eeacms/volto-clms-theme/components/Blocks/CclHomeBgImageBlock/HomeBgImg';
14
15
 
15
16
  import PropTypes from 'prop-types';
16
17
  import { FormattedMessage } from 'react-intl';
@@ -218,6 +219,7 @@ function CclCard(props) {
218
219
  'file',
219
220
  'downloadFile',
220
221
  'fileWithoutDates',
222
+ 'cardWithBgImage',
221
223
  ];
222
224
  const wrapperClass =
223
225
  'card-' +
@@ -229,6 +231,8 @@ function CclCard(props) {
229
231
  ? 'file card-file-aligned'
230
232
  : type === 'line-no-description'
231
233
  ? 'line card-line-no-description'
234
+ : type === 'cardWithBgImage'
235
+ ? 'home-map-banner'
232
236
  : type || 'line');
233
237
 
234
238
  return (
@@ -400,6 +404,31 @@ function CclCard(props) {
400
404
  </div>
401
405
  </>
402
406
  )}
407
+ {type === 'cardWithBgImage' && (
408
+ <>
409
+ {card.title && <h1>{card?.title}</h1>}
410
+ {card.subtitle && <h2>{card?.subtitle}</h2>}
411
+ {card.description && <h3>{card?.description} </h3>}
412
+ {card?.buttonTitle && (
413
+ <CclButton
414
+ url={url === '/' ? '#' : url}
415
+ disabled={card?.disabled}
416
+ download={
417
+ card?.download || card?.href?.[0]?.['@type'] === 'File'
418
+ }
419
+ target={
420
+ card?.target ||
421
+ (card?.download &&
422
+ card?.href[0]['@type'] === 'File' &&
423
+ '_blank')
424
+ }
425
+ mode={card?.style}
426
+ >
427
+ {card?.buttonTitle}
428
+ </CclButton>
429
+ )}
430
+ </>
431
+ )}
403
432
  </>
404
433
  ) : (
405
434
  <>
@@ -41,6 +41,11 @@ const Facets = (props) => {
41
41
  const field = facetSettings?.field?.value;
42
42
  const index = querystring.indexes[field] || {};
43
43
  const { values = {} } = index;
44
+ const isQueryDefined =
45
+ data.query?.query?.length > 0 &&
46
+ data.query?.query.find((q) => q.i === field)
47
+ ? true
48
+ : false;
44
49
 
45
50
  let choices = Object.keys(values)
46
51
  .map((name) => ({
@@ -75,14 +80,15 @@ const Facets = (props) => {
75
80
  const {
76
81
  rewriteOptions = (name, options) => options,
77
82
  } = search.extensions.facetWidgets;
78
-
79
83
  return FacetWrapper && (isEditMode || showFacet(index)) ? (
80
84
  <FacetWrapper key={facetSettings['@id']}>
81
85
  <FacetWidget
82
86
  facet={facetSettings}
83
87
  choices={rewriteOptions(facetSettings?.field?.value, choices)}
84
88
  isMulti={isMulti}
85
- value={value}
89
+ value={
90
+ value.length < choices.length || !isQueryDefined ? value : []
91
+ }
86
92
  isEditMode={isEditMode}
87
93
  onChange={(id, value) => {
88
94
  !isEditMode && setFacets({ ...facets, [id]: value });
@@ -0,0 +1,118 @@
1
+ import React, { useRef, useEffect } from 'react';
2
+ import { useHistory, useLocation } from 'react-router-dom';
3
+ import qs from 'query-string';
4
+ import { useSelector } from 'react-redux';
5
+ import { slugify } from '@plone/volto/helpers/Utils/Utils';
6
+
7
+ /**
8
+ * @function numberOfPaginatedBlocks
9
+ * @description A function to search blocks with pagination, return the number of blocks with pagination possibility.
10
+ * @returns {string} Example: 2
11
+ */
12
+
13
+ const numberOfPaginatedBlocks = (blocks, blocksLayout) => {
14
+ const blockTypesWithPagination = ['search', 'listing'];
15
+ const total = blocksLayout.reduce((acc, blockId) => {
16
+ if (blockTypesWithPagination.includes(blocks[blockId]['@type'])) {
17
+ return 1 + acc;
18
+ } else if (
19
+ 'tabs_block' === blocks[blockId]['@type'] &&
20
+ blocks[blockId].data?.blocks &&
21
+ blocks[blockId].data?.blocks_layout?.items
22
+ ) {
23
+ const tab_items = blocks[blockId].data?.blocks_layout?.items;
24
+ const tab_blocks = blocks[blockId].data?.blocks;
25
+ const tab_paginations = tab_items.reduce((acc, blockId) => {
26
+ return (
27
+ acc +
28
+ numberOfPaginatedBlocks(
29
+ tab_blocks[blockId].blocks,
30
+ tab_blocks[blockId].blocks_layout?.items,
31
+ )
32
+ );
33
+ }, 0);
34
+ return (
35
+ tab_paginations +
36
+ numberOfPaginatedBlocks(
37
+ blocks[blockId].data?.blocks,
38
+ blocks[blockId].data?.blocks_layout?.items,
39
+ ) +
40
+ acc
41
+ );
42
+ } // else if (/* TODO: add the support for other container blocks. fe: accordion */){}
43
+ return acc;
44
+ }, 0);
45
+ return total;
46
+ };
47
+
48
+ /**
49
+ * @function useCreatePageQueryStringKey
50
+ * @description A hook that creates a key with an id if there are multiple blocks with pagination.
51
+ * @returns {string} Example: page || page_012345678
52
+ */
53
+ const useCreatePageQueryStringKey = (id) => {
54
+ const blocks = useSelector((state) => state?.content?.data?.blocks) || [];
55
+ const blocksLayout =
56
+ useSelector((state) => state?.content?.data?.blocks_layout?.items) || [];
57
+ const paginatedBlocks = numberOfPaginatedBlocks(blocks, blocksLayout);
58
+ return paginatedBlocks > 1 ? slugify(`page-${id}`) : 'page';
59
+ };
60
+
61
+ const useGetBlockType = (id) => {
62
+ const blocks = useSelector((state) => state?.content?.data?.blocks) || [];
63
+ const block = blocks[id];
64
+ return block ? block?.['@type'] : null;
65
+ };
66
+
67
+ /**
68
+ * A pagination helper that tracks the query and resets pagination in case the
69
+ * query changes.
70
+ */
71
+ export const usePagination = (id = null, defaultPage = 1) => {
72
+ const location = useLocation();
73
+ const history = useHistory();
74
+ const pageQueryStringKey = useCreatePageQueryStringKey(id);
75
+ const block_type = useGetBlockType(id);
76
+ const pageQueryParam =
77
+ qs.parse(location.search)[pageQueryStringKey] || defaultPage;
78
+ const [currentPage, setCurrentPageState] = React.useState(
79
+ parseInt(pageQueryParam),
80
+ );
81
+ const setCurrentPage = (page) => {
82
+ setCurrentPageState(page);
83
+ const newParams = {
84
+ ...qs.parse(location.search),
85
+ [pageQueryStringKey]: page,
86
+ };
87
+ history.push({ search: qs.stringify(newParams) });
88
+ };
89
+
90
+ const queryRef = useRef(qs.parse(location.search)?.query);
91
+ useEffect(() => {
92
+ if (
93
+ queryRef.current !== qs.parse(location.search)?.query &&
94
+ block_type === 'search'
95
+ ) {
96
+ setCurrentPageState(defaultPage);
97
+ const newParams = {
98
+ ...qs.parse(location.search),
99
+ [pageQueryStringKey]: defaultPage,
100
+ };
101
+ delete newParams[pageQueryStringKey];
102
+ history.replace({ search: qs.stringify(newParams) });
103
+ queryRef.current = qs.parse(location.search)?.query;
104
+ } else {
105
+ setCurrentPageState(
106
+ parseInt(
107
+ qs.parse(location.search)?.[pageQueryStringKey] || defaultPage,
108
+ ),
109
+ );
110
+ }
111
+ // eslint-disable-next-line react-hooks/exhaustive-deps
112
+ }, [location.search, block_type]);
113
+
114
+ return {
115
+ currentPage,
116
+ setCurrentPage,
117
+ };
118
+ };
@@ -293,6 +293,7 @@
293
293
 
294
294
  @media (max-width: 700px) {
295
295
  .home-dataset-banner,
296
+ .card-home-map-banner,
296
297
  .home-map-banner {
297
298
  min-width: 320px;
298
299
  }
@@ -316,6 +317,22 @@
316
317
  }
317
318
  }
318
319
 
320
+ .card-home-map-banner {
321
+ max-width: 100%;
322
+ padding: 1.5rem;
323
+ background-color: fade(@white, 70%);
324
+ text-align: center;
325
+ }
326
+
327
+ .card-home-map-banner h4 {
328
+ margin-bottom: 1rem;
329
+ }
330
+ @media (min-width: 768px) {
331
+ .card-home-map-banner {
332
+ width: 25%;
333
+ }
334
+ }
335
+
319
336
  .home-map-banner {
320
337
  max-width: 100%;
321
338
  padding: 1.5rem;