design-comuni-plone-theme 11.31.2 → 11.32.1

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 (40) hide show
  1. package/.yarn/install-state.gz +0 -0
  2. package/CHANGELOG.md +41 -0
  3. package/RELEASE.md +22 -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/Common/SearchFilters/DateFilter.jsx +27 -2
  15. package/src/components/ItaliaTheme/Blocks/Listing/CardWithImage/CardWithImageDefault.jsx +2 -4
  16. package/src/components/ItaliaTheme/Blocks/Listing/Commons/ListingImage.jsx +1 -1
  17. package/src/components/ItaliaTheme/Blocks/Listing/TableTemplate.jsx +163 -0
  18. package/src/components/ItaliaTheme/Blocks/Listing/TemplatesSkeletons/TableTemplateSkeleton.jsx +50 -0
  19. package/src/components/ItaliaTheme/View/Commons/SideMenu.jsx +2 -1
  20. package/src/components/ItaliaTheme/View/Commons/SideMenuByTitles.jsx +16 -8
  21. package/src/components/ItaliaTheme/index.js +5 -0
  22. package/src/components/ItaliaTheme/manage/Widgets/BlocksViewWidget.jsx +7 -0
  23. package/src/components/ItaliaTheme/manage/Widgets/CTFieldsWidget.jsx +84 -0
  24. package/src/components/ItaliaTheme/manage/Widgets/CTTitleColumnWidget.jsx +22 -0
  25. package/src/components/ItaliaTheme/manage/Widgets/DataGridWidget.jsx +26 -0
  26. package/src/components/ItaliaTheme/manage/Widgets/PDCViewWidget.jsx +21 -0
  27. package/src/config/Blocks/ListingOptions/index.js +1 -0
  28. package/src/config/Blocks/ListingOptions/tableTemplate.js +105 -0
  29. package/src/config/Blocks/listingVariations.js +18 -0
  30. package/src/config/Widgets/widgets.js +24 -1
  31. package/src/customizations/volto/helpers/Html/Html.jsx +28 -14
  32. package/src/helpers/getWidgetView.js +112 -0
  33. package/src/helpers/index.js +1 -0
  34. package/src/reducers/ctSchema.js +80 -0
  35. package/src/reducers/index.js +2 -0
  36. package/src/theme/ItaliaTheme/Blocks/_completeBlockLinkstemplate.scss +5 -8
  37. package/src/theme/ItaliaTheme/Blocks/_listing.scss +18 -0
  38. package/src/theme/ItaliaTheme/Blocks/_smallblockLinkstemplate.scss +1 -0
  39. package/src/theme/ItaliaTheme/Blocks/_tableTemplate.scss +46 -0
  40. package/src/theme/site.scss +1 -0
@@ -2,13 +2,17 @@
2
2
  * Html helper.
3
3
  * @module helpers/Html
4
4
  */
5
+
5
6
  /*
6
- CUSTOMIZATIONS:
7
- - Rimosso <link rel="shortcut icon" href="/favicon.ico" /> perchè creato da volto-site-settings
8
- - Add shrink-to-fit=no in viewport meta
9
- - Remove link for manifest and svg/apple icons
7
+ * original: https://raw.githubusercontent.com/plone/volto/refs/tags/17.20.4/src/helpers/Html/Html.jsx
8
+ *
9
+ * CUSTOMIZATIONS:
10
+ * - Rimossi <link per rle favicon perchè creato da volto-site-settings
11
+ * - Add shrink-to-fit=no in viewport meta
12
+ * - Remove link for manifest and svg/apple icons
13
+ * - Aggiunto og:type website
10
14
  */
11
-
15
+
12
16
  import React, { Component } from 'react';
13
17
  import PropTypes from 'prop-types';
14
18
  import Helmet from '@plone/volto/helpers/Helmet/Helmet';
