Skip to content

Commit

Permalink
Merge pull request #26 from eea/develop
Browse files Browse the repository at this point in the history
Release fix refs#267957
  • Loading branch information
nileshgulia1 committed Apr 4, 2024
2 parents 404cb09 + a76cf1a commit ff24391
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 24 deletions.
28 changes: 10 additions & 18 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,18 @@ All notable changes to this project will be documented in this file. Dates are d

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

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

#### :bug: Bug Fixes
#### :hammer_and_wrench: Others

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

#### :house: Internal changes

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

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

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

#### :hammer_and_wrench: Others

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

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

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

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

#### :hammer_and_wrench: Others

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

#### :hammer_and_wrench: Others

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

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

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

#### :hammer_and_wrench: Others
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pipeline {
environment {
GIT_NAME = "volto-block-toc"
NAMESPACE = "@eeacms"
SONARQUBE_TAGS = "volto.eea.europa.eu,biodiversity.europa.eu"
SONARQUBE_TAGS = "volto.eea.europa.eu,biodiversity.europa.eu,water.europa.eu-freshwater"
DEPENDENCIES = ""
VOLTO = "16"
}
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eeacms/volto-block-toc",
"version": "3.0.8",
"version": "4.0.0",
"description": "volto-block-toc: Volto add-on",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
Expand All @@ -13,11 +13,15 @@
"plone",
"react"
],
"addons": [
"@eeacms/volto-anchors"
],
"repository": {
"type": "git",
"url": "git@github.com:eea/volto-block-toc.git"
},
"dependencies": {
"@eeacms/volto-anchors": "*",
"smoothscroll-polyfill": "^0.4.4"
},
"devDependencies": {
Expand Down
3 changes: 3 additions & 0 deletions src/Block/TocEdit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ class Edit extends Component {
}}
onChangeBlock={this.props.onChangeBlock}
formData={this.props.data}
block={this.props.block}
navRoot={this.props.navRoot}
contentType={this.props.contentType}
/>
</SidebarPortal>
</>
Expand Down
9 changes: 7 additions & 2 deletions src/Block/variations/DefaultTocRenderer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,19 @@ import { map } from 'lodash';
import { List } from 'semantic-ui-react';
import { FormattedMessage, injectIntl } from 'react-intl';
import AnchorLink from 'react-anchor-link-smooth-scroll';
import { toSlug } from '@eeacms/volto-anchors/helpers';
import { normalizeString } from './helpers';

const RenderListItems = ({ items, data }) => {
return map(items, (item) => {
const { id, level, title } = item;
const { id, level, title, override_toc, plaintext } = item;
const slug = override_toc
? toSlug(normalizeString(plaintext))
: toSlug(normalizeString(title)) || id;
return (
item && (
<List.Item key={id} className={`item headline-${level}`} as="li">
<AnchorLink href={`#${id}`}>{title}</AnchorLink>
<AnchorLink href={`#${slug}`}>{title}</AnchorLink>
{item.items?.length > 0 && (
<List
ordered={data.ordered}
Expand Down
9 changes: 7 additions & 2 deletions src/Block/variations/HorizontalMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,20 @@ import { map } from 'lodash';
import { Menu, Dropdown } from 'semantic-ui-react';
import { FormattedMessage, injectIntl } from 'react-intl';
import AnchorLink from 'react-anchor-link-smooth-scroll';
import { toSlug } from '@eeacms/volto-anchors/helpers';
import { normalizeString } from './helpers';

const RenderMenuItems = ({ items }) => {
return map(items, (item) => {
const { id, level, title } = item;
const { id, level, title, override_toc, plaintext } = item;
const slug = override_toc
? toSlug(normalizeString(plaintext))
: toSlug(normalizeString(title)) || id;
return (
item && (
<React.Fragment key={id}>
<Menu.Item className={`headline-${level}`}>
<AnchorLink href={`#${id}`}>{title}</AnchorLink>
<AnchorLink href={`#${slug}`}>{title}</AnchorLink>
</Menu.Item>
{item.items?.length > 0 && <RenderMenuItems items={item.items} />}
</React.Fragment>
Expand Down
5 changes: 5 additions & 0 deletions src/Block/variations/helpers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//to be removed when upgrade to Volto 17

export function normalizeString(str) {
return str.normalize('NFD').replace(/\p{Diacritic}/gu, '');
}

0 comments on commit ff24391

Please sign in to comment.