@eeacms/volto-eea-website-theme 3.18.1 → 3.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ ### [3.19.0](https://github.com/eea/volto-eea-website-theme/compare/3.18.1...3.19.0) - 11 February 2026
8
+
9
+ #### :house: Internal changes
10
+
11
+ - style: Automated code fix [eea-jenkins - [`26e2fec`](https://github.com/eea/volto-eea-website-theme/commit/26e2fec974c85b5221730215650d049e3deefbad)]
12
+
13
+ #### :hammer_and_wrench: Others
14
+
15
+ - fix formating [Teodor - [`7131bcf`](https://github.com/eea/volto-eea-website-theme/commit/7131bcf73f9b561c87599e590941419bf6c23c67)]
7
16
  ### [3.18.1](https://github.com/eea/volto-eea-website-theme/compare/3.18.0...3.18.1) - 20 January 2026
8
17
 
9
18
  #### :bug: Bug Fixes
@@ -56,7 +65,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
56
65
  #### :hammer_and_wrench: Others
57
66
 
58
67
  - Release 3.12.0 [Alin Voinea - [`ea1e961`](https://github.com/eea/volto-eea-website-theme/commit/ea1e96144684b2a8238ae476fd8d47de82ff42b4)]
59
- - Add Sonarqube tag using bise-frontend addons list [EEA Jenkins - [`2cac56e`](https://github.com/eea/volto-eea-website-theme/commit/2cac56e22e580e042d368b69254172539ed33b65)]
60
68
  ### [3.11.0](https://github.com/eea/volto-eea-website-theme/compare/3.10.1...3.11.0) - 29 September 2025
61
69
 
62
70
  #### :bug: Bug Fixes
@@ -150,8 +158,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
150
158
 
151
159
  #### :hammer_and_wrench: Others
152
160
 
153
- - Add Sonarqube tag using fise-frontend addons list [EEA Jenkins - [`3d50874`](https://github.com/eea/volto-eea-website-theme/commit/3d50874281ebcb91a1ae3727248f656a6f26c603)]
154
- - Add Sonarqube tag using ied-frontend addons list [EEA Jenkins - [`a3f7676`](https://github.com/eea/volto-eea-website-theme/commit/a3f76767d99cb6dd93cc7fa0eafdea57e9000b2c)]
155
161
  ### [3.5.4](https://github.com/eea/volto-eea-website-theme/compare/3.5.3...3.5.4) - 30 January 2025
156
162
 
157
163
  #### :bug: Bug Fixes
@@ -252,7 +258,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
252
258
 
253
259
  #### :hammer_and_wrench: Others
254
260
 
255
- - Add Sonarqube tag using bise-frontend addons list [EEA Jenkins - [`e417f83`](https://github.com/eea/volto-eea-website-theme/commit/e417f839312045c56b67ab8134fe5b0622b3e2c3)]
256
261
  ## [3.0.0](https://github.com/eea/volto-eea-website-theme/compare/2.4.0...3.0.0) - 21 October 2024
257
262
 
258
263
  #### :nail_care: Enhancements
@@ -338,7 +343,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
338
343
  - Refs #269520 - other_organisation test [Tripon Eugen - [`7558b27`](https://github.com/eea/volto-eea-website-theme/commit/7558b27a9d1cd6d3480a32b296c7325c796006c9)]
339
344
  - Refs #269520 - other_organisation token widget edit mode [Tripon Eugen - [`b6df127`](https://github.com/eea/volto-eea-website-theme/commit/b6df127bd91b6f55dda8f468e1107037d43752ff)]
340
345
  - Refs #269520 - other_organisation token widget [Tripon Eugen - [`6fd7543`](https://github.com/eea/volto-eea-website-theme/commit/6fd7543894bd2c593a1729116befd95c82ea3c8f)]
341
- - Add Sonarqube tag using marine-frontend addons list [EEA Jenkins - [`cbc36c7`](https://github.com/eea/volto-eea-website-theme/commit/cbc36c74dfcd5f7cb1013a4c673d9c02e0023766)]
342
346
  ### [2.1.1](https://github.com/eea/volto-eea-website-theme/compare/2.1.0...2.1.1) - 28 May 2024
343
347
 
344
348
  #### :bug: Bug Fixes
@@ -423,7 +427,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
423
427
 
424
428
  #### :hammer_and_wrench: Others
425
429
 
426
- - Add Sonarqube tag using insitu-frontend addons list [EEA Jenkins - [`adc6730`](https://github.com/eea/volto-eea-website-theme/commit/adc6730e21a37afb865b842182624401de6a29f5)]
427
430
  ### [1.33.1](https://github.com/eea/volto-eea-website-theme/compare/1.33.0...1.33.1) - 4 April 2024
428
431
 
429
432
  #### :bug: Bug Fixes
@@ -557,8 +560,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
557
560
 
558
561
  - bump version [Razvan - [`721e939`](https://github.com/eea/volto-eea-website-theme/commit/721e939d12e324b459ebfa78a2e656ee7142a3d6)]
559
562
  - merge master into this branch [Razvan - [`586c8f9`](https://github.com/eea/volto-eea-website-theme/commit/586c8f910bac55a043bd8dda60e9444bd2ae1663)]
560
- - Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`fd90044`](https://github.com/eea/volto-eea-website-theme/commit/fd9004442a9d1d465f7601ecdefe3e23c61e6a9c)]
561
- - Add Sonarqube tag using insitu-frontend addons list [EEA Jenkins - [`4bc3dd3`](https://github.com/eea/volto-eea-website-theme/commit/4bc3dd3ae412a66befd04b5b80fab3716c929240)]
562
563
  - test: Update jest,Jenkinsfile,lint to volto-addons-template PR30 [valentinab25 - [`c4dbd28`](https://github.com/eea/volto-eea-website-theme/commit/c4dbd289358205bc2d849aab7edb11ccf3b89cee)]
563
564
  - fix tests [Razvan - [`042330b`](https://github.com/eea/volto-eea-website-theme/commit/042330bc97d32ffe7ba769b4f2453f71cffed706)]
564
565
  - remove RemoveSchema logic [Razvan - [`08d10f8`](https://github.com/eea/volto-eea-website-theme/commit/08d10f8bf6f75478260e4e4c66d7316ba87b907a)]
@@ -653,11 +654,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
653
654
  - test: Add real image to cypress test [Alin Voinea - [`4ff591a`](https://github.com/eea/volto-eea-website-theme/commit/4ff591ae3318c9588b4e2114582c0fa6cfdf31ae)]
654
655
  - test: Add cypress tests for Image block styling position and align [Alin Voinea - [`7341ef7`](https://github.com/eea/volto-eea-website-theme/commit/7341ef7b92714fc0cc3ab0c31c39033e7b3e19e7)]
655
656
  - Revert "change(tests): commented out rss test since title block config is missing" [Alin Voinea - [`fb61191`](https://github.com/eea/volto-eea-website-theme/commit/fb611918d6ca380b89b594f283dcf9f685a4b294)]
656
- - test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`6a3be30`](https://github.com/eea/volto-eea-website-theme/commit/6a3be3092589411af7808a235f76de5222fd3868)]
657
- - test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`c3978f2`](https://github.com/eea/volto-eea-website-theme/commit/c3978f23375ef066e9fd6f6c2e34ba6c1c058f69)]
658
- - test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`f672779`](https://github.com/eea/volto-eea-website-theme/commit/f672779e845bec9240ccc901e9f53ec80c5a1819)]
659
- - test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`ae5d8e3`](https://github.com/eea/volto-eea-website-theme/commit/ae5d8e3f4e04dc2808d47ce2ee886e1b23b528da)]
660
- - test: [JENKINS] Improve cypress time [valentinab25 - [`170ff0c`](https://github.com/eea/volto-eea-website-theme/commit/170ff0c8e3b30e69479bdf1117e811fea94f1027)]
661
657
  ### [1.23.0](https://github.com/eea/volto-eea-website-theme/compare/1.22.1...1.23.0) - 2 November 2023
662
658
 
663
659
  #### :rocket: New Features
@@ -670,7 +666,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
670
666
 
671
667
  #### :house: Internal changes
672
668
 
673
- - chore: [JENKINS] Refactor automated testing [valentinab25 - [`f28fce3`](https://github.com/eea/volto-eea-website-theme/commit/f28fce3d1eb815f95fb9aa40de42b10b7e8e30c5)]
674
669
  - chore: husky, lint-staged use fixed versions [valentinab25 - [`6d15088`](https://github.com/eea/volto-eea-website-theme/commit/6d150886c5aeb2ca0b569270486e60f7cc274e2c)]
675
670
  - chore:volto 16 in tests, update docs, fix stylelint overrides [valentinab25 - [`20c0323`](https://github.com/eea/volto-eea-website-theme/commit/20c032380b33c0077c869a05136f93e2fb68e5d4)]
676
671
 
@@ -856,7 +851,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
856
851
 
857
852
  #### :house: Internal changes
858
853
 
859
- - chore: [JENKINS] Deprecate circularity website [valentinab25 - [`370dcbf`](https://github.com/eea/volto-eea-website-theme/commit/370dcbfbf1a8135ce7b1b3b271b004552a631837)]
860
854
 
861
855
  #### :hammer_and_wrench: Others
862
856
 
@@ -1012,7 +1006,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
1012
1006
 
1013
1007
  #### :hammer_and_wrench: Others
1014
1008
 
1015
- - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`6c5e2f8`](https://github.com/eea/volto-eea-website-theme/commit/6c5e2f80456e2061d9e9c15fd0a0b91b9ac70568)]
1016
1009
  ### [1.9.1](https://github.com/eea/volto-eea-website-theme/compare/1.9.0...1.9.1) - 28 February 2023
1017
1010
 
1018
1011
  #### :bug: Bug Fixes
@@ -1159,7 +1152,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
1159
1152
 
1160
1153
  - For some reasons types is a string [Alin Voinea - [`3769a09`](https://github.com/eea/volto-eea-website-theme/commit/3769a0981181d5b633f3498daebbe96be8b4b833)]
1161
1154
  - Fix(redirect): o.filter - refs #157627 [Alin Voinea - [`deb23da`](https://github.com/eea/volto-eea-website-theme/commit/deb23da846444cc96539697fd798429ae0abe89e)]
1162
- - Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`f1fffc5`](https://github.com/eea/volto-eea-website-theme/commit/f1fffc5db96725440863d545580b4e76cce4b796)]
1163
1155
  ### [1.5.0](https://github.com/eea/volto-eea-website-theme/compare/1.4.2...1.5.0) - 9 January 2023
1164
1156
 
1165
1157
  #### :hammer_and_wrench: Others
@@ -1193,7 +1185,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
1193
1185
 
1194
1186
  - Release 1.4.0 [Alin Voinea - [`bd42a0d`](https://github.com/eea/volto-eea-website-theme/commit/bd42a0d26e928cac5d99933194755da3db06b341)]
1195
1187
  - bump version to use as volto-eea-design-system [David Ichim - [`f4be047`](https://github.com/eea/volto-eea-website-theme/commit/f4be047328b46399b03b612d378b18aaf82e7dc1)]
1196
- - Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`9b7cfef`](https://github.com/eea/volto-eea-website-theme/commit/9b7cfefb4d34fc1c948015e491feb370f9795bd8)]
1197
1188
  - test(Jenkins): Run tests and cypress with latest canary @plone/volto [Alin Voinea - [`df252a9`](https://github.com/eea/volto-eea-website-theme/commit/df252a9bfed0bb86cadf53c59dd1603b1e2cd822)]
1198
1189
  ### [1.3.2](https://github.com/eea/volto-eea-website-theme/compare/1.3.1...1.3.2) - 16 December 2022
1199
1190
 
@@ -1203,7 +1194,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
1203
1194
 
1204
1195
  #### :hammer_and_wrench: Others
1205
1196
 
1206
- - Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`a43c658`](https://github.com/eea/volto-eea-website-theme/commit/a43c658a7920c8df95e763b9a637f38ce77eba2c)]
1207
1197
  - Better razzle.config [Tiberiu Ichim - [`81dbf48`](https://github.com/eea/volto-eea-website-theme/commit/81dbf48815fb27facb4f82c9b764540fdf188b2e)]
1208
1198
  - Better razzle.config [Tiberiu Ichim - [`7bc9da2`](https://github.com/eea/volto-eea-website-theme/commit/7bc9da2cd837ab62a95cd29979cdd9b0055b7d67)]
1209
1199
  ### [1.3.1](https://github.com/eea/volto-eea-website-theme/compare/1.3.0...1.3.1) - 28 November 2022
@@ -1214,7 +1204,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
1214
1204
 
1215
1205
  #### :hammer_and_wrench: Others
1216
1206
 
1217
- - yarn 3 [Alin Voinea - [`ea7a709`](https://github.com/eea/volto-eea-website-theme/commit/ea7a7094945312776e9b6f44e371178603e92139)]
1218
1207
  ### [1.3.0](https://github.com/eea/volto-eea-website-theme/compare/1.2.0...1.3.0) - 22 November 2022
1219
1208
 
1220
1209
  #### :rocket: New Features
@@ -1255,7 +1244,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
1255
1244
  - Add subsite class to body [Tiberiu Ichim - [`74d700f`](https://github.com/eea/volto-eea-website-theme/commit/74d700fbfd6249a8604762a7e4e49cce857db0f3)]
1256
1245
  - Add subsite info to header [Tiberiu Ichim - [`47daf8b`](https://github.com/eea/volto-eea-website-theme/commit/47daf8bb6374a1222040626b19d4154df7ba1b83)]
1257
1246
  - fix eslint [Miu Razvan - [`eb8d0a7`](https://github.com/eea/volto-eea-website-theme/commit/eb8d0a790bc70c0aae256c6ff35f63c4885f338e)]
1258
- - Add Sonarqube tag using circularity-frontend addons list [EEA Jenkins - [`cc578a4`](https://github.com/eea/volto-eea-website-theme/commit/cc578a413b205a8e61e091fab3a88f94cedefc89)]
1259
1247
  ### [1.1.0](https://github.com/eea/volto-eea-website-theme/compare/1.0.0...1.1.0) - 28 October 2022
1260
1248
 
1261
1249
  #### :nail_care: Enhancements
@@ -1303,7 +1291,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
1303
1291
 
1304
1292
  #### :hammer_and_wrench: Others
1305
1293
 
1306
- - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`33b56ac`](https://github.com/eea/volto-eea-website-theme/commit/33b56acb13fbaf0c5b79e8fc6e13c4b699c79c90)]
1307
1294
  ### [0.7.3](https://github.com/eea/volto-eea-website-theme/compare/0.7.2...0.7.3) - 22 September 2022
1308
1295
 
1309
1296
  #### :hammer_and_wrench: Others
@@ -1571,7 +1558,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
1571
1558
  - Header refactor, add custom logo #5 [ichim-david - [`4950235`](https://github.com/eea/volto-eea-website-theme/commit/49502358105437cfeac3b144e6d301cb59aa2346)]
1572
1559
  - Update footer.config with new publication card component [ichim-david - [`2e38e9a`](https://github.com/eea/volto-eea-website-theme/commit/2e38e9a417f835009d60c80d4eb4b30229f55e45)]
1573
1560
  - feature(breadcrumbs): implement eea-design-system breadcrumb as Volto component #32 #7 [ichim-david - [`181af41`](https://github.com/eea/volto-eea-website-theme/commit/181af4125ce2b9ddac56dab4723cb11c26633221)]
1574
- - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`da8ceb6`](https://github.com/eea/volto-eea-website-theme/commit/da8ceb68ea68bfbc9504e48ccd4d68277f11ab9a)]
1575
1561
  - use breadcrumbs from eea-design-system [nileshgulia1 - [`db2f9e9`](https://github.com/eea/volto-eea-website-theme/commit/db2f9e9a4327420a3cce9a9903cd88549b129eab)]
1576
1562
  - Update theme.config [ichim-david - [`8eca4f4`](https://github.com/eea/volto-eea-website-theme/commit/8eca4f40397a4aeca6d39029c92db78968d37064)]
1577
1563
  - Added keyContent component to theme.config [ichim-david - [`d86f202`](https://github.com/eea/volto-eea-website-theme/commit/d86f202d0274d839487a88b51cae9a0e899beb23)]
@@ -1613,5 +1599,4 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
1613
1599
 
1614
1600
  #### :hammer_and_wrench: Others
1615
1601
 
1616
- - yarn bootstrap [Alin Voinea - [`6995e9e`](https://github.com/eea/volto-eea-website-theme/commit/6995e9e091f21fdbbdffa8a44fc0e2c626f6d46a)]
1617
1602
  - Initial commit [Alin Voinea - [`6a9c03a`](https://github.com/eea/volto-eea-website-theme/commit/6a9c03a7cebe71ca87e82cf58c42904063e9d8d3)]
@@ -1,4 +1,3 @@
1
- version: "3"
2
1
  services:
3
2
  backend:
4
3
  image: eeacms/plone-backend
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-website-theme",
3
- "version": "3.18.1",
3
+ "version": "3.19.0",
4
4
  "description": "@eeacms/volto-eea-website-theme: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -183,7 +183,7 @@ const View = (props) => {
183
183
  />
184
184
  )}
185
185
  {rssLinks?.map((rssLink, index) => (
186
- <>
186
+ <React.Fragment key={rssLink.href || index}>
187
187
  <Helmet
188
188
  link={[
189
189
  {
@@ -205,7 +205,7 @@ const View = (props) => {
205
205
  href={rssLink.href}
206
206
  target="_blank"
207
207
  />
208
- </>
208
+ </React.Fragment>
209
209
  ))}
210
210
  </>
211
211
  }
@@ -4,16 +4,16 @@ const ContributorsViewWidget = ({ value, content, children, className }) => {
4
4
  const resolvedValue = content?.contributors_fullname || value || [];
5
5
  return resolvedValue ? (
6
6
  <span className={cx(className, 'array', 'widget')}>
7
- {resolvedValue.map((item, key) => (
8
- <>
9
- {key ? ', ' : ''}
10
- <span key={item.token || item.title || item}>
11
- {children
12
- ? children(item.title || item.token || item)
13
- : item.title || item.token || item}
7
+ {resolvedValue.map((item, index) => {
8
+ const label = item?.title || item?.token || item;
9
+ const key = `${label}-${index}`;
10
+ return (
11
+ <span key={key}>
12
+ {index ? ', ' : ''}
13
+ {children ? children(label) : label}
14
14
  </span>
15
- </>
16
- ))}
15
+ );
16
+ })}
17
17
  </span>
18
18
  ) : (
19
19
  ''
@@ -4,16 +4,16 @@ const CreatorsViewWidget = ({ value, content, children, className }) => {
4
4
  const resolvedValue = content?.creators_fullname || value || [];
5
5
  return resolvedValue ? (
6
6
  <span className={cx(className, 'array', 'widget')}>
7
- {resolvedValue.map((item, key) => (
8
- <>
9
- {key ? ', ' : ''}
10
- <span key={item.token || item.title || item}>
11
- {children
12
- ? children(item.title || item.token || item)
13
- : item.title || item.token || item}
7
+ {resolvedValue.map((item, index) => {
8
+ const label = item?.title || item?.token || item;
9
+ const key = `${label}-${index}`;
10
+ return (
11
+ <span key={key}>
12
+ {index ? ', ' : ''}
13
+ {children ? children(label) : label}
14
14
  </span>
15
- </>
16
- ))}
15
+ );
16
+ })}
17
17
  </span>
18
18
  ) : (
19
19
  ''
@@ -101,7 +101,7 @@ jest.mock('@plone/volto/components/manage/Widgets/ObjectWidget', () => {
101
101
 
102
102
  // Mock semantic-ui-react components
103
103
  jest.mock('semantic-ui-react', () => {
104
- const MockAccordion = ({ children, ...props }) => (
104
+ const MockAccordion = ({ children, fluid, styled, ...props }) => (
105
105
  <div className="ui accordion" data-testid="accordion" {...props}>
106
106
  {children}
107
107
  </div>
@@ -0,0 +1,165 @@
1
+ /**
2
+ * Slate Table block's View component.
3
+ * @module volto-slate/blocks/Table/View
4
+ */
5
+
6
+ import React, { useState, useMemo } from 'react';
7
+ import PropTypes from 'prop-types';
8
+ import { Table } from 'semantic-ui-react';
9
+ import { map } from 'lodash';
10
+ import {
11
+ serializeNodes,
12
+ serializeNodesToText,
13
+ } from '@plone/volto-slate/editor/render';
14
+ import { Node } from 'slate';
15
+
16
+ // TODO: loading LESS files with `volto-slate/...` paths does not work currently
17
+ import '../../editor/plugins/Table/less/public.less';
18
+
19
+ /**
20
+ * Slate Table block's View class.
21
+ * @class View
22
+ * @extends Component
23
+ * @param {object} data The table data to render as a table.
24
+ */
25
+ const View = ({ data }) => {
26
+ const [state, setState] = useState({
27
+ column: null,
28
+ direction: null,
29
+ });
30
+
31
+ const headers = useMemo(() => {
32
+ return data.table.rows?.[0]?.cells;
33
+ }, [data.table.rows]);
34
+
35
+ const rows = useMemo(() => {
36
+ const items = [];
37
+ if (!data.table.rows) return [];
38
+ data.table.rows.forEach((row, index) => {
39
+ if (index > 0) {
40
+ items[index] = [];
41
+ row.cells.forEach((cell, cellIndex) => {
42
+ items[index][cellIndex] = {
43
+ ...cell,
44
+ value:
45
+ cell.value && Node.string({ children: cell.value }).length > 0
46
+ ? serializeNodes(cell.value)
47
+ : '\u00A0',
48
+ valueText:
49
+ cell.value && Node.string({ children: cell.value }).length > 0
50
+ ? serializeNodesToText(cell.value)
51
+ : '\u00A0',
52
+ align: cell.value?.[0]?.align || 'left',
53
+ };
54
+ });
55
+ }
56
+ });
57
+ return items;
58
+ }, [data.table.rows]);
59
+
60
+ const sortedRows = useMemo(() => {
61
+ if (state.column === null) return Object.keys(rows);
62
+ return Object.keys(rows).sort((a, b) => {
63
+ const a_text = rows[a][state.column].valueText;
64
+ const b_text = rows[b][state.column].valueText;
65
+ if (state.direction === 'ascending' ? a_text < b_text : a_text > b_text) {
66
+ return -1;
67
+ }
68
+ if (state.direction === 'ascending' ? a_text > b_text : a_text < b_text) {
69
+ return 1;
70
+ }
71
+ return 0;
72
+ });
73
+ }, [state, rows]);
74
+
75
+ const handleSort = (index) => {
76
+ if (!data.table.sortable) return;
77
+ setState({
78
+ column: index,
79
+ direction:
80
+ state.column !== index
81
+ ? 'ascending'
82
+ : state.direction === 'ascending'
83
+ ? 'descending'
84
+ : 'ascending',
85
+ });
86
+ };
87
+
88
+ return (
89
+ <>
90
+ {data && data.table && (
91
+ <Table
92
+ fixed={data.table.fixed}
93
+ compact={data.table.compact}
94
+ basic={data.table.basic ? 'very' : false}
95
+ celled={data.table.celled}
96
+ inverted={data.table.inverted}
97
+ striped={data.table.striped}
98
+ sortable={data.table.sortable}
99
+ className="slate-table-block"
100
+ >
101
+ {!data.table.hideHeaders ? (
102
+ <Table.Header>
103
+ <Table.Row>
104
+ {headers.map((cell, index) => (
105
+ <Table.HeaderCell
106
+ key={cell.key}
107
+ textAlign={cell.value?.[0]?.align || 'left'}
108
+ verticalAlign="middle"
109
+ tabIndex={data.table.sortable ? '0' : '-1'}
110
+ sorted={state.column === index ? state.direction : null}
111
+ onClick={() => {
112
+ handleSort(index);
113
+ }}
114
+ onKeyDown={(e) => {
115
+ if (e.key === 'Enter' || e.key === ' ') {
116
+ e.preventDefault();
117
+ handleSort(index);
118
+ }
119
+ }}
120
+ aria-sort={
121
+ state.column === index ? state.direction : 'none'
122
+ }
123
+ >
124
+ {cell.value &&
125
+ Node.string({ children: cell.value }).length > 0
126
+ ? serializeNodes(cell.value)
127
+ : '\u00A0'}
128
+ </Table.HeaderCell>
129
+ ))}
130
+ </Table.Row>
131
+ </Table.Header>
132
+ ) : (
133
+ ''
134
+ )}
135
+ <Table.Body>
136
+ {map(sortedRows, (row) => (
137
+ <Table.Row key={row}>
138
+ {map(rows[row], (cell) => (
139
+ <Table.Cell
140
+ key={cell.key}
141
+ textAlign={cell.align}
142
+ verticalAlign="middle"
143
+ >
144
+ {cell.value}
145
+ </Table.Cell>
146
+ ))}
147
+ </Table.Row>
148
+ ))}
149
+ </Table.Body>
150
+ </Table>
151
+ )}
152
+ </>
153
+ );
154
+ };
155
+
156
+ /**
157
+ * Property types.
158
+ * @property {Object} propTypes Property types.
159
+ * @static
160
+ */
161
+ View.propTypes = {
162
+ data: PropTypes.objectOf(PropTypes.any).isRequired,
163
+ };
164
+
165
+ export default View;
@@ -0,0 +1,43 @@
1
+ @brown: #826a6a;
2
+
3
+ table.slate-table {
4
+ width: 100%;
5
+ border: 0.025rem solid @brown;
6
+ margin-top: 1rem;
7
+ margin-bottom: 1rem;
8
+ border-collapse: collapse;
9
+ border-spacing: 30px;
10
+
11
+ th,
12
+ td {
13
+ padding: 0.5rem;
14
+ border: 0.05rem solid @brown;
15
+ vertical-align: middle;
16
+ }
17
+
18
+ th {
19
+ border-bottom: 0.15rem solid @brown;
20
+ }
21
+ }
22
+
23
+ table.slate-table-block {
24
+ th p,
25
+ td p {
26
+ margin-top: 0;
27
+ margin-bottom: 0;
28
+ }
29
+ }
30
+
31
+ table.slate-table-block.sortable {
32
+ tr th {
33
+ position: relative;
34
+ padding-right: 1.5em;
35
+
36
+ &::after {
37
+ position: absolute !important;
38
+ top: 50%;
39
+ right: 0.5em;
40
+ transform: translateY(-50%);
41
+ }
42
+ }
43
+ }
@@ -438,8 +438,8 @@ class Comments extends Component {
438
438
  open={this.state.showEdit}
439
439
  onCancel={this.onEditCancel}
440
440
  onOk={this.onEditOk}
441
- id={this.state.editId}
442
- text={this.state.editText}
441
+ id={this.state.editId ?? ''}
442
+ text={this.state.editText ?? ''}
443
443
  />
444
444
  {permissions.can_reply && (
445
445
  <div id="comment-add-id">
@@ -26,6 +26,21 @@ beforeAll(
26
26
  await require('@plone/volto/helpers/Loadable/Loadable').__setLoadables(),
27
27
  );
28
28
 
29
+ jest.mock('semantic-ui-react', () => {
30
+ const React = require('react');
31
+ const actual = jest.requireActual('semantic-ui-react');
32
+ const Dropdown = React.forwardRef(({ text, trigger, ...props }, ref) => {
33
+ const resolvedTrigger =
34
+ trigger || (typeof text === 'function' ? text() : text);
35
+ return <actual.Dropdown {...props} ref={ref} trigger={resolvedTrigger} />;
36
+ });
37
+ Dropdown.Menu = actual.Dropdown.Menu;
38
+ Dropdown.Item = actual.Dropdown.Item;
39
+ Dropdown.Header = actual.Dropdown.Header;
40
+ Dropdown.Divider = actual.Dropdown.Divider;
41
+ return { ...actual, Dropdown };
42
+ });
43
+
29
44
  describe('Header', () => {
30
45
  it('renders a header component with homepage_inverse_view layout', () => {
31
46
  const store = mockStore({
@@ -383,24 +383,11 @@ describe('setupPrintView', () => {
383
383
  });
384
384
  document.body.appendChild(iframe);
385
385
 
386
- // Mock the iframe to never fire load event, causing timeout
387
- const originalSetTimeout = global.setTimeout;
388
- let timeoutCallback;
389
- global.setTimeout = jest.fn((callback, delay) => {
390
- if (delay === 5000) {
391
- // This is the iframe timeout
392
- timeoutCallback = callback;
393
- }
394
- return originalSetTimeout(callback, delay);
395
- });
396
-
397
386
  await act(async () => {
398
387
  setupPrintView(dispatch);
399
388
 
400
389
  // Trigger the iframe timeout to simulate error condition
401
- if (timeoutCallback) {
402
- timeoutCallback();
403
- }
390
+ jest.advanceTimersByTime(5000);
404
391
 
405
392
  for (let i = 0; i < 10; i++) {
406
393
  jest.runAllTimers();
@@ -410,9 +397,6 @@ describe('setupPrintView', () => {
410
397
 
411
398
  // Should still call print even with timeout
412
399
  expect(window.print).toHaveBeenCalled();
413
-
414
- // Restore original setTimeout
415
- global.setTimeout = originalSetTimeout;
416
400
  });
417
401
 
418
402
  it('prevents multiple resets of print state', async () => {