design-comuni-plone-theme 10.6.2 → 10.6.4
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 +30 -0
- package/README.md +22 -0
- package/RELEASE.md +12 -0
- package/package.json +2 -2
- package/publiccode.yml +19 -2
- package/src/customizations/volto/components/manage/Blocks/Search/SearchBlockView.jsx +4 -1
- package/src/theme/ItaliaTheme/Blocks/_bandiInEvidenceTemplate.scss +2 -2
- package/src/theme/ItaliaTheme/Blocks/_completeBlockLinkstemplate.scss +0 -4
- package/src/theme/ItaliaTheme/Blocks/_ctaBlock.scss +0 -5
- package/src/theme/ItaliaTheme/Blocks/_imageBlock.scss +4 -0
- package/src/theme/ItaliaTheme/Blocks/_search.scss +11 -5
- package/src/theme/ItaliaTheme/_common.scss +2 -19
- package/src/customizations/volto-gdpr-privacy/components/ConditionalEmbed/ConditionalEmbed.jsx +0 -135
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
## [10.6.4](https://github.com/redturtle/design-comuni-plone-theme/compare/v10.6.3...v10.6.4) (2023-12-18)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* external-link icon colors ([27ba53d](https://github.com/redturtle/design-comuni-plone-theme/commit/27ba53db1fb14b318f0d792545481903cd1dea4c))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Documentation
|
|
12
|
+
|
|
13
|
+
* aggiornata lista dei comuni nel README.md ([#162](https://github.com/redturtle/design-comuni-plone-theme/issues/162)) ([23f9c50](https://github.com/redturtle/design-comuni-plone-theme/commit/23f9c501634795f0263e0c7bb66eb26768853e65))
|
|
14
|
+
* aggiunti i comuni di nci a publiccode.yml ([#163](https://github.com/redturtle/design-comuni-plone-theme/issues/163)) ([3748bcd](https://github.com/redturtle/design-comuni-plone-theme/commit/3748bcddd93d86137f74bd4311ebe50600a04549))
|
|
15
|
+
* aggiunto campegine a publiccode.yml ([#160](https://github.com/redturtle/design-comuni-plone-theme/issues/160)) ([f36c5c1](https://github.com/redturtle/design-comuni-plone-theme/commit/f36c5c103df04b8c5cca05885f1cf90a322129c7))
|
|
16
|
+
* aggiunto canossa a publiccode.yml ([#161](https://github.com/redturtle/design-comuni-plone-theme/issues/161)) ([5172337](https://github.com/redturtle/design-comuni-plone-theme/commit/5172337fce80452311249c81b16397bd826aa7c0))
|
|
17
|
+
* updated publiccode ([c962dc6](https://github.com/redturtle/design-comuni-plone-theme/commit/c962dc699f850ff9f5206afb01abe38d2577a3cf))
|
|
18
|
+
|
|
19
|
+
## [10.6.3](https://github.com/redturtle/design-comuni-plone-theme/compare/v10.6.2...v10.6.3) (2023-12-15)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* different styles and ui for all Search block listing templates when compared to default Listing template ([#437](https://github.com/redturtle/design-comuni-plone-theme/issues/437)) ([d6cf41d](https://github.com/redturtle/design-comuni-plone-theme/commit/d6cf41dd63e6d1b891ff045238d5d7d9d9df5ff0))
|
|
25
|
+
* gdpr privacy conditional embed to work in diff view ([#438](https://github.com/redturtle/design-comuni-plone-theme/issues/438)) ([6a8c361](https://github.com/redturtle/design-comuni-plone-theme/commit/6a8c361feda654f0301b5026533234438469ff37))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Documentation
|
|
29
|
+
|
|
30
|
+
* aggiornamento della lista dei comuni in publiccode.yml ([#159](https://github.com/redturtle/design-comuni-plone-theme/issues/159)) ([7e87e9f](https://github.com/redturtle/design-comuni-plone-theme/commit/7e87e9f2071adeced38eae57eb8d09cee6433fa1))
|
|
31
|
+
* updated publiccode and release log ([f27a61a](https://github.com/redturtle/design-comuni-plone-theme/commit/f27a61aef3f41ac34bcbdf9e58e2a6ae0166d0f9))
|
|
32
|
+
|
|
3
33
|
## [10.6.2](https://github.com/redturtle/design-comuni-plone-theme/compare/v10.6.1...v10.6.2) (2023-12-14)
|
|
4
34
|
|
|
5
35
|
|
package/README.md
CHANGED
|
@@ -68,26 +68,47 @@ Si veda ad esempio:
|
|
|
68
68
|
- [Biblioteche Pianura Est](https://bibest.it)
|
|
69
69
|
- [Camera di Commercio dell'Umbria](https://www.umbria.camcom.it/)
|
|
70
70
|
- [Camera di Commercio di Reggio Emilia](https://www.re.camcom.gov.it/)
|
|
71
|
+
- [Comune della Spezia](https://www.comune.laspezia.it/)
|
|
71
72
|
- [Comune di Bibbiano](https://www.comune.bibbiano.re.it/)
|
|
73
|
+
- [Comune di Borgo Tossignano](https://www.comune.borgotossignano.bo.it/)
|
|
72
74
|
- [Comune di Campegine](https://www.comune.campegine.re.it/)
|
|
73
75
|
- [Comune di Camposanto](https://www.comune.camposanto.mo.it/)
|
|
74
76
|
- [Comune di Canossa](https://www.comune.canossa.re.it/)
|
|
75
77
|
- [Comune di Cantagallo](https://www.comune.cantagallo.po.it/)
|
|
78
|
+
- [Comune di Casalfiumanese](https://www.comune.casalfiumanese.bo.it/)
|
|
79
|
+
- [Comune di Castel del Rio](https://www.comune.casteldelrio.bo.it/)
|
|
80
|
+
- [Comune di Cavezzo](https://www.comune.cavezzo.mo.it/)
|
|
76
81
|
- [Comune di Cavriago](https://www.comune.cavriago.re.it/)
|
|
82
|
+
- [Comune di Concordia sul Secchia](https://www.comune.concordia.mo.it/)
|
|
83
|
+
- [Comune di Dozza](https://www.comune.dozza.bo.it/)
|
|
84
|
+
- [Comune di Finale Emilia](https://www.comune.finale.mo.it/)
|
|
85
|
+
- [Comune di Fiorano Modenese](https://www.comune.fiorano-modenese.mo.it/)
|
|
86
|
+
- [Comune di Fontanelice](https://www.comune.fontanelice.bo.it/)
|
|
87
|
+
- [Comune di Formigine](https://www.comune.formigine.mo.it/)
|
|
88
|
+
- [Comune di Frassinoro](https://www.comune.frassinoro.mo.it/)
|
|
77
89
|
- [Comune di Gattatico](https://www.comune.gattatico.re.it/)
|
|
78
90
|
- [Comune di Imola](https://www.comune.imola.bo.it)
|
|
91
|
+
- [Comune di Maranello](https://www.comune.maranello.mo.it/)
|
|
79
92
|
- [Comune di Medolla](https://www.comune.medolla.mo.it/)
|
|
80
93
|
- [Comune di Mirandola](https://www.comune.mirandola.mo.it/)
|
|
81
94
|
- [Comune di Modena](https://www.comune.modena.it/)
|
|
82
95
|
- [Comune di Montecchio Emilia](https://www.comune.montecchio-emilia.re.it/)
|
|
96
|
+
- [Comune di Montefiorino](https://www.comune.montefiorino.mo.it/)
|
|
97
|
+
- [Comune di Mordano](https://www.comune.mordano.bo.it/)
|
|
83
98
|
- [Comune di Novellara](https://www.comune.novellara.re.it/)
|
|
99
|
+
- [Comune di Palagano](https://www.comune.palagano.mo.it/)
|
|
84
100
|
- [Comune di Parma](https://www.comune.parma.it/)
|
|
85
101
|
- [Comune di Piacenza](https://www.comune.piacenza.it/)
|
|
102
|
+
- [Comune di Prignano sulla Secchia](https://www.comune.prignano.mo.it/)
|
|
86
103
|
- [Comune di Reggio Emilia](https://www.comune.re.it/)
|
|
104
|
+
- [Comune di San Felice sul Panaro](https://www.comune.sanfelice.mo.it/)
|
|
87
105
|
- [Comune di San Lazzaro di Savena](https://www.comune.sanlazzaro.bo.it)
|
|
88
106
|
- [Comune di San Polo d'Enza](https://www.comune.sanpolodenza.re.it/)
|
|
89
107
|
- [Comune di San Possidonio](https://www.comune.sanpossidonio.mo.it/)
|
|
108
|
+
- [Comune di San Prospero](https://www.comune.sanprospero.mo.it/)
|
|
90
109
|
- [Comune di Santilario d'Enza](https://www.comune.santilariodenza.re.it/)
|
|
110
|
+
- [Comune di Sassuolo](https://www.comune.sassuolo.mo.it/)
|
|
111
|
+
- [Comune di Toscolano Maderno](https://www.comune.toscolanomaderno.bs.it/)
|
|
91
112
|
- [Comune di Vaiano](https://www.comune.vaiano.po.it/)
|
|
92
113
|
- [Comune di Vernio](https://www.comune.vernio.po.it/)
|
|
93
114
|
- [Comando Generale della Guardia di Finanza](https://www.gdf.gov.it/it)
|
|
@@ -95,6 +116,7 @@ Si veda ad esempio:
|
|
|
95
116
|
- [Nuovo Circondario Imolese](https://www.nuovocircondarioimolese.it)
|
|
96
117
|
- [Ospedali Galliera - Bilancio Sociale](https://bilanciosociale.galliera.it)
|
|
97
118
|
- [Provincia di Pisa](https://www.provincia.pisa.it/)
|
|
119
|
+
- [Unione Comuni Distretto Ceramico](https://www.distrettoceramico.mo.it/)
|
|
98
120
|
- [UCMAN (Unione dei Comuni Modenesi Area Nord)](https://www.unioneareanord.mo.it/)
|
|
99
121
|
- [Unione Val d'Enza](https://www.unionevaldenza.it/)
|
|
100
122
|
- [Unione Val di Bisenzio](https://www.bisenzio.it/)
|
package/RELEASE.md
CHANGED
|
@@ -41,6 +41,18 @@
|
|
|
41
41
|
- ...
|
|
42
42
|
-->
|
|
43
43
|
|
|
44
|
+
## Versione 10.6.4 (18/12/2023)
|
|
45
|
+
|
|
46
|
+
### Fix
|
|
47
|
+
|
|
48
|
+
- Colori delle icone che specificano che un link è esterno che in alcuni casi erano errati.
|
|
49
|
+
|
|
50
|
+
## Versione 10.6.3 (15/12/2023)
|
|
51
|
+
|
|
52
|
+
### Fix
|
|
53
|
+
|
|
54
|
+
- Sistemati alcuni problemi di visualizzazione nei template disponibili per il blocco Cerca. Ora tutti i template disponibili per questo blocco rispecchiano graficamente quelli per il blocco Elenco sia in visualizzazione che in modifica.
|
|
55
|
+
|
|
44
56
|
## Versione 10.6.2 (14/12/2023)
|
|
45
57
|
|
|
46
58
|
### Fix
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "design-comuni-plone-theme",
|
|
3
3
|
"description": "Volto Theme for Italia design guidelines",
|
|
4
4
|
"license": "GPL-v3",
|
|
5
|
-
"version": "10.6.
|
|
5
|
+
"version": "10.6.4",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"volto-addon",
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
"volto-editablefooter": "5.0.1",
|
|
147
147
|
"volto-feedback": "0.1.5",
|
|
148
148
|
"volto-form-block": "3.1.0",
|
|
149
|
-
"volto-gdpr-privacy": "2.1.
|
|
149
|
+
"volto-gdpr-privacy": "2.1.1",
|
|
150
150
|
"volto-google-analytics": "2.0.0",
|
|
151
151
|
"volto-multilingual-widget": "3.0.0",
|
|
152
152
|
"volto-querywidget-with-browser": "0.4.0",
|
package/publiccode.yml
CHANGED
|
@@ -227,9 +227,9 @@ maintenance:
|
|
|
227
227
|
name: io-Comune - Il sito AgID per Comuni ed Enti Pubblici
|
|
228
228
|
platforms:
|
|
229
229
|
- web
|
|
230
|
-
releaseDate: '2023-12-
|
|
230
|
+
releaseDate: '2023-12-18'
|
|
231
231
|
softwareType: standalone/web
|
|
232
|
-
softwareVersion: 10.6.
|
|
232
|
+
softwareVersion: 10.6.4
|
|
233
233
|
url: 'https://github.com/italia/design-comuni-plone-theme'
|
|
234
234
|
usedBy:
|
|
235
235
|
- ASP Comuni Modenesi Area Nord
|
|
@@ -245,21 +245,36 @@ usedBy:
|
|
|
245
245
|
- Camera di Commercio di Reggio Emilia
|
|
246
246
|
- Comune della Spezia
|
|
247
247
|
- Comune di Bibbiano
|
|
248
|
+
- Comune di Borgo Tossignano
|
|
249
|
+
- Comune di Campegine
|
|
248
250
|
- Comune di Camposanto
|
|
251
|
+
- Comune di Canossa
|
|
249
252
|
- Comune di Cantagallo
|
|
253
|
+
- Comune di Casalfiumanese
|
|
254
|
+
- Comune di Castel del Rio
|
|
250
255
|
- Comune di Cavezzo
|
|
251
256
|
- Comune di Cavriago
|
|
252
257
|
- Comune di Concordia sul Secchia
|
|
258
|
+
- Comune di Dozza
|
|
253
259
|
- Comune di Gattatico
|
|
254
260
|
- Comune di Finale Emilia
|
|
261
|
+
- Comune di Fiorano Modenese
|
|
262
|
+
- Comune di Fontanelice
|
|
263
|
+
- Comune di Formigine
|
|
264
|
+
- Comune di Frassinoro
|
|
255
265
|
- Comune di Imola
|
|
266
|
+
- Comune di Maranello
|
|
256
267
|
- Comune di Medolla
|
|
257
268
|
- Comune di Mirandola
|
|
258
269
|
- Comune di Modena
|
|
259
270
|
- Comune di Montecchio Emilia
|
|
271
|
+
- Comune di Montefiorino
|
|
272
|
+
- Comune di Mordano
|
|
260
273
|
- Comune di Novellara
|
|
274
|
+
- Comune di Palagano
|
|
261
275
|
- Comune di Parma
|
|
262
276
|
- Comune di Piacenza
|
|
277
|
+
- Comune di Prignano
|
|
263
278
|
- Comune di Reggio Emilia
|
|
264
279
|
- Comune di San Felice sul Panaro
|
|
265
280
|
- Comune di San Lazzaro di Savena
|
|
@@ -267,6 +282,7 @@ usedBy:
|
|
|
267
282
|
- Comune di San Possidonio
|
|
268
283
|
- Comune di San Prospero
|
|
269
284
|
- Comune di Santilario d'Enza
|
|
285
|
+
- Comune di Sassuolo
|
|
270
286
|
- Comune di Toscolano Maderno
|
|
271
287
|
- Comune di Vaiano
|
|
272
288
|
- Comune di Vernio
|
|
@@ -275,6 +291,7 @@ usedBy:
|
|
|
275
291
|
- Nuovo Circondario Imolese
|
|
276
292
|
- Ospedali Galliera - Bilancio Sociale
|
|
277
293
|
- Provincia di Pisa
|
|
294
|
+
- Unione Comuni Distretto Ceramico
|
|
278
295
|
- UCMAN (Unione dei Comuni Modenesi Area Nord)
|
|
279
296
|
- Unione Val d'Enza
|
|
280
297
|
- Unione Val di Bisenzio
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/* CUSTOMIZATIONS:
|
|
2
2
|
- Agid styling
|
|
3
|
+
- Add class .block.listing in listing body container div to use
|
|
4
|
+
existing listing template styles
|
|
3
5
|
*/
|
|
4
6
|
|
|
5
7
|
import React from 'react';
|
|
@@ -99,7 +101,8 @@ const SearchBlockView = (props) => {
|
|
|
99
101
|
selectedView={selectedView}
|
|
100
102
|
setSelectedView={setSelectedView}
|
|
101
103
|
>
|
|
102
|
-
|
|
104
|
+
{/* Add class .block.listing to benefit from existing listing template styles */}
|
|
105
|
+
<div className="block listing search-results">
|
|
103
106
|
<ListingBody
|
|
104
107
|
variation={{ ...data, ...listingBodyVariation }}
|
|
105
108
|
data={listingBodyData}
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
|
|
57
57
|
// tablet
|
|
58
58
|
.bandi-in-evidence-cards-wrapper {
|
|
59
|
-
@media (min-width: #{map-get($grid-breakpoints, md)}) and (max-width: #{map-get($grid-breakpoints,
|
|
60
|
-
grid-template-columns: auto
|
|
59
|
+
@media (min-width: #{map-get($grid-breakpoints, md)}) and (max-width: #{map-get($grid-breakpoints, xl)}) {
|
|
60
|
+
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
@media (min-width: #{map-get($grid-breakpoints, md)}) and (max-width: #{map-get($grid-breakpoints, lg)}) {
|
|
@@ -42,17 +42,12 @@
|
|
|
42
42
|
&:focus {
|
|
43
43
|
background: $secondary-text;
|
|
44
44
|
color: $secondary;
|
|
45
|
-
|
|
46
|
-
.external-link {
|
|
47
|
-
fill: #004080 !important;
|
|
48
|
-
}
|
|
49
45
|
}
|
|
50
46
|
|
|
51
47
|
.external-link {
|
|
52
48
|
position: absolute;
|
|
53
49
|
top: 3px;
|
|
54
50
|
right: 3px;
|
|
55
|
-
fill: $external-link-fill-buttons !important;
|
|
56
51
|
}
|
|
57
52
|
}
|
|
58
53
|
|
|
@@ -151,15 +151,13 @@
|
|
|
151
151
|
border-color: hsl(210deg, 17.6470588235%, 43.35%) !important;
|
|
152
152
|
border-bottom: 1px solid;
|
|
153
153
|
font-size: 1rem;
|
|
154
|
-
transition:
|
|
155
|
-
border-color 0.3s ease-in,
|
|
154
|
+
transition: border-color 0.3s ease-in,
|
|
156
155
|
background-color 0.2s cubic-bezier(0, 1, 0, 1) 0.2s;
|
|
157
156
|
|
|
158
157
|
&[aria-expanded='true'] {
|
|
159
158
|
border-color: transparent !important;
|
|
160
159
|
box-shadow: 0 1rem 2rem -0.25rem rgba(0, 0, 0, 0.15) !important;
|
|
161
|
-
transition:
|
|
162
|
-
background-color 0.2s cubic-bezier(0, 1, 0, 1),
|
|
160
|
+
transition: background-color 0.2s cubic-bezier(0, 1, 0, 1),
|
|
163
161
|
border-color 0.05s cubic-bezier(1, 0, 1, 0);
|
|
164
162
|
}
|
|
165
163
|
|
|
@@ -246,8 +244,16 @@
|
|
|
246
244
|
}
|
|
247
245
|
}
|
|
248
246
|
}
|
|
247
|
+
.block.listing {
|
|
248
|
+
.bandi-in-evidence .bandi-in-evidence-cards-wrapper {
|
|
249
|
+
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
|
|
250
|
+
@media (min-width: #{map-get($grid-breakpoints, md)}) and (max-width: #{map-get($grid-breakpoints, lg)}) {
|
|
251
|
+
display: block !important;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
249
255
|
}
|
|
250
256
|
|
|
251
|
-
|
|
257
|
+
.cms-ui .block.search .sideColumn .columnText .draftjs-buttons a {
|
|
252
258
|
color: $primary-text;
|
|
253
259
|
}
|
|
@@ -65,34 +65,17 @@
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
.btn-primary,
|
|
69
|
-
.btn-secondary,
|
|
70
|
-
.btn-tertiary,
|
|
71
|
-
.draftjs-buttons {
|
|
72
|
-
.external-link {
|
|
73
|
-
fill: $external-link-fill-buttons !important;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
68
|
.external-link {
|
|
78
|
-
fill:
|
|
69
|
+
fill: currentColor;
|
|
79
70
|
|
|
80
71
|
&.align-sub {
|
|
81
72
|
vertical-align: sub;
|
|
82
73
|
}
|
|
83
|
-
|
|
84
|
-
&:hover {
|
|
85
|
-
fill: #004080 !important;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.it-footer-small-prints-list .external-link {
|
|
90
|
-
fill: $external-link-fill-subfooter !important;
|
|
91
74
|
}
|
|
92
75
|
}
|
|
93
76
|
|
|
94
77
|
.icon.external-link.icon-xs {
|
|
95
|
-
height: 1rem;
|
|
78
|
+
height: 1rem !important;
|
|
96
79
|
}
|
|
97
80
|
|
|
98
81
|
section.it-page-section,
|
package/src/customizations/volto-gdpr-privacy/components/ConditionalEmbed/ConditionalEmbed.jsx
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
CUSTOMIZATIONS
|
|
3
|
-
- permit render if server, cannot use in history diff otherwise
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import React, { useEffect, useState } from 'react';
|
|
7
|
-
import { useSelector, useDispatch } from 'react-redux';
|
|
8
|
-
import { useIntl, defineMessages } from 'react-intl';
|
|
9
|
-
import { useLocation } from 'react-router-dom';
|
|
10
|
-
import {
|
|
11
|
-
displayBanner,
|
|
12
|
-
updateGdprPrivacyConsent,
|
|
13
|
-
} from 'volto-gdpr-privacy/actions';
|
|
14
|
-
|
|
15
|
-
import {
|
|
16
|
-
usePanelConfigAndPreferences,
|
|
17
|
-
GDPRCookies,
|
|
18
|
-
getLocaleConf,
|
|
19
|
-
} from 'volto-gdpr-privacy/helpers';
|
|
20
|
-
|
|
21
|
-
import 'volto-gdpr-privacy/components/ConditionalEmbed/conditional-embed.css';
|
|
22
|
-
|
|
23
|
-
const messages = defineMessages({
|
|
24
|
-
conditionalEmbedAcceptCookiesDefaultDescription: {
|
|
25
|
-
id: 'volto-gdpr-privacy-conditional-embed-default-description',
|
|
26
|
-
defaultMessage:
|
|
27
|
-
'Please, accept {cookie_type} cookies to view this content.',
|
|
28
|
-
},
|
|
29
|
-
conditionalEmbedAcceptCookiesAcceptMessage: {
|
|
30
|
-
id: 'volto-gdpr-privacy-conditional-embed-accept-message',
|
|
31
|
-
defaultMessage: '{enable_cookie_button}, or {manage_preferences_button}',
|
|
32
|
-
},
|
|
33
|
-
specificCookieLink: {
|
|
34
|
-
id: 'volto-gdpr-privacy-conditional-embed-specific-cookie-link',
|
|
35
|
-
defaultMessage: 'Enable {cookie_type} cookies',
|
|
36
|
-
},
|
|
37
|
-
genericCookieLink: {
|
|
38
|
-
id: 'volto-gdpr-privacy-conditional-embed-generic-cookie-link',
|
|
39
|
-
defaultMessage: 'manage your cookie preferences',
|
|
40
|
-
},
|
|
41
|
-
});
|
|
42
|
-
const ConditionalEmbed = ({ code, url, children }) => {
|
|
43
|
-
const intl = useIntl();
|
|
44
|
-
const cookies = new GDPRCookies();
|
|
45
|
-
const embed = code ?? url ?? '';
|
|
46
|
-
const dispatch = useDispatch();
|
|
47
|
-
const location = useLocation();
|
|
48
|
-
|
|
49
|
-
const { defaultPreferences } = usePanelConfigAndPreferences(cookies);
|
|
50
|
-
const profilingConfig = useSelector((state) =>
|
|
51
|
-
state.gdprPrivacyConfig?.config?.profiling?.choices?.filter(
|
|
52
|
-
(c) => c?.referenceUrls?.length > 0,
|
|
53
|
-
),
|
|
54
|
-
);
|
|
55
|
-
const gdprPreferences = useSelector(
|
|
56
|
-
(state) => state.gdprPrivacyConsent.preferences ?? defaultPreferences,
|
|
57
|
-
);
|
|
58
|
-
const [urlReferenceConfig, setUrlReferenceConfig] = useState(null);
|
|
59
|
-
|
|
60
|
-
useEffect(() => {
|
|
61
|
-
if (profilingConfig && !urlReferenceConfig) {
|
|
62
|
-
let conditionalConfig = profilingConfig.filter(
|
|
63
|
-
(c) =>
|
|
64
|
-
c.referenceUrls.filter((r) => embed?.indexOf(r) >= 0)?.length > 0,
|
|
65
|
-
);
|
|
66
|
-
|
|
67
|
-
setUrlReferenceConfig(conditionalConfig?.[0] ?? null);
|
|
68
|
-
}
|
|
69
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
70
|
-
}, [profilingConfig, setUrlReferenceConfig, urlReferenceConfig, embed]);
|
|
71
|
-
|
|
72
|
-
//return value
|
|
73
|
-
let ret = <></>;
|
|
74
|
-
let embedDisabled = true;
|
|
75
|
-
|
|
76
|
-
embedDisabled =
|
|
77
|
-
urlReferenceConfig != null &&
|
|
78
|
-
!gdprPreferences[urlReferenceConfig.config_key];
|
|
79
|
-
const isDiffView = location.pathname?.includes('/diff');
|
|
80
|
-
if (__CLIENT__ && !gdprPreferences && !isDiffView) {
|
|
81
|
-
return <></>;
|
|
82
|
-
} else if (embedDisabled && !isDiffView) {
|
|
83
|
-
//embed disabled
|
|
84
|
-
const text = getLocaleConf(urlReferenceConfig.text, intl.locale);
|
|
85
|
-
const key = urlReferenceConfig.config_key;
|
|
86
|
-
ret = (
|
|
87
|
-
<div className="volto-gdpr-embed-disabled">
|
|
88
|
-
{text.conditional_embed_text ??
|
|
89
|
-
intl.formatMessage(
|
|
90
|
-
messages.conditionalEmbedAcceptCookiesDefaultDescription,
|
|
91
|
-
{ cookie_type: key },
|
|
92
|
-
)}{' '}
|
|
93
|
-
{intl.formatMessage(
|
|
94
|
-
messages.conditionalEmbedAcceptCookiesAcceptMessage,
|
|
95
|
-
{
|
|
96
|
-
enable_cookie_button: (
|
|
97
|
-
<button
|
|
98
|
-
onClick={(e) => {
|
|
99
|
-
e.preventDefault();
|
|
100
|
-
cookies.set(key, true);
|
|
101
|
-
dispatch(
|
|
102
|
-
updateGdprPrivacyConsent({
|
|
103
|
-
...gdprPreferences,
|
|
104
|
-
[key]: true,
|
|
105
|
-
}),
|
|
106
|
-
);
|
|
107
|
-
}}
|
|
108
|
-
>
|
|
109
|
-
{intl.formatMessage(messages.specificCookieLink, {
|
|
110
|
-
cookie_type: key,
|
|
111
|
-
})}
|
|
112
|
-
</button>
|
|
113
|
-
),
|
|
114
|
-
manage_preferences_button: (
|
|
115
|
-
<button
|
|
116
|
-
onClick={(e) => {
|
|
117
|
-
e.preventDefault();
|
|
118
|
-
dispatch(displayBanner(true, true));
|
|
119
|
-
}}
|
|
120
|
-
>
|
|
121
|
-
{intl.formatMessage(messages.genericCookieLink)}
|
|
122
|
-
</button>
|
|
123
|
-
),
|
|
124
|
-
},
|
|
125
|
-
)}
|
|
126
|
-
</div>
|
|
127
|
-
);
|
|
128
|
-
} else {
|
|
129
|
-
ret = <>{children}</>;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
return ret;
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
export default ConditionalEmbed;
|