Skip to content

Commit ff24391

Browse files
authored
Merge pull request #26 from eea/develop
Release fix refs#267957
2 parents 404cb09 + a76cf1a commit ff24391

File tree

7 files changed

+38
-24
lines changed

7 files changed

+38
-24
lines changed

CHANGELOG.md

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,18 @@ All notable changes to this project will be documented in this file. Dates are d
44

55
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
66

7-
### [3.0.8](https://github.com/eea/volto-block-toc/compare/3.0.7...3.0.8) - 16 February 2024
7+
### [4.0.0](https://github.com/eea/volto-block-toc/compare/3.0.8...4.0.0) - 4 April 2024
88

9-
#### :bug: Bug Fixes
9+
#### :hammer_and_wrench: Others
1010

11-
- fix(toc): make it work, refs #265201 [Razvan - [`c3728d5`](https://github.com/eea/volto-block-toc/commit/c3728d57750a0495139897609b2cb38f5bcdf7eb)]
11+
- bump v4.0.0 [nileshgulia1 - [`985e23d`](https://github.com/eea/volto-block-toc/commit/985e23d50f61e7fc5fc30276b26cb9664584ab03)]
12+
- update [Miu Razvan - [`798beb6`](https://github.com/eea/volto-block-toc/commit/798beb6b6b5def7a89f26c04774c16045de302d6)]
13+
- add volto-anchors addon [Teodor - [`220c53a`](https://github.com/eea/volto-block-toc/commit/220c53a062ca4ed381046c19497d811296c14033)]
14+
- fix typo [Teodor - [`a8981ca`](https://github.com/eea/volto-block-toc/commit/a8981ca4fd6c2c670d3988055a3676dd61e64cdc)]
15+
- include volto-anchors as dependency and update import of github-slugger [Teodor - [`b2cc084`](https://github.com/eea/volto-block-toc/commit/b2cc084e515882852e5702e670aa045f4ef429c4)]
16+
- fix horizontal menu variation [Teodor - [`9d339f8`](https://github.com/eea/volto-block-toc/commit/9d339f88f7061c62274a022b6ff063fdda07e6f5)]
17+
- fix table of contents default renderer as per volto 17 fix [Teodor - [`be8de3b`](https://github.com/eea/volto-block-toc/commit/be8de3bdbc20889d20f64fa0a839513df7d70bcb)]
18+
### [3.0.8](https://github.com/eea/volto-block-toc/compare/3.0.7...3.0.8) - 19 February 2024
1219

1320
#### :house: Internal changes
1421

@@ -37,7 +44,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
3744
- test: Update Makefile and docker-compose to align it with Jenkinsfile [valentinab25 - [`ede85d4`](https://github.com/eea/volto-block-toc/commit/ede85d4ba7888001add18888d24f8c712af68bef)]
3845
- test: jest should look for addons in node_modules Refs #253277 [valentinab25 - [`8e48d6f`](https://github.com/eea/volto-block-toc/commit/8e48d6fd45f0ea2e91b64494cbc029152632bcee)]
3946
- test: Fix test config, coverage Refs #253277 [valentinab25 - [`4f80fe5`](https://github.com/eea/volto-block-toc/commit/4f80fe53f3fc31ef7f7c15955d6df412cfb139d7)]
40-
- Add Sonarqube tag using bise-frontend addons list [EEA Jenkins - [`d10a982`](https://github.com/eea/volto-block-toc/commit/d10a982c3173080bfcfc29e7a7367b223fa10258)]
4147
### [3.0.5](https://github.com/eea/volto-block-toc/compare/3.0.4...3.0.5) - 22 May 2023
4248

4349
#### :hammer_and_wrench: Others
@@ -63,14 +69,11 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6369
#### :hammer_and_wrench: Others
6470

6571
- Update Jenkinsfile [Claudia Ifrim - [`96e0797`](https://github.com/eea/volto-block-toc/commit/96e079736684c7b0fa8e7abaa0486f8b50b31b7c)]
66-
- Add Sonarqube tag using marine-frontend addons list [EEA Jenkins - [`66e274d`](https://github.com/eea/volto-block-toc/commit/66e274da2d5945e78c00c0e1b7a42b8a08966cbc)]
67-
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`91a49d2`](https://github.com/eea/volto-block-toc/commit/91a49d2712097854d7ba75ffc361f757c5fd2175)]
6872
- update(jest): add @plone/volto-slate resolver refs- #153447 [nileshgulia1 - [`c98050d`](https://github.com/eea/volto-block-toc/commit/c98050d7aa3cc48f658a5d498e5232bd7b4b0ae7)]
6973
### [3.0.1](https://github.com/eea/volto-block-toc/compare/3.0.0...3.0.1) - 30 June 2022
7074

7175
#### :hammer_and_wrench: Others
7276

73-
- Add Sonarqube tag using circularity-frontend addons list [EEA Jenkins - [`b3c16c6`](https://github.com/eea/volto-block-toc/commit/b3c16c6a31c38a44451b009af271f17244edbc1f)]
7477
## [3.0.0](https://github.com/eea/volto-block-toc/compare/2.3.0...3.0.0) - 17 May 2022
7578

7679
#### :hammer_and_wrench: Others
@@ -84,27 +87,17 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
8487

8588
- Release 2.3.0 [Alin Voinea - [`693f4bb`](https://github.com/eea/volto-block-toc/commit/693f4bbb13068e0b7c22353de5a451414e4d91a0)]
8689
- remove uneeded code [Miu Razvan - [`b554883`](https://github.com/eea/volto-block-toc/commit/b554883f393936e7a1e8e28ec2fcdc954982a4e7)]
87-
- Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`9961973`](https://github.com/eea/volto-block-toc/commit/996197359b91c0769f1fd8a1891b55063dd6c1e5)]
88-
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`a3f1404`](https://github.com/eea/volto-block-toc/commit/a3f1404ec40f9bde18495e0e02eb23609deca78a)]
8990
### [2.2.5](https://github.com/eea/volto-block-toc/compare/2.2.4...2.2.5) - 3 January 2022
9091

9192
### [2.2.4](https://github.com/eea/volto-block-toc/compare/2.2.3...2.2.4) - 18 December 2021
9293

9394
#### :hammer_and_wrench: Others
9495

95-
- Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`1f07faa`](https://github.com/eea/volto-block-toc/commit/1f07faa181ece91cc97fc4087fc0a5bdd83292dc)]
9696
### [2.2.3](https://github.com/eea/volto-block-toc/compare/2.2.2...2.2.3) - 10 December 2021
9797

9898
#### :hammer_and_wrench: Others
9999

100100
- Refs #142010 - Optimize Volto-addons gitflow pipelines [valentinab25 - [`6973d84`](https://github.com/eea/volto-block-toc/commit/6973d84e3fe20548be2cb7903d6cb23e93610c0d)]
101-
- Add Sonarqube tag using industry-frontend addons list [EEA Jenkins - [`bf8be2e`](https://github.com/eea/volto-block-toc/commit/bf8be2e0027002150a52b187e08f56b2f0905e54)]
102-
- Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`c47d850`](https://github.com/eea/volto-block-toc/commit/c47d850e4feccb6c42ccb0e5463f32af62fed95b)]
103-
- Add Sonarqube tag using forests-frontend addons list [EEA Jenkins - [`5565395`](https://github.com/eea/volto-block-toc/commit/5565395a8b90cd5fd8650a24d0931b84306c0704)]
104-
- Add Sonarqube tag using sustainability-frontend addons list [EEA Jenkins - [`96d69df`](https://github.com/eea/volto-block-toc/commit/96d69dfc20e738c0f9af809a684dcb5b6c33cdf7)]
105-
- Add Sonarqube tag using climate-energy-frontend addons list [EEA Jenkins - [`9509446`](https://github.com/eea/volto-block-toc/commit/950944640e317ac2e375311663a150d0e0166dd8)]
106-
- Add Sonarqube tag using ims-frontend addons list [EEA Jenkins - [`1c96364`](https://github.com/eea/volto-block-toc/commit/1c963640148edbb6978ab518dfa2743044234c91)]
107-
- Add Sonarqube tag using frontend addons list [EEA Jenkins - [`421c23c`](https://github.com/eea/volto-block-toc/commit/421c23cb1ad5add8dc74796d8e93b8c5f88524d1)]
108101
### [2.2.2](https://github.com/eea/volto-block-toc/compare/2.2.1...2.2.2) - 27 May 2021
109102

110103
### [2.2.1](https://github.com/eea/volto-block-toc/compare/2.2.0...2.2.1) - 14 May 2021
@@ -133,7 +126,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
133126

134127
- Release 1.0.0 [Alin Voinea - [`5501bf6`](https://github.com/eea/volto-block-toc/commit/5501bf6e97cd6dae5af9735bea0ab28dee10dd30)]
135128
- Release 1.0.0 [Alin Voinea - [`528b2e6`](https://github.com/eea/volto-block-toc/commit/528b2e69303482bdefd240b3d6d95e1690e43a5d)]
136-
- yarn prettier [Alin Voinea - [`18f812b`](https://github.com/eea/volto-block-toc/commit/18f812b776964062054bf6f77710c6a8ece1cc8f)]
137129
### 0.1.0 - 21 October 2020
138130

139131
#### :hammer_and_wrench: Others

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pipeline {
44
environment {
55
GIT_NAME = "volto-block-toc"
66
NAMESPACE = "@eeacms"
7-
SONARQUBE_TAGS = "volto.eea.europa.eu,biodiversity.europa.eu"
7+
SONARQUBE_TAGS = "volto.eea.europa.eu,biodiversity.europa.eu,water.europa.eu-freshwater"
88
DEPENDENCIES = ""
99
VOLTO = "16"
1010
}

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@eeacms/volto-block-toc",
3-
"version": "3.0.8",
3+
"version": "4.0.0",
44
"description": "volto-block-toc: Volto add-on",
55
"main": "src/index.js",
66
"author": "European Environment Agency: IDM2 A-Team",
@@ -13,11 +13,15 @@
1313
"plone",
1414
"react"
1515
],
16+
"addons": [
17+
"@eeacms/volto-anchors"
18+
],
1619
"repository": {
1720
"type": "git",
1821
"url": "[email protected]:eea/volto-block-toc.git"
1922
},
2023
"dependencies": {
24+
"@eeacms/volto-anchors": "*",
2125
"smoothscroll-polyfill": "^0.4.4"
2226
},
2327
"devDependencies": {

src/Block/TocEdit.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ class Edit extends Component {
2626
}}
2727
onChangeBlock={this.props.onChangeBlock}
2828
formData={this.props.data}
29+
block={this.props.block}
30+
navRoot={this.props.navRoot}
31+
contentType={this.props.contentType}
2932
/>
3033
</SidebarPortal>
3134
</>

src/Block/variations/DefaultTocRenderer.jsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,19 @@ import { map } from 'lodash';
99
import { List } from 'semantic-ui-react';
1010
import { FormattedMessage, injectIntl } from 'react-intl';
1111
import AnchorLink from 'react-anchor-link-smooth-scroll';
12+
import { toSlug } from '@eeacms/volto-anchors/helpers';
13+
import { normalizeString } from './helpers';
1214

1315
const RenderListItems = ({ items, data }) => {
1416
return map(items, (item) => {
15-
const { id, level, title } = item;
17+
const { id, level, title, override_toc, plaintext } = item;
18+
const slug = override_toc
19+
? toSlug(normalizeString(plaintext))
20+
: toSlug(normalizeString(title)) || id;
1621
return (
1722
item && (
1823
<List.Item key={id} className={`item headline-${level}`} as="li">
19-
<AnchorLink href={`#${id}`}>{title}</AnchorLink>
24+
<AnchorLink href={`#${slug}`}>{title}</AnchorLink>
2025
{item.items?.length > 0 && (
2126
<List
2227
ordered={data.ordered}

src/Block/variations/HorizontalMenu.jsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,20 @@ import { map } from 'lodash';
44
import { Menu, Dropdown } from 'semantic-ui-react';
55
import { FormattedMessage, injectIntl } from 'react-intl';
66
import AnchorLink from 'react-anchor-link-smooth-scroll';
7+
import { toSlug } from '@eeacms/volto-anchors/helpers';
8+
import { normalizeString } from './helpers';
79

810
const RenderMenuItems = ({ items }) => {
911
return map(items, (item) => {
10-
const { id, level, title } = item;
12+
const { id, level, title, override_toc, plaintext } = item;
13+
const slug = override_toc
14+
? toSlug(normalizeString(plaintext))
15+
: toSlug(normalizeString(title)) || id;
1116
return (
1217
item && (
1318
<React.Fragment key={id}>
1419
<Menu.Item className={`headline-${level}`}>
15-
<AnchorLink href={`#${id}`}>{title}</AnchorLink>
20+
<AnchorLink href={`#${slug}`}>{title}</AnchorLink>
1621
</Menu.Item>
1722
{item.items?.length > 0 && <RenderMenuItems items={item.items} />}
1823
</React.Fragment>

src/Block/variations/helpers.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//to be removed when upgrade to Volto 17
2+
3+
export function normalizeString(str) {
4+
return str.normalize('NFD').replace(/\p{Diacritic}/gu, '');
5+
}

0 commit comments

Comments
 (0)