@@ -97,8 +101,10 @@ class Html extends Component {
97
101
  this.props;
98
102
  const head = Helmet.rewind();
99
103
  const bodyClass = join(BodyClass.rewind(), ' ');
104
+ const htmlAttributes = head.htmlAttributes.toComponent();
105
+
100
106
  return (
101
- <html lang="en">
107
+ <html lang={htmlAttributes.lang}>
102
108
  <head>
103
109
  <meta charSet="utf-8" />
104
110
  {head.base.toComponent()}
@@ -122,13 +128,21 @@ class Html extends Component {
122
128
  })};`,
123
129
  }}
124
130
  />
125
- {/* <link rel="shortcut icon" href="/favicon.ico" /> */}
131
+
132
+ {/*
133
+ * <link rel="icon" href="/favicon.ico" sizes="any" />
134
+ * <link rel="icon" href="/icon.svg" type="image/svg+xml" />
135
+ * <link
136
+ * rel="apple-touch-icon"
137
+ * sizes="180x180"
138
+ * href="/apple-touch-icon.png"
139
+ * />
140
+ * <link rel="manifest" href="/site.webmanifest" />
141
+ */}
142
+
126
143
  <meta property="og:type" content="website" />
127
144
  <meta name="generator" content="Plone 6 - https://plone.org" />
128
- <meta
129
- name="viewport"
130
- content="width=device-width, initial-scale=1, shrink-to-fit=no"
131
- />
145
+ <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
132
146
  <meta name="apple-mobile-web-app-capable" content="yes" />
133
147
  {process.env.NODE_ENV === 'production' && criticalCss && (
134
148
  <style
@@ -143,8 +157,8 @@ class Html extends Component {
143
157
  rel: !criticalCss
144
158
  ? elem.props.rel
145
159
  : elem.props.as === 'style'
146
- ? 'prefetch'
147
- : elem.props.rel,
160
+ ? 'prefetch'
161
+ : elem.props.rel,
148
162
  }),
149
163
  )}
150
164
  {/* Styles in development are loaded with Webpack's style-loader, in production,
@@ -177,7 +191,7 @@ class Html extends Component {
177
191
  <body className={bodyClass}>
178
192
  <div role="navigation" aria-label="Toolbar" id="toolbar" />
179
193
  <div id="main" dangerouslySetInnerHTML={{ __html: markup }} />
180
- <div id="sidebar" />
194
+ <div role="complementary" aria-label="Sidebar" id="sidebar" />
181
195
  <script
182
196
  dangerouslySetInnerHTML={{
183
197
  __html: `window.__data=${serialize(
@@ -0,0 +1,112 @@
1
+ import config from '@plone/volto/registry';
2
+
3
+ /**
4
+ * Get widget by field's `id` attribute
5
+ * @method getWidgetByFieldId
6
+ * @param {string} id Id
7
+ * @returns {string} Widget component.
8
+ */
9
+ const getWidgetByFieldId = (id) => config.widgets.views.id[id] || null;
10
+
11
+ /**
12
+ * Get widget by field's `front end options` attribute
13
+ * @method getWidgetFromTaggedValues
14
+ * @param {object} widgetOptions widgetOptions
15
+ * @returns {string} Widget component.
16
+ */
17
+ const getWidgetFromTaggedValues = (widgetOptions) =>
18
+ typeof widgetOptions?.frontendOptions?.widget === 'string'
19
+ ? config.widgets.views.widget[widgetOptions.frontendOptions.widget]
20
+ : null;
21
+
22
+ /**
23
+ * Get widget by field's `widget` attribute
24
+ * @method getWidgetByName
25
+ * @param {string} widget Widget
26
+ * @returns {string} Widget component.
27
+ */
28
+ const getWidgetByName = (widget) =>
29
+ typeof widget === 'string' ? config.widgets.views.widget[widget] : null;
30
+ /**
31
+ * Get widget by field's `vocabulary` attribute
32
+ * @method getWidgetByVocabulary
33
+ * @param {string} vocabulary Widget
34
+ * @returns {string} Widget component.
35
+ */
36
+ const getWidgetByVocabulary = (vocabulary) =>
37
+ vocabulary && vocabulary['@id']
38
+ ? config.widgets.views.vocabulary[
39
+ vocabulary['@id'].replace(
40
+ `${config.settings.apiPath}/@vocabularies/`,
41
+ '',
42
+ )
43
+ ]
44
+ : null;
45
+
46
+ /**
47
+ * Get widget by field's hints `vocabulary` attribute in widgetOptions
48
+ * @method getWidgetByVocabularyFromHint
49
+ * @param {string} props Widget props
50
+ * @returns {string} Widget component.
51
+ */
52
+ const getWidgetByVocabularyFromHint = (props) =>
53
+ props.widgetOptions && props.widgetOptions.vocabulary
54
+ ? config.widgets.views.vocabulary[
55
+ props.widgetOptions.vocabulary['@id'].replace(
56
+ `${config.settings.apiPath}/@vocabularies/`,
57
+ '',
58
+ )
59
+ ]
60
+ : null;
61
+
62
+ /**
63
+ * Get widget by field's `choices` attribute
64
+ * @method getWidgetByChoices
65
+ * @param {string} choices Widget
66
+ * @returns {string} Widget component.
67
+ */
68
+ const getWidgetByChoices = (props) => {
69
+ if (props.choices) {
70
+ return config.widgets.views.choices;
71
+ }
72
+
73
+ if (props.vocabulary) {
74
+ // If vocabulary exists, then it means it's a choice field in disguise with
75
+ // no widget specified that probably contains a string then we force it
76
+ // to be a select widget instead
77
+ return config.widgets.views.choices;
78
+ }
79
+
80
+ return null;
81
+ };
82
+
83
+ /**
84
+ * Get widget by field's `type` attribute
85
+ * @method getWidgetByType
86
+ * @param {string} type Type
87
+ * @returns {string} Widget component.
88
+ */
89
+ const getWidgetByType = (type) => config.widgets.views.type[type] || null;
90
+
91
+ /**
92
+ * Get default widget
93
+ * @method getWidgetDefault
94
+ * @returns {string} Widget component.
95
+ */
96
+ const getWidgetDefault = () => config.widgets.views.default;
97
+
98
+ /**
99
+ * Get Widget View
100
+ * @method getWidgetView
101
+ * @param {dict} props Props
102
+ * @returns {string} Widget component.
103
+ */
104
+ export const getWidgetView = (props) =>
105
+ getWidgetByFieldId(props.id) ||
106
+ getWidgetFromTaggedValues(props.widgetOptions) ||
107
+ getWidgetByName(props.widget) ||
108
+ getWidgetByChoices(props) ||
109
+ getWidgetByVocabulary(props.vocabulary) ||
110
+ getWidgetByVocabularyFromHint(props) ||
111
+ getWidgetByType(props.type) ||
112
+ getWidgetDefault();
@@ -63,3 +63,4 @@ export {
63
63
  useFallbackImageSrc,
64
64
  contentHasImage,
65
65
  } from 'design-comuni-plone-theme/helpers/images';
66
+ export { getWidgetView } from 'design-comuni-plone-theme/helpers/getWidgetView';
@@ -0,0 +1,80 @@
1
+ import { GET_CT_SCHEMA } from 'design-comuni-plone-theme/actions';
2
+
3
+ const initialState = {
4
+ error: null,
5
+ result: {},
6
+ loaded: false,
7
+ loading: false,
8
+ subrequests: {},
9
+ };
10
+
11
+ export function ctSchema(state = initialState, action = {}) {
12
+ switch (action.type) {
13
+ case `${GET_CT_SCHEMA}_PENDING`:
14
+ return action.subrequest
15
+ ? {
16
+ ...state,
17
+ subrequests: {
18
+ ...state.subrequests,
19
+ [action.subrequest]: {
20
+ ...state.subrequests[action.subrequest],
21
+ result: {},
22
+ error: null,
23
+ loaded: false,
24
+ loading: true,
25
+ },
26
+ },
27
+ }
28
+ : {
29
+ ...state,
30
+ error: null,
31
+ loading: true,
32
+ loaded: false,
33
+ };
34
+ case `${GET_CT_SCHEMA}_SUCCESS`:
35
+ return action.subrequest
36
+ ? {
37
+ ...state,
38
+ subrequests: {
39
+ ...state.subrequests,
40
+ [action.subrequest]: {
41
+ error: null,
42
+ result: action.result,
43
+ loaded: true,
44
+ loading: false,
45
+ },
46
+ },
47
+ }
48
+ : {
49
+ ...state,
50
+ error: null,
51
+ result: action.result,
52
+ loaded: true,
53
+ loading: false,
54
+ };
55
+ case `${GET_CT_SCHEMA}_FAIL`:
56
+ return action.subrequest
57
+ ? {
58
+ ...state,
59
+ subrequests: {
60
+ ...state.subrequests,
61
+ [action.subrequest]: {
62
+ error: action.error,
63
+ result: {},
64
+ loading: false,
65
+ loaded: false,
66
+ },
67
+ },
68
+ }
69
+ : {
70
+ ...state,
71
+ error: action.error,
72
+ result: {},
73
+
74
+ loading: false,
75
+ loaded: false,
76
+ };
77
+ default:
78
+ return state;
79
+ }
80
+ }
@@ -13,6 +13,7 @@ import { modulisticaItems } from './modulisticaItems';
13
13
  import { originalQueryReducer } from './originalQueryReducer';
14
14
  import { searchBandiFiltersReducer } from './searchBandiFiltersReducer';
15
15
  import { breadcrumbs } from './breadcrumbs';
16
+ import { ctSchema } from './ctSchema';
16
17
 
17
18
  /**
18
19
  * Root reducer.
@@ -32,6 +33,7 @@ const reducers = {
32
33
  originalQuery: originalQueryReducer,
33
34
  searchBandiFilters: searchBandiFiltersReducer,
34
35
  breadcrumbs: breadcrumbs,
36
+ ct_schema: ctSchema,
35
37
  };
36
38
 
37
39
  export default reducers;
@@ -17,14 +17,6 @@
17
17
  margin: 18px 0px 0px 18px;
18
18
 
19
19
  background-color: $white;
20
-
21
- .volto-image {
22
- img {
23
- width: 100%;
24
- height: 100%;
25
- object-fit: cover;
26
- }
27
- }
28
20
  }
29
21
 
30
22
  .card.card-bg {
@@ -52,4 +44,9 @@
52
44
  .no-external-if-link > .external-link {
53
45
  display: none;
54
46
  }
47
+
48
+ img.responsive {
49
+ height: 100%;
50
+ object-fit: cover;
51
+ }
55
52
  }
@@ -30,4 +30,22 @@
30
30
  padding-bottom: 15px;
31
31
  border-bottom: 1px solid #455b71;
32
32
  }
33
+
34
+ //* customizzazione: nascondere enhance-link quando è un'immagine
35
+ .card-with-image-template,
36
+ .in-evidence,
37
+ .contentInEvidenceTemplate,
38
+ .list-template {
39
+ .img-responsive-wrapper {
40
+ .enhance-link {
41
+ display: none;
42
+ }
43
+ }
44
+ }
45
+ .small-block-links,
46
+ .contentInEvidenceTemplate {
47
+ .enhance-link {
48
+ display: none;
49
+ }
50
+ }
33
51
  }
@@ -3,6 +3,7 @@
3
3
  position: relative;
4
4
  display: flex;
5
5
  overflow: hidden;
6
+ padding: 0.2rem;
6
7
  height: 100%;
7
8
  align-items: center;
8
9
  justify-content: center;
@@ -0,0 +1,46 @@
1
+ .table-template {
2
+ table.table {
3
+ th {
4
+ vertical-align: top;
5
+ }
6
+ td {
7
+ background-color: #fff;
8
+ }
9
+
10
+ &,
11
+ p,
12
+ ul,
13
+ ul,
14
+ li,
15
+ ol {
16
+ font-size: 0.9rem;
17
+ }
18
+
19
+ .date-column {
20
+ min-width: 6.5rem;
21
+ }
22
+
23
+ ul.relations.widget {
24
+ list-style-type: none;
25
+ padding-left: 0;
26
+ li {
27
+ a {
28
+ .icon {
29
+ display: none;
30
+ }
31
+ }
32
+ }
33
+ }
34
+ }
35
+
36
+ + .pagination-wrapper {
37
+ .mt-5.pagination-wrapper {
38
+ margin-top: 0 !important;
39
+ }
40
+ }
41
+
42
+ .link-button .btn.btn-primary {
43
+ color: color-contrast($primary);
44
+ text-decoration: none;
45
+ }
46
+ }
@@ -90,6 +90,7 @@
90
90
  @import 'ItaliaTheme/Blocks/simpleCardTemplate';
91
91
  @import 'ItaliaTheme/Blocks/search';
92
92
  @import 'ItaliaTheme/Blocks/gridBlock';
93
+ @import 'ItaliaTheme/Blocks/tableTemplate';
93
94
 
94
95
  @import 'ItaliaTheme/Views/uo';
95
96
  @import 'ItaliaTheme/Views/evento';