diff --git a/CHANGELOG.md b/CHANGELOG.md index 59b9fda8..a3eedd9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,25 @@ 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.5.0](https://github.com/eea/volto-eea-website-theme/compare/3.4.0...3.5.0) - 16 December 2024 + +#### :rocket: New Features + +- feat(report-navigation): add download icon and ensure file is downloaded directly [David Ichim - [`fa653c2`](https://github.com/eea/volto-eea-website-theme/commit/fa653c288988248218877a7ea66a7fe63bb59b09)] + +#### :bug: Bug Fixes + +- fix(UniversaLink): added option to open in new tab when isDisplayFile is true refs#281635 [laszlocseh - [`6e65ded`](https://github.com/eea/volto-eea-website-theme/commit/6e65dedef15e395156380318bdd19bc3812aba44)] +- fix(report-navigation): check if page has children before rendering it as a detail [David Ichim - [`35aabb3`](https://github.com/eea/volto-eea-website-theme/commit/35aabb31ef1619ff60695228373a9b1e08c248d6)] +- fix(context-navigation): error on layout page when types was an object [David Ichim - [`d06f7ab`](https://github.com/eea/volto-eea-website-theme/commit/d06f7ab641fafad0cfdf1c69381dc1e44696e008)] + +#### :house: Internal changes + +- style: Automated code fix [eea-jenkins - [`fabc331`](https://github.com/eea/volto-eea-website-theme/commit/fabc331a5ae2048c695ae7be57d45d47f0744e84)] + +#### :hammer_and_wrench: Others + +- bump package version [David Ichim - [`fb11d4c`](https://github.com/eea/volto-eea-website-theme/commit/fb11d4c5a48aadbde7fef65f5e5fa07dd451d58c)] ### [3.4.0](https://github.com/eea/volto-eea-website-theme/compare/3.3.0...3.4.0) - 11 December 2024 #### :bug: Bug Fixes diff --git a/package.json b/package.json index 1a03bbe2..344c3866 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@eeacms/volto-eea-website-theme", - "version": "3.4.0", + "version": "3.5.0", "description": "@eeacms/volto-eea-website-theme: Volto add-on", "main": "src/index.js", "author": "European Environment Agency: IDM2 A-Team", @@ -82,4 +82,4 @@ "cypress:open": "make cypress-open", "prepare": "husky install" } -} +} \ No newline at end of file diff --git a/src/components/manage/Blocks/ContextNavigation/ContextNavigationEdit.jsx b/src/components/manage/Blocks/ContextNavigation/ContextNavigationEdit.jsx index 06b90648..657ed26e 100644 --- a/src/components/manage/Blocks/ContextNavigation/ContextNavigationEdit.jsx +++ b/src/components/manage/Blocks/ContextNavigation/ContextNavigationEdit.jsx @@ -20,8 +20,12 @@ const ContextNavigationFillEdit = (props) => { (state) => state.types?.types || [], shallowEqual, ); + const availableTypes = React.useMemo( - () => contentTypes?.map((type) => [type.id, type.title || type.name]), + () => + Array.isArray(contentTypes) + ? contentTypes.map((type) => [type.id, type.title || type.name]) + : [], [contentTypes], ); diff --git a/src/components/manage/Blocks/ContextNavigation/variations/ReportNavigation.jsx b/src/components/manage/Blocks/ContextNavigation/variations/ReportNavigation.jsx index 6476f4a4..7b56bec7 100644 --- a/src/components/manage/Blocks/ContextNavigation/variations/ReportNavigation.jsx +++ b/src/components/manage/Blocks/ContextNavigation/variations/ReportNavigation.jsx @@ -1,14 +1,15 @@ import PropTypes from 'prop-types'; import React from 'react'; -import { Link as RouterLink } from 'react-router-dom'; import cx from 'classnames'; import { compose } from 'redux'; import { withRouter } from 'react-router'; import { flattenToAppURL } from '@plone/volto/helpers'; -import { UniversalLink, MaybeWrap } from '@plone/volto/components'; +import { UniversalLink, MaybeWrap, Icon } from '@plone/volto/components'; import { withContentNavigation } from '@plone/volto/components/theme/Navigation/withContentNavigation'; +import downloadSVG from '@plone/volto/icons/download.svg'; + /** * Handles click on summary links and closes parent details elements * @param {Event} e - Click event @@ -37,7 +38,8 @@ function renderNode(node, parentLevel) { const hasChildItems = node.items?.length; const nodeType = node.type; const isDocument = nodeType === 'document'; - let wrapWithDetails = isDocument && level > 2; + const isFile = nodeType === 'file'; + let wrapWithDetails = isDocument && level > 2 && hasChildItems; return (
  • - {nodeType !== 'link' ? ( - + + wrapWithDetails && handleSummaryClick(e, wrapWithDetails) + } > - - wrapWithDetails && handleSummaryClick(e, wrapWithDetails) - } - > - {node.title} - {nodeType === 'file' && node.getObjSize - ? ' [' + node.getObjSize + ']' - : ''} - - - ) : ( - + {isFile && } {node.title} + {isFile && node.getObjSize ? ' [' + node.getObjSize + ']' : ''} - )} + {(hasChildItems && (