@eeacms/volto-tabs-block 9.0.2 → 9.0.3
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 +38 -2
- package/package.json +1 -1
- package/src/components/View.jsx +19 -17
- package/src/components/View.test.jsx +8 -3
package/CHANGELOG.md
CHANGED
|
@@ -4,11 +4,17 @@ 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
|
-
### [9.0.
|
|
7
|
+
### [9.0.3](https://github.com/eea/volto-tabs-block/compare/9.0.2...9.0.3) - 7 May 2025
|
|
8
8
|
|
|
9
9
|
#### :bug: Bug Fixes
|
|
10
10
|
|
|
11
|
-
- fix:
|
|
11
|
+
- fix: Active tab when navigation from within - refs #287006 [Nilesh - [`5133d07`](https://github.com/eea/volto-tabs-block/commit/5133d07b1fcf9fef8b336ea27a679d4aea594513)]
|
|
12
|
+
|
|
13
|
+
#### :hammer_and_wrench: Others
|
|
14
|
+
|
|
15
|
+
- Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`01b5632`](https://github.com/eea/volto-tabs-block/commit/01b563271bd04f4329d9f876278324b970443413)]
|
|
16
|
+
- Add Sonarqube tag using ied-frontend addons list [EEA Jenkins - [`d457e25`](https://github.com/eea/volto-tabs-block/commit/d457e25d8a97b080eb8eb32ae4b85db530049e96)]
|
|
17
|
+
### [9.0.2](https://github.com/eea/volto-tabs-block/compare/9.0.1...9.0.2) - 27 January 2025
|
|
12
18
|
|
|
13
19
|
#### :house: Internal changes
|
|
14
20
|
|
|
@@ -58,6 +64,8 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
58
64
|
|
|
59
65
|
#### :hammer_and_wrench: Others
|
|
60
66
|
|
|
67
|
+
- Add Sonarqube tag using insitu-frontend addons list [EEA Jenkins - [`cb58ea7`](https://github.com/eea/volto-tabs-block/commit/cb58ea7417e8dd237b66908fd53f1f3ca8726566)]
|
|
68
|
+
- Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`4377ffc`](https://github.com/eea/volto-tabs-block/commit/4377ffc350a92f62cbe77b17b67dd331c71cbcd7)]
|
|
61
69
|
### [7.5.1](https://github.com/eea/volto-tabs-block/compare/7.5.0...7.5.1) - 28 March 2024
|
|
62
70
|
|
|
63
71
|
#### :nail_care: Enhancements
|
|
@@ -100,6 +108,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
100
108
|
- Update react-slick version to 0.30.1 [David Ichim - [`3369176`](https://github.com/eea/volto-tabs-block/commit/33691768899e7f91d2cd15319dbe3ebe66cf1513)]
|
|
101
109
|
- update [Razvan - [`61b19e8`](https://github.com/eea/volto-tabs-block/commit/61b19e8584ff6023320b3671414392ea11449ff0)]
|
|
102
110
|
- use DefaultEdit variation for responsive accordion, refs #266327 [Razvan - [`11acf6c`](https://github.com/eea/volto-tabs-block/commit/11acf6ce5afe022ddd30bff42c9a3321d1284da6)]
|
|
111
|
+
- Add Sonarqube tag using insitu-frontend addons list [EEA Jenkins - [`5045757`](https://github.com/eea/volto-tabs-block/commit/5045757a275477ba382551b301998d835741b716)]
|
|
103
112
|
### [7.0.5](https://github.com/eea/volto-tabs-block/compare/7.0.4...7.0.5) - 10 December 2023
|
|
104
113
|
|
|
105
114
|
#### :rocket: New Features
|
|
@@ -131,6 +140,8 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
131
140
|
|
|
132
141
|
#### :hammer_and_wrench: Others
|
|
133
142
|
|
|
143
|
+
- test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`3b87d12`](https://github.com/eea/volto-tabs-block/commit/3b87d12df4d01031231b15eb4196f6ff6937706b)]
|
|
144
|
+
- test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`f5f3430`](https://github.com/eea/volto-tabs-block/commit/f5f343024b45bb0206e0169cce6dd0e8472b6795)]
|
|
134
145
|
### [7.0.1](https://github.com/eea/volto-tabs-block/compare/7.0.0...7.0.1) - 9 November 2023
|
|
135
146
|
|
|
136
147
|
#### :bug: Bug Fixes
|
|
@@ -140,10 +151,14 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
140
151
|
|
|
141
152
|
#### :hammer_and_wrench: Others
|
|
142
153
|
|
|
154
|
+
- test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`bd6ffd4`](https://github.com/eea/volto-tabs-block/commit/bd6ffd42a00a2d77ff59545d9adaab7a45361446)]
|
|
155
|
+
- test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`d481e25`](https://github.com/eea/volto-tabs-block/commit/d481e25c4d61d7ff6ea11ff75c99fbdd730ecd82)]
|
|
156
|
+
- test: [JENKINS] Improve cypress time [valentinab25 - [`6c39efc`](https://github.com/eea/volto-tabs-block/commit/6c39efcc30bddfebb6c61f8a8cd714f61828ec69)]
|
|
143
157
|
## [7.0.0](https://github.com/eea/volto-tabs-block/compare/6.0.3...7.0.0) - 31 October 2023
|
|
144
158
|
|
|
145
159
|
#### :house: Internal changes
|
|
146
160
|
|
|
161
|
+
- chore: [JENKINS] Refactor automated testing [valentinab25 - [`f2e3d39`](https://github.com/eea/volto-tabs-block/commit/f2e3d3973c026f0331b82e0f691ec9bdc5899672)]
|
|
147
162
|
|
|
148
163
|
#### :hammer_and_wrench: Others
|
|
149
164
|
|
|
@@ -356,6 +371,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
356
371
|
|
|
357
372
|
#### :house: Internal changes
|
|
358
373
|
|
|
374
|
+
- chore: [JENKINS] Deprecate circularity website [valentinab25 - [`820aaa9`](https://github.com/eea/volto-tabs-block/commit/820aaa963e978a893a23b77f694bb011f3d768c1)]
|
|
359
375
|
|
|
360
376
|
#### :hammer_and_wrench: Others
|
|
361
377
|
|
|
@@ -446,6 +462,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
446
462
|
|
|
447
463
|
#### :hammer_and_wrench: Others
|
|
448
464
|
|
|
465
|
+
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`52bc1b0`](https://github.com/eea/volto-tabs-block/commit/52bc1b0fbd4611173b8ca9dc2cf4033b31474420)]
|
|
449
466
|
## [4.0.0](https://github.com/eea/volto-tabs-block/compare/3.0.1...4.0.0) - 10 March 2023
|
|
450
467
|
|
|
451
468
|
#### :house: Internal changes
|
|
@@ -456,7 +473,13 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
456
473
|
#### :hammer_and_wrench: Others
|
|
457
474
|
|
|
458
475
|
- Release 4.0.0 [Alin Voinea - [`8fc4cc9`](https://github.com/eea/volto-tabs-block/commit/8fc4cc9d8dc71e623e6586b95871cb3b98dc385f)]
|
|
476
|
+
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`22d5bdc`](https://github.com/eea/volto-tabs-block/commit/22d5bdc1b3579cc46c73ce855041ca09154eb502)]
|
|
477
|
+
- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`fde4324`](https://github.com/eea/volto-tabs-block/commit/fde4324f962cde8e8de0d76a44bee4b67d216bf8)]
|
|
478
|
+
- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`9175e47`](https://github.com/eea/volto-tabs-block/commit/9175e470d793edc63b62a99940aed25dd45f3713)]
|
|
459
479
|
- test(Jenkins): Run tests and cypress with latest canary @plone/volto [Alin Voinea - [`3348950`](https://github.com/eea/volto-tabs-block/commit/334895036f8e367281abb35a20879c32dfbfc292)]
|
|
480
|
+
- Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`39bfb39`](https://github.com/eea/volto-tabs-block/commit/39bfb39fa6e8483e639491ff998293e758ac6384)]
|
|
481
|
+
- yarn 3 [Alin Voinea - [`7e98df5`](https://github.com/eea/volto-tabs-block/commit/7e98df59669d71945be461e86e282b913538b805)]
|
|
482
|
+
- Add Sonarqube tag using demo-kitkat-frontend addons list [EEA Jenkins - [`079d7a4`](https://github.com/eea/volto-tabs-block/commit/079d7a43480e92fe280a9372399ff2d4d28537ae)]
|
|
460
483
|
### [3.0.1](https://github.com/eea/volto-tabs-block/compare/3.0.0...3.0.1) - 16 November 2022
|
|
461
484
|
|
|
462
485
|
#### :hammer_and_wrench: Others
|
|
@@ -480,7 +503,9 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
480
503
|
|
|
481
504
|
#### :hammer_and_wrench: Others
|
|
482
505
|
|
|
506
|
+
- Add Sonarqube tag using marine-frontend addons list [EEA Jenkins - [`a00e419`](https://github.com/eea/volto-tabs-block/commit/a00e419aef4c82a25f277f5e25e3d512c7838264)]
|
|
483
507
|
- lint fix [David Ichim - [`c0a898c`](https://github.com/eea/volto-tabs-block/commit/c0a898c54461478baed2ac2f149ae580d4c89aeb)]
|
|
508
|
+
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`3b284e6`](https://github.com/eea/volto-tabs-block/commit/3b284e65e0eafa9b5ad8c92b4cb77628ffcc8103)]
|
|
484
509
|
### [2.2.0](https://github.com/eea/volto-tabs-block/compare/2.1.0...2.2.0) - 25 August 2022
|
|
485
510
|
|
|
486
511
|
#### :hammer_and_wrench: Others
|
|
@@ -496,6 +521,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
496
521
|
|
|
497
522
|
- Release 2.1.0 [Alin Voinea - [`3cdfa30`](https://github.com/eea/volto-tabs-block/commit/3cdfa30d4d03d864be8ad63f0648b4717298734a)]
|
|
498
523
|
- Squashed commit of the following: [Alin Voinea - [`ca241f5`](https://github.com/eea/volto-tabs-block/commit/ca241f56a96817679a1948154e2a8cc0e17b96fe)]
|
|
524
|
+
- Add Sonarqube tag using circularity-frontend addons list [EEA Jenkins - [`68ea5a6`](https://github.com/eea/volto-tabs-block/commit/68ea5a6b971fc36840cf5716a04f68316b229b2b)]
|
|
499
525
|
### [2.0.2](https://github.com/eea/volto-tabs-block/compare/2.0.1...2.0.2) - 16 June 2022
|
|
500
526
|
|
|
501
527
|
### [2.0.1](https://github.com/eea/volto-tabs-block/compare/2.0.0...2.0.1) - 10 June 2022
|
|
@@ -539,6 +565,8 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
539
565
|
- Let theme addon to set default values for default template schema [Miu Razvan - [`55f148d`](https://github.com/eea/volto-tabs-block/commit/55f148d1a95417f8a0b55681ce250acde8463c1c)]
|
|
540
566
|
- Render pane as container if tabs-block has full-width class [Miu Razvan - [`bbffb96`](https://github.com/eea/volto-tabs-block/commit/bbffb96b908476ddee447af3ce79bafb1a12f9a8)]
|
|
541
567
|
- Refactor default template [Miu Razvan - [`58eff52`](https://github.com/eea/volto-tabs-block/commit/58eff5281adb08a5f8fe6d21fd43330252012277)]
|
|
568
|
+
- Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`72a6735`](https://github.com/eea/volto-tabs-block/commit/72a6735cbbc0e7d57b4bb7ea83fea9becc317018)]
|
|
569
|
+
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`e928da1`](https://github.com/eea/volto-tabs-block/commit/e928da1df7e4680bd4be9b5d46406800d721b8c5)]
|
|
542
570
|
### [1.2.12](https://github.com/eea/volto-tabs-block/compare/1.2.11...1.2.12) - 21 January 2022
|
|
543
571
|
|
|
544
572
|
### [1.2.11](https://github.com/eea/volto-tabs-block/compare/1.2.10...1.2.11) - 4 January 2022
|
|
@@ -553,11 +581,17 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
553
581
|
|
|
554
582
|
#### :hammer_and_wrench: Others
|
|
555
583
|
|
|
584
|
+
- Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`cd2e2ac`](https://github.com/eea/volto-tabs-block/commit/cd2e2ac1d127bfc688ecf16e17734603ab727a34)]
|
|
556
585
|
### [1.2.8](https://github.com/eea/volto-tabs-block/compare/1.2.7...1.2.8) - 10 December 2021
|
|
557
586
|
|
|
558
587
|
#### :hammer_and_wrench: Others
|
|
559
588
|
|
|
560
589
|
- Refs #142010 - Optimize Volto-addons gitflow pipelines [valentinab25 - [`d10c0b3`](https://github.com/eea/volto-tabs-block/commit/d10c0b3d35d25c530d19eebde38dfe5da8fda01b)]
|
|
590
|
+
- Add Sonarqube tag using industry-frontend addons list [EEA Jenkins - [`1a7187f`](https://github.com/eea/volto-tabs-block/commit/1a7187f10b2bd9e1307dabf51823f63ccd766864)]
|
|
591
|
+
- Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`72a7550`](https://github.com/eea/volto-tabs-block/commit/72a755025b38e1d8dd7fe206273a70585e4b9ac8)]
|
|
592
|
+
- Add Sonarqube tag using forests-frontend addons list [EEA Jenkins - [`022b277`](https://github.com/eea/volto-tabs-block/commit/022b2779a5d7fd7217c2d8a559eafab0bd86ce23)]
|
|
593
|
+
- Add Sonarqube tag using sustainability-frontend addons list [EEA Jenkins - [`84c9bea`](https://github.com/eea/volto-tabs-block/commit/84c9bea7a0aba2fe9ef9713e7131de6da6e0bcce)]
|
|
594
|
+
- Add Sonarqube tag using ims-frontend addons list [EEA Jenkins - [`020aa97`](https://github.com/eea/volto-tabs-block/commit/020aa97bc70a643ea3857566c5a1dc3a5200c2be)]
|
|
561
595
|
### [1.2.7](https://github.com/eea/volto-tabs-block/compare/1.2.6...1.2.7) - 27 August 2021
|
|
562
596
|
|
|
563
597
|
#### :hammer_and_wrench: Others
|
|
@@ -574,6 +608,8 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
574
608
|
|
|
575
609
|
- Move less import in View instead of Edit [Tiberiu Ichim - [`84aeff0`](https://github.com/eea/volto-tabs-block/commit/84aeff04a980076f54687c546691d37b6e790478)]
|
|
576
610
|
- gitignore tweaks [Tiberiu Ichim - [`f4c993d`](https://github.com/eea/volto-tabs-block/commit/f4c993d004b126f08f16651ab9460546fa9e9cad)]
|
|
611
|
+
- Add Sonarqube tag using frontend addons list [EEA Jenkins - [`865906a`](https://github.com/eea/volto-tabs-block/commit/865906a0deb261d44cc23e26bfd2d1dd0e319640)]
|
|
612
|
+
- Add Sonarqube tag using frontend addons list [EEA Jenkins - [`5383861`](https://github.com/eea/volto-tabs-block/commit/538386100adbc868e693c1c2a5ba13461307ffee)]
|
|
577
613
|
- Style update [razvanMiu - [`323aaaf`](https://github.com/eea/volto-tabs-block/commit/323aaafcad01d8fdf0e713a1fc254ae9fe319f43)]
|
|
578
614
|
- Fix 'scroll to' feature on carousel [razvanMiu - [`16c6a08`](https://github.com/eea/volto-tabs-block/commit/16c6a08f6db687542ea38e07a92b265e592f6173)]
|
|
579
615
|
- Better accesibility [razvanMiu - [`3511611`](https://github.com/eea/volto-tabs-block/commit/351161197270a4807f01d85a7055cbaadae72f8e)]
|
package/package.json
CHANGED
package/src/components/View.jsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useCallback, useEffect, useMemo } from 'react';
|
|
2
2
|
import cx from 'classnames';
|
|
3
3
|
import { compose } from 'redux';
|
|
4
4
|
import { withRouter } from 'react-router';
|
|
@@ -39,32 +39,34 @@ const View = (props) => {
|
|
|
39
39
|
|
|
40
40
|
const TabsView = activeVariation?.[0]?.view || DefaultView;
|
|
41
41
|
|
|
42
|
-
const query =
|
|
42
|
+
const query = useMemo(() => {
|
|
43
43
|
const { search } = location;
|
|
44
44
|
|
|
45
45
|
return new URLSearchParams(search);
|
|
46
46
|
}, [location]);
|
|
47
|
-
const activeTabId = query.get('activeTab');
|
|
47
|
+
const activeTabId = useMemo(() => query.get('activeTab'), [query]);
|
|
48
48
|
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
const handleActiveTabChange = useCallback(
|
|
50
|
+
(id) => {
|
|
51
|
+
const searchParams = new URLSearchParams(location.search);
|
|
52
|
+
searchParams.set('activeTab', id);
|
|
52
53
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
addQueryParam('activeTab', id);
|
|
62
|
-
};
|
|
54
|
+
history.push({
|
|
55
|
+
pathname: location.pathname,
|
|
56
|
+
search: searchParams.toString(),
|
|
57
|
+
});
|
|
58
|
+
setActiveTab(id);
|
|
59
|
+
},
|
|
60
|
+
[history, location],
|
|
61
|
+
);
|
|
63
62
|
|
|
64
|
-
|
|
63
|
+
useEffect(() => {
|
|
65
64
|
if (tabsList.includes(activeTabId)) {
|
|
66
65
|
setActiveTab(activeTabId);
|
|
67
66
|
}
|
|
67
|
+
}, [activeTabId, tabsList]);
|
|
68
|
+
|
|
69
|
+
useEffect(() => {
|
|
68
70
|
const urlHash = props.location.hash.substring(1) || '';
|
|
69
71
|
const parentTabId = getParentTabFromHash(data, urlHash);
|
|
70
72
|
const id = parentTabId;
|
|
@@ -34,6 +34,11 @@ jest.mock('react-router', () => ({
|
|
|
34
34
|
},
|
|
35
35
|
}));
|
|
36
36
|
|
|
37
|
+
// ENOENT: no such file or directory, open 'node:crypto'
|
|
38
|
+
jest.mock('uuid', () => ({
|
|
39
|
+
v4: () => 'test-uuid-1234',
|
|
40
|
+
}));
|
|
41
|
+
|
|
37
42
|
jest.mock('@eeacms/volto-block-style/StyleWrapper', () => ({
|
|
38
43
|
StyleWrapperView: (props) => {
|
|
39
44
|
return <div className="mocked-style-wrapper">{props.children}</div>;
|
|
@@ -51,14 +56,14 @@ describe('View Component', () => {
|
|
|
51
56
|
it('Should render and switch Tabs', () => {
|
|
52
57
|
const customTabsData = {
|
|
53
58
|
blocks_layout: {
|
|
54
|
-
items: ['
|
|
59
|
+
items: ['test-uuid-1234', 'test-uuid-5678', 'tab3'],
|
|
55
60
|
},
|
|
56
61
|
blocks: {
|
|
57
|
-
|
|
62
|
+
'test-uuid-1234': {
|
|
58
63
|
title: 'Tab 1 Title',
|
|
59
64
|
content: 'Tab 1 Content',
|
|
60
65
|
},
|
|
61
|
-
|
|
66
|
+
'test-uuid-5678': {
|
|
62
67
|
title: 'Tab 2 Title',
|
|
63
68
|
content: 'Tab 2 Content',
|
|
64
69
|
},
|