design-comuni-plone-theme 8.3.0 → 8.3.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.
@@ -33,15 +33,17 @@ jobs:
33
33
  ADDON_PATH=design-comuni-plone-theme
34
34
  VOLTO_VERSION=17.0.0-alpha.19
35
35
 
36
- - name: Deploy to rancher
37
- uses: redturtle/rancher-deploy-action@v0.2.0
38
- with:
39
- host: ${{ secrets.RANCHER_HOST }}
40
- api-username: ${{ secrets.RANCHER_API_USERNAME }}
41
- api-password: ${{ secrets.RANCHER_API_PASSWORD }}
42
- cluster-id: ${{ secrets.RANCHER_CLUSTER_ID }}
43
- project-id: ${{ secrets.RANCHER_PROJECT_ID }}
44
- namespace: ${{ secrets.RANCHER_NAMESPACE_DEVELOP }}
45
- workload: ${{ secrets.RANCHER_WORKLOAD_DEVELOP }}
46
- image: redturtletech/io-comune-base:develop
47
- slack-hook-url: ${{ secrets.RANCHER_SLACK_HOOK_URL }}
36
+ # deploy disabled. see https://gitlab.com/redturtle/io-comune/io-comune-demo-theme
37
+ #
38
+ # - name: Deploy to rancher
39
+ # uses: redturtle/rancher-deploy-action@v0.2.0
40
+ # with:
41
+ # host: ${{ secrets.RANCHER_HOST }}
42
+ # api-username: ${{ secrets.RANCHER_API_USERNAME }}
43
+ # api-password: ${{ secrets.RANCHER_API_PASSWORD }}
44
+ # cluster-id: ${{ secrets.RANCHER_CLUSTER_ID }}
45
+ # project-id: ${{ secrets.RANCHER_PROJECT_ID }}
46
+ # namespace: ${{ secrets.RANCHER_NAMESPACE_DEVELOP }}
47
+ # workload: ${{ secrets.RANCHER_WORKLOAD_DEVELOP }}
48
+ # image: redturtletech/io-comune-base:develop
49
+ # slack-hook-url: ${{ secrets.RANCHER_SLACK_HOOK_URL }}
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
 
2
2
 
