design-comuni-plone-theme 12.2.2 → 12.3.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 (37) hide show
  1. package/.yarn/install-state.gz +0 -0
  2. package/CHANGELOG.md +38 -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/MegaMenu/MegaMenu.jsx +1 -0
  18. package/src/components/ItaliaTheme/View/Commons/SideMenu.jsx +2 -1
  19. package/src/components/ItaliaTheme/View/Commons/SideMenuByTitles.jsx +16 -8
  20. package/src/components/ItaliaTheme/index.js +5 -0
  21. package/src/components/ItaliaTheme/manage/Widgets/BlocksViewWidget.jsx +7 -0
  22. package/src/components/ItaliaTheme/manage/Widgets/CTFieldsWidget.jsx +84 -0
  23. package/src/components/ItaliaTheme/manage/Widgets/CTTitleColumnWidget.jsx +22 -0
  24. package/src/components/ItaliaTheme/manage/Widgets/DataGridWidget.jsx +26 -0
  25. package/src/components/ItaliaTheme/manage/Widgets/PDCViewWidget.jsx +21 -0
  26. package/src/config/Blocks/ListingOptions/index.js +1 -0
  27. package/src/config/Blocks/ListingOptions/tableTemplate.js +105 -0
  28. package/src/config/Blocks/listingVariations.js +18 -0
  29. package/src/config/Widgets/widgets.js +24 -1
  30. package/src/customizations/volto/helpers/Html/Html.jsx +28 -14
  31. package/src/helpers/getWidgetView.js +112 -0
  32. package/src/helpers/index.js +1 -0
  33. package/src/reducers/ctSchema.js +80 -0
  34. package/src/reducers/index.js +2 -0
  35. package/src/theme/ItaliaTheme/Blocks/_smallblockLinkstemplate.scss +1 -0
  36. package/src/theme/ItaliaTheme/Blocks/_tableTemplate.scss +46 -0
  37. package/src/theme/site.scss +1 -0
Binary file
package/CHANGELOG.md CHANGED
@@ -1,5 +1,43 @@
1
1
  # Changelog
2
2
 
