io-sanita-theme 2.20.0 → 2.20.2

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 CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.20.2](https://github.com/RedTurtle/io-sanita-theme/compare/2.20.1...2.20.2) (2025-09-01)
4
+
5
+ ### Maintenance
6
+
7
+ * updated volto-form-block ([77734c3](https://github.com/RedTurtle/io-sanita-theme/commit/77734c37ac7b361d6d42e1fe3b62a9a6ee0e4319))
8
+
9
+ ## [2.20.1](https://github.com/RedTurtle/io-sanita-theme/compare/2.20.0...2.20.1) (2025-08-27)
10
+
11
+ ### Bug Fixes
12
+
13
+ * pagination in getTassonomieSearch ([e1b73fe](https://github.com/RedTurtle/io-sanita-theme/commit/e1b73fe25fb106043de69dad6a347b76151b4a8a))
14
+ * scroll page on pagination change in aggregation page ([83e3239](https://github.com/RedTurtle/io-sanita-theme/commit/83e32395fecb5b910d688544d7309194a0e43745))
15
+
3
16
  ## [2.20.0](https://github.com/RedTurtle/io-sanita-theme/compare/2.19.0...2.20.0) (2025-08-20)
4
17
 
5
18
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "io-sanita-theme",
3
- "version": "2.20.0",
3
+ "version": "2.20.2",
4
4
  "description": "io-sanita-theme: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "license": "MIT",
@@ -32,7 +32,6 @@
32
32
  "volto-feedback-italia",
33
33
  "volto-subfooter",
34
34
  "volto-querywidget-with-browser",
35
- "volto-form-block",
36
35
  "volto-form-block-italia",
37
36
  "volto-data-grid-widget",
38
37
  "volto-venue",
@@ -102,8 +101,7 @@
102
101
  "volto-editablefooter": "5.1.9",
103
102
  "volto-feedback": "0.6.2",
104
103
  "volto-feedback-italia": "1.0.8",
105
- "volto-form-block": "3.10.2",
106
- "volto-form-block-italia": "1.0.5",
104
+ "volto-form-block-italia": "1.1.1",
107
105
  "volto-gdpr-privacy": "2.2.15",
108
106
  "volto-querywidget-with-browser": "0.4.3",
109
107
  "volto-rss-block": "3.0.1",
@@ -44,7 +44,14 @@ export function getSearchResults(params) {
44
44
  * @function getTassonomieSearch
45
45
  * @returns {Object} Get search filters action.
46
46
  */
47
- export function getTassonomieSearch({ type, id, portalType, order, page }) {
47
+ export function getTassonomieSearch({
48
+ type,
49
+ id,
50
+ portalType,
51
+ order,
52
+ currentPage,
53
+ b_size,
54
+ }) {
48
55
  /*
49
56
  valori possibili.
50
57
  - type: ['a_chi_si_rivolge_tassonomia','parliamo_di']
@@ -52,8 +59,7 @@ export function getTassonomieSearch({ type, id, portalType, order, page }) {
52
59
  - portal_type: se si vogliono i contenuti di quel portal_type per la tassonomia type/value
53
60
  */
54
61
 
55
- const b_size = config.settings.defaultPageSize;
56
- const params = {};
62
+ const _b_size = b_size ?? config.settings.defaultPageSize;
57
63
 
58
64
  return {
59
65
  type: GET_TASSONOMIE_SEARCH,
@@ -66,10 +72,10 @@ export function getTassonomieSearch({ type, id, portalType, order, page }) {
66
72
  ...(portalType && { portal_type: portalType }),
67
73
  ...(order?.sort_on && { sort_on: order.sort_on }),
68
74
  ...(order?.sort_order & { sort_order: order.sort_order }),
69
- ...(page && {
70
- b_start: b_size * (page - 1),
75
+ ...(currentPage && {
76
+ b_start: _b_size * (currentPage - 1),
71
77
  }),
72
- b_size: b_size,
78
+ b_size: _b_size,
73
79
  },
74
80
  },
75
81
  };
@@ -3,7 +3,7 @@
3
3
  * @module components/theme/View/AggregationPage
4
4
  */
5
5
 
6
- import React, { useState, useEffect } from 'react';
6
+ import React, { useState, useEffect, createRef } from 'react';
7
7
  import { defineMessages, useIntl } from 'react-intl';
8
8
  import { useDispatch, useSelector } from 'react-redux';
9
9
  import { Redirect } from 'react-router-dom';
@@ -23,6 +23,7 @@ import {
23
23
  Pagination,
24
24
  SortByWidget,
25
25
  } from 'io-sanita-theme/components';
26
+ import { scrollIntoView } from 'io-sanita-theme/helpers';
26
27
 
27
28
  /* STYLE */
28
29
  import './_aggregationPage.scss';
@@ -57,6 +58,7 @@ const AggregationPage = ({ match, route, location }) => {
57
58
  const dispatch = useDispatch();
58
59
  const id = match?.params?.id ?? '';
59
60
  const type = route?.type;
61
+ const resultsRef = createRef();
60
62
 
61
63
  if (id?.length === 0) {
62
64
  return <Redirect to="/" />;
@@ -69,6 +71,7 @@ const AggregationPage = ({ match, route, location }) => {
69
71
  portalType: null, //per filtrare su un tipo di conteneuto specifico (click dal menu laterale)
70
72
  order: { sort_on: 'relevance', sort_order: 'ascending' },
71
73
  currentPage: 1,
74
+ b_size,
72
75
  });
73
76
  const tassonomieSearch = useSelector((state) => state.tassonomieSearch);
74
77
  const result = useSelector((state) => state.tassonomieSearch.result);
@@ -140,6 +143,7 @@ const AggregationPage = ({ match, route, location }) => {
140
143
  }, [searchParams.portalType, searchParams.order]);
141
144
 
142
145
  const onPaginationChange = (e, { activePage }) => {
146
+ scrollIntoView({ ref: resultsRef.current });
143
147
  setSearchParams({ ...searchParams, currentPage: activePage });
144
148
  };
145
149
 
@@ -161,7 +165,10 @@ const AggregationPage = ({ match, route, location }) => {
161
165
  }}
162
166
  />
163
167
 
164
- <div className="row row-column-border border-light row-column-menu-left">
168
+ <div
169
+ className="row row-column-border border-light row-column-menu-left"
170
+ ref={resultsRef}
171
+ >
165
172
  <aside
166
173
  className="col-md-12 col-lg-4"
167
174
  aria-label={intl.formatMessage(commonIntlMessages.sideMenuIndex)}