From 2553322f8e8e61d877546bc7303d3a1c460a70f6 Mon Sep 17 00:00:00 2001 From: Piero Nicolli Date: Tue, 12 Dec 2023 13:02:45 +0100 Subject: [PATCH] fix: removed automatic pager-link and updated available manual data-elements --- RELEASE.md | 14 ++++++++++++++ .../ItaliaTheme/Pagination/Pagination.jsx | 13 ++----------- .../ItaliaTheme/Pagination/PaginationItem.jsx | 9 +-------- src/config/Blocks/ListingOptions/utils.js | 1 - .../components/LinkButton/AddLinkForm.jsx | 1 + .../manage/Blocks/Listing/ListingBody.jsx | 8 -------- 6 files changed, 18 insertions(+), 28 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index ae8f9a0c5..21008d55a 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -41,6 +41,20 @@ - ... --> +## Versione X.X.X (dd/mm/yyyy) + +### Migliorie + +- ... + +### Novità + +- ... [`Istruzioni`](url della documentazione relativa alla novità) + +### Fix + +- Rimosso pager-link automatico dal paginatore perché non riconosciuto dal validatore. È ora possibile inserire a mano il data-element pager-link nei blocchi di testo. + ## Versione 10.5.0 (06/12/2023) ### Novità diff --git a/src/components/ItaliaTheme/Pagination/Pagination.jsx b/src/components/ItaliaTheme/Pagination/Pagination.jsx index 4c0ee86c4..ad6f745d0 100644 --- a/src/components/ItaliaTheme/Pagination/Pagination.jsx +++ b/src/components/ItaliaTheme/Pagination/Pagination.jsx @@ -43,9 +43,6 @@ class Pagination extends Component { /** Total number of pages. */ totalPages: PropTypes.oneOfType([PropTypes.number, PropTypes.string]) .isRequired, - - /** Lighthouse ID to set Agid data-element on pager link for CT Servizio*/ - isServiceLink: PropTypes.bool, }; static defaultProps = { @@ -72,13 +69,8 @@ class Pagination extends Component { }; render() { - const { - boundaryRange, - ellipsisItem, - siblingRange, - totalPages, - isServiceLink, - } = this.props; + const { boundaryRange, ellipsisItem, siblingRange, totalPages } = + this.props; const { activePage } = this.state; const items = createPaginationItems({ @@ -104,7 +96,6 @@ class Pagination extends Component { onClick={this.handleItemClick} type={type} ellipsisItem={ellipsisItem} - isServiceLink={isServiceLink} > {value} diff --git a/src/components/ItaliaTheme/Pagination/PaginationItem.jsx b/src/components/ItaliaTheme/Pagination/PaginationItem.jsx index f53e14949..b7e2d9de9 100644 --- a/src/components/ItaliaTheme/Pagination/PaginationItem.jsx +++ b/src/components/ItaliaTheme/Pagination/PaginationItem.jsx @@ -46,9 +46,6 @@ class PaginationItem extends Component { 'nextItem', 'lastItem', ]), - - /** Lighthouse ID to set Agid data-element on pager link for CT Servizio*/ - isServiceLink: PropTypes.bool, }; handleClick = (e) => { @@ -62,8 +59,7 @@ class PaginationItem extends Component { }; render() { - const { active, type, children, intl, ellipsisItem, isServiceLink } = - this.props; + const { active, type, children, intl, ellipsisItem } = this.props; const disabled = this.props.disabled || type === 'ellipsisItem'; return ( @@ -72,9 +68,6 @@ class PaginationItem extends Component { onClick={this.handleClick} onKeyDown={this.handleKeyDown} aria-current={active ? 'page' : null} - data-element={ - isServiceLink && type !== 'prevItem' ? 'pager-link' : null - } > {type === 'prevItem' && ( <> diff --git a/src/config/Blocks/ListingOptions/utils.js b/src/config/Blocks/ListingOptions/utils.js index 2e13dfbd9..322ae0b90 100644 --- a/src/config/Blocks/ListingOptions/utils.js +++ b/src/config/Blocks/ListingOptions/utils.js @@ -165,7 +165,6 @@ export const addLighthouseField = (schema, intl, position = 0) => { ['service-category-link', 'service-category-link'], ['topic-element', 'topic-element'], ['service-link', 'service-link'], - ['administration-element', 'administration-element'], ['management-category-link', 'management-category-link'], ['news-category-link', 'news-category-link'], ['custom-category-link', 'custom-category-link'], diff --git a/src/config/RichTextEditor/Plugins/AnchorPlugin/components/LinkButton/AddLinkForm.jsx b/src/config/RichTextEditor/Plugins/AnchorPlugin/components/LinkButton/AddLinkForm.jsx index 34f3eace2..cbecedc87 100644 --- a/src/config/RichTextEditor/Plugins/AnchorPlugin/components/LinkButton/AddLinkForm.jsx +++ b/src/config/RichTextEditor/Plugins/AnchorPlugin/components/LinkButton/AddLinkForm.jsx @@ -87,6 +87,7 @@ class AddLinkForm extends Component { ['accessibility-link', 'accessibility-link'], ['privacy-policy-link', 'privacy-policy-link'], ['legal-notes', 'legal-notes'], + ['pager-link', 'pager-link'], ]; } diff --git a/src/customizations/volto/components/manage/Blocks/Listing/ListingBody.jsx b/src/customizations/volto/components/manage/Blocks/Listing/ListingBody.jsx index c9c980914..cad27aa3f 100644 --- a/src/customizations/volto/components/manage/Blocks/Listing/ListingBody.jsx +++ b/src/customizations/volto/components/manage/Blocks/Listing/ListingBody.jsx @@ -93,13 +93,6 @@ const ListingBody = React.memo( // Also need to purge title from searchblock schema, it's the name of the listing template used const listingBodyProps = variation?.['@type'] !== 'search' ? data : { ...variation, title: '' }; - - // Need to know if data-element is "service-link" - // to add data-element="pager-link" to pagination links - const isServiceLink = - data?.id_lighthouse === 'service-link' || - variation?.id_lighthouse === 'service-link'; - return (
{loadingQuery && ( @@ -130,7 +123,6 @@ const ListingBody = React.memo( activePage={currentPage} totalPages={totalPages} onPageChange={onPaginationChange} - isServiceLink={isServiceLink} />
)}