design-comuni-plone-theme 12.1.2 → 12.1.3

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 (31) hide show
  1. package/.yarn/install-state.gz +0 -0
  2. package/CHANGELOG.md +14 -0
  3. package/RELEASE.md +8 -1
  4. package/package.json +1 -1
  5. package/publiccode.yml +2 -2
  6. package/src/components/ItaliaTheme/Blocks/Listing/AttachmentCardTemplate.jsx +1 -1
  7. package/src/components/ItaliaTheme/Blocks/Listing/BandiInEvidenceTemplate.jsx +3 -3
  8. package/src/components/ItaliaTheme/Blocks/Listing/CardWithImageTemplate.jsx +2 -2
  9. package/src/components/ItaliaTheme/Blocks/Listing/CardWithSlideUpTextTemplate.jsx +4 -3
  10. package/src/components/ItaliaTheme/Blocks/Listing/ContentInEvidenceTemplate.jsx +2 -2
  11. package/src/components/ItaliaTheme/Blocks/Listing/GridGalleryTemplate.jsx +2 -2
  12. package/src/components/ItaliaTheme/Blocks/Listing/InEvidenceTemplate.jsx +2 -2
  13. package/src/components/ItaliaTheme/Blocks/Listing/RibbonCardTemplate.jsx +5 -4
  14. package/src/components/ItaliaTheme/Blocks/Listing/SimpleCard/SimpleCardTemplateDefault.jsx +1 -1
  15. package/src/components/ItaliaTheme/Blocks/Listing/SmallBlockLinksTemplate.jsx +3 -3
  16. package/src/components/ItaliaTheme/Blocks/Listing/TemplatesSkeletons/BandiInEvidenceTemplateSkeleton.jsx +4 -4
  17. package/src/components/ItaliaTheme/Blocks/Listing/TemplatesSkeletons/CardWithImageTemplateSkeleton.jsx +2 -2
  18. package/src/components/ItaliaTheme/Blocks/Listing/TemplatesSkeletons/CardWithSlideUpTextTemplateSkeleton.jsx +3 -3
  19. package/src/components/ItaliaTheme/Blocks/Listing/TemplatesSkeletons/ContentInEvidenceTemplateSkeleton.jsx +2 -2
  20. package/src/components/ItaliaTheme/Blocks/Listing/TemplatesSkeletons/GridGalleryTemplateSkeleton.jsx +2 -2
  21. package/src/components/ItaliaTheme/Blocks/Listing/TemplatesSkeletons/InEvidenceTemplateSkeleton.jsx +2 -2
  22. package/src/components/ItaliaTheme/Blocks/Listing/TemplatesSkeletons/RibbonCardTemplateSkeleton.jsx +2 -2
  23. package/src/components/ItaliaTheme/Blocks/Listing/TemplatesSkeletons/SmallBlockLinksTemplateSkeleton.jsx +1 -1
  24. package/src/components/ItaliaTheme/Blocks/Teaser/ItaliaTeaserBody.jsx +1 -3
  25. package/src/components/ItaliaTheme/View/PaginaArgomentoView/PaginaArgomentoView.jsx +2 -2
  26. package/src/customizations/volto/helpers/FormValidation/FormValidation.js +3 -2
  27. package/src/customizations/volto/helpers/FormValidation/FormValidation.test.js +189 -0
  28. package/src/theme/ItaliaTheme/Blocks/_completeBlockLinkstemplate.scss +0 -6
  29. package/src/theme/ItaliaTheme/Blocks/_contentInEvidenceTemplate.scss +5 -0
  30. package/src/theme/ItaliaTheme/Blocks/_inEvidenceTemplate.scss +0 -4
  31. package/src/theme/ItaliaTheme/Blocks/_smallblockLinkstemplate.scss +0 -6
Binary file
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [12.1.3](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v12.1.2...v12.1.3) (2025-05-20)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * correct the alt and title on the Argomento header image ([#950](https://github.com/RedTurtle/design-comuni-plone-theme/issues/950)) ([e21820c](https://github.com/RedTurtle/design-comuni-plone-theme/commit/e21820cd00937a062ac035ac332731ed0556c441))
9
+ * spacings and alignments of listing blocks ([#945](https://github.com/RedTurtle/design-comuni-plone-theme/issues/945)) ([2cdf137](https://github.com/RedTurtle/design-comuni-plone-theme/commit/2cdf1378d55e096ef141227dcc86191ab69a6456))
10
+ * url validation for path and querystring with @, :, ... ([#952](https://github.com/RedTurtle/design-comuni-plone-theme/issues/952)) ([93a5243](https://github.com/RedTurtle/design-comuni-plone-theme/commit/93a52435f463e1cdb3ca54c1e0c5ca35a184c913))
11
+
12
+
13
+ ### Documentation
14
+
15
+ * updated publiccode and release log ([c3a5545](https://github.com/RedTurtle/design-comuni-plone-theme/commit/c3a554516326b39fd4632275b92e90548db9d209))
16
+
3
17
  ## [12.1.2](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v12.1.1...v12.1.2) (2025-05-07)
4
18
 
5
19
 
package/RELEASE.md CHANGED
@@ -41,13 +41,20 @@
41
41
  - ...
42
42
  -->
43
43
 
44
+ ## Versione 12.1.3 (20/05/2025)
45
+
46
+ ### Fix
47
+
48
+ - Corretta la descrizione per la didascalia per l'immagine di testata dentro al CT Argomento.
49
+ - Uniformato le varie spaziature e allineamenti dei blocchi Elenco.
50
+
44
51
  ## Versione 12.1.2 (07/05/2025)
45
52
 
46
53
  ### Fix
47
54
 
48
55
  - L'altezza delle immagini all'interno del blocco "link solo immagini" è stata aumentata e non ha più un limite massimo. Ora tutte le card avranno la stessa altezza.
49
56
  - Sistemato stile del blocco callout per la versione mobile.
50
- - Sistemati i formati "A pieno schermo" e "Allineamento al centro" del blocco Video, l"immagine in anteprima dava problemi nella visualizzazione di video di Youtube.
57
+ - Sistemati i formati "A pieno schermo" e "Allineamento al centro" del blocco Video, l"immagine in anteprima dava problemi nella visualizzazione di video di YouTube.
51
58
 
52
59
  ## Versione 12.1.1 (14/04/2025)
53
60
 
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": "12.1.2",
5
+ "version": "12.1.3",
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: '2025-05-07'
230
+ releaseDate: '2025-05-20'
231
231
  softwareType: standalone/web
232
- softwareVersion: 12.1.2
232
+ softwareVersion: 12.1.3
233
233
  url: 'https://github.com/italia/design-comuni-plone-theme'
234
234
  usedBy:
235
235
  - ASP Comuni Modenesi Area Nord
@@ -36,7 +36,7 @@ const AttachmentCardTemplate = ({
36
36
  const intl = useIntl();
37
37
 
38
38
  return (
39
- <Container className="px-4">
39
+ <Container className="px-4 pt-3">
40
40
  <div className="simple-card-compact-template">
41
41
  {title && (
42
42
  <h2
@@ -69,7 +69,7 @@ const BandiInEvidenceTemplate = ({
69
69
  const intl = useIntl();
70
70
  return (
71
71
  <div className="bandi-in-evidence">
72
- <Container className="px-4">
72
+ <Container className="px-4 pt-3">
73
73
  {title && (
74
74
  <Row>
75
75
  <Col>
@@ -84,11 +84,11 @@ const BandiInEvidenceTemplate = ({
84
84
  </Col>
85
85
  </Row>
86
86
  )}
87
- <div className="bandi-in-evidence-cards-wrapper mb-5">
87
+ <div className="bandi-in-evidence-cards-wrapper mt-2 mb-4">
88
88
  {items.map((item, index) => {
89
89
  const listingText = <ListingText item={item} />;
90
90
  return (
91
- <Card key={index} className={cx('listing-item card-bg', '')}>
91
+ <Card key={index} className="listing-item card-bg mt-2">
92
92
  <CardBody>
93
93
  <CardTitle tag="h3" className="title">
94
94
  <UniversalLink
@@ -24,8 +24,8 @@ const CardWithImageTemplate = (props) => {
24
24
  } = props;
25
25
 
26
26
  return (
27
- <div className="card-with-image-template">
28
- <Container className="px-4">
27
+ <div className="card-with-image-template my-3">
28
+ <Container className="px-4 pt-3">
29
29
  {title && (
30
30
  <Row>
31
31
  <Col>
@@ -38,6 +38,7 @@ const CardWithSlideUpTextTemplate = (props) => {
38
38
  show_section,
39
39
  show_description = true,
40
40
  hide_dates = false,
41
+ show_block_bg,
41
42
  id_lighthouse,
42
43
  linkmore_id_lighthouse,
43
44
  titleLine,
@@ -46,7 +47,7 @@ const CardWithSlideUpTextTemplate = (props) => {
46
47
 
47
48
  return (
48
49
  <div className="card-slide-text-template">
49
- <Container>
50
+ <Container className="px-4 mt-3">
50
51
  <div className="title">
51
52
  {title && (
52
53
  <h2 className={cx('', { 'title-bottom-line': titleLine })}>
@@ -54,7 +55,7 @@ const CardWithSlideUpTextTemplate = (props) => {
54
55
  </h2>
55
56
  )}
56
57
  </div>
57
- <div className="grid mb-3 mt-5">
58
+ <div className={cx('grid pt-3', { 'mb-3': show_block_bg })}>
58
59
  {items.map((item, index) => {
59
60
  const image = getListingImageBackground(item, 'large');
60
61
  const category = getCategory(item, show_type, show_section, props);
@@ -70,7 +71,7 @@ const CardWithSlideUpTextTemplate = (props) => {
70
71
 
71
72
  return (
72
73
  <div
73
- className="listing-item box bg-img"
74
+ className="listing-item box bg-img mb-2"
74
75
  style={
75
76
  image && {
76
77
  backgroundImage: `url(${image})`,
@@ -53,7 +53,7 @@ const ContentInEvidenceTemplate = (props) => {
53
53
 
54
54
  return (
55
55
  <div className="contentInEvidenceTemplate">
56
- <Container>
56
+ <Container className="px-4 pt-3">
57
57
  {title && (
58
58
  <Row>
59
59
  <Col>
@@ -78,7 +78,7 @@ const ContentInEvidenceTemplate = (props) => {
78
78
  item?.parent?.['@type'] === 'Event' && item?.['@type'] === 'Event';
79
79
 
80
80
  return (
81
- <Row key={item['@id']} className="content-in-evidence">
81
+ <Row key={item['@id']} className="content-in-evidence my-3">
82
82
  {hasImage && (
83
83
  <Col lg={{ size: 6, offset: 1, order: 2 }}>
84
84
  <ListingImage
@@ -37,7 +37,7 @@ const GridGalleryTemplate = ({
37
37
  const intl = useIntl();
38
38
  return (
39
39
  <div className="grid-gallery-template">
40
- <Container className="px-4">
40
+ <Container className="px-4 pt-3">
41
41
  {title && (
42
42
  <Row>
43
43
  <Col>
@@ -53,7 +53,7 @@ const GridGalleryTemplate = ({
53
53
  {intl.formatMessage(messages.maxItemsExceeded)}
54
54
  </Alert>
55
55
  )}
56
- <div className="grid-gallery-grid">
56
+ <div className="grid-gallery-grid my-3 pb-3">
57
57
  {items.map((item, index) => {
58
58
  let image = ListingImage({
59
59
  item,
@@ -61,7 +61,7 @@ const InEvidenceTemplate = (props) => {
61
61
 
62
62
  return (
63
63
  <div className="in-evidence">
64
- <Container className="px-4">
64
+ <Container className="px-4 pt-3">
65
65
  {title && (
66
66
  <Row>
67
67
  <Col>
@@ -76,7 +76,7 @@ const InEvidenceTemplate = (props) => {
76
76
  </Col>
77
77
  </Row>
78
78
  )}
79
- <div className="in-evidence-cards-wrapper mb-5">
79
+ <div className="in-evidence-cards-wrapper my-3 pb-2">
80
80
  {items.map((item, index) => {
81
81
  const icon = show_icon ? getItemIcon(item) : null;
82
82
  const date = hide_dates
@@ -60,6 +60,7 @@ const RibbonCardTemplate = (props) => {
60
60
  show_icon = true,
61
61
  show_description = true,
62
62
  show_type,
63
+ show_block_bg,
63
64
  hide_dates,
64
65
  id_lighthouse,
65
66
  titleLine,
@@ -68,7 +69,7 @@ const RibbonCardTemplate = (props) => {
68
69
  } = props;
69
70
  return (
70
71
  <div className="ribbon-card-template">
71
- <Container className="px-4">
72
+ <Container className="px-4 pt-3">
72
73
  {title && (
73
74
  <Row>
74
75
  <Col>
@@ -79,7 +80,7 @@ const RibbonCardTemplate = (props) => {
79
80
  </Row>
80
81
  )}
81
82
 
82
- <Row className="mb-4">
83
+ <Row className={cx({ 'pb-3': show_block_bg })}>
83
84
  {items.map((item, index) => {
84
85
  const itemTitle = item.title || item.id;
85
86
  const showRibbon =
@@ -106,10 +107,10 @@ const RibbonCardTemplate = (props) => {
106
107
  item.parent?.['@type'] === 'Event' && item?.['@type'] === 'Event';
107
108
 
108
109
  return (
109
- <Col lg={4} sm={12} key={index}>
110
+ <Col lg={4} sm={12} key={index} className="pb-3">
110
111
  <Card
111
112
  className={cx(
112
- `card-bg card-big align-items-top rounded shadow`,
113
+ `card-bg card-big align-items-top rounded shadow mt-3`,
113
114
  { show_detail_link: show_detail_link },
114
115
  )}
115
116
  noWrapper={false}
@@ -113,7 +113,7 @@ const SimpleCardTemplateDefault = (props) => {
113
113
  )}
114
114
 
115
115
  <div
116
- className="card-wrapper card-teaser-wrapper card-teaser-wrapper-equal card-teaser-block-3 mb-3"
116
+ className="card-wrapper card-teaser-wrapper card-teaser-wrapper-equal card-teaser-block-3 my-3"
117
117
  id={resultsUID + '_results'}
118
118
  >
119
119
  {items.map((item, index) => (
@@ -25,7 +25,7 @@ const SmallBlockLinksTemplate = ({
25
25
  }) => {
26
26
  return (
27
27
  <div className="small-block-links">
28
- <Container className="px-4">
28
+ <Container className="px-4 pt-3">
29
29
  {title && (
30
30
  <Row>
31
31
  <Col>
@@ -35,13 +35,13 @@ const SmallBlockLinksTemplate = ({
35
35
  </Col>
36
36
  </Row>
37
37
  )}
38
- <Row className="items">
38
+ <Row className={cx('items', { 'pb-3': show_block_bg })}>
39
39
  {items.map((item, index) => {
40
40
  return (
41
41
  <Col
42
42
  md="3"
43
43
  key={item['@id']}
44
- className="col-item col-sm-4 col-lg-2"
44
+ className="col-item col-sm-4 col-lg-2 my-3"
45
45
  >
46
46
  <div className="center-image-card">
47
47
  <UniversalLink
@@ -21,8 +21,8 @@ const BandiInEvidenceTemplateSkeleton = ({
21
21
  return (
22
22
  <div className={'bandi-in-evidence public-ui'}>
23
23
  <div className="full-width">
24
- <Container className="listing-container">
25
- <div className="skeleton-template ">
24
+ <Container className="px-4 pt-3">
25
+ <div className="skeleton-template">
26
26
  {title && (
27
27
  <Row>
28
28
  <Col>
@@ -33,10 +33,10 @@ const BandiInEvidenceTemplateSkeleton = ({
33
33
  </Row>
34
34
  )}
35
35
 
36
- <div className="bandi-in-evidence-cards-wrapper mb-5">
36
+ <div className="bandi-in-evidence-cards-wrapper mt-2 mb-4">
37
37
  {[0, 1, 2, 3, 4, 5].map((i) => {
38
38
  return (
39
- <Card key={i} className="listing-item card-bg">
39
+ <Card key={i} className="listing-item card-bg mt-2">
40
40
  <CardBody>
41
41
  <CardTitle tag="h4" className="title">
42
42
  -
@@ -25,8 +25,8 @@ const CardWithImageTemplateSkeleton = ({
25
25
  full_width = true,
26
26
  }) => {
27
27
  return (
28
- <div className="card-with-image-template">
29
- <Container className="px-4">
28
+ <div className="card-with-image-template my-3">
29
+ <Container className="px-4 pt-3">
30
30
  <div className="skeleton-template">
31
31
  {title && (
32
32
  <Row>
@@ -20,14 +20,14 @@ const CardWithSlideUpTextTemplateSkeleton = ({
20
20
 
21
21
  return (
22
22
  <div className="card-slide-text-template">
23
- <Container>
23
+ <Container className="px-4 mt-3">
24
24
  <div className="title">{title && <h2>{title}</h2>}</div>
25
- <div className="grid mb-3 mt-5">
25
+ <div className="grid pt-3">
26
26
  {[0, 1, 2].map((i) => {
27
27
  return (
28
28
  <UniversalLink
29
29
  href="#"
30
- className="listing-item box bg-img"
30
+ className="listing-item box bg-img mb-2"
31
31
  key={i}
32
32
  >
33
33
  <div className="bg-gradient"></div>
@@ -22,7 +22,7 @@ const ContentInEvidenceTemplateSkeleton = ({
22
22
  }) => {
23
23
  return (
24
24
  <div className="contentInEvidence">
25
- <Container>
25
+ <Container className="px-4 pt-3">
26
26
  <div className="skeleton-template">
27
27
  {title && (
28
28
  <Row>
@@ -36,7 +36,7 @@ const ContentInEvidenceTemplateSkeleton = ({
36
36
 
37
37
  {[0].map((i) => {
38
38
  return (
39
- <Row key={i}>
39
+ <Row key={i} className="my-3">
40
40
  <Col lg={{ size: 6, offset: 1, order: 2 }}>
41
41
  <div className="img-responsive-wrapper item-image">
42
42
  <div className="img-responsive">
@@ -14,7 +14,7 @@ const GridGalleryTemplateSkeleton = ({
14
14
  }) => {
15
15
  return (
16
16
  <div className="grid-gallery-template">
17
- <Container className="px-4">
17
+ <Container className="px-4 pt-3">
18
18
  <div className="skeleton-template">
19
19
  {title && (
20
20
  <Row>
@@ -24,7 +24,7 @@ const GridGalleryTemplateSkeleton = ({
24
24
  </Row>
25
25
  )}
26
26
 
27
- <div className="grid-gallery-grid">
27
+ <div className="grid-gallery-grid my-3 pb-3">
28
28
  {[0, 1, 2, 3, 4, 5, 6].map((i) => (
29
29
  <div key={i} className={cx('grid-gallery-item', `item-${i % 7}`)}>
30
30
  <UniversalLink href="#">
@@ -22,7 +22,7 @@ const InEvidenceTemplateSkeleton = ({
22
22
  }) => {
23
23
  return (
24
24
  <div className="in-evidence">
25
- <Container className="px-4">
25
+ <Container className="px-4 pt-3">
26
26
  <div className="skeleton-template">
27
27
  {title && (
28
28
  <Row>
@@ -34,7 +34,7 @@ const InEvidenceTemplateSkeleton = ({
34
34
  </Row>
35
35
  )}
36
36
 
37
- <div className="in-evidence-cards-wrapper mb-5">
37
+ <div className="in-evidence-cards-wrapper my-3 pb-2">
38
38
  {[0, 1, 2, 3, 4].map((i) => {
39
39
  return (
40
40
  <Card key={i} className={cx('listing-item card-bg')}>
@@ -28,7 +28,7 @@ const RibbonCardTemplateSkeleton = ({
28
28
  }) => {
29
29
  return (
30
30
  <div className="ribbon-card-template">
31
- <Container className="px-4">
31
+ <Container className="px-4 pt-3">
32
32
  <div className="skeleton-template">
33
33
  {title && (
34
34
  <Row>
@@ -46,7 +46,7 @@ const RibbonCardTemplateSkeleton = ({
46
46
  <Col lg={4} sm={12} key={i}>
47
47
  <Card
48
48
  className={cx(
49
- `card-bg card-big align-items-top rounded shadow`,
49
+ `card-bg card-big align-items-top rounded shadow mt-3`,
50
50
  { show_detail_link: show_detail_link },
51
51
  )}
52
52
  noWrapper={false}
@@ -9,7 +9,7 @@ const SmallBlockLinksTemplateSkeleton = ({
9
9
  }) => {
10
10
  return (
11
11
  <div className="small-block-links">
12
- <Container className="px-4">
12
+ <Container className="px-4 pt-3">
13
13
  <div className="skeleton-template">
14
14
  {title && (
15
15
  <Row>
@@ -139,9 +139,7 @@ const ItaliaTeaserBody = (props) => {
139
139
  {data.title || content.title}
140
140
  </ConditionalLink>
141
141
  </CardTitle>
142
- {!data.hide_description && (
143
- <CardText>{content.description}</CardText>
144
- )}
142
+ <CardText>{content.description||content.Description}</CardText>
145
143
  <BlockExtraTags {...props} item={content} itemIndex={0} />
146
144
  {content.tassonomia_argomenti &&
147
145
  content.tassonomia_argomenti.length > 0 && (
@@ -140,8 +140,8 @@ const PaginaArgomentoView = ({ content }) => {
140
140
  <div>
141
141
  <Image
142
142
  item={content}
143
- alt={content.caption ?? content.title}
144
- title={content.caption ?? content.title}
143
+ alt={content.image_caption ?? content.title}
144
+ title={content.image_caption ?? content.title}
145
145
  key={content.image.download}
146
146
  responsive={true}
147
147
  sizes="100vw"
@@ -107,8 +107,9 @@ const widgetValidation = {
107
107
  'localhost' + // OR localhost
108
108
  ')' +
109
109
  '(\\:\\d+)?' + // optional port
110
- '(\\/[-a-z\\d%_.~+]*)*' + // path
111
- '(\\?[;&a-z\\d%_.~+\\/=-]*)?' + // validate query string
110
+ '(\\/[-a-z\\d%_.~+@]*)*' + // path
111
+ // '(\\?[;&a-z\\d%_.~+\\/=-]*)?' + // validate query string
112
+ '(\\?.*)?' + // validate query string (relaxed)
112
113
  '(\\#[-a-z\\d\\/_]*)?$', // validate fragment locator
113
114
  'i',
114
115
  );
@@ -0,0 +1,189 @@
1
+ import FormValidation from './FormValidation';
2
+ import { messages } from '@plone/volto/helpers/MessageLabels/MessageLabels';
3
+
4
+ const schema = {
5
+ properties: {
6
+ username: { title: 'Username', type: 'string', description: '' },
7
+ email: { title: 'Email', type: 'string', widget: 'email', description: '' },
8
+ url: { title: 'url', type: 'string', widget: 'url', description: '' },
9
+ },
10
+ fieldsets: [
11
+ { id: 'default', title: 'FIXME: User Data', fields: ['username'] },
12
+ { id: 'second', title: 'Second: User Data', fields: ['email'] },
13
+ ],
14
+ required: ['username'],
15
+ };
16
+ const errors = { email: ['The specified email is not valid.'] };
17
+ const formData = { username: 'test username', email: 'test' };
18
+ const formatMessage = (messageObj) => {
19
+ return messageObj?.defaultMessage;
20
+ };
21
+ const errorJSON =
22
+ "[{'message': 'The specified email is not valid.', 'field': 'email', 'error': 'ValidationError'}]";
23
+
24
+ describe('FormValidation', () => {
25
+ describe('showFirstTabWithErrors', () => {
26
+ it('does not break without arguments', () => {
27
+ expect(FormValidation.showFirstTabWithErrors()).toEqual(0);
28
+ });
29
+ it('shows the correct tab index', () => {
30
+ expect(
31
+ FormValidation.showFirstTabWithErrors({
32
+ errors,
33
+ schema,
34
+ }),
35
+ ).toEqual(1);
36
+ });
37
+ });
38
+
39
+ describe('giveServerErrorsToCorrespondingFields', () => {
40
+ it('does not break without arguments', () => {
41
+ expect(FormValidation.giveServerErrorsToCorrespondingFields()).toEqual(
42
+ {},
43
+ );
44
+ });
45
+ it('fix JSON and show correct error', () => {
46
+ expect(
47
+ FormValidation.giveServerErrorsToCorrespondingFields(errorJSON),
48
+ ).toEqual({ email: ['The specified email is not valid.'] });
49
+ });
50
+ });
51
+
52
+ describe('validateFieldsPerFieldset', () => {
53
+ it('does not break without arguments', () => {
54
+ expect(FormValidation.validateFieldsPerFieldset()).toEqual({});
55
+ });
56
+
57
+ it('validates missing required', () => {
58
+ expect(
59
+ FormValidation.validateFieldsPerFieldset({
60
+ schema,
61
+ formData: {},
62
+ formatMessage,
63
+ }),
64
+ ).toEqual({
65
+ username: [messages.required.defaultMessage],
66
+ });
67
+ });
68
+
69
+ it('do not treat 0 as missing required value', () => {
70
+ let newSchema = {
71
+ ...schema,
72
+ properties: {
73
+ ...schema.properties,
74
+ age: {
75
+ title: 'age',
76
+ type: 'integer',
77
+ widget: 'number',
78
+ description: '',
79
+ },
80
+ },
81
+ required: ['age'],
82
+ };
83
+ expect(
84
+ FormValidation.validateFieldsPerFieldset({
85
+ schema: newSchema,
86
+ formData: { username: 'test username', age: null },
87
+ formatMessage,
88
+ }),
89
+ ).toEqual({
90
+ age: [messages.required.defaultMessage],
91
+ });
92
+ expect(
93
+ FormValidation.validateFieldsPerFieldset({
94
+ schema: newSchema,
95
+ formData: { username: 'test username', age: 0 },
96
+ formatMessage,
97
+ }),
98
+ ).toEqual({});
99
+ });
100
+
101
+ it('validates incorrect email', () => {
102
+ expect(
103
+ FormValidation.validateFieldsPerFieldset({
104
+ schema,
105
+ formData,
106
+ formatMessage,
107
+ }),
108
+ ).toEqual({
109
+ email: [messages.isValidEmail.defaultMessage],
110
+ });
111
+ });
112
+
113
+ it('validates correct email', () => {
114
+ formData.email = 'test@domain.name';
115
+ expect(
116
+ FormValidation.validateFieldsPerFieldset({
117
+ schema,
118
+ formData,
119
+ formatMessage,
120
+ }),
121
+ ).toEqual({});
122
+ });
123
+ it('validates incorrect url', () => {
124
+ formData.url = 'foo';
125
+ expect(
126
+ FormValidation.validateFieldsPerFieldset({
127
+ schema,
128
+ formData,
129
+ formatMessage,
130
+ }),
131
+ ).toEqual({ url: [messages.isValidURL.defaultMessage] });
132
+ });
133
+ it('validates url', () => {
134
+ formData.url = 'https://plone.org/';
135
+ expect(
136
+ FormValidation.validateFieldsPerFieldset({
137
+ schema,
138
+ formData,
139
+ formatMessage,
140
+ }),
141
+ ).toEqual({});
142
+ });
143
+ it('validates url with ip', () => {
144
+ formData.url = 'http://127.0.0.1:8080/Plone';
145
+ expect(
146
+ FormValidation.validateFieldsPerFieldset({
147
+ schema,
148
+ formData,
149
+ formatMessage,
150
+ }),
151
+ ).toEqual({});
152
+ });
153
+ it('validates url with localhost', () => {
154
+ formData.url = 'http://localhost:8080/Plone';
155
+ expect(
156
+ FormValidation.validateFieldsPerFieldset({
157
+ schema,
158
+ formData,
159
+ formatMessage,
160
+ }),
161
+ ).toEqual({});
162
+ });
163
+
164
+ // RedTurtle
165
+ it('validates url with @ in path', () => {
166
+ formData.url = 'https://plone.org/@@foo';
167
+ expect(
168
+ FormValidation.validateFieldsPerFieldset({
169
+ schema,
170
+ formData,
171
+ formatMessage,
172
+ }),
173
+ ).toEqual({});
174
+ });
175
+
176
+ // RedTurtle
177
+ it('validates url with @, :, /, ... in query', () => {
178
+ formData.url = 'https://plone.org/foo?remote=http://plone.org/@@foo&baz=2';
179
+ expect(
180
+ FormValidation.validateFieldsPerFieldset({
181
+ schema,
182
+ formData,
183
+ formatMessage,
184
+ }),
185
+ ).toEqual({});
186
+ });
187
+
188
+ });
189
+ });
@@ -1,14 +1,8 @@
1
1
  .complete-block-links-template {
2
- margin: 40px 0;
3
-
4
2
  a {
5
3
  text-decoration: none;
6
4
  }
7
5
 
8
- .col-item {
9
- margin-bottom: 22px;
10
- }
11
-
12
6
  .image-container {
13
7
  display: flex;
14
8
  overflow: hidden;
@@ -42,6 +42,11 @@
42
42
  }
43
43
  }
44
44
 
45
+ .public-ui > :not(.bg-light) .content-in-evidence:nth-of-type(2n) {
46
+ margin-right: 0;
47
+ margin-left: 0;
48
+ }
49
+
45
50
  @media (min-width: #{map-get($grid-breakpoints, lg)}) {
46
51
  .content-in-evidence:nth-of-type(2n) {
47
52
  .order-lg-2 {
@@ -1,8 +1,4 @@
1
1
  .block.listing .in-evidence {
2
- .col-item {
3
- margin-bottom: 22px;
4
- }
5
-
6
2
  .icon {
7
3
  width: 32px;
8
4
  height: 32px;
@@ -1,10 +1,4 @@
1
1
  .small-block-links {
2
- margin: 40px 0;
3
-
4
- .col-item {
5
- margin-bottom: 22px;
6
- }
7
-
8
2
  .center-image-card {
9
3
  position: relative;
10
4
  display: flex;