3
+ ## [12.3.0](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v12.2.3...v12.3.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)) ([79aca4a](https://github.com/RedTurtle/design-comuni-plone-theme/commit/79aca4adad850851e9359143d87fd44bf6499395))
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)) ([0c74ac1](https://github.com/RedTurtle/design-comuni-plone-theme/commit/0c74ac16006e8b742b900265377a1614b0e6480f))
14
+ * **a11y:** fixed image focus of smallBlockLinkTemplate ([#974](https://github.com/RedTurtle/design-comuni-plone-theme/issues/974)) ([d27bcad](https://github.com/RedTurtle/design-comuni-plone-theme/commit/d27bcad7b123c2920bffa6e2591a317243c84897))
15
+ * locales ([ac069ed](https://github.com/RedTurtle/design-comuni-plone-theme/commit/ac069eda31301cb4622a46968df33ecebd6bc4fe))
16
+ * progressbar a11y ([#966](https://github.com/RedTurtle/design-comuni-plone-theme/issues/966)) ([c5be555](https://github.com/RedTurtle/design-comuni-plone-theme/commit/c5be55506c6d0f787d29d5d0a166a2348f1516de))
17
+ * sync HTML.jsx customization (lang in html tag) ([#968](https://github.com/RedTurtle/design-comuni-plone-theme/issues/968)) ([d0f09ac](https://github.com/RedTurtle/design-comuni-plone-theme/commit/d0f09acd22fb9ca3021b2eedeb7ed62e2011f399))
18
+
19
+
20
+ ### Maintenance
21
+
22
+ * updated i18n ([b307141](https://github.com/RedTurtle/design-comuni-plone-theme/commit/b30714137c408a61f996361528e3a2e7094f6101))
23
+
24
+
25
+ ### Documentation
26
+
27
+ * updated publiccode and release log ([f3f8457](https://github.com/RedTurtle/design-comuni-plone-theme/commit/f3f845751f47db45aa8a2e8143cb9d393c0dffd5))
28
+
29
+ ## [12.2.3](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v12.2.2...v12.2.3) (2025-07-17)
30
+
31
+
32
+ ### Bug Fixes
33
+
34
+ * added role='menuitem' to links inside dropdown to fix menubar role hierarchy ([#967](https://github.com/RedTurtle/design-comuni-plone-theme/issues/967)) ([521460a](https://github.com/RedTurtle/design-comuni-plone-theme/commit/521460a6477c1fc647a1a60a04111ed2db37381c))
35
+
36
+
37
+ ### Documentation
38
+
39
+ * updated publiccode ([6b3ce2c](https://github.com/RedTurtle/design-comuni-plone-theme/commit/6b3ce2ce87761ec40c20960e53cc2166b65d5146))
40
+
3
41
  ## [12.2.2](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v12.2.1...v12.2.2) (2025-07-14)
4
42
 
5
43
 
package/RELEASE.md CHANGED
@@ -41,6 +41,17 @@
41
41
  - ...
42
42
  -->
43
43
 
44
+ ## Versione 12.3.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 12.2.2 (14/07/2025)
45
56
 
46
57
  ### Fix
@@ -4012,6 +4012,7 @@ msgid "sideMenuIndex"
4012
4012
  msgstr ""
4013
4013
 
4014
4014
  #: components/ItaliaTheme/View/Commons/SideMenu
4015
+ #: components/ItaliaTheme/View/Commons/SideMenuByTitles
4015
4016
  # defaultMessage: Navigazione della pagina
4016
4017
  msgid "sideMenuNavigation"
4017
4018
  msgstr ""
@@ -4244,6 +4245,46 @@ msgstr ""
4244
4245
  msgid "supported_by"
4245
4246
  msgstr ""
4246
4247
 
4248
+ #: config/Blocks/ListingOptions/tableTemplate
4249
+ # defaultMessage: Colore delle righe alternato
4250
+ msgid "table_variation_alternate_rows"
4251
+ msgstr ""
4252
+
4253
+ #: config/Blocks/ListingOptions/tableTemplate
4254
+ # defaultMessage: Colonne della tabella
4255
+ msgid "table_variation_columns"
4256
+ msgstr ""
4257
+
4258
+ #: config/Blocks/ListingOptions/tableTemplate
4259
+ # defaultMessage: Colonna
4260
+ msgid "table_variaton_column"
4261
+ msgstr ""
4262
+
4263
+ #: config/Blocks/ListingOptions/tableTemplate
4264
+ # defaultMessage: Tipo di contenuto
4265
+ msgid "table_variaton_ct"
4266
+ msgstr ""
4267
+
4268
+ #: config/Blocks/ListingOptions/tableTemplate
4269
+ # defaultMessage: Campo
4270
+ msgid "table_variaton_field"
4271
+ msgstr ""
4272
+
4273
+ #: config/Blocks/ListingOptions/tableTemplate
4274
+ # defaultMessage: Titolo
4275
+ msgid "table_variaton_title"
4276
+ msgstr ""
4277
+
4278
+ #: config/Blocks/ListingOptions/tableTemplate
4279
+ # defaultMessage: Titolo della colonna. Se vuoi, puoi modificare il titolo di default.
4280
+ msgid "table_variaton_title_description"
4281
+ msgstr ""
4282
+
4283
+ #: components/ItaliaTheme/Blocks/Listing/TableTemplate
4284
+ # defaultMessage: Titolo
4285
+ msgid "tabletemplate_column_title"
4286
+ msgstr ""
4287
+
4247
4288
  #: components/ItaliaTheme/View/Commons/ContactLink
4248
4289
  #: components/ItaliaTheme/View/PuntoDiContattoView/PuntoDiContattoView
4249
4290
  #: helpers/contentHelper
@@ -3997,6 +3997,7 @@ msgid "sideMenuIndex"
3997
3997
  msgstr "Page index"
3998
3998
 
3999
3999
  #: components/ItaliaTheme/View/Commons/SideMenu
4000
+ #: components/ItaliaTheme/View/Commons/SideMenuByTitles
4000
4001
  # defaultMessage: Navigazione della pagina
4001
4002
  msgid "sideMenuNavigation"
4002
4003
  msgstr "Elements of the sidebar menu"
@@ -4229,6 +4230,46 @@ msgstr "Next"
4229
4230
  msgid "supported_by"
4230
4231
  msgstr "Supported by"
4231
4232
 
4233
+ #: config/Blocks/ListingOptions/tableTemplate
4234
+ # defaultMessage: Colore delle righe alternato
4235
+ msgid "table_variation_alternate_rows"
4236
+ msgstr ""
4237
+
4238
+ #: config/Blocks/ListingOptions/tableTemplate
4239
+ # defaultMessage: Colonne della tabella
4240
+ msgid "table_variation_columns"
4241
+ msgstr ""
4242
+
4243
+ #: config/Blocks/ListingOptions/tableTemplate
4244
+ # defaultMessage: Colonna
4245
+ msgid "table_variaton_column"
4246
+ msgstr ""
4247
+
4248
+ #: config/Blocks/ListingOptions/tableTemplate
4249
+ # defaultMessage: Tipo di contenuto
4250
+ msgid "table_variaton_ct"
4251
+ msgstr ""
4252
+
4253
+ #: config/Blocks/ListingOptions/tableTemplate
4254
+ # defaultMessage: Campo
4255
+ msgid "table_variaton_field"
4256
+ msgstr ""
4257
+
4258
+ #: config/Blocks/ListingOptions/tableTemplate
4259
+ # defaultMessage: Titolo
4260
+ msgid "table_variaton_title"
4261
+ msgstr ""
4262
+
4263
+ #: config/Blocks/ListingOptions/tableTemplate
4264
+ # defaultMessage: Titolo della colonna. Se vuoi, puoi modificare il titolo di default.
4265
+ msgid "table_variaton_title_description"
4266
+ msgstr ""
4267
+
4268
+ #: components/ItaliaTheme/Blocks/Listing/TableTemplate
4269
+ # defaultMessage: Titolo
4270
+ msgid "tabletemplate_column_title"
4271
+ msgstr ""
4272
+
4232
4273
  #: components/ItaliaTheme/View/Commons/ContactLink
4233
4274
  #: components/ItaliaTheme/View/PuntoDiContattoView/PuntoDiContattoView
4234
4275
  #: helpers/contentHelper
@@ -4006,6 +4006,7 @@ msgid "sideMenuIndex"
4006
4006
  msgstr ""
4007
4007
 
4008
4008
  #: components/ItaliaTheme/View/Commons/SideMenu
4009
+ #: components/ItaliaTheme/View/Commons/SideMenuByTitles
4009
4010
  # defaultMessage: Navigazione della pagina
4010
4011
  msgid "sideMenuNavigation"
4011
4012
  msgstr ""
@@ -4238,6 +4239,46 @@ msgstr ""
4238
4239
  msgid "supported_by"
4239
4240
  msgstr "Con el apoyo de"
4240
4241
 
4242
+ #: config/Blocks/ListingOptions/tableTemplate
4243
+ # defaultMessage: Colore delle righe alternato
4244
+ msgid "table_variation_alternate_rows"
4245
+ msgstr ""
4246
+
4247
+ #: config/Blocks/ListingOptions/tableTemplate
4248
+ # defaultMessage: Colonne della tabella
4249
+ msgid "table_variation_columns"
4250
+ msgstr ""
4251
+
4252
+ #: config/Blocks/ListingOptions/tableTemplate
4253
+ # defaultMessage: Colonna
4254
+ msgid "table_variaton_column"
4255
+ msgstr ""
4256
+
4257
+ #: config/Blocks/ListingOptions/tableTemplate
4258
+ # defaultMessage: Tipo di contenuto
4259
+ msgid "table_variaton_ct"
4260
+ msgstr ""
4261
+
4262
+ #: config/Blocks/ListingOptions/tableTemplate
4263
+ # defaultMessage: Campo
4264
+ msgid "table_variaton_field"
4265
+ msgstr ""
4266
+
4267
+ #: config/Blocks/ListingOptions/tableTemplate
4268
+ # defaultMessage: Titolo
4269
+ msgid "table_variaton_title"
4270
+ msgstr ""
4271
+
4272
+ #: config/Blocks/ListingOptions/tableTemplate
4273
+ # defaultMessage: Titolo della colonna. Se vuoi, puoi modificare il titolo di default.
4274
+ msgid "table_variaton_title_description"
4275
+ msgstr ""
4276
+
4277
+ #: components/ItaliaTheme/Blocks/Listing/TableTemplate
4278
+ # defaultMessage: Titolo
4279
+ msgid "tabletemplate_column_title"
4280
+ msgstr ""
4281
+
4241
4282
  #: components/ItaliaTheme/View/Commons/ContactLink
4242
4283
  #: components/ItaliaTheme/View/PuntoDiContattoView/PuntoDiContattoView
4243
4284
  #: helpers/contentHelper
@@ -4014,6 +4014,7 @@ msgid "sideMenuIndex"
4014
4014
  msgstr ""
4015
4015
 
4016
4016
  #: components/ItaliaTheme/View/Commons/SideMenu
4017
+ #: components/ItaliaTheme/View/Commons/SideMenuByTitles
4017
4018
  # defaultMessage: Navigazione della pagina
4018
4019
  msgid "sideMenuNavigation"
4019
4020
  msgstr ""
@@ -4246,6 +4247,46 @@ msgstr ""
4246
4247
  msgid "supported_by"
4247
4248
  msgstr ""
4248
4249
 
4250
+ #: config/Blocks/ListingOptions/tableTemplate
4251
+ # defaultMessage: Colore delle righe alternato
4252
+ msgid "table_variation_alternate_rows"
4253
+ msgstr ""
4254
+
4255
+ #: config/Blocks/ListingOptions/tableTemplate
4256
+ # defaultMessage: Colonne della tabella
4257
+ msgid "table_variation_columns"
4258
+ msgstr ""
4259
+
4260
+ #: config/Blocks/ListingOptions/tableTemplate
4261
+ # defaultMessage: Colonna
4262
+ msgid "table_variaton_column"
4263
+ msgstr ""
4264
+
4265
+ #: config/Blocks/ListingOptions/tableTemplate
4266
+ # defaultMessage: Tipo di contenuto
4267
+ msgid "table_variaton_ct"
4268
+ msgstr ""
4269
+
4270
+ #: config/Blocks/ListingOptions/tableTemplate
4271
+ # defaultMessage: Campo
4272
+ msgid "table_variaton_field"
4273
+ msgstr ""
4274
+
4275
+ #: config/Blocks/ListingOptions/tableTemplate
4276
+ # defaultMessage: Titolo
4277
+ msgid "table_variaton_title"
4278
+ msgstr ""
4279
+
4280
+ #: config/Blocks/ListingOptions/tableTemplate
4281
+ # defaultMessage: Titolo della colonna. Se vuoi, puoi modificare il titolo di default.
4282
+ msgid "table_variaton_title_description"
4283
+ msgstr ""
4284
+
4285
+ #: components/ItaliaTheme/Blocks/Listing/TableTemplate
4286
+ # defaultMessage: Titolo
4287
+ msgid "tabletemplate_column_title"
4288
+ msgstr ""
4289
+
4249
4290
  #: components/ItaliaTheme/View/Commons/ContactLink
4250
4291
  #: components/ItaliaTheme/View/PuntoDiContattoView/PuntoDiContattoView
4251
4292
  #: helpers/contentHelper
@@ -3997,6 +3997,7 @@ msgid "sideMenuIndex"
3997
3997
  msgstr ""
3998
3998
 
3999
3999
  #: components/ItaliaTheme/View/Commons/SideMenu
4000
+ #: components/ItaliaTheme/View/Commons/SideMenuByTitles
4000
4001
  # defaultMessage: Navigazione della pagina
4001
4002
  msgid "sideMenuNavigation"
4002
4003
  msgstr ""
@@ -4229,6 +4230,46 @@ msgstr "Successivo"
4229
4230
  msgid "supported_by"
4230
4231
  msgstr "Con il supporto di"
4231
4232
 
4233
+ #: config/Blocks/ListingOptions/tableTemplate
4234
+ # defaultMessage: Colore delle righe alternato
4235
+ msgid "table_variation_alternate_rows"
4236
+ msgstr ""
4237
+
4238
+ #: config/Blocks/ListingOptions/tableTemplate
4239
+ # defaultMessage: Colonne della tabella
4240
+ msgid "table_variation_columns"
4241
+ msgstr ""
4242
+
4243
+ #: config/Blocks/ListingOptions/tableTemplate
4244
+ # defaultMessage: Colonna
4245
+ msgid "table_variaton_column"
4246
+ msgstr ""
4247
+
4248
+ #: config/Blocks/ListingOptions/tableTemplate
4249
+ # defaultMessage: Tipo di contenuto
4250
+ msgid "table_variaton_ct"
4251
+ msgstr ""
4252
+
4253
+ #: config/Blocks/ListingOptions/tableTemplate
4254
+ # defaultMessage: Campo
4255
+ msgid "table_variaton_field"
4256
+ msgstr ""
4257
+
4258
+ #: config/Blocks/ListingOptions/tableTemplate
4259
+ # defaultMessage: Titolo
4260
+ msgid "table_variaton_title"
4261
+ msgstr ""
4262
+
4263
+ #: config/Blocks/ListingOptions/tableTemplate
4264
+ # defaultMessage: Titolo della colonna. Se vuoi, puoi modificare il titolo di default.
4265
+ msgid "table_variaton_title_description"
4266
+ msgstr ""
4267
+
4268
+ #: components/ItaliaTheme/Blocks/Listing/TableTemplate
4269
+ # defaultMessage: Titolo
4270
+ msgid "tabletemplate_column_title"
4271
+ msgstr ""
4272
+
4232
4273
  #: components/ItaliaTheme/View/Commons/ContactLink
4233
4274
  #: components/ItaliaTheme/View/PuntoDiContattoView/PuntoDiContattoView
4234
4275
  #: 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:01:52.709Z\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"
@@ -3999,6 +3999,7 @@ msgid "sideMenuIndex"
3999
3999
  msgstr ""
4000
4000
 
4001
4001
  #: components/ItaliaTheme/View/Commons/SideMenu
4002
+ #: components/ItaliaTheme/View/Commons/SideMenuByTitles
4002
4003
  # defaultMessage: Navigazione della pagina
4003
4004
  msgid "sideMenuNavigation"
4004
4005
  msgstr ""
@@ -4231,6 +4232,46 @@ msgstr ""
4231
4232
  msgid "supported_by"
4232
4233
  msgstr ""
4233
4234
 
4235
+ #: config/Blocks/ListingOptions/tableTemplate
4236
+ # defaultMessage: Colore delle righe alternato
4237
+ msgid "table_variation_alternate_rows"
4238
+ msgstr ""
4239
+
4240
+ #: config/Blocks/ListingOptions/tableTemplate
4241
+ # defaultMessage: Colonne della tabella
4242
+ msgid "table_variation_columns"
4243
+ msgstr ""
4244
+
4245
+ #: config/Blocks/ListingOptions/tableTemplate
4246
+ # defaultMessage: Colonna
4247
+ msgid "table_variaton_column"
4248
+ msgstr ""
4249
+
4250
+ #: config/Blocks/ListingOptions/tableTemplate
4251
+ # defaultMessage: Tipo di contenuto
4252
+ msgid "table_variaton_ct"
4253
+ msgstr ""
4254
+
4255
+ #: config/Blocks/ListingOptions/tableTemplate
4256
+ # defaultMessage: Campo
4257
+ msgid "table_variaton_field"
4258
+ msgstr ""
4259
+
4260
+ #: config/Blocks/ListingOptions/tableTemplate
4261
+ # defaultMessage: Titolo
4262
+ msgid "table_variaton_title"
4263
+ msgstr ""
4264
+
4265
+ #: config/Blocks/ListingOptions/tableTemplate
4266
+ # defaultMessage: Titolo della colonna. Se vuoi, puoi modificare il titolo di default.
4267
+ msgid "table_variaton_title_description"
4268
+ msgstr ""
4269
+
4270
+ #: components/ItaliaTheme/Blocks/Listing/TableTemplate
4271
+ # defaultMessage: Titolo
4272
+ msgid "tabletemplate_column_title"
4273
+ msgstr ""
4274
+
4234
4275
  #: components/ItaliaTheme/View/Commons/ContactLink
4235
4276
  #: components/ItaliaTheme/View/PuntoDiContattoView/PuntoDiContattoView
4236
4277
  #: 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": "12.2.2",
5
+ "version": "12.3.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-14'
230
+ releaseDate: '2025-07-31'
231
231
  softwareType: standalone/web
232
- softwareVersion: 12.2.2
232
+ softwareVersion: 12.3.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;