3
+ ## [8.3.1](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v8.3.0...v8.3.1) (2023-08-10)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * card persona images now have fixed size ([#275](https://github.com/RedTurtle/design-comuni-plone-theme/issues/275)) ([cfbdbc8](https://github.com/RedTurtle/design-comuni-plone-theme/commit/cfbdbc8c458036864dd5c6c02fa35e85fc87fc63))
9
+ * event card in listing breaking with invalid dates ([94aa154](https://github.com/RedTurtle/design-comuni-plone-theme/commit/94aa154e02f1a48f2afb9757d43767fea5c1f01a))
10
+ * event dates in cards when recurrence is entirely in the past ([#277](https://github.com/RedTurtle/design-comuni-plone-theme/issues/277)) ([5c45415](https://github.com/RedTurtle/design-comuni-plone-theme/commit/5c4541529e276693a7d145d99dfbd6a291a52796))
11
+ * focus on cookie banner toggles ([#282](https://github.com/RedTurtle/design-comuni-plone-theme/issues/282)) ([ccc3c73](https://github.com/RedTurtle/design-comuni-plone-theme/commit/ccc3c7324263058916cbe053131be6ae1add7ea0))
12
+ * querystring results when block ids are the same on different pages ([#278](https://github.com/RedTurtle/design-comuni-plone-theme/issues/278)) ([71db4d3](https://github.com/RedTurtle/design-comuni-plone-theme/commit/71db4d30b2ac0faa0dbe1e06302ceb20b81f5b1c))
13
+ * restored full-width class to listing block ([#280](https://github.com/RedTurtle/design-comuni-plone-theme/issues/280)) ([d19c08a](https://github.com/RedTurtle/design-comuni-plone-theme/commit/d19c08a29cefe3b4a482e3b2546e71f3c4bf0604))
14
+ * wrong layout for external link indicator icon if objects are Plone Links in anonimous view ([#270](https://github.com/RedTurtle/design-comuni-plone-theme/issues/270)) ([4bbb741](https://github.com/RedTurtle/design-comuni-plone-theme/commit/4bbb74110659144e4f398e54b10b9c66b2c41f7a))
15
+
16
+
17
+ ### Maintenance
18
+
19
+ * deploy to rancher disabled ([d924ef1](https://github.com/RedTurtle/design-comuni-plone-theme/commit/d924ef133380d2e7b890483bf0c519ecf4c07a78))
20
+
21
+
22
+ ### Documentation
23
+
24
+ * updated publiccode ([c8769d2](https://github.com/RedTurtle/design-comuni-plone-theme/commit/c8769d20088300e59b1d0fef70319b4416ef4a97))
25
+
3
26
  ## [8.3.0](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v8.2.1...v8.3.0) (2023-08-04)
4
27
 
5
28
 
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": "8.3.0",
5
+ "version": "8.3.1",
6
6
  "main": "src/index.js",
7
7
  "keywords": [
8
8
  "volto-addon",
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: '2023-08-04'
230
+ releaseDate: '2023-08-10'
231
231
  softwareType: standalone/web
232
- softwareVersion: 8.3.0
232
+ softwareVersion: 8.3.1
233
233
  url: 'https://github.com/italia/design-comuni-plone-theme'
234
234
  usedBy:
235
235
  - ASP Comuni Modenesi Area Nord
@@ -15,6 +15,10 @@ import {
15
15
  ListingLinkMore,
16
16
  ListingImage,
17
17
  } from 'design-comuni-plone-theme/components/ItaliaTheme';
18
+ import { Icon } from 'design-comuni-plone-theme/components/ItaliaTheme';
19
+ import { isInternalURL } from '@plone/volto/helpers/Url/Url';
20
+
21
+ import config from '@plone/volto/registry';
18
22
 
19
23
  const CompleteBlockLinksTemplate = ({
20
24
  items,
@@ -61,6 +65,7 @@ const CompleteBlockLinksTemplate = ({
61
65
  item={!isEditMode ? item : null}
62
66
  href={isEditMode ? '#' : null}
63
67
  data-element={id_lighthouse}
68
+ className={'no-external-if-link'}
64
69
  >
65
70
  <div className="d-flex">
66
71
  {image && <div className="image-container">{image}</div>}
@@ -68,6 +73,19 @@ const CompleteBlockLinksTemplate = ({
68
73
  <CardBody>
69
74
  <CardTitle tag="h3" className="text-secondary">
70
75
  {item.title}
76
+ {item['@type'] === 'Link' &&
77
+ !isInternalURL(
78
+ item.remoteUrl || item.getRemoteUrl,
79
+ ) &&
80
+ config.settings.siteProperties
81
+ .markSpecialLinks && (
82
+ <Icon
83
+ icon="it-external-link"
84
+ title={title}
85
+ size="xs"
86
+ className="align-top ms-1 external-link"
87
+ />
88
+ )}
71
89
  </CardTitle>
72
90
  {show_description && (
73
91
  <CardText tag="p" className="text-secondary">
@@ -166,6 +166,7 @@ const SliderTemplate = ({
166
166
  <UniversalLink
167
167
  item={item}
168
168
  title={intl.formatMessage(messages.viewImage)}
169
+ className={'no-external-if-link'}
169
170
  >
170
171
  <div className="slide-title">
171
172
  {full_width ? (
@@ -34,7 +34,7 @@ export const CardPersona = ({
34
34
  {
35
35
  'card-with-image': hasImage,
36
36
  },
37
- `card-persona card-big-io-comune p-4 card-teaser-image card-flex no-after border border-light rounded`,
37
+ `card-persona card-big-io-comune card-teaser-image card-flex no-after border border-light rounded`,
38
38
  className,
39
39
  )}
40
40
  >
@@ -57,7 +57,7 @@ export const CardPersona = ({
57
57
  <CardText>{item.incarichi || item.description}</CardText>
58
58
  )}
59
59
  </CardBody>
60
- {showImage && (
60
+ {hasImage && (
61
61
  <div className="card-image card-image-rounded">{image}</div>
62
62
  )}
63
63
  </div>
@@ -66,7 +66,7 @@ const ListingBody = React.memo(
66
66
  const isSearchBlockResults = variation?.['@type'] === 'search';
67
67
  const block = isSearchBlockResults ? variation : data;
68
68
 
69
- if (!block?.show_block_bg) return '';
69
+ if (!block?.show_block_bg) return 'full-width';
70
70
 
71
71
  let bg_color = data.bg_color ? `bg-${data.bg_color}` : '';
72
72
 
@@ -5,6 +5,7 @@ CUSTOMIZATIONS:
5
5
  - added additional filters
6
6
  - added additional fields to pass to @querystring-search (config.settings.querystringAdditionalFields)
7
7
  - usedeepCompareEffect and integrate custom logic for searchBlock to make it work with our implementation
8
+ - used [subrequestID] instead [id] of block, as id of subrequest to avoid block unload on duplicate contents with blocks with same id's. Volto's pr: https://github.com/plone/volto/pull/5071
8
9
  */
9
10
  import React, { createRef, useEffect } from 'react';
10
11
  import hoistNonReactStatics from 'hoist-non-react-statics';
@@ -66,6 +67,7 @@ export default function withQuerystringResults(WrappedComponent) {
66
67
  const content = useSelector((state) => state.content.data);
67
68
  const { settings } = config;
68
69
  const querystring = data.querystring || data; // For backwards compat with data saved before Blocks schema
70
+ const subrequestID = content.UID + '-' + id;
69
71
  const { b_size = settings.defaultPageSize } = querystring;
70
72
  const [firstLoading, setFirstLoading] = React.useState(true);
71
73
  // save the path so it won't trigger dispatch on eager router location change
@@ -82,44 +84,49 @@ export default function withQuerystringResults(WrappedComponent) {
82
84
 
83
85
  const originalQuery = useSelector((state) => {
84
86
  if (props?.variation?.['@type'] === 'search') {
85
- return state.originalQuery?.[path]?.[id];
87
+ return state.originalQuery?.[path]?.[subrequestID];
86
88
  }
87
- return state.originalQuery?.[properties['@id']]?.[id]?.toArray?.();
89
+ return state.originalQuery?.[properties['@id']]?.[
90
+ subrequestID
91
+ ]?.toArray?.();
88
92
  });
89
93
  const folderItems = content?.is_folderish ? content.items : [];
90
94
  const hasQuery = querystring?.query?.length > 0;
91
- const hasLoaded = hasQuery ? querystringResults?.[id]?.loaded : true;
95
+ const hasLoaded = hasQuery
96
+ ? querystringResults?.[subrequestID]?.loaded
97
+ : true;
92
98
  const loadingQuery =
93
99
  hasQuery &&
94
- (querystringResults?.[id]?.loading || !querystringResults?.[id]?.loaded);
100
+ (querystringResults?.[subrequestID]?.loading ||
101
+ !querystringResults?.[subrequestID]?.loaded);
95
102
 
96
103
  const listingItems = hasQuery
97
- ? querystringResults?.[id]?.items || []
104
+ ? querystringResults?.[subrequestID]?.items || []
98
105
  : folderItems;
99
106
 
100
107
  const showAsFolderListing = !hasQuery && content?.items_total > b_size;
101
108
  const showAsQueryListing =
102
- hasQuery && querystringResults?.[id]?.total > b_size;
109
+ hasQuery && querystringResults?.[subrequestID]?.total > b_size;
103
110
 
104
111
  const itemsTotal = showAsFolderListing
105
112
  ? content.items_total
106
- : querystringResults?.[id]?.total;
113
+ : querystringResults?.[subrequestID]?.total;
107
114
 
108
115
  const totalPages = showAsFolderListing
109
116
  ? Math.ceil(content.items_total / b_size)
110
117
  : showAsQueryListing
111
- ? Math.ceil(querystringResults[id].total / b_size)
118
+ ? Math.ceil(querystringResults[subrequestID].total / b_size)
112
119
  : 0;
113
120
 
114
121
  const prevBatch = showAsFolderListing
115
122
  ? content.batching?.prev
116
123
  : showAsQueryListing
117
- ? querystringResults[id].batching?.prev
124
+ ? querystringResults[subrequestID].batching?.prev
118
125
  : null;
119
126
  const nextBatch = showAsFolderListing
120
127
  ? content.batching?.next
121
128
  : showAsQueryListing
122
- ? querystringResults[id].batching?.next
129
+ ? querystringResults[subrequestID].batching?.next
123
130
  : null;
124
131
 
125
132
  function handleContentPaginationChange(e, { activePage }) {
@@ -163,7 +170,7 @@ export default function withQuerystringResults(WrappedComponent) {
163
170
  );
164
171
  }
165
172
 
166
- if (firstLoading && querystringResults[id] && !loadingQuery) {
173
+ if (firstLoading && querystringResults[subrequestID] && !loadingQuery) {
167
174
  setFirstLoading(false);
168
175
  }
169
176
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -172,7 +179,8 @@ export default function withQuerystringResults(WrappedComponent) {
172
179
  useDeepCompareEffect(() => {
173
180
  if (
174
181
  (hasQuery &&
175
- (isEditMode || (!isEditMode && !querystringResults[id]?.loaded))) ||
182
+ (isEditMode ||
183
+ (!isEditMode && !querystringResults[subrequestID]?.loaded))) ||
176
184
  (hasQuery && props.variation?.['@type'] === 'search')
177
185
  ) {
178
186
  doSearch(data);
@@ -222,7 +230,7 @@ export default function withQuerystringResults(WrappedComponent) {
222
230
  getQueryStringResults(
223
231
  path,
224
232
  getAdaptedQuery(_querystring, b_size, data.variation),
225
- id,
233
+ subrequestID,
226
234
  page,
227
235
  ),
228
236
  );
@@ -245,7 +253,7 @@ export default function withQuerystringResults(WrappedComponent) {
245
253
  },
246
254
  ],
247
255
  },
248
- id,
256
+ subrequestID,
249
257
  ),
250
258
  );
251
259
  }
@@ -270,7 +278,7 @@ export default function withQuerystringResults(WrappedComponent) {
270
278
  ? handleContentPaginationChange(e, { activePage })
271
279
  : handleQueryPaginationChange(e, { activePage });
272
280
  }}
273
- total={querystringResults?.[id]?.total}
281
+ total={querystringResults?.[subrequestID]?.total}
274
282
  batch_size={b_size}
275
283
  currentPage={currentPage}
276
284
  totalPages={totalPages}
@@ -83,7 +83,6 @@ const UniversalLink = ({
83
83
  (!isExternal && url.includes('@@display-file')) || false;
84
84
 
85
85
  const checkedURL = URLUtils.checkAndNormalizeUrl(url);
86
-
87
86
  url = checkedURL.url;
88
87
  let tag = (
89
88
  <Link
@@ -61,7 +61,7 @@ export const When = ({
61
61
  if (!datesInfo) {
62
62
  // eslint-disable-next-line no-console
63
63
  console.warn('EventWhen: Received invalid start or end date.');
64
- return;
64
+ return null;
65
65
  }
66
66
 
67
67
  const getDate = () => {
@@ -53,8 +53,12 @@ export const getCalendarDate = (item, rrulestr) => {
53
53
  rrulestr,
54
54
  intl,
55
55
  );
56
- realStart = recurrenceDates.recurrenceStart;
57
- realEnd = recurrenceDates.recurrenceEnd;
56
+ // If the recurrence range is entirely in the past,
57
+ // then no future occurrences exist and both
58
+ // recurrenceStart and recurrenceEnd will be null
59
+ // so fallback to displaying the original info
60
+ realStart = recurrenceDates.recurrenceStart || item.start;
61
+ realEnd = recurrenceDates.recurrenceEnd || item.end;
58
62
  }
59
63
  ret = (
60
64
  <When
@@ -170,7 +170,8 @@
170
170
  &:focus {
171
171
  & + label {
172
172
  &:before {
173
- box-shadow: 0 0 3px 3px #ccc;
173
+ box-shadow: 0 0 0 5px black !important;
174
+ outline: #ddd 2px solid !important;
174
175
  }
175
176
  }
176
177
  }
@@ -45,9 +45,15 @@
45
45
  font-size: 1rem !important;
46
46
  font-weight: 700 !important;
47
47
  line-height: 1.44444rem;
48
+ .external-link {
49
+ fill: $external-link-fill-buttons !important;
50
+ }
48
51
  }
49
52
 
50
53
  .card:after {
51
54
  content: none;
52
55
  }
56
+ .no-external-if-link > .external-link {
57
+ display: none;
58
+ }
53
59
  }
@@ -1,52 +1,34 @@
1
- .card-persona.card-teaser-image.card-flex.card {
2
- min-height: 135px;
3
- height: fit-content;
4
-
5
- &.card-with-image {
6
- .card-image-wrapper {
7
- flex: 1;
8
- display: flex;
9
- flex-direction: row;
10
- justify-content: space-between;
11
- align-items: flex-start;
1
+ .card-persona.card-flex {
2
+ .card-image-wrapper {
3
+ flex: 1;
4
+ display: flex;
5
+ align-items: flex-start;
6
+ }
12
7
 
13
- .card-body {
14
- width: calc(100% - 7.2rem);
15
- flex-grow: 0;
16
- }
17
- }
8
+ .card-body {
9
+ // TODO Rimuovere important e mettere p-4 come classe nel jsx
10
+ // nel momento in cui riusciremo a togliere il padding 0 important
11
+ // dalla classe .card-big-io-comune .card-body globalmente
12
+ padding: 24px !important;
18
13
  }
19
14
 
20
- .card-image-wrapper {
21
- .card-image {
22
- position: absolute;
23
- top: 0;
24
- right: 0;
25
- bottom: 0;
26
- overflow: hidden;
27
- height: 100%;
28
- .volto-image {
29
- height: 100%;
30
- display: flex;
31
- align-items: stretch;
15
+ .card-image {
16
+ flex: 0 0 130px;
32
17
 
33
- img {
34
- min-width: 5.27rem;
35
- max-width: 7.2rem;
36
- width: auto;
37
- min-height: 7.5rem;
38
- object-fit: cover;
39
- aspect-ratio: 180/100;
40
- object-position: center;
41
- }
42
- }
43
- }
44
- .card-title {
45
- font-size: $card-big-head-size;
46
- line-height: $card-big-head-l-h;
18
+ img {
19
+ // Dobbiamo vincere contro gli stili del blocco listing
20
+ width: 130px !important;
21
+ height: 130px * 1.4 !important;
22
+ object-fit: cover;
23
+ object-position: center;
47
24
  }
48
25
  }
49
26
 
27
+ .card-title {
28
+ font-size: $card-big-head-size;
29
+ line-height: $card-big-head-l-h;
30
+ }
31
+
50
32
  &.listing-item {
51
33
  .card-body {
52
34
  .category-top {
@@ -69,10 +51,5 @@
69
51
  }
70
52
  }
71
53
  }
72
-
73
- .card-image {
74
- margin-bottom: 0.8em;
75
- height: auto;
76
- }
77
54
  }
78
55
  }
@@ -21,4 +21,7 @@
21
21
  padding: 0;
22
22
  margin: 0;
23
23
  }
24
+ .no-external-if-link > .external-link {
25
+ display: none;
26
+ }
24
27
  }