design-comuni-plone-theme 11.20.3 → 11.21.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,34 @@
1
1
 
2
2
 
3
+ ## [11.21.0](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v11.20.4...v11.21.0) (2024-08-14)
4
+
5
+
6
+ ### Features
7
+
8
+ * contextualvocabularies [#6236](https://github.com/RedTurtle/design-comuni-plone-theme/issues/6236) backport ([#738](https://github.com/RedTurtle/design-comuni-plone-theme/issues/738)) ([29f5c2e](https://github.com/RedTurtle/design-comuni-plone-theme/commit/29f5c2e7f2849dbc5d03fbc31d216a2920564116))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * metadata field in EventSearch ([#744](https://github.com/RedTurtle/design-comuni-plone-theme/issues/744)) ([0b255e6](https://github.com/RedTurtle/design-comuni-plone-theme/commit/0b255e6569573e557622de6afaa6f9d260bb7efe))
14
+
15
+
16
+ ### Documentation
17
+
18
+ * updated publiccode and release log ([1bc0699](https://github.com/RedTurtle/design-comuni-plone-theme/commit/1bc0699fcf0a234929f5b960c1a0305878fe2db4))
19
+
20
+ ## [11.20.4](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v11.20.3...v11.20.4) (2024-08-14)
21
+
22
+
23
+ ### Bug Fixes
24
+
25
+ * changed rrule translation in PageHeaderEventDates ([#743](https://github.com/RedTurtle/design-comuni-plone-theme/issues/743)) ([9a7d59f](https://github.com/RedTurtle/design-comuni-plone-theme/commit/9a7d59f0927f34dbab74c44d09029904e07d5067))
26
+
27
+
28
+ ### Documentation
29
+
30
+ * updated publiccode ([e0c1f3c](https://github.com/RedTurtle/design-comuni-plone-theme/commit/e0c1f3ceaf1134cd0b5eec8352eeab2a2632e154))
31
+
3
32
  ## [11.20.3](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v11.20.2...v11.20.3) (2024-08-14)
4
33
 
5
34
 
package/RELEASE.md CHANGED
@@ -41,6 +41,12 @@
41
41
  - ...
42
42
  -->
43
43
 
44
+ ## Versione 11.21.0 (14/08/2024)
45
+
46
+ ### Fix
47
+
48
+ - Le date delle card nella Ricerca Eventi vengono mostrate correttamente come impostate nell'evento.
49
+
44
50
  ## Versione 11.20.2 (12/08/2024)
45
51
 
46
52
  ### Fix
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.20.3",
5
+ "version": "11.21.0",
6
6
  "main": "src/index.js",
7
7
  "repository": {
8
8
  "type": "git",
package/publiccode.yml CHANGED
@@ -229,7 +229,7 @@ platforms:
229
229
  - web
230
230
  releaseDate: '2024-08-14'
231
231
  softwareType: standalone/web
232
- softwareVersion: 11.20.3
232
+ softwareVersion: 11.21.0
233
233
  url: 'https://github.com/italia/design-comuni-plone-theme'
234
234
  usedBy:
235
235
  - ASP Comuni Modenesi Area Nord
@@ -99,7 +99,7 @@ const Body = ({ data, id, inEditMode, path, onChangeBlock }) => {
99
99
  subsite ? flattenToAppURL(subsite['@id']) : '',
100
100
  {
101
101
  query: query,
102
- metadata: '_all',
102
+ metadata_fields: '_all',
103
103
  b_size: b_size,
104
104
  sort_order: 'ascending',
105
105
  sort_on: 'start',
@@ -34,6 +34,10 @@ const PageHeaderEventDates = ({ content, moment, rrule }) => {
34
34
 
35
35
  if (content['@type'] === 'Event') {
36
36
  if (content.recurrence) {
37
+ const isRecurrenceByDay = content.recurrence.includes('BYDAY=+');
38
+ const isWeekdaySunday = content.recurrence
39
+ .split('BYDAY')[1]
40
+ ?.includes('SU');
37
41
  const rruleSet = rrulestr(content.recurrence, {
38
42
  compatible: true, //If set to True, the parser will operate in RFC-compatible mode. Right now it means that unfold will be turned on, and if a DTSTART is found, it will be considered the first recurrence instance, as documented in the RFC.
39
43
  forceset: true,
@@ -41,6 +45,16 @@ const PageHeaderEventDates = ({ content, moment, rrule }) => {
41
45
  const RRULE_LANGUAGE = rrulei18n(intl, Moment);
42
46
  eventRecurrenceText = rruleSet.rrules()[0]?.toText(
43
47
  (t) => {
48
+ if (Moment.locale(intl.locale) === 'it' && isRecurrenceByDay) {
49
+ RRULE_LANGUAGE.strings.th = '°';
50
+ RRULE_LANGUAGE.strings.nd = '°';
51
+ RRULE_LANGUAGE.strings.rd = '°';
52
+ RRULE_LANGUAGE.strings.st = '°';
53
+
54
+ if (isWeekdaySunday) {
55
+ RRULE_LANGUAGE.strings['on the'] = 'la';
56
+ }
57
+ }
44
58
  return RRULE_LANGUAGE.strings[t];
45
59
  },
46
60
  RRULE_LANGUAGE,
@@ -89,6 +89,7 @@ export default function applyConfig(voltoConfig) {
89
89
  config.experimental.addBlockButton.enabled = true; //per spostare il bottone di aggiunta dei blocchi in basso, e fare in modo che i bottoni di edit dei blocchi siano usabili anche da tablet/mobile
90
90
  config.settings = {
91
91
  ...config.settings,
92
+ contextualVocabularies: config.settings.contextualVocabularies || [],
92
93
  openExternalLinkInNewTab: true,
93
94
  sentryOptions: (libraries) => ({
94
95
  ...voltoSentryOptions(libraries),
@@ -0,0 +1,98 @@
1
+ /**
2
+
3
+ * original from volto 17.18.2
4
+ * backport https://github.com/plone/volto/pull/6236
5
+
6
+ * Vocabularies actions.
7
+ * @module actions/vocabularies/vocabularies
8
+ */
9
+
10
+ import {
11
+ GET_VOCABULARY,
12
+ GET_VOCABULARY_TOKEN_TITLE,
13
+ } from '@plone/volto/constants/ActionTypes';
14
+ import config from '@plone/volto/registry';
15
+ import { flattenToAppURL } from '@plone/volto/helpers';
16
+ import { getVocabName } from '@plone/volto/helpers/Vocabularies/Vocabularies';
17
+ import qs from 'query-string';
18
+
19
+ /**
20
+ * Get vocabulary given a URL (coming from a Schema) or from a vocabulary name.
21
+ * @function getVocabulary
22
+ * @param {string} vocabNameOrURL Full API URL of vocabulary or vocabulary name
23
+ * @param {string} query Only include results containing this string.
24
+ * @param {number} start Start of result batch.
25
+ * @param {number} b_size The size of the batch.
26
+ * @param {string} subrequest Name of the subrequest.
27
+ * @returns {Object} Get vocabulary action.
28
+ */
29
+ export function getVocabulary({
30
+ vocabNameOrURL,
31
+ query = null,
32
+ start = 0,
33
+ size,
34
+ subrequest,
35
+ }) {
36
+ const vocabulary = getVocabName(vocabNameOrURL);
37
+ const contextualVocabularies = config.settings.contextualVocabularies;
38
+ const vocabPath =
39
+ contextualVocabularies && contextualVocabularies.includes(vocabulary)
40
+ ? flattenToAppURL(vocabNameOrURL)
41
+ : `/@vocabularies/${vocabulary}`;
42
+ let queryString = `b_start=${start}${size ? '&b_size=' + size : ''}`;
43
+
44
+ if (query) {
45
+ queryString = `${queryString}&title=${query}`;
46
+ }
47
+ return {
48
+ type: GET_VOCABULARY,
49
+ vocabulary: vocabNameOrURL,
50
+ start,
51
+ request: {
52
+ op: 'get',
53
+ path: `${vocabPath}?${queryString}`,
54
+ },
55
+ subrequest,
56
+ };
57
+ }
58
+
59
+ /**
60
+ * Get the title value given a token from vocabulary given a vocabulary URL
61
+ * (coming from a Schema) or from a vocabulary name.
62
+ * @function getVocabularyTokenTitle
63
+ * @param {string} vocabNameOrURL Full API URL of vocabulary or vocabulary name
64
+ * @param {string} token Only include results containing this string.
65
+ * @returns {Object} Get vocabulary action.
66
+ */
67
+ export function getVocabularyTokenTitle({
68
+ vocabNameOrURL,
69
+ token = null,
70
+ tokens = null,
71
+ subrequest,
72
+ }) {
73
+ // In case we have a URL, we have to get the vocabulary name
74
+ const vocabulary = getVocabName(vocabNameOrURL);
75
+ const contextualVocabularies = config.settings.contextualVocabularies;
76
+ const vocabPath =
77
+ contextualVocabularies && contextualVocabularies.includes(vocabulary)
78
+ ? flattenToAppURL(vocabNameOrURL)
79
+ : `/@vocabularies/${vocabulary}`;
80
+ const queryString = {
81
+ ...(token && { token }),
82
+ ...(tokens && { tokens }),
83
+ };
84
+
85
+ return {
86
+ type: GET_VOCABULARY_TOKEN_TITLE,
87
+ vocabulary: vocabNameOrURL,
88
+ token,
89
+ tokens,
90
+ subrequest,
91
+ request: {
92
+ op: 'get',
93
+ path: `${vocabPath}}?b_size=-1&${qs.stringify(queryString, {
94
+ encode: false,
95
+ })}`,
96
+ },
97
+ };
98
+ }