io-sanita-theme 2.12.0 → 2.12.2

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.12.2](https://github.com/RedTurtle/io-sanita-theme/compare/2.12.1...2.12.2) (2025-04-18)
4
+
5
+ ### Bug Fixes
6
+
7
+ * Multilingual aggregation page url ([#82](https://github.com/RedTurtle/io-sanita-theme/issues/82)) ([a16e9e9](https://github.com/RedTurtle/io-sanita-theme/commit/a16e9e9b5f4bb3e1026eb53ef58e94e4ab5f5808))
8
+
9
+ ## [2.12.1](https://github.com/RedTurtle/io-sanita-theme/compare/2.12.0...2.12.1) (2025-04-17)
10
+
11
+ ### Bug Fixes
12
+
13
+ * fixed video block view and layout ([#81](https://github.com/RedTurtle/io-sanita-theme/issues/81)) ([70cf688](https://github.com/RedTurtle/io-sanita-theme/commit/70cf688645320a172b766e37383df52ae9ed4546))
14
+ * root aggregation page - redirect to home ([50d9c52](https://github.com/RedTurtle/io-sanita-theme/commit/50d9c52f5b7fcc4249a8067af19f2dbb8e143de7))
15
+
3
16
  ## [2.12.0](https://github.com/RedTurtle/io-sanita-theme/compare/2.11.2...2.12.0) (2025-04-14)
4
17
 
5
18
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "io-sanita-theme",
3
- "version": "2.12.0",
3
+ "version": "2.12.2",
4
4
  "description": "io-sanita-theme: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "license": "MIT",
@@ -8,11 +8,7 @@ import React from 'react';
8
8
  import { Card, CardBody, CardTitle, CardText, Badge } from 'design-react-kit';
9
9
  import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink';
10
10
  import { Icon } from 'io-sanita-theme/components';
11
-
12
- import {
13
- AGGREGATION_PAGE_ARGOMENTO,
14
- AGGREGATION_PAGE_TIPOLOGIA_UTENTE,
15
- } from 'io-sanita-theme/config/ioSanitaConfig';
11
+ import { getAggregationPageUrl } from 'io-sanita-theme/helpers/aggregation';
16
12
 
17
13
  import './cardTaxonomy.scss';
18
14
 
@@ -27,10 +23,7 @@ export const CardTaxonomy = ({
27
23
  type = 'topics', //topics,users
28
24
  }) => {
29
25
  const title = item.title ?? item.label;
30
- const href =
31
- (type === 'topics'
32
- ? AGGREGATION_PAGE_ARGOMENTO
33
- : AGGREGATION_PAGE_TIPOLOGIA_UTENTE) + item.value;
26
+ const href = getAggregationPageUrl(type, item.value);
34
27
 
35
28
  return (
36
29
  <Card
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import cx from 'classnames';
3
3
  import { useIntl, defineMessages } from 'react-intl';
4
4
  import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink';
5
- import { AGGREGATION_PAGE_ARGOMENTO } from 'io-sanita-theme/config/ioSanitaConfig';
5
+ import { getAggregationPageUrl } from 'io-sanita-theme/helpers/aggregation';
6
6
 
7
7
  const messages = defineMessages({
8
8
  uo: { id: 'CardCategoryBottom_UO', defaultMessage: 'Unità operativa' },
@@ -53,7 +53,7 @@ const CardCategoryBottom = ({
53
53
  href={
54
54
  isEditMode
55
55
  ? '#'
56
- : AGGREGATION_PAGE_ARGOMENTO + display_category.token
56
+ : getAggregationPageUrl('topics', display_category.token)
57
57
  }
58
58
  >
59
59
  <span className="text">{display_category.title}</span>
@@ -6,6 +6,7 @@
6
6
  import React, { useState, useEffect } from 'react';
7
7
  import { defineMessages, useIntl } from 'react-intl';
8
8
  import { useDispatch, useSelector } from 'react-redux';
9
+ import { Redirect } from 'react-router-dom';
9
10
  import { Spinner } from 'design-react-kit';
10
11
  import Helmet from '@plone/volto/helpers/Helmet/Helmet';
11
12
  import { resetContent } from '@plone/volto/actions/content/content';
@@ -57,6 +58,9 @@ const AggregationPage = ({ match, route, location }) => {
57
58
  const id = match?.params?.id ?? '';
58
59
  const type = route?.type;
59
60
 
61
+ if (id?.length === 0) {
62
+ return <Redirect to="/" />;
63
+ }
60
64
  //search
61
65
  const b_size = config.settings.defaultPageSize; //batchsize
62
66
  const [searchParams, setSearchParams] = useState({
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink';
3
- import { AGGREGATION_PAGE_ARGOMENTO } from 'io-sanita-theme/config/ioSanitaConfig';
3
+ import { getAggregationPageUrl } from 'io-sanita-theme/helpers/aggregation';
4
4
  import { Chip, ChipLabel } from 'design-react-kit';
5
5
 
6
6
  const ParliamoDiWidgetView = ({ value, children, className }) => {
@@ -8,7 +8,7 @@ const ParliamoDiWidgetView = ({ value, children, className }) => {
8
8
  <div className="topics-view-widget">
9
9
  {value.map((item, i) => (
10
10
  <UniversalLink
11
- href={AGGREGATION_PAGE_ARGOMENTO + item.token}
11
+ href={getAggregationPageUrl('topics', item.token)}
12
12
  key={item.token}
13
13
  className="text-decoration-none me-2 d-inline-block"
14
14
  >
@@ -2,10 +2,9 @@ import React from 'react';
2
2
  import { defineMessages, useIntl } from 'react-intl';
3
3
  import PropTypes from 'prop-types';
4
4
  import { Chip, ChipLabel } from 'design-react-kit';
5
-
5
+ import { getAggregationPageUrl } from 'io-sanita-theme/helpers/aggregation';
6
6
  import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink';
7
7
  import { Icon } from 'io-sanita-theme/components';
8
- import { AGGREGATION_PAGE_TIPOLOGIA_UTENTE } from 'io-sanita-theme/config/ioSanitaConfig';
9
8
 
10
9
  /**
11
10
  * TassonomiaUtenti view component class.
@@ -27,7 +26,10 @@ const TassonomiaUtenti = ({ content }) => {
27
26
 
28
27
  return (
29
28
  <UniversalLink
30
- href={AGGREGATION_PAGE_TIPOLOGIA_UTENTE + item.token}
29
+ href={getAggregationPageUrl(
30
+ 'a_chi_si_rivolge_tassonomia',
31
+ item.token,
32
+ )}
31
33
  key={item.token}
32
34
  className="text-decoration-none me-2 d-inline-block"
33
35
  //data-element="service-topic"
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
4
4
  import { Chip, ChipLabel } from 'design-react-kit';
5
5
 
6
6
  import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink';
7
- import { AGGREGATION_PAGE_ARGOMENTO } from 'io-sanita-theme/config/ioSanitaConfig';
7
+ import { getAggregationPageUrl } from 'io-sanita-theme/helpers/aggregation';
8
8
 
9
9
  /**
10
10
  * Topics view component class.
@@ -34,7 +34,7 @@ const Topics = ({ content, titleTag = 'h3' }) => {
34
34
  </Tag>
35
35
  {list.map((item, i) => (
36
36
  <UniversalLink
37
- href={AGGREGATION_PAGE_ARGOMENTO + item.token}
37
+ href={getAggregationPageUrl('topics', item.token)}
38
38
  key={item.token}
39
39
  className="text-decoration-none me-2 d-inline-block"
40
40
  data-element="service-topic"
@@ -54,8 +54,8 @@ import { component } from 'design-react-kit/dist/types/Icon/assets/ItAndroidSqua
54
54
  export const AGGREGATION_PAGE_ARGOMENTO = '/argomento/';
55
55
  export const AGGREGATION_PAGE_TIPOLOGIA_UTENTE = '/tipologia-utente/';
56
56
 
57
- const ReleaseLog = loadable(
58
- () => import('io-sanita-theme/components/ReleaseLog/ReleaseLog'),
57
+ const ReleaseLog = loadable(() =>
58
+ import('io-sanita-theme/components/ReleaseLog/ReleaseLog'),
59
59
  );
60
60
 
61
61
  const messages = defineMessages({
@@ -250,11 +250,11 @@ export default function applyConfig(config) {
250
250
  ...(config.settings['volto-feedback']
251
251
  ?.feedbackEnabledNonContentRoutes ?? []),
252
252
  {
253
- path: AGGREGATION_PAGE_TIPOLOGIA_UTENTE,
253
+ path: '/*' + AGGREGATION_PAGE_TIPOLOGIA_UTENTE,
254
254
  feedbackTitle: null /*usa il path per sapere quale tipologia è*/,
255
255
  },
256
256
  {
257
- path: AGGREGATION_PAGE_ARGOMENTO,
257
+ path: '/*' + AGGREGATION_PAGE_ARGOMENTO,
258
258
  feedbackTitle: null /*usa il path per sapere quale tipologia è*/,
259
259
  },
260
260
  ],
@@ -338,13 +338,19 @@ export default function applyConfig(config) {
338
338
  component: ReleaseLog,
339
339
  },
340
340
  {
341
- path: [AGGREGATION_PAGE_ARGOMENTO + ':id'],
341
+ path: [
342
+ '*' + AGGREGATION_PAGE_ARGOMENTO + ':id',
343
+ '*' + AGGREGATION_PAGE_ARGOMENTO.replace(/\/+$/, ''),
344
+ ],
342
345
  component: AggregationPage,
343
346
  type: 'parliamo_di',
344
347
  breadcrumbs_title: ':id',
345
348
  },
346
349
  {
347
- path: [AGGREGATION_PAGE_TIPOLOGIA_UTENTE + ':id'],
350
+ path: [
351
+ '*' + AGGREGATION_PAGE_TIPOLOGIA_UTENTE + ':id',
352
+ '*' + AGGREGATION_PAGE_TIPOLOGIA_UTENTE.replace(/\/+$/, ''),
353
+ ],
348
354
  component: AggregationPage,
349
355
  type: 'a_chi_si_rivolge_tassonomia',
350
356
  breadcrumbs_title: ':id',
@@ -0,0 +1,17 @@
1
+ import {
2
+ AGGREGATION_PAGE_ARGOMENTO,
3
+ AGGREGATION_PAGE_TIPOLOGIA_UTENTE,
4
+ } from 'io-sanita-theme/config/ioSanitaConfig';
5
+ import { useHomePath } from 'io-sanita-theme/helpers';
6
+
7
+ export const getAggregationPageUrl = (type, value) => {
8
+ const homepath = useHomePath();
9
+ let href =
10
+ homepath +
11
+ (type === 'topics'
12
+ ? AGGREGATION_PAGE_ARGOMENTO
13
+ : AGGREGATION_PAGE_TIPOLOGIA_UTENTE) +
14
+ value;
15
+ href = href.replaceAll('//', '/');
16
+ return href;
17
+ };
@@ -1,48 +1,91 @@
1
1
  .block.video {
2
- .ui.embed {
3
- position: relative;
4
- aspect-ratio: 16 / 9;
2
+ .video-inner {
3
+ > div {
4
+ position: relative;
5
+ overflow: hidden;
6
+ max-width: 100%;
7
+ height: 0;
8
+ padding-bottom: 56.25%;
9
+
10
+ .icon-play {
11
+ position: absolute;
12
+ z-index: 2;
13
+ top: 50%;
14
+ left: 50%;
15
+ width: 4rem;
16
+ height: 2.6rem;
17
+ border-radius: 15px;
18
+ background-color: rgba(0, 0, 0, 0.7);
19
+ color: $white;
20
+ cursor: pointer;
21
+ line-height: 2.6rem;
22
+ text-align: center;
23
+ transform: translateX(-50%) translateY(-50%);
24
+ }
25
+ }
26
+
27
+ .ui.embed.active {
28
+ .icon-play,
29
+ img.placeholder {
30
+ display: none;
31
+ }
32
+ }
5
33
 
6
34
  img.placeholder {
7
35
  position: absolute;
8
36
  top: 50%;
9
37
  left: 0;
10
38
  width: 100%;
39
+ min-width: 100%;
40
+ height: unset;
41
+ min-height: 100%;
42
+ object-fit: cover;
11
43
  transform: translateY(-50%);
12
- aspect-ratio: 16 / 9;
13
44
  }
45
+ }
14
46
 
15
- .icon-play {
16
- position: absolute;
17
- z-index: 2;
18
- top: 50%;
19
- left: 50%;
20
- width: 4rem;
21
- height: 2.6rem;
22
- border-radius: 15px;
23
- background-color: rgba(0, 0, 0, 0.7);
24
- color: $white;
47
+ .ui.embed {
48
+ position: relative;
49
+
50
+ img.placeholder {
25
51
  cursor: pointer;
26
- line-height: 2.6rem;
27
- text-align: center;
28
- transform: translateX(-50%) translateY(-50%);
52
+ }
53
+ }
29
54
 
30
- svg {
31
- width: 1.2rem;
32
- height: 1.2rem;
33
- }
55
+ &.align.center iframe,
56
+ &.full .video-inner.full-width iframe {
57
+ position: absolute;
58
+ top: 0;
59
+ left: 0;
60
+ width: 100%;
61
+ height: 100%;
62
+ padding: 0;
63
+ border: none;
64
+ margin: 0;
65
+ }
34
66
 
35
- &:hover,
36
- &:active,
37
- &:focus {
38
- background-color: $primary;
39
- color: $primary-text;
40
- }
67
+ &.full {
68
+ .video-inner.full-width > div {
69
+ height: 480px;
70
+ position: relative;
71
+ padding-bottom: 0;
41
72
  }
73
+ }
42
74
 
43
- &.active {
44
- .icon-play {
45
- display: none;
75
+ @media (max-width: #{map-get($grid-breakpoints, md)}) {
76
+ &.align.right,
77
+ &.align.left {
78
+ .video-inner {
79
+ width: 100%;
80
+ margin-right: 0 !important;
81
+ margin-left: 0 !important;
82
+ float: unset;
83
+ }
84
+
85
+ img {
86
+ margin-right: 0 !important;
87
+ margin-left: 0 !important;
88
+ float: unset;
46
89
  }
47
90
  }
48
91
  }