design-comuni-plone-theme 11.18.2 → 11.19.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.
Binary file
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
 
2
2
 
3
+ ## [11.19.0](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v11.18.3...v11.19.0) (2024-08-01)
4
+
5
+
6
+ ### Features
7
+
8
+ * vista news su ct ComunicatoStampa ([#727](https://github.com/RedTurtle/design-comuni-plone-theme/issues/727)) ([a161c56](https://github.com/RedTurtle/design-comuni-plone-theme/commit/a161c56fd326f03277c50ada59dee6d6166aeba0))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * add clear:both to bottom-metadata and richtext-blocks classes ([#735](https://github.com/RedTurtle/design-comuni-plone-theme/issues/735)) ([e1a9e9a](https://github.com/RedTurtle/design-comuni-plone-theme/commit/e1a9e9a4b0f1e1cdcf424802a74278a9ed827e85))
14
+ * removed bg from template-wrapper inside block search ([#733](https://github.com/RedTurtle/design-comuni-plone-theme/issues/733)) ([965a201](https://github.com/RedTurtle/design-comuni-plone-theme/commit/965a201cc63334eb4820f39de58d8fcdc5c35460))
15
+ * updated logic to show paginator only if pages>1 in Uo and venue ([#734](https://github.com/RedTurtle/design-comuni-plone-theme/issues/734)) ([2ab208d](https://github.com/RedTurtle/design-comuni-plone-theme/commit/2ab208d21aab76332296d2fb21e5dd35a047f3d9))
16
+
17
+
18
+ ### Documentation
19
+
20
+ * updated publiccode ([0d51acd](https://github.com/RedTurtle/design-comuni-plone-theme/commit/0d51acd2a0d7efd10b0e07fe45d26fcc167cf270))
21
+
22
+ ## [11.18.3](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v11.18.2...v11.18.3) (2024-07-26)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * hamburger menu icon color for sites with white header ([f0de756](https://github.com/RedTurtle/design-comuni-plone-theme/commit/f0de756e9431df00e03e7c5d2442cba81553b5fd))
28
+
3
29
  ## [11.18.2](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v11.18.1...v11.18.2) (2024-07-25)
4
30
 
5
31
 
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.18.2",
5
+ "version": "11.19.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: '2024-07-25'
230
+ releaseDate: '2024-08-01'
231
231
  softwareType: standalone/web
232
- softwareVersion: 11.18.2
232
+ softwareVersion: 11.19.0
233
233
  url: 'https://github.com/italia/design-comuni-plone-theme'
234
234
  usedBy:
235
235
  - ASP Comuni Modenesi Area Nord
@@ -16,7 +16,6 @@ const RelatedArticles = ({
16
16
  }) => {
17
17
  const { batches, currentPage, onPaginationChange, pageNumbers } =
18
18
  usePaginatedItemsSection({ data: items });
19
-
20
19
  return (
21
20
  <article
22
21
  id={id}
@@ -41,11 +40,13 @@ const RelatedArticles = ({
41
40
  />
42
41
  ))}
43
42
  </div>
44
- <Pagination
45
- activePage={currentPage}
46
- totalPages={pageNumbers}
47
- onPageChange={onPaginationChange}
48
- />
43
+ {pageNumbers > 1 ? (
44
+ <Pagination
45
+ activePage={currentPage}
46
+ totalPages={pageNumbers}
47
+ onPageChange={onPaginationChange}
48
+ />
49
+ ) : null}
49
50
  </article>
50
51
  );
51
52
  };
@@ -1,7 +1,11 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { defineMessages, useIntl } from 'react-intl';
4
- import { RichTextSection } from 'design-comuni-plone-theme/components/ItaliaTheme/View';
4
+ import {
5
+ RichText,
6
+ RichTextSection,
7
+ richTextHasContent,
8
+ } from 'design-comuni-plone-theme/components/ItaliaTheme/View';
5
9
 
6
10
  const messages = defineMessages({
7
11
  news_item_contenuto: {
@@ -13,20 +17,38 @@ const messages = defineMessages({
13
17
  const NewsItemText = ({ content }) => {
14
18
  const intl = useIntl();
15
19
 
16
- return (
17
- <RichTextSection
18
- data={content.descrizione_estesa}
19
- tag_id={'text-body'}
20
- field="descrizione_estesa"
21
- title={intl.formatMessage(messages.news_item_contenuto)}
22
- show_title={false}
23
- />
24
- );
20
+ // NewsItem ha la descrizione_estesa (testo con blocchi)
21
+ // altri CT (come i Comunicati Stampa) potrebbero avere `text`
22
+ // (richtext senza blocchi).
23
+ //
24
+ // La condizione sul campo descrizione_estesa è volutamente semplificata
25
+ // senza `richTextHasContent` perchè non interessa tanto se il campo
26
+ // ha o non ha contenuto, ma se il campo esiste o non esiste
27
+ return Object.hasOwn(content, 'descrizione_estesa')
28
+ ? richTextHasContent(content.descrizione_estesa) && (
29
+ <RichTextSection
30
+ data={content.descrizione_estesa}
31
+ tag_id={'text-body'}
32
+ field="descrizione_estesa"
33
+ title={intl.formatMessage(messages.news_item_contenuto)}
34
+ show_title={false}
35
+ />
36
+ )
37
+ : content.text && (
38
+ <RichTextSection
39
+ tag_id={'text-body'}
40
+ title={intl.formatMessage(messages.news_item_contenuto)}
41
+ show_title={false}
42
+ >
43
+ <RichText data={content.text} />
44
+ </RichTextSection>
45
+ );
25
46
  };
26
47
 
27
48
  NewsItemText.propTypes = {
28
49
  content: PropTypes.shape({
29
50
  descrizione_estesa: PropTypes.object,
51
+ text: PropTypes.object,
30
52
  }).isRequired,
31
53
  };
32
54
 
@@ -55,13 +55,15 @@ const UOServices = ({ content }) => {
55
55
  </Col>
56
56
  ))}
57
57
  </Row>
58
- <div className="pagination-wrapper">
59
- <Pagination
60
- activePage={currentPage}
61
- totalPages={pageNumbers}
62
- onPageChange={onPaginationChange}
63
- />
64
- </div>
58
+ {pageNumbers > 1 ? (
59
+ <div className="pagination-wrapper">
60
+ <Pagination
61
+ activePage={currentPage}
62
+ totalPages={pageNumbers}
63
+ onPageChange={onPaginationChange}
64
+ />
65
+ </div>
66
+ ) : null}
65
67
  </section>
66
68
  ) : null;
67
69
  };
@@ -44,6 +44,7 @@ defineMessages({
44
44
  const italiaContentTypesViews = {
45
45
  Document: PageView,
46
46
  'News Item': NewsItemView,
47
+ ComunicatoStampa: NewsItemView, // ct opzionale da volto-rer-ufficiostampa
47
48
  UnitaOrganizzativa: UOView,
48
49
  Persona: PersonaView,
49
50
  Venue: VenueView,
@@ -82,7 +82,7 @@ const ListingBody = React.memo(
82
82
  isSearchBlockResults ? '' : 'full-width'
83
83
  }`;
84
84
  } else {
85
- return `py-5 ${bg_color} ${
85
+ return `py-5 ${
86
86
  isSearchBlockResults ? 'template-wrapper' : 'full-width'
87
87
  }`;
88
88
  }
@@ -10,5 +10,6 @@
10
10
  &.bottom-metadata {
11
11
  margin: 1rem 0;
12
12
  font-size: 0.8rem;
13
+ clear: both;
13
14
  }
14
15
  }
@@ -1,4 +1,5 @@
1
1
  .richtext-blocks {
2
+ clear: both;
2
3
  .row-full-width {
3
4
  max-width: 100%;
4
5
  margin: 0 -20px !important;
@@ -55,7 +55,7 @@
55
55
  }
56
56
  @media (max-width: map-get($map: $grid-breakpoints, $key: 'lg') - 1px) {
57
57
  button.custom-navbar-toggler svg.icon {
58
- fill: color-contrast($primary);
58
+ fill: $primary;
59
59
  }
60
60
  }
61
61
  }