design-comuni-plone-theme 11.31.2 → 11.32.0

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.
Files changed (36) hide show
  1. package/.yarn/install-state.gz +0 -0
  2. package/CHANGELOG.md +26 -0
  3. package/RELEASE.md +11 -0
  4. package/locales/de/LC_MESSAGES/volto.po +41 -0
  5. package/locales/en/LC_MESSAGES/volto.po +41 -0
  6. package/locales/es/LC_MESSAGES/volto.po +41 -0
  7. package/locales/fr/LC_MESSAGES/volto.po +41 -0
  8. package/locales/it/LC_MESSAGES/volto.po +41 -0
  9. package/locales/volto.pot +42 -1
  10. package/package.json +1 -1
  11. package/publiccode.yml +2 -2
  12. package/src/actions/getCTSchema.js +13 -0
  13. package/src/actions/index.js +3 -0
  14. package/src/components/ItaliaTheme/Blocks/Listing/Commons/ListingImage.jsx +1 -1
  15. package/src/components/ItaliaTheme/Blocks/Listing/TableTemplate.jsx +163 -0
  16. package/src/components/ItaliaTheme/Blocks/Listing/TemplatesSkeletons/TableTemplateSkeleton.jsx +50 -0
  17. package/src/components/ItaliaTheme/View/Commons/SideMenu.jsx +2 -1
  18. package/src/components/ItaliaTheme/View/Commons/SideMenuByTitles.jsx +16 -8
  19. package/src/components/ItaliaTheme/index.js +5 -0
  20. package/src/components/ItaliaTheme/manage/Widgets/BlocksViewWidget.jsx +7 -0
  21. package/src/components/ItaliaTheme/manage/Widgets/CTFieldsWidget.jsx +84 -0
  22. package/src/components/ItaliaTheme/manage/Widgets/CTTitleColumnWidget.jsx +22 -0
  23. package/src/components/ItaliaTheme/manage/Widgets/DataGridWidget.jsx +26 -0
  24. package/src/components/ItaliaTheme/manage/Widgets/PDCViewWidget.jsx +21 -0
  25. package/src/config/Blocks/ListingOptions/index.js +1 -0
  26. package/src/config/Blocks/ListingOptions/tableTemplate.js +105 -0
  27. package/src/config/Blocks/listingVariations.js +18 -0
  28. package/src/config/Widgets/widgets.js +24 -1
  29. package/src/customizations/volto/helpers/Html/Html.jsx +28 -14
  30. package/src/helpers/getWidgetView.js +112 -0
  31. package/src/helpers/index.js +1 -0
  32. package/src/reducers/ctSchema.js +80 -0
  33. package/src/reducers/index.js +2 -0
  34. package/src/theme/ItaliaTheme/Blocks/_smallblockLinkstemplate.scss +1 -0
  35. package/src/theme/ItaliaTheme/Blocks/_tableTemplate.scss +46 -0
  36. package/src/theme/site.scss +1 -0
Binary file
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
 
2
2
 
3
+ ## [11.32.0](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v11.31.2...v11.32.0) (2025-07-31)
4
+
5
+
6
+ ### Features
7
+
8
+ * new listing and search variation - table ([#975](https://github.com/RedTurtle/design-comuni-plone-theme/issues/975)) ([4c687f9](https://github.com/RedTurtle/design-comuni-plone-theme/commit/4c687f900e3a0bac8321a80be4b44b558d4a09df))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **a11y:** avoided tabbing listing image and reading the item title twice ([#972](https://github.com/RedTurtle/design-comuni-plone-theme/issues/972)) ([3874b22](https://github.com/RedTurtle/design-comuni-plone-theme/commit/3874b227356209d5bec5c8872652cc07324861fc))
14
+ * **a11y:** fixed image focus of smallBlockLinkTemplate ([#974](https://github.com/RedTurtle/design-comuni-plone-theme/issues/974)) ([447bccb](https://github.com/RedTurtle/design-comuni-plone-theme/commit/447bccb73b6f36489f3fd4c06c5a641988dc7a8f))
15
+ * locales ([dc40868](https://github.com/RedTurtle/design-comuni-plone-theme/commit/dc40868867d8560e0c8c02b6be614b0978ce1549))
16
+ * progressbar a11y ([#966](https://github.com/RedTurtle/design-comuni-plone-theme/issues/966)) ([974feb8](https://github.com/RedTurtle/design-comuni-plone-theme/commit/974feb85ceedae259a73f7ecdaa4de45f5732f4c))
17
+ * sync HTML.jsx customization (lang in html tag) ([#968](https://github.com/RedTurtle/design-comuni-plone-theme/issues/968)) ([b37a21e](https://github.com/RedTurtle/design-comuni-plone-theme/commit/b37a21ef33f6c7a4af57feb01539eb1fd817c623))
18
+
19
+
20
+ ### Maintenance
21
+
22
+ * updated i18n ([d7ea323](https://github.com/RedTurtle/design-comuni-plone-theme/commit/d7ea32359d6c79f0b263f5835efd6755d7e5fe33))
23
+
24
+
25
+ ### Documentation
26
+
27
+ * updated publiccode and release log ([4a905c0](https://github.com/RedTurtle/design-comuni-plone-theme/commit/4a905c047507b16cd0727fd2e2bf898564085513))
28
+
3
29
  ## [11.31.2](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v11.31.1...v11.31.2) (2025-07-17)
4
30
 
5
31
 
package/RELEASE.md CHANGED
@@ -41,6 +41,17 @@
41
41
  - ...
42
42
  -->
43
43
 
44
+ ## Versione 11.32.0 (31/07/2025)
45
+
46
+ ### Novità
47
+
48
+ - Nuovo tipo di blocco Elenco disponibile: Tabella
49
+
50
+ ### Fix
51
+
52
+ - Migliorata l'accessibilità nel blocco elenco Link solo Immagini, ora il focus si vede in tutte le immagini.
53
+ - Rimossa la possibilità di raggiungere tramite Tab le immagini nei card quando sono link, evitando doppie letture del titolo.
54
+
44
55
  ## Versione 11.31.1 (14/07/2025)
45
56
 
46
57
  ### Fix
@@ -3940,6 +3940,7 @@ msgid "sideMenuIndex"
3940
3940
  msgstr ""
3941
3941
 
3942
3942
  #: components/ItaliaTheme/View/Commons/SideMenu
3943
+ #: components/ItaliaTheme/View/Commons/SideMenuByTitles
3943
3944
  # defaultMessage: Navigazione della pagina
3944
3945
  msgid "sideMenuNavigation"
3945
3946
  msgstr ""
@@ -4172,6 +4173,46 @@ msgstr ""
4172
4173
  msgid "supported_by"
4173
4174
  msgstr ""
4174
4175
 
4176
+ #: config/Blocks/ListingOptions/tableTemplate
4177
+ # defaultMessage: Colore delle righe alternato
4178
+ msgid "table_variation_alternate_rows"
4179
+ msgstr ""
4180
+
4181
+ #: config/Blocks/ListingOptions/tableTemplate
4182
+ # defaultMessage: Colonne della tabella
4183
+ msgid "table_variation_columns"
4184
+ msgstr ""
4185
+
4186
+ #: config/Blocks/ListingOptions/tableTemplate
4187
+ # defaultMessage: Colonna
4188
+ msgid "table_variaton_column"
4189
+ msgstr ""
4190
+
4191
+ #: config/Blocks/ListingOptions/tableTemplate
4192
+ # defaultMessage: Tipo di contenuto
4193
+ msgid "table_variaton_ct"
4194
+ msgstr ""
4195
+
4196
+ #: config/Blocks/ListingOptions/tableTemplate
4197
+ # defaultMessage: Campo
4198
+ msgid "table_variaton_field"
4199
+ msgstr ""
4200
+
4201
+ #: config/Blocks/ListingOptions/tableTemplate
4202
+ # defaultMessage: Titolo
4203
+ msgid "table_variaton_title"
4204
+ msgstr ""
4205
+
4206
+ #: config/Blocks/ListingOptions/tableTemplate
4207
+ # defaultMessage: Titolo della colonna. Se vuoi, puoi modificare il titolo di default.
4208
+ msgid "table_variaton_title_description"
4209
+ msgstr ""
4210
+
4211
+ #: components/ItaliaTheme/Blocks/Listing/TableTemplate
4212
+ # defaultMessage: Titolo
4213
+ msgid "tabletemplate_column_title"
4214
+ msgstr ""
4215
+
4175
4216
  #: components/ItaliaTheme/View/Commons/ContactLink
4176
4217
  #: components/ItaliaTheme/View/PuntoDiContattoView/PuntoDiContattoView
4177
4218
  #: helpers/contentHelper
@@ -3925,6 +3925,7 @@ msgid "sideMenuIndex"
3925
3925
  msgstr "Page index"
3926
3926
 
3927
3927
  #: components/ItaliaTheme/View/Commons/SideMenu
3928
+ #: components/ItaliaTheme/View/Commons/SideMenuByTitles
3928
3929
  # defaultMessage: Navigazione della pagina
3929
3930
  msgid "sideMenuNavigation"
3930
3931
  msgstr "Elements of the sidebar menu"
@@ -4157,6 +4158,46 @@ msgstr "Next"
4157
4158
  msgid "supported_by"
4158
4159
  msgstr "Supported by"
4159
4160
 
4161
+ #: config/Blocks/ListingOptions/tableTemplate
4162
+ # defaultMessage: Colore delle righe alternato
4163
+ msgid "table_variation_alternate_rows"
4164
+ msgstr ""
4165
+
4166
+ #: config/Blocks/ListingOptions/tableTemplate
4167
+ # defaultMessage: Colonne della tabella
4168
+ msgid "table_variation_columns"
4169
+ msgstr ""
4170
+
4171
+ #: config/Blocks/ListingOptions/tableTemplate
4172
+ # defaultMessage: Colonna
4173
+ msgid "table_variaton_column"
4174
+ msgstr ""
4175
+
4176
+ #: config/Blocks/ListingOptions/tableTemplate
4177
+ # defaultMessage: Tipo di contenuto
4178
+ msgid "table_variaton_ct"
4179
+ msgstr ""
4180
+
4181
+ #: config/Blocks/ListingOptions/tableTemplate
4182
+ # defaultMessage: Campo
4183
+ msgid "table_variaton_field"
4184
+ msgstr ""
4185
+
4186
+ #: config/Blocks/ListingOptions/tableTemplate
4187
+ # defaultMessage: Titolo
4188
+ msgid "table_variaton_title"
4189
+ msgstr ""
4190
+
4191
+ #: config/Blocks/ListingOptions/tableTemplate
4192
+ # defaultMessage: Titolo della colonna. Se vuoi, puoi modificare il titolo di default.
4193
+ msgid "table_variaton_title_description"
4194
+ msgstr ""
4195
+
4196
+ #: components/ItaliaTheme/Blocks/Listing/TableTemplate
4197
+ # defaultMessage: Titolo
4198
+ msgid "tabletemplate_column_title"
4199
+ msgstr ""
4200
+
4160
4201
  #: components/ItaliaTheme/View/Commons/ContactLink
4161
4202
  #: components/ItaliaTheme/View/PuntoDiContattoView/PuntoDiContattoView
4162
4203
  #: helpers/contentHelper
@@ -3934,6 +3934,7 @@ msgid "sideMenuIndex"
3934
3934
  msgstr ""
3935
3935
 
3936
3936
  #: components/ItaliaTheme/View/Commons/SideMenu
3937
+ #: components/ItaliaTheme/View/Commons/SideMenuByTitles
3937
3938
  # defaultMessage: Navigazione della pagina
3938
3939
  msgid "sideMenuNavigation"
3939
3940
  msgstr ""
@@ -4166,6 +4167,46 @@ msgstr ""
4166
4167
  msgid "supported_by"
4167
4168
  msgstr "Con el apoyo de"
4168
4169
 
4170
+ #: config/Blocks/ListingOptions/tableTemplate
4171
+ # defaultMessage: Colore delle righe alternato
4172
+ msgid "table_variation_alternate_rows"
4173
+ msgstr ""
4174
+
4175
+ #: config/Blocks/ListingOptions/tableTemplate
4176
+ # defaultMessage: Colonne della tabella
4177
+ msgid "table_variation_columns"
4178
+ msgstr ""
4179
+
4180
+ #: config/Blocks/ListingOptions/tableTemplate
4181
+ # defaultMessage: Colonna
4182
+ msgid "table_variaton_column"
4183
+ msgstr ""
4184
+
4185
+ #: config/Blocks/ListingOptions/tableTemplate
4186
+ # defaultMessage: Tipo di contenuto
4187
+ msgid "table_variaton_ct"
4188
+ msgstr ""
4189
+
4190
+ #: config/Blocks/ListingOptions/tableTemplate
4191
+ # defaultMessage: Campo
4192
+ msgid "table_variaton_field"
4193
+ msgstr ""
4194
+
4195
+ #: config/Blocks/ListingOptions/tableTemplate
4196
+ # defaultMessage: Titolo
4197
+ msgid "table_variaton_title"
4198
+ msgstr ""
4199
+
4200
+ #: config/Blocks/ListingOptions/tableTemplate
4201
+ # defaultMessage: Titolo della colonna. Se vuoi, puoi modificare il titolo di default.
4202
+ msgid "table_variaton_title_description"
4203
+ msgstr ""
4204
+
4205
+ #: components/ItaliaTheme/Blocks/Listing/TableTemplate
4206
+ # defaultMessage: Titolo
4207
+ msgid "tabletemplate_column_title"
4208
+ msgstr ""
4209
+
4169
4210
  #: components/ItaliaTheme/View/Commons/ContactLink
4170
4211
  #: components/ItaliaTheme/View/PuntoDiContattoView/PuntoDiContattoView
4171
4212
  #: helpers/contentHelper
@@ -3942,6 +3942,7 @@ msgid "sideMenuIndex"
3942
3942
  msgstr ""
3943
3943
 
3944
3944
  #: components/ItaliaTheme/View/Commons/SideMenu
3945
+ #: components/ItaliaTheme/View/Commons/SideMenuByTitles
3945
3946
  # defaultMessage: Navigazione della pagina
3946
3947
  msgid "sideMenuNavigation"
3947
3948
  msgstr ""
@@ -4174,6 +4175,46 @@ msgstr ""
4174
4175
  msgid "supported_by"
4175
4176
  msgstr ""
4176
4177
 
4178
+ #: config/Blocks/ListingOptions/tableTemplate
4179
+ # defaultMessage: Colore delle righe alternato
4180
+ msgid "table_variation_alternate_rows"
4181
+ msgstr ""
4182
+
4183
+ #: config/Blocks/ListingOptions/tableTemplate
4184
+ # defaultMessage: Colonne della tabella
4185
+ msgid "table_variation_columns"
4186
+ msgstr ""
4187
+
4188
+ #: config/Blocks/ListingOptions/tableTemplate
4189
+ # defaultMessage: Colonna
4190
+ msgid "table_variaton_column"
4191
+ msgstr ""
4192
+
4193
+ #: config/Blocks/ListingOptions/tableTemplate
4194
+ # defaultMessage: Tipo di contenuto
4195
+ msgid "table_variaton_ct"
4196
+ msgstr ""
4197
+
4198
+ #: config/Blocks/ListingOptions/tableTemplate
4199
+ # defaultMessage: Campo
4200
+ msgid "table_variaton_field"
4201
+ msgstr ""
4202
+
4203
+ #: config/Blocks/ListingOptions/tableTemplate
4204
+ # defaultMessage: Titolo
4205
+ msgid "table_variaton_title"
4206
+ msgstr ""
4207
+
4208
+ #: config/Blocks/ListingOptions/tableTemplate
4209
+ # defaultMessage: Titolo della colonna. Se vuoi, puoi modificare il titolo di default.
4210
+ msgid "table_variaton_title_description"
4211
+ msgstr ""
4212
+
4213
+ #: components/ItaliaTheme/Blocks/Listing/TableTemplate
4214
+ # defaultMessage: Titolo
4215
+ msgid "tabletemplate_column_title"
4216
+ msgstr ""
4217
+
4177
4218
  #: components/ItaliaTheme/View/Commons/ContactLink
4178
4219
  #: components/ItaliaTheme/View/PuntoDiContattoView/PuntoDiContattoView
4179
4220
  #: helpers/contentHelper
@@ -3925,6 +3925,7 @@ msgid "sideMenuIndex"
3925
3925
  msgstr ""
3926
3926
 
3927
3927
  #: components/ItaliaTheme/View/Commons/SideMenu
3928
+ #: components/ItaliaTheme/View/Commons/SideMenuByTitles
3928
3929
  # defaultMessage: Navigazione della pagina
3929
3930
  msgid "sideMenuNavigation"
3930
3931
  msgstr ""
@@ -4157,6 +4158,46 @@ msgstr "Successivo"
4157
4158
  msgid "supported_by"
4158
4159
  msgstr "Con il supporto di"
4159
4160
 
4161
+ #: config/Blocks/ListingOptions/tableTemplate
4162
+ # defaultMessage: Colore delle righe alternato
4163
+ msgid "table_variation_alternate_rows"
4164
+ msgstr ""
4165
+
4166
+ #: config/Blocks/ListingOptions/tableTemplate
4167
+ # defaultMessage: Colonne della tabella
4168
+ msgid "table_variation_columns"
4169
+ msgstr ""
4170
+
4171
+ #: config/Blocks/ListingOptions/tableTemplate
4172
+ # defaultMessage: Colonna
4173
+ msgid "table_variaton_column"
4174
+ msgstr ""
4175
+
4176
+ #: config/Blocks/ListingOptions/tableTemplate
4177
+ # defaultMessage: Tipo di contenuto
4178
+ msgid "table_variaton_ct"
4179
+ msgstr ""
4180
+
4181
+ #: config/Blocks/ListingOptions/tableTemplate
4182
+ # defaultMessage: Campo
4183
+ msgid "table_variaton_field"
4184
+ msgstr ""
4185
+
4186
+ #: config/Blocks/ListingOptions/tableTemplate
4187
+ # defaultMessage: Titolo
4188
+ msgid "table_variaton_title"
4189
+ msgstr ""
4190
+
4191
+ #: config/Blocks/ListingOptions/tableTemplate
4192
+ # defaultMessage: Titolo della colonna. Se vuoi, puoi modificare il titolo di default.
4193
+ msgid "table_variaton_title_description"
4194
+ msgstr ""
4195
+
4196
+ #: components/ItaliaTheme/Blocks/Listing/TableTemplate
4197
+ # defaultMessage: Titolo
4198
+ msgid "tabletemplate_column_title"
4199
+ msgstr ""
4200
+
4160
4201
  #: components/ItaliaTheme/View/Commons/ContactLink
4161
4202
  #: components/ItaliaTheme/View/PuntoDiContattoView/PuntoDiContattoView
4162
4203
  #: helpers/contentHelper
package/locales/volto.pot CHANGED
@@ -1,7 +1,7 @@
1
1
  msgid ""
2
2
  msgstr ""
3
3
  "Project-Id-Version: Plone\n"
4
- "POT-Creation-Date: 2025-04-29T19:12:18.732Z\n"
4
+ "POT-Creation-Date: 2025-07-31T15:00:17.623Z\n"
5
5
  "Last-Translator: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
6
6
  "Language-Team: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
7
7
  "MIME-Version: 1.0\n"
@@ -3927,6 +3927,7 @@ msgid "sideMenuIndex"
3927
3927
  msgstr ""
3928
3928
 
3929
3929
  #: components/ItaliaTheme/View/Commons/SideMenu
3930
+ #: components/ItaliaTheme/View/Commons/SideMenuByTitles
3930
3931
  # defaultMessage: Navigazione della pagina
3931
3932
  msgid "sideMenuNavigation"
3932
3933
  msgstr ""
@@ -4159,6 +4160,46 @@ msgstr ""
4159
4160
  msgid "supported_by"
4160
4161
  msgstr ""
4161
4162
 
4163
+ #: config/Blocks/ListingOptions/tableTemplate
4164
+ # defaultMessage: Colore delle righe alternato
4165
+ msgid "table_variation_alternate_rows"
4166
+ msgstr ""
4167
+
4168
+ #: config/Blocks/ListingOptions/tableTemplate
4169
+ # defaultMessage: Colonne della tabella
4170
+ msgid "table_variation_columns"
4171
+ msgstr ""
4172
+
4173
+ #: config/Blocks/ListingOptions/tableTemplate
4174
+ # defaultMessage: Colonna
4175
+ msgid "table_variaton_column"
4176
+ msgstr ""
4177
+
4178
+ #: config/Blocks/ListingOptions/tableTemplate
4179
+ # defaultMessage: Tipo di contenuto
4180
+ msgid "table_variaton_ct"
4181
+ msgstr ""
4182
+
4183
+ #: config/Blocks/ListingOptions/tableTemplate
4184
+ # defaultMessage: Campo
4185
+ msgid "table_variaton_field"
4186
+ msgstr ""
4187
+
4188
+ #: config/Blocks/ListingOptions/tableTemplate
4189
+ # defaultMessage: Titolo
4190
+ msgid "table_variaton_title"
4191
+ msgstr ""
4192
+
4193
+ #: config/Blocks/ListingOptions/tableTemplate
4194
+ # defaultMessage: Titolo della colonna. Se vuoi, puoi modificare il titolo di default.
4195
+ msgid "table_variaton_title_description"
4196
+ msgstr ""
4197
+
4198
+ #: components/ItaliaTheme/Blocks/Listing/TableTemplate
4199
+ # defaultMessage: Titolo
4200
+ msgid "tabletemplate_column_title"
4201
+ msgstr ""
4202
+
4162
4203
  #: components/ItaliaTheme/View/Commons/ContactLink
4163
4204
  #: components/ItaliaTheme/View/PuntoDiContattoView/PuntoDiContattoView
4164
4205
  #: helpers/contentHelper
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "design-comuni-plone-theme",
3
3
  "description": "Volto Theme for Italia design guidelines",
4
4
  "license": "GPL-v3",
5
- "version": "11.31.2",
5
+ "version": "11.32.0",
6
6
  "main": "src/index.js",
7
7
  "repository": {
8
8
  "type": "git",
package/publiccode.yml CHANGED
@@ -227,9 +227,9 @@ maintenance:
227
227
  name: io-Comune - Il sito AgID per Comuni ed Enti Pubblici
228
228
  platforms:
229
229
  - web
230
- releaseDate: '2025-07-17'
230
+ releaseDate: '2025-07-31'
231
231
  softwareType: standalone/web
232
- softwareVersion: 11.31.2
232
+ softwareVersion: 11.32.0
233
233
  url: 'https://github.com/italia/design-comuni-plone-theme'
234
234
  usedBy:
235
235
  - ASP Comuni Modenesi Area Nord
@@ -0,0 +1,13 @@
1
+ export const GET_CT_SCHEMA = 'GET_CT_SCHEMA';
2
+
3
+ export function getCTSchema(type, url) {
4
+ url = typeof url !== 'undefined' ? url : '';
5
+ return {
6
+ type: GET_CT_SCHEMA,
7
+ subrequest: type,
8
+ request: {
9
+ op: 'get',
10
+ path: `${url}/@types/${type}`,
11
+ },
12
+ };
13
+ }
@@ -39,6 +39,7 @@ import {
39
39
  getSearchBandiFilters,
40
40
  GET_SEARCH_BANDI_FILTERS,
41
41
  } from './getSearchBandiFilters';
42
+ import { getCTSchema, GET_CT_SCHEMA } from './getCTSchema';
42
43
 
43
44
  export {
44
45
  getSearchFilters,
@@ -62,4 +63,6 @@ export {
62
63
  getSearchBandiFilters,
63
64
  GET_SEARCH_BANDI_FILTERS,
64
65
  resetQuerystringResults,
66
+ getCTSchema,
67
+ GET_CT_SCHEMA,
65
68
  };
@@ -8,7 +8,7 @@ const ListingImageWrapper = ({ children, item, noWrapLink }) => {
8
8
  return noWrapLink ? (
9
9
  children
10
10
  ) : (
11
- <UniversalLink item={item} className="img-wrapper">
11
+ <UniversalLink item={item} className="img-wrapper" tabIndex="-1">
12
12
  {children}
13
13
  </UniversalLink>
14
14
  );
@@ -0,0 +1,163 @@
1
+ /*
2
+ * Template a tabella
3
+ */
4
+ import React, { useEffect } from 'react';
5
+ import cx from 'classnames';
6
+ import PropTypes from 'prop-types';
7
+ import { useDispatch, useSelector } from 'react-redux';
8
+ import { useIntl, defineMessages } from 'react-intl';
9
+ import { getCTSchema } from 'design-comuni-plone-theme/actions';
10
+ import { Table, Container } from 'design-react-kit';
11
+ import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink';
12
+
13
+ import { ListingLinkMore } from 'design-comuni-plone-theme/components/ItaliaTheme';
14
+ import { getWidget } from '@plone/volto/helpers/Widget/utils';
15
+
16
+ import config from '@plone/volto/registry';
17
+
18
+ const messages = defineMessages({
19
+ title: { id: 'tabletemplate_column_title', defaultMessage: 'Titolo' },
20
+ });
21
+
22
+ const TableTemplate = (props) => {
23
+ const {
24
+ columns,
25
+ alternate_rows,
26
+ items,
27
+ isEditMode,
28
+ linkAlign,
29
+ linkTitle,
30
+ linkHref,
31
+ linkmore_id_lighthouse,
32
+ } = props;
33
+
34
+ const intl = useIntl();
35
+ const { views } = config.widgets;
36
+
37
+ // necessario per gli edditor nel momento in cui aggiungono nuove colonne
38
+ const ct_schema = useSelector((state) => state.ct_schema?.subrequests);
39
+
40
+ let render_columns =
41
+ (columns ?? []).filter((c) => c.field === 'title').length > 0
42
+ ? columns
43
+ : [
44
+ { field: 'title', title: intl.formatMessage(messages.title) },
45
+ ...(columns ?? []),
46
+ ];
47
+ return (
48
+ <div className="table-template">
49
+ <Container className="px-4 pt-3">
50
+ <Table size="sm" responsive bordered striped={alternate_rows ?? false}>
51
+ <thead className="table-light">
52
+ <tr>
53
+ {render_columns.map((c, index) => {
54
+ const field_properties =
55
+ c.field_properties ??
56
+ ct_schema?.[c.ct]?.result?.properties?.[c.field] ??
57
+ {};
58
+
59
+ return (
60
+ <th
61
+ scope="col"
62
+ className={cx(c.ct + '-' + c.field, {
63
+ 'date-column':
64
+ field_properties.widget === 'date' ||
65
+ field_properties.widget === 'datetime',
66
+ })}
67
+ key={index}
68
+ >
69
+ {c.title}
70
+ </th>
71
+ );
72
+ })}
73
+ </tr>
74
+ </thead>
75
+ <tbody>
76
+ {items.map((item, index) => (
77
+ <tr key={index}>
78
+ {render_columns.map((c, index) => {
79
+ const field_properties =
80
+ c.field_properties ??
81
+ ct_schema?.[c.ct]?.result?.properties?.[c.field] ??
82
+ {};
83
+ let render_value = JSON.stringify(item[c.field]);
84
+
85
+ if (field_properties) {
86
+ const field = {
87
+ ...field_properties,
88
+ id: c.field,
89
+ widget: getWidget(c.field, field_properties),
90
+ };
91
+ const Widget = views?.getWidget(field);
92
+
93
+ const widget_props = {
94
+ behavior: field_properties.behavior,
95
+ };
96
+ switch (c.field) {
97
+ case 'apertura_bando':
98
+ case 'chiusura_procedimento_bando':
99
+ case 'scadenza_domande_bando':
100
+ case 'scadenza_bando':
101
+ widget_props.format = 'DD MMM yyyy';
102
+ break;
103
+ default:
104
+ break;
105
+ }
106
+ // rimuove ora, se non valorizzata
107
+ if (
108
+ field_properties.widget === 'datetime' &&
109
+ c.field !== 'whole_day' &&
110
+ c.field !== 'open_end' &&
111
+ item?.[c.field]?.indexOf('T00:00') > 0
112
+ ) {
113
+ widget_props.format = 'DD MMM yyyy';
114
+ }
115
+ if (field_properties.vocabulary) {
116
+ widget_props.vocabulary =
117
+ field_properties.vocabulary['@id'];
118
+ }
119
+ render_value = (
120
+ <Widget value={item[c.field]} {...widget_props} />
121
+ );
122
+ }
123
+ if (c.field === 'title') {
124
+ render_value = (
125
+ <UniversalLink
126
+ item={!isEditMode ? item : null}
127
+ href={isEditMode ? '#' : ''}
128
+ className="img-link"
129
+ >
130
+ {item[c.field]}
131
+ </UniversalLink>
132
+ );
133
+ }
134
+
135
+ // return <td key={index}>ciao</td>;
136
+ return <td key={index}>{render_value}</td>;
137
+ })}
138
+ </tr>
139
+ ))}
140
+ </tbody>
141
+ </Table>
142
+
143
+ <ListingLinkMore
144
+ title={linkTitle}
145
+ href={linkHref}
146
+ linkAlign={linkAlign}
147
+ className="my-4"
148
+ linkmoreIdLighthouse={linkmore_id_lighthouse}
149
+ />
150
+ </Container>
151
+ </div>
152
+ );
153
+ };
154
+
155
+ TableTemplate.propTypes = {
156
+ items: PropTypes.arrayOf(PropTypes.any).isRequired,
157
+ linkTitle: PropTypes.any,
158
+ linkHref: PropTypes.any,
159
+ isEditMode: PropTypes.bool,
160
+ title: PropTypes.string,
161
+ };
162
+
163
+ export default TableTemplate;
@@ -0,0 +1,50 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { Row, Col, Table, Container } from 'design-react-kit';
4
+
5
+ const SimpleListTemplateSkeleton = (props) => {
6
+ const { title, linkHref } = props;
7
+ return (
8
+ <div className="table-skeleton-template">
9
+ <Container className="px-4">
10
+ <div className="skeleton-template">
11
+ {title && (
12
+ <Row>
13
+ <Col>
14
+ <h2 className="mb-4">{title}</h2>
15
+ </Col>
16
+ </Row>
17
+ )}
18
+
19
+ <Table size="sm" responsive bordered>
20
+ <thead>
21
+ <tr>
22
+ {[0, 1, 2, 3, 4].map((i) => (
23
+ <th scope="col" key={i}></th>
24
+ ))}
25
+ </tr>
26
+ </thead>
27
+ <tbody>
28
+ {[0, 1, 2, 3, 4, 5, 6].map((i) => (
29
+ <tr key={i}>
30
+ {[0, 1, 2, 3, 4].map((i) => (
31
+ <td key={i}></td>
32
+ ))}
33
+ </tr>
34
+ ))}
35
+ </tbody>
36
+ </Table>
37
+ {linkHref && <div className="link-button text-center my-5"></div>}
38
+ </div>
39
+ </Container>
40
+ </div>
41
+ );
42
+ };
43
+
44
+ SimpleListTemplateSkeleton.propTypes = {
45
+ linkHref: PropTypes.any,
46
+ isEditMode: PropTypes.bool,
47
+ title: PropTypes.string,
48
+ };
49
+
50
+ export default SimpleListTemplateSkeleton;
@@ -176,7 +176,8 @@ const SideMenu = ({ data, content_uid }) => {
176
176
  <div className="mb-3">
177
177
  <Progress
178
178
  value={progressValue > 0 ? 100 * progressValue : 0}
179
- role="progressbar"
179
+ role="progressbar"
180
+ aria-labelledby={`item-${activeSection}`}
180
181
  />
181
182
  </div>
182
183
  <AccordionBody active={isNavOpen} id="side-menu-body">