design-comuni-plone-theme 11.33.1 → 11.34.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.
Files changed (52) hide show
  1. package/.yarn/cache/@tanstack-react-table-npm-8.21.2-f809795b71-3cda97794c.zip +0 -0
  2. package/.yarn/cache/@tanstack-table-core-npm-8.21.2-0f1fa83089-21573388b2.zip +0 -0
  3. package/.yarn/cache/{tar-fs-npm-2.1.3-32d6d6fb31-8dd66c2077.zip → tar-fs-npm-2.1.4-90a454735f-a9e18e2e61.zip} +0 -0
  4. package/.yarn/cache/volto-blocks-widget-npm-3.4.7-1bc2eeb4b5-4350a9c54b.zip +0 -0
  5. package/.yarn/cache/{volto-form-block-npm-3.12.0-0e050cb6bf-878c6f6af8.zip → volto-form-block-npm-3.13.0-f978a02e9c-0ce41843f5.zip} +0 -0
  6. package/.yarn/install-state.gz +0 -0
  7. package/CHANGELOG.md +38 -0
  8. package/RELEASE.md +26 -0
  9. package/locales/de/LC_MESSAGES/volto.po +82 -2
  10. package/locales/en/LC_MESSAGES/volto.po +84 -4
  11. package/locales/es/LC_MESSAGES/volto.po +82 -2
  12. package/locales/fr/LC_MESSAGES/volto.po +82 -2
  13. package/locales/it/LC_MESSAGES/volto.po +84 -4
  14. package/locales/volto.pot +83 -3
  15. package/package.json +3 -3
  16. package/publiccode.yml +2 -2
  17. package/src/actions/contacts.js +13 -0
  18. package/src/actions/index.js +3 -0
  19. package/src/components/ItaliaTheme/Blocks/Common/SearchFilters/DateFilter.jsx +50 -44
  20. package/src/components/ItaliaTheme/Blocks/Common/SearchFilters/SelectFilter.jsx +3 -2
  21. package/src/components/ItaliaTheme/Blocks/Common/SearchFilters/TextFilter.jsx +44 -16
  22. package/src/components/ItaliaTheme/Blocks/Listing/BandiInEvidenceTemplate.jsx +2 -0
  23. package/src/components/ItaliaTheme/Blocks/Listing/CardWithSlideUpTextTemplate.jsx +4 -1
  24. package/src/components/ItaliaTheme/Blocks/Listing/RibbonCardTemplate.jsx +1 -0
  25. package/src/components/ItaliaTheme/Blocks/Listing/SimpleCard/Card/SimpleCardDefault.jsx +1 -0
  26. package/src/components/ItaliaTheme/Blocks/Listing/TemplatesSkeletons/BandiInEvidenceTemplateSkeleton.jsx +2 -0
  27. package/src/components/ItaliaTheme/ContactsBlock/ContactsBlock.jsx +77 -0
  28. package/src/components/ItaliaTheme/View/Commons/PageHeader/PageHeaderTassonomiaArgomenti.jsx +2 -2
  29. package/src/components/ItaliaTheme/index.js +4 -0
  30. package/src/components/ItaliaTheme/manage/Widgets/ConditionallyRequiredDateWidget.jsx +25 -0
  31. package/src/components/ItaliaTheme/manage/Widgets/ContactsWidget/ContactsConfigForm.jsx +90 -0
  32. package/src/components/ItaliaTheme/manage/Widgets/ContactsWidget/ContactsConfigWidget.jsx +394 -0
  33. package/src/components/SelectInput/SelectInput.jsx +7 -2
  34. package/src/config/Widgets/widgets.js +11 -0
  35. package/src/config/italiaConfig.js +3 -1
  36. package/src/customizations/volto/components/manage/Widgets/FileWidget.jsx +1 -1
  37. package/src/customizations/volto/components/theme/Footer/Footer.jsx +8 -1
  38. package/src/customizations/volto-form-block/components/Edit.jsx +100 -49
  39. package/src/customizations/volto-form-block/components/Field.jsx +71 -62
  40. package/src/customizations/volto-form-block/components/FormResult.jsx +25 -18
  41. package/src/customizations/volto-form-block/components/FormView.jsx +192 -194
  42. package/src/customizations/volto-form-block/components/Sidebar.jsx +7 -172
  43. package/src/customizations/volto-form-block/components/View.jsx +9 -5
  44. package/src/overrideTranslations.jsx +7 -2
  45. package/src/reducers/contacts.js +38 -0
  46. package/src/reducers/index.js +2 -0
  47. package/src/theme/ItaliaTheme/Blocks/_form.scss +20 -1
  48. package/src/theme/ItaliaTheme/Blocks/common/_searchBlockFilters.scss +56 -0
  49. package/src/theme/ItaliaTheme/Components/_contactsBlock.scss +40 -0
  50. package/src/theme/ItaliaTheme/Widgets/_contactsConfigWidget.scss +39 -0
  51. package/src/theme/site.scss +2 -0
  52. package/.yarn/cache/volto-blocks-widget-npm-3.4.1-c4d451e2c2-4f5c183698.zip +0 -0
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { useIntl, defineMessages } from 'react-intl';
3
+ import { Input } from 'design-react-kit';
3
4
 
4
5
  const messages = defineMessages({
5
6
  text_filter_placeholder: {
@@ -8,26 +9,53 @@ const messages = defineMessages({
8
9
  },
9
10
  });
10
11
 
11
- const TextFilter = ({ value, id, onChange, placeholder, blockID }) => {
12
+ const TextFilter = ({
13
+ value,
14
+ id,
15
+ onChange,
16
+ placeholder,
17
+ blockID,
18
+ activeTopLabel = false,
19
+ infoText = '',
20
+ }) => {
12
21
  const intl = useIntl();
22
+ const placeholderText =
23
+ placeholder || intl.formatMessage(messages.text_filter_placeholder);
13
24
 
14
25
  return (
15
26
  <div className="me-lg-3 my-2 my-lg-1 filter-wrapper text-filter">
16
- <label htmlFor={`${blockID}-${id}`} className="visually-hidden">
17
- {placeholder}
18
- </label>
19
- <input
20
- type="text"
21
- placeholder={
22
- placeholder || intl.formatMessage(messages.text_filter_placeholder)
23
- }
24
- value={value}
25
- onChange={(e, data) => {
26
- onChange(id, e.target.value ?? '');
27
- }}
28
- autocomplete="off"
29
- id={`${blockID}-${id}`}
30
- />
27
+ {!activeTopLabel ? (
28
+ <>
29
+ {/* Input con label NACOSTA */}
30
+ <label htmlFor={`${blockID}-${id}`} className="visually-hidden">
31
+ {placeholderText}
32
+ </label>
33
+ <input
34
+ type="text"
35
+ placeholder={placeholderText}
36
+ value={value}
37
+ onChange={(e, data) => {
38
+ onChange(id, e.target.value ?? '');
39
+ }}
40
+ id={`${blockID}-${id}`}
41
+ />
42
+ {infoText && <small className="form-text d-block">{infoText}</small>}
43
+ </>
44
+ ) : (
45
+ <>
46
+ {/* Input con label VISIBILE */}
47
+ <Input
48
+ type="text"
49
+ label={placeholderText}
50
+ infoText={infoText} // small text
51
+ value={value}
52
+ onChange={(e, data) => {
53
+ onChange(id, e.target.value ?? '');
54
+ }}
55
+ id={`${blockID}-${id}`}
56
+ />
57
+ </>
58
+ )}
31
59
  </div>
32
60
  );
33
61
  };
@@ -237,6 +237,8 @@ const BandiInEvidenceTemplate = ({
237
237
  item={!isEditMode ? item : null}
238
238
  href={isEditMode ? '#' : null}
239
239
  text={intl.formatMessage(messages.vedi)}
240
+ tabIndex={-1}
241
+ aria-hidden="true"
240
242
  />
241
243
  </div>
242
244
  </div>
@@ -77,6 +77,7 @@ const CardWithSlideUpTextTemplate = (props) => {
77
77
  backgroundImage: `url(${image})`,
78
78
  }
79
79
  }
80
+ tabIndex={-1}
80
81
  >
81
82
  <div className="bg-gradient"></div>
82
83
  {(category || date) && (
@@ -117,13 +118,15 @@ const CardWithSlideUpTextTemplate = (props) => {
117
118
  href={isEditMode ? '#' : null}
118
119
  text={intl.formatMessage(messages.vedi)}
119
120
  className="justify-content-end"
121
+ tabIndex={-1}
122
+ aria-hidden="true"
120
123
  />
121
124
  </div>
122
125
  <UniversalLink
123
126
  item={!isEditMode ? item : null}
124
127
  className="card-link"
125
128
  aria-hidden="true"
126
- tabIndex="-1"
129
+ tabIndex={-1}
127
130
  ></UniversalLink>
128
131
  </div>
129
132
  );
@@ -170,6 +170,7 @@ const RibbonCardTemplate = (props) => {
170
170
  detail_link_label ||
171
171
  intl.formatMessage(messages.default_detail_link)
172
172
  }
173
+ tabIndex={-1}
173
174
  aria-hidden="true"
174
175
  />
175
176
  )}
@@ -175,6 +175,7 @@ const SimpleCardDefault = (props) => {
175
175
  detail_link_label ||
176
176
  intl.formatMessage(messages.card_detail_label)
177
177
  }
178
+ tabIndex={-1}
178
179
  aria-hidden="true"
179
180
  />
180
181
  )}
@@ -49,6 +49,8 @@ const BandiInEvidenceTemplateSkeleton = ({
49
49
  tag={Link}
50
50
  to={'#'}
51
51
  text=""
52
+ tabIndex={-1}
53
+ aria-hidden="true"
52
54
  />
53
55
  </div>
54
56
  </CardBody>
@@ -0,0 +1,77 @@
1
+ import { useEffect } from 'react';
2
+ import { useLocation } from 'react-router-dom';
3
+ import { useIntl, defineMessages } from 'react-intl';
4
+ import { useDispatch, useSelector } from 'react-redux';
5
+ import { Container, Row, Col, Spinner, Card, CardBody } from 'design-react-kit';
6
+ import { UniversalLink } from '@plone/volto/components';
7
+ import { getContacts } from 'design-comuni-plone-theme/actions';
8
+ import { Icon } from 'design-comuni-plone-theme/components/ItaliaTheme';
9
+
10
+ const messages = defineMessages({
11
+ contact_block_title: {
12
+ id: 'contact_block_title',
13
+ defaultMessage: 'Contatta il comune',
14
+ },
15
+ });
16
+
17
+ const ContactsBlock = () => {
18
+ const intl = useIntl();
19
+ const { pathname } = useLocation();
20
+ const dispatch = useDispatch();
21
+
22
+ useEffect(() => {
23
+ dispatch(getContacts(pathname));
24
+ }, [dispatch, pathname]);
25
+
26
+ const contacts = useSelector((state) => state.contacts) ?? {};
27
+ const contactsItems = contacts?.result?.items ?? [];
28
+ const isContactsLoading = contacts.loading;
29
+ const isContactsLoaded = contacts.loaded;
30
+
31
+ return contactsItems.length > 0 ? (
32
+ <section className="contacts-block bg-light py-5">
33
+ <Container>
34
+ <Row className="d-flex justify-content-center">
35
+ <Col xs={12} lg={6} xl={6} xxl={6}>
36
+ {isContactsLoading && !isContactsLoaded && (
37
+ <div className="d-flex justify-content-center">
38
+ <Spinner active />
39
+ </div>
40
+ )}
41
+ {!isContactsLoading && contactsItems?.length > 0 && (
42
+ <Card className="contacts-box">
43
+ <CardBody>
44
+ <h2>{intl.formatMessage(messages.contact_block_title)}</h2>
45
+ <div>
46
+ <ul className="mb-0 mt-3 contacts-list">
47
+ {contactsItems.map((contact, idx) => (
48
+ <li key={idx}>
49
+ <UniversalLink
50
+ overrideMarkSpecialLinks={true}
51
+ href={contact.contact}
52
+ className="d-flex align-items-center"
53
+ >
54
+ <span className="icon-container d-flex justify-content-center">
55
+ <Icon icon={contact.icon} color="current" />
56
+ </span>
57
+ <span className="text-container">
58
+ {contact.title}
59
+ </span>
60
+ </UniversalLink>
61
+ </li>
62
+ ))}
63
+ </ul>
64
+ </div>
65
+ </CardBody>
66
+ </Card>
67
+ )}
68
+ </Col>
69
+ </Row>
70
+ </Container>
71
+ </section>
72
+ ) : (
73
+ <></>
74
+ );
75
+ };
76
+
77
+ export default ContactsBlock;
@@ -24,9 +24,9 @@ const PageHeaderTassonomiaArgomenti = ({ content }) => {
24
24
 
25
25
  return content?.tassonomia_argomenti?.length > 0 ? (
26
26
  <div className="mt-4 mb-4 page-arguments">
27
- <h5>
27
+ <h2 className="h5">
28
28
  <small>{intl.formatMessage(messages.topics)}</small>
29
- </h5>
29
+ </h2>
30
30
  {content.tassonomia_argomenti.map((item, i) => (
31
31
  <UniversalLink
32
32
  item={item}
@@ -22,6 +22,9 @@ export CTTitleColumnWidget from 'design-comuni-plone-theme/components/ItaliaThem
22
22
  export BlocksViewWidget from 'design-comuni-plone-theme/components/ItaliaTheme/manage/Widgets/BlocksViewWidget.jsx';
23
23
  export PDCViewWidget from 'design-comuni-plone-theme/components/ItaliaTheme/manage/Widgets/PDCViewWidget.jsx';
24
24
  export DataGridWidget from 'design-comuni-plone-theme/components/ItaliaTheme/manage/Widgets/DataGridWidget.jsx';
25
+ export ContactsConfigWidget from 'design-comuni-plone-theme/components/ItaliaTheme/manage/Widgets/ContactsWidget/ContactsConfigWidget.jsx';
26
+ export ContactsConfigForm from 'design-comuni-plone-theme/components/ItaliaTheme/manage/Widgets/ContactsWidget/ContactsConfigForm.jsx';
27
+ export ConditionallyRequiredDateWidget from 'design-comuni-plone-theme/components/ItaliaTheme/manage/Widgets/ConditionallyRequiredDateWidget.jsx';
25
28
 
26
29
  /********* ICONS ********* */
27
30
  export getItemIcon from 'design-comuni-plone-theme/components/ItaliaTheme/Icons/common/common';
@@ -75,6 +78,7 @@ export Breadcrumbs from 'design-comuni-plone-theme/components/ItaliaTheme/Breadc
75
78
  export FeedbackForm from 'design-comuni-plone-theme/components/ItaliaTheme/CustomerSatisfaction/FeedbackForm';
76
79
  export AnswersStep from 'design-comuni-plone-theme/components/ItaliaTheme/CustomerSatisfaction/Steps/AnswersStep';
77
80
  export CommentsStep from 'design-comuni-plone-theme/components/ItaliaTheme/CustomerSatisfaction/Steps/CommentsStep';
81
+ export ContactsBlock from 'design-comuni-plone-theme/components/ItaliaTheme/ContactsBlock/ContactsBlock';
78
82
 
79
83
  /********* BLOCKS ********* */
80
84
  export AlertSidebar from 'design-comuni-plone-theme/components/ItaliaTheme/Blocks/Alert/Sidebar';
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ import { DatetimeWidget } from '@plone/volto/config/Widgets';
3
+
4
+ const ConditionallyRequiredDateWidget = (props) => {
5
+ const { value, formData, onChange, id, title, required, ...rest } = props;
6
+
7
+ // Check tipo di incarico in formData
8
+ const tipoIncarico = formData?.tipologia_incarico;
9
+
10
+ // Make required only if tipo di incarico !== "amministrativo"
11
+ const isRequired = tipoIncarico !== 'amministrativo';
12
+
13
+ return (
14
+ <DatetimeWidget
15
+ {...rest}
16
+ id={id}
17
+ title={title}
18
+ value={value}
19
+ required={isRequired}
20
+ onChange={onChange}
21
+ />
22
+ );
23
+ };
24
+
25
+ export default ConditionallyRequiredDateWidget;
@@ -0,0 +1,90 @@
1
+ import { useIntl, defineMessages } from 'react-intl';
2
+ import { Form as UIForm, Grid, Button } from 'semantic-ui-react';
3
+
4
+ import { TextWidget } from '@plone/volto/components';
5
+
6
+ const messages = defineMessages({
7
+ icon: {
8
+ id: 'contacts-config-icon',
9
+ defaultMessage: 'Icon name',
10
+ },
11
+ title: {
12
+ id: 'contacts-config-title',
13
+ defaultMessage: 'Contact title',
14
+ },
15
+ contact: {
16
+ id: 'contacts-config-contact',
17
+ defaultMessage: 'Contact',
18
+ },
19
+ delete_contact: {
20
+ id: 'contacts-config-delete-item',
21
+ defaultMessage: 'Delete contact',
22
+ },
23
+ });
24
+
25
+ const ContactsConfigForm = ({
26
+ id,
27
+ contactItem,
28
+ onChange,
29
+ deleteContactItem,
30
+ }) => {
31
+ const intl = useIntl();
32
+ const onChangeFormData = (id, value) => {
33
+ onChange({ ...contactItem, [id]: value });
34
+ };
35
+ return (
36
+ <div className="contact-config-form">
37
+ <TextWidget
38
+ id="icon"
39
+ title={intl.formatMessage(messages.icon)}
40
+ description=""
41
+ value={contactItem.icon}
42
+ onChange={(id, value) => {
43
+ onChangeFormData('icon', value);
44
+ }}
45
+ />
46
+ <TextWidget
47
+ id="title"
48
+ title={intl.formatMessage(messages.title)}
49
+ description=""
50
+ value={contactItem.title}
51
+ onChange={(id, value) => {
52
+ onChangeFormData('title', value);
53
+ }}
54
+ />
55
+ <TextWidget
56
+ id="contact"
57
+ title={intl.formatMessage(messages.contact)}
58
+ description=""
59
+ value={contactItem.contact}
60
+ onChange={(id, value) => {
61
+ onChangeFormData('contact', value);
62
+ }}
63
+ />
64
+ <UIForm.Field
65
+ inline
66
+ className="delete wide delete-field"
67
+ id="menu-delete"
68
+ >
69
+ <Grid>
70
+ <Grid.Row stretched>
71
+ <Grid.Column width={4}>
72
+ <div className="wrapper"></div>
73
+ </Grid.Column>
74
+ <Grid.Column width={8}>
75
+ <Button
76
+ icon="trash"
77
+ onClick={deleteContactItem}
78
+ id="delete-contact-item"
79
+ negative
80
+ content={intl.formatMessage(messages.delete_contact)}
81
+ />
82
+ </Grid.Column>
83
+ </Grid.Row>
84
+ </Grid>
85
+ </UIForm.Field>
86
+ </div>
87
+ );
88
+ };
89
+
90
+ export default ContactsConfigForm;