@eeacms/volto-clms-theme 1.1.103 → 1.1.105

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,28 @@ 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.105](https://github.com/eea/volto-clms-theme/compare/1.1.104...1.1.105) - 25 January 2024
8
+
9
+ #### :bug: Bug Fixes
10
+
11
+ - fix: CLMS-2970 redirect to dataset page [Unai - [`df6898f`](https://github.com/eea/volto-clms-theme/commit/df6898f37b79f4c309764928fb943b6f8076affb)]
12
+ - fix: CLMS-2982 [Unai - [`2b3226b`](https://github.com/eea/volto-clms-theme/commit/2b3226bd6020da1dab5d0544604ec6907b440d99)]
13
+ - fix: CLMS-3026 [Unai - [`6616839`](https://github.com/eea/volto-clms-theme/commit/66168397ff68cd96f861e22424c144a7218a00ac)]
14
+ - fix: CLMS-3026 [Unai - [`2a0edb9`](https://github.com/eea/volto-clms-theme/commit/2a0edb936adffdfd20a61fbef69f86fa85954eb2)]
15
+
16
+ #### :hammer_and_wrench: Others
17
+
18
+ - lint [Unai - [`79e0512`](https://github.com/eea/volto-clms-theme/commit/79e0512de5f15b307859e949b3c491792178e208)]
19
+ - lint [Unai - [`3b65686`](https://github.com/eea/volto-clms-theme/commit/3b65686e7f5b4d1b1fd20e72a3fada723ac88a84)]
20
+ - dataset extras removed from homeBgImageBlock & white variation still working [Unai - [`9707e63`](https://github.com/eea/volto-clms-theme/commit/9707e632877bbee38d208f0eb2d5b58d88e5e15e)]
21
+ - new listing card variation [Unai - [`b34ddb4`](https://github.com/eea/volto-clms-theme/commit/b34ddb40c79014cae7f2fe68513a9c12462cfc52)]
22
+ - Revert "fix: CLMS-3026" [Unai - [`36c450d`](https://github.com/eea/volto-clms-theme/commit/36c450db7351bef129241dcd2816c0bc1d4a1a44)]
23
+ ### [1.1.104](https://github.com/eea/volto-clms-theme/compare/1.1.103...1.1.104) - 19 January 2024
24
+
25
+ #### :bug: Bug Fixes
26
+
27
+ - fix: multiselect in accordionCheckbox facet [Unai - [`55d543f`](https://github.com/eea/volto-clms-theme/commit/55d543ffffb8edfb4d5872231add7e7c5406d5a5)]
28
+
7
29
  ### [1.1.103](https://github.com/eea/volto-clms-theme/compare/1.1.102...1.1.103) - 17 January 2024
8
30
 
9
31
  #### :hammer_and_wrench: Others
@@ -204,7 +226,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
204
226
 
205
227
  - to render nothing, return null [Mikel Larreategi - [`2fb3580`](https://github.com/eea/volto-clms-theme/commit/2fb35802b23e3aba5fd166aeefd103c929ffb5d1)]
206
228
  - simplify condtioin [Mikel Larreategi - [`f9b43da`](https://github.com/eea/volto-clms-theme/commit/f9b43da91d360e0028402f9a7ba762f16b0d9b22)]
207
- - test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`7c6e9ca`](https://github.com/eea/volto-clms-theme/commit/7c6e9cac9da0c06d0f24711303404f5055fba7d1)]
208
229
  ### [1.1.80](https://github.com/eea/volto-clms-theme/compare/1.1.79...1.1.80) - 17 November 2023
209
230
 
210
231
  #### :bug: Bug Fixes
@@ -215,7 +236,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
215
236
 
216
237
  #### :hammer_and_wrench: Others
217
238
 
218
- - test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`37c3299`](https://github.com/eea/volto-clms-theme/commit/37c3299dd19c95057e70d48152bfef2365f2416c)]
219
239
  - CLMS-2509 (Bug): Lint [Urkorue - [`1bbc011`](https://github.com/eea/volto-clms-theme/commit/1bbc011481c0ee1feb68d0cf57c4a5a9f4c224ca)]
220
240
  - CLMS-2509 (Bug): Timeseries icon centered [Urkorue - [`fc38685`](https://github.com/eea/volto-clms-theme/commit/fc3868598ab592f01bb3ee23f985ada5c11227d4)]
221
241
  ### [1.1.78](https://github.com/eea/volto-clms-theme/compare/1.1.77...1.1.78) - 16 November 2023
@@ -268,17 +288,14 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
268
288
 
269
289
  #### :hammer_and_wrench: Others
270
290
 
271
- - test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`c55db1c`](https://github.com/eea/volto-clms-theme/commit/c55db1c20cfef1eb34c587343a4822fa4bde3c54)]
272
291
  ### [1.1.73](https://github.com/eea/volto-clms-theme/compare/1.1.72...1.1.73) - 6 November 2023
273
292
 
274
293
  #### :hammer_and_wrench: Others
275
294
 
276
- - test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`3a543b9`](https://github.com/eea/volto-clms-theme/commit/3a543b9000c1168d54edfb8003eb08dfa7c85031)]
277
295
  - comment Integration tests [Ion Lizarazu - [`74713f8`](https://github.com/eea/volto-clms-theme/commit/74713f8f78d77ba193d8c27462cc8787d698ab81)]
278
296
  - uncomment cypress tests [Ion Lizarazu - [`3526a5c`](https://github.com/eea/volto-clms-theme/commit/3526a5c46481667b0518c6cce0927e67726c6f6c)]
279
297
  - use chrome instead of chromium to run cypress tests [Ion Lizarazu - [`6ae3a06`](https://github.com/eea/volto-clms-theme/commit/6ae3a06dbec1914c06a55c0dcb826c49b75f9739)]
280
298
  - ccltabs activeTab condition having first child [Ion Lizarazu - [`3cf9376`](https://github.com/eea/volto-clms-theme/commit/3cf9376d55f5f41b7e42c25e5925cd871ec71d81)]
281
- - test: [JENKINS] Improve cypress time [valentinab25 - [`f41ecfe`](https://github.com/eea/volto-clms-theme/commit/f41ecfea8b5a1e409303ffcc7befe7f51316d652)]
282
299
  ### [1.1.72](https://github.com/eea/volto-clms-theme/compare/1.1.71...1.1.72) - 2 November 2023
283
300
 
284
301
  ### [1.1.71](https://github.com/eea/volto-clms-theme/compare/1.1.70...1.1.71) - 31 October 2023
@@ -289,7 +306,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
289
306
 
290
307
  #### :house: Internal changes
291
308
 
292
- - chore: [JENKINS] Refactor automated testing [valentinab25 - [`67ca3bb`](https://github.com/eea/volto-clms-theme/commit/67ca3bb111f34842569c12b9c87a2a91bd14b09e)]
293
309
 
294
310
  #### :hammer_and_wrench: Others
295
311
 
@@ -386,7 +402,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
386
402
 
387
403
  - readme [Mikel Larreategi - [`3c0ab05`](https://github.com/eea/volto-clms-theme/commit/3c0ab051981a4efad7712bc46182eed9d79fd10f)]
388
404
  - remove from addons [Mikel Larreategi - [`89c2e7d`](https://github.com/eea/volto-clms-theme/commit/89c2e7d793193e6bb64642f0b06a01cd3c81108a)]
389
- - yarn.lock added after running yarn [Unai - [`ad307be`](https://github.com/eea/volto-clms-theme/commit/ad307be72bbfe753f7571ea4d784a09978e0f7f2)]
390
405
  - prettier issue fix [Unai - [`8bc0650`](https://github.com/eea/volto-clms-theme/commit/8bc0650918f9fa1065d19d2c15ce153a5fc5abbb)]
391
406
  - set a limit of 5 items in the download queue [Mikel Larreategi - [`b81cc83`](https://github.com/eea/volto-clms-theme/commit/b81cc8383165bafbbff52fbeeb365d413051802e)]
392
407
  - adjust logo size [Mikel Larreategi - [`b90a72c`](https://github.com/eea/volto-clms-theme/commit/b90a72c07102025a7e90607b25d34611ddd4f4f6)]
@@ -528,7 +543,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
528
543
 
529
544
  - fix cart items concat function [Ion Lizarazu - [`4b72249`](https://github.com/eea/volto-clms-theme/commit/4b72249ef17a0cda22661809fce5be7c2d1f6649)]
530
545
  - revert Jenkinsfile [Ion Lizarazu - [`64f6cd0`](https://github.com/eea/volto-clms-theme/commit/64f6cd08100357843b507c00d3286d7debe0ef04)]
531
- - yarn.lock file [Ion Lizarazu - [`8444ad1`](https://github.com/eea/volto-clms-theme/commit/8444ad1606b3939e4609bdd186e5ace2252588a8)]
532
546
  - packages.json versions order [Ion Lizarazu - [`4fd7a86`](https://github.com/eea/volto-clms-theme/commit/4fd7a86ab43238841b421e1ed10ebd52ab420a15)]
533
547
  - downloadablefilestablewidget param modification [Ion Lizarazu - [`5dd794a`](https://github.com/eea/volto-clms-theme/commit/5dd794a33a8eddd042a753b7ab47e7d2a323b011)]
534
548
  - add technical_documents_accordion_text field to the dataset view [Ion Lizarazu - [`96ed1e5`](https://github.com/eea/volto-clms-theme/commit/96ed1e5e2c2b501bd303bc76b333a70ad1614c16)]
@@ -653,7 +667,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
653
667
 
654
668
  - remove NUTS text for area naming in the cart [ionlizarazu - [`062e0a3`](https://github.com/eea/volto-clms-theme/commit/062e0a375f5352bc13c18ff7ec33fad4bcc59f2f)]
655
669
  - dependencies [ionlizarazu - [`405ef96`](https://github.com/eea/volto-clms-theme/commit/405ef96090fe7bd4af73a49d3285a92fad712e3b)]
656
- - yarn.lock [ionlizarazu - [`7132119`](https://github.com/eea/volto-clms-theme/commit/71321195c4dd4fceed67f2f0872f3e24bba61c17)]
657
670
  - volto-blocks-grid module mapping [ionlizarazu - [`4fec3ca`](https://github.com/eea/volto-clms-theme/commit/4fec3cabc437322ad92ed90d682250bd123ccaaf)]
658
671
  - volto-blocks-grid v7.0.2 [ionlizarazu - [`2557e60`](https://github.com/eea/volto-clms-theme/commit/2557e6039d3cea33ca0bd11a0a3ef4764c611f78)]
659
672
  - remove styling from teaser block [ionlizarazu - [`879e684`](https://github.com/eea/volto-clms-theme/commit/879e684057c88f52f60f0fa54cbaa155c7d14688)]
@@ -741,7 +754,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
741
754
 
742
755
  #### :house: Internal changes
743
756
 
744
- - chore: [JENKINS] Remove alpha testing version [valentinab25 - [`b4cbf65`](https://github.com/eea/volto-clms-theme/commit/b4cbf6557fbc67f7fc4cea5aa2cb19804f3d7e3c)]
745
757
 
746
758
  #### :hammer_and_wrench: Others
747
759
 
@@ -1940,7 +1952,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
1940
1952
  #### :hammer_and_wrench: Others
1941
1953
 
1942
1954
  - 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)]
1943
- - Revert "[JENKINS] Use eeacms/plone-backend and Volto alpha version- Refs #151967" [Mikel Larreategi - [`46eb694`](https://github.com/eea/volto-clms-theme/commit/46eb69415280a3c982405299135027ae4221426a)]
1944
1955
  - 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)]
1945
1956
  - lint fix [Unai - [`1264a7a`](https://github.com/eea/volto-clms-theme/commit/1264a7adfe8d679fea1bd821ad087add20f4271d)]
1946
1957
  - 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)]
@@ -2091,7 +2102,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
2091
2102
  - search block new features [ionlizarazu - [`8e814cb`](https://github.com/eea/volto-clms-theme/commit/8e814cbd359782540c21fe37b37ef146d331f0d6)]
2092
2103
  - language selector cookie management [ionlizarazu - [`1385ac9`](https://github.com/eea/volto-clms-theme/commit/1385ac95795702206d3623ba6e780faa43a89e0a)]
2093
2104
  - toolbar cookie management [ionlizarazu - [`5c23200`](https://github.com/eea/volto-clms-theme/commit/5c23200790b20e1d4f1bc966463c37bf4c808f47)]
2094
- - Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`0316a0d`](https://github.com/eea/volto-clms-theme/commit/0316a0d8b6fb0fa14af13002415f3c95d9f8ede3)]
2095
2105
  ### [1.0.84](https://github.com/eea/volto-clms-theme/compare/1.0.83...1.0.84) - 18 March 2022
2096
2106
 
2097
2107
  #### :hammer_and_wrench: Others
@@ -2996,13 +3006,11 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
2996
3006
  #### :hammer_and_wrench: Others
2997
3007
 
2998
3008
  - replace @collective/volto-dropdownmenu with volto-dropdownmenu [ionlizarazu - [`07f004f`](https://github.com/eea/volto-clms-theme/commit/07f004fe0219e403fb51bc045c83d34f3b981f76)]
2999
- - yarn.lock [ionlizarazu - [`fe1ca04`](https://github.com/eea/volto-clms-theme/commit/fe1ca04889d29fe7b653db4c69af2751b84b8a1a)]
3000
3009
  - add NODE_ENV parameter [ionlizarazu - [`101f27c`](https://github.com/eea/volto-clms-theme/commit/101f27c25b8fbd192e1b11865e95cf5ffee08c1b)]
3001
3010
  - upgrade volto-dropdownmenu version [ionlizarazu - [`2081855`](https://github.com/eea/volto-clms-theme/commit/2081855301f4c708776e0dbab39db143cee00dbc)]
3002
3011
  - HomeSearch block missing url behaviour [ionlizarazu - [`d20a378`](https://github.com/eea/volto-clms-theme/commit/d20a378ce3f254b8343692348f314bf281974542)]
3003
3012
  - babel configuration [ionlizarazu - [`203ea2d`](https://github.com/eea/volto-clms-theme/commit/203ea2de07f99ca3403e4ca220ca74d7ce69b61d)]
3004
3013
  - prettier [ionlizarazu - [`e79e26b`](https://github.com/eea/volto-clms-theme/commit/e79e26bf2fa40ba7b4eb53a24dabd87928221c28)]
3005
- - add yarn lock [ionlizarazu - [`e1ab28b`](https://github.com/eea/volto-clms-theme/commit/e1ab28b060d5a74431c368b0de82a68dabce1eab)]
3006
3014
  - Jenkinsfile cypress test [ionlizarazu - [`b385d65`](https://github.com/eea/volto-clms-theme/commit/b385d65986f717c60f8c434a08fc11b829d08eb4)]
3007
3015
  - cypress [ionlizarazu - [`a243cf0`](https://github.com/eea/volto-clms-theme/commit/a243cf0182fa3dd113c16ff495c71e310252d83b)]
3008
3016
  - 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.103",
3
+ "version": "1.1.105",
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,94 @@ 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 = (hasExtras, hasButton) => {
26
+ const hasExtrasFieldset = hasExtras
27
+ ? [
28
+ {
29
+ id: 'extraFields',
30
+ title: 'Extra fields',
31
+ fields: ['subtitle', 'hasButton'],
32
+ },
33
+ ]
34
+ : [];
35
+ const hasButtonFieldset = hasButton
36
+ ? [
37
+ {
38
+ id: 'buttonStyle',
39
+ title: 'Button style',
40
+ fields: ['buttonTitle', 'href', 'style', 'disabled'],
41
+ },
42
+ ]
43
+ : [];
44
+
45
+ return {
46
+ title: 'Card block',
47
+ fieldsets: [
48
+ {
49
+ id: 'default',
50
+ title: 'Default',
51
+ fields: ['title', 'description', 'url'],
52
+ },
53
+ ...hasExtrasFieldset,
54
+ ...hasButtonFieldset,
55
+ ],
56
+ properties: {
57
+ title: {
58
+ title: 'Title',
59
+ description: 'Card title',
60
+ type: 'string',
61
+ placeholder: 'Card title here',
62
+ },
63
+ image: {
64
+ title: 'Card image',
65
+ },
66
+ description: {
67
+ title: 'Product description',
68
+ type: 'string',
69
+ },
70
+ url: {
71
+ title: 'url',
72
+ widget: 'object_browser',
73
+ mode: 'link',
74
+ allowExternals: true,
75
+ },
76
+ subtitle: {
77
+ title: 'SubTitle',
78
+ description: 'Div Subtitle',
79
+ type: 'string',
80
+ },
81
+ hasButton: {
82
+ title: 'Button',
83
+ type: 'boolean',
84
+ default: false,
85
+ },
86
+ buttonTitle: {
87
+ title: 'Title',
88
+ description: 'Add button text',
89
+ type: 'string',
90
+ },
91
+ href: {
92
+ title: 'URL',
93
+ description: 'Select site content or paste external url',
94
+ widget: 'object_browser',
95
+ mode: 'link',
96
+ selectedItemAttrs: ['Title', 'Description', '@type', '@id'],
97
+ allowExternals: true,
98
+ },
99
+ style: {
100
+ title: 'Button style',
101
+ choices: [
102
+ ['default', 'Default'],
103
+ ['filled', 'Filled'],
104
+ ],
105
+ default: 'default',
106
+ },
107
+ disabled: {
108
+ title: 'Disabled',
109
+ type: 'boolean',
110
+ default: false,
111
+ },
53
112
  },
54
- },
55
- required: [],
56
- });
113
+ required: [],
114
+ };
115
+ };
@@ -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 hasExtras = 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,10 @@ const CclCardContainerBlockEdit = ({
129
167
  }
130
168
  >
131
169
  <BlockDataForm
132
- schema={CardBlockSchema()}
170
+ schema={CardBlockSchema(
171
+ hasExtras,
172
+ data?.customCards?.blocks?.[selectedCardBlock]?.hasButton,
173
+ )}
133
174
  title="Card block"
134
175
  onChangeField={(id, value) => {
135
176
  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
  };
@@ -23,6 +23,14 @@ export const uncheckOptionAndChildren = (value, option) => {
23
23
  };
24
24
 
25
25
  export const enhanceExpandedByDefault = ({ schema, formData }) => {
26
+ let { fields } = schema.fieldsets[0];
27
+ const pos = fields.indexOf('type') + 1;
28
+ fields = [
29
+ ...fields.slice(0, pos),
30
+ 'multiple',
31
+ ...fields.slice(pos, fields.length),
32
+ ];
33
+ schema.fieldsets[0].fields = fields;
26
34
  return expandedByDefault(schema);
27
35
  };
28
36
 
@@ -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
+ 'cardWithBgImage',
172
+ 'cardWithBgImage',
173
+ ),
168
174
  ];
169
175
 
170
176
  const customBlocks = (config) => ({