design-comuni-plone-theme 8.5.1 → 8.6.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
 
2
2
 
3
+ ## [8.6.0](https://github.com/redturtle/design-comuni-plone-theme/compare/v8.5.1...v8.6.0) (2023-09-18)
4
+
5
+
6
+ ### Features
7
+
8
+ * added Release log ([#332](https://github.com/redturtle/design-comuni-plone-theme/issues/332)) ([d1f73d0](https://github.com/redturtle/design-comuni-plone-theme/commit/d1f73d033c54e4c5e9f6b8ec231e938d7bc97c8b))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * fix container in edit mode ([#328](https://github.com/redturtle/design-comuni-plone-theme/issues/328)) ([d52a02d](https://github.com/redturtle/design-comuni-plone-theme/commit/d52a02d7218d6ccfcfa13a1b66993887820f7114))
14
+
3
15
  ## [8.5.1](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v8.5.0...v8.5.1) (2023-09-18)
4
16
 
5
17
 
package/RELEASE.md ADDED
@@ -0,0 +1,31 @@
1
+ <!--- RELEASE file. La cura di questo file è in carico ai dev.
2
+ Qui vanno inserite tutte le novità e bugfix, spiegati in un linguaggio comprensibile anche ai non dev.
3
+ Se ci sono delle migliorie/novità per cui è stato aggiunto qualcosa nel manuale, linkarlo come nell'esempio sotto.
4
+ -->
5
+
6
+ <!--- -----------------------------------------------------------------
7
+ Esempio:
8
+ ---------------------------------------------------------------------
9
+ ## Versione 7.10.9
10
+ ### Migliorie
11
+ - Fissato il layout di stampa per pagine con Accordion
12
+ ### Novità
13
+ - Nuovo blocco "Informazioni" [`Istruzioni`](https://docs.google.com/document/d/1SThuxa_ah0BuNXukWs564kKPfprK41WLQE8Mome-0xg/edit#heading=h.7ty110jumgmd)
14
+ ### Fix
15
+ - il numero di telefono dentro card ufficio adesso è visibile anche senza indirizzo
16
+ -->
17
+
18
+ <!--- -----------------------------------------------------------------
19
+ TEMPLATE PER RELEASE
20
+ ----------------------------------------------------------------------
21
+
22
+ ## Versione X.X.X
23
+ ### Migliorie
24
+ - ...
25
+
26
+ ### Novità
27
+ - ... [`Istruzioni`](url della documentazione relativa alla novità)
28
+
29
+ ### Fix
30
+ - ...
31
+ -->
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.5.1",
5
+ "version": "8.6.0",
6
6
  "main": "src/index.js",
7
7
  "keywords": [
8
8
  "volto-addon",
@@ -117,6 +117,7 @@
117
117
  "classnames": "^2.3.2",
118
118
  "design-react-kit": "italia/design-react-kit#fc9b40257ba3cb613141faf217f1f5b806489740",
119
119
  "htmldiff-js": "1.0.5",
120
+ "marked": "9.0.0",
120
121
  "react-dropzone": "11.0.1",
121
122
  "react-google-recaptcha-v3": "1.7.0",
122
123
  "react-highlight-words": "0.18.0",
@@ -46,11 +46,7 @@ const ContentInEvidenceTemplate = ({
46
46
 
47
47
  return (
48
48
  <div className="contentInEvidenceTemplate">
49
- <Container
50
- className={cx('', {
51
- 'px-4': isEditMode,
52
- })}
53
- >
49
+ <Container>
54
50
  {title && (
55
51
  <Row>
56
52
  <Col>
@@ -0,0 +1,4 @@
1
+ h2 {
2
+ border-top: 1px solid grey;
3
+ font-weight: 600 !important;
4
+ }
@@ -0,0 +1,147 @@
1
+ /**
2
+ * ReleaseLog component.
3
+ * @module components/ReleaseLog/ReleaseLog
4
+ */
5
+
6
+ import React, { useState, useEffect } from 'react';
7
+
8
+ import {
9
+ Container,
10
+ Nav,
11
+ NavItem,
12
+ NavLink,
13
+ TabContent,
14
+ TabPane,
15
+ } from 'design-react-kit';
16
+ import { Helmet } from '@plone/volto/helpers';
17
+ import { marked } from 'marked';
18
+
19
+ import './ReleaseLog.css';
20
+
21
+ const ReleaseLog = () => {
22
+ let ReleaseDCPT = null;
23
+ let ReleaseIoCittadino = null;
24
+ let ReleaseIoPrenoto = null;
25
+ try {
26
+ ReleaseDCPT = require('design-comuni-plone-theme/../RELEASE.md');
27
+ } catch {
28
+ console.log("design-comuni-plone-theme/../RELEASE.md doesn't exists");
29
+ }
30
+ try {
31
+ ReleaseIoCittadino = require('@redturtle/volto-io-cittadino/../RELEASE.md');
32
+ } catch {
33
+ console.log("@redturtle/volto-io-cittadino/../RELEASE.md doesn't exists");
34
+ }
35
+ try {
36
+ ReleaseIoPrenoto = require('@redturtle/volto-io-prenoto/../RELEASE.md');
37
+ } catch {
38
+ console.log("@redturtle/volto-io-prenoto/../RELEASE.md doesn't exists");
39
+ }
40
+
41
+ const LOGS_TO_VIEW = [
42
+ { name: 'io-comune', file: ReleaseDCPT },
43
+ {
44
+ name: 'io-cittadino',
45
+ file: ReleaseIoCittadino,
46
+ },
47
+ { name: 'io-prenoto', file: ReleaseIoPrenoto },
48
+ ];
49
+
50
+ const [activeTab, toggleTab] = useState(LOGS_TO_VIEW[0].name);
51
+ const [logDCPT, setLogDCPT] = useState('');
52
+ const [logIoCittadino, setLogIoCittadino] = useState('');
53
+ const [logIoPrenoto, setLogIoPrenoto] = useState('');
54
+
55
+ useEffect(() => {
56
+ if (ReleaseDCPT) {
57
+ try {
58
+ fetch(ReleaseDCPT)
59
+ .then((res) => res.text())
60
+ .then((text) => {
61
+ setLogDCPT(marked(text));
62
+ });
63
+ } catch {
64
+ console.log(ReleaseDCPT + ' not found.');
65
+ }
66
+ }
67
+ if (ReleaseIoCittadino) {
68
+ try {
69
+ fetch(ReleaseIoCittadino)
70
+ .then((res) => res.text())
71
+ .then((text) => {
72
+ setLogIoCittadino(marked(text));
73
+ });
74
+ } catch {
75
+ console.log(ReleaseIoCittadino + ' not found.');
76
+ }
77
+ }
78
+ if (ReleaseIoPrenoto) {
79
+ try {
80
+ fetch(ReleaseIoPrenoto)
81
+ .then((res) => res.text())
82
+ .then((text) => {
83
+ setLogIoPrenoto(marked(text));
84
+ });
85
+ } catch {
86
+ console.log(ReleaseIoPrenoto + ' not found.');
87
+ }
88
+ }
89
+ }, []);
90
+
91
+ const viewTab = (tab) => {
92
+ if (activeTab !== tab) {
93
+ toggleTab(tab);
94
+ }
95
+ };
96
+
97
+ return (
98
+ <div className="public-ui">
99
+ <Helmet title="Release LOG" />
100
+ <Helmet>
101
+ <meta name="robots" content="noindex" />
102
+ </Helmet>
103
+ <Container className="px-4 my-4">
104
+ <Nav tabs className="mb-3">
105
+ {LOGS_TO_VIEW.filter((log) => log.file != null).map((log) => (
106
+ <NavItem key={log.name}>
107
+ <NavLink
108
+ href="#"
109
+ active={activeTab === log.name}
110
+ onClick={() => viewTab(log.name)}
111
+ >
112
+ <span>{log.name}</span>
113
+ </NavLink>
114
+ </NavItem>
115
+ ))}
116
+ </Nav>
117
+
118
+ <TabContent activeTab={activeTab}>
119
+ {LOGS_TO_VIEW.filter((log) => log.file != null).map((log) => (
120
+ <TabPane
121
+ tabId={log.name}
122
+ className="p-3"
123
+ key={log.name + 'tabcontent'}
124
+ >
125
+ <div
126
+ dangerouslySetInnerHTML={{
127
+ __html:
128
+ log.name === 'io-comune' ? (
129
+ logDCPT
130
+ ) : log.name == 'io-cittadino' ? (
131
+ logIoCittadino
132
+ ) : log.name == 'io-prenoto' ? (
133
+ logIoPrenoto
134
+ ) : (
135
+ <div></div>
136
+ ),
137
+ }}
138
+ ></div>
139
+ </TabPane>
140
+ ))}
141
+ </TabContent>
142
+ </Container>
143
+ </div>
144
+ );
145
+ };
146
+
147
+ export default ReleaseLog;
@@ -1,3 +1,4 @@
1
+ import loadable from '@loadable/component';
1
2
  import menuSVG from '@plone/volto/icons/menu.svg';
2
3
  import menuAltSVG from '@plone/volto/icons/menu-alt.svg';
3
4
  import navSVG from '@plone/volto/icons/nav.svg';
@@ -54,6 +55,7 @@ import faBuildingSVG from 'design-comuni-plone-theme/icons/building.svg';
54
55
  import faFileDownloadSVG from 'design-comuni-plone-theme/icons/file-download.svg';
55
56
  import faQuestionSVG from 'design-comuni-plone-theme/icons/question-solid.svg';
56
57
  import bandoSVG from 'design-comuni-plone-theme/icons/bando.svg';
58
+ import logSVG from 'design-comuni-plone-theme/icons/log.svg';
57
59
 
58
60
  import applyRichTextConfig from 'design-comuni-plone-theme/config/RichTextEditor/config';
59
61
 
@@ -63,6 +65,10 @@ import { schemaListing } from 'design-comuni-plone-theme/components/ItaliaTheme/
63
65
 
64
66
  import reducers from 'design-comuni-plone-theme/reducers';
65
67
 
68
+ const ReleaseLog = loadable(() =>
69
+ import('design-comuni-plone-theme/components/ReleaseLog/ReleaseLog'),
70
+ );
71
+
66
72
  export default function applyConfig(voltoConfig) {
67
73
  let config = applyRichTextConfig(voltoConfig);
68
74
 
@@ -155,6 +161,15 @@ export default function applyConfig(voltoConfig) {
155
161
  great: 1200,
156
162
  huge: 1600,
157
163
  },
164
+ controlpanels: [
165
+ ...(config.settings.controlpanels ?? []),
166
+ {
167
+ '@id': '/release-log',
168
+ group: 'Generali',
169
+ title: 'Novità ultimi rilasci',
170
+ id: 'release-log',
171
+ },
172
+ ],
158
173
  controlPanelsIcons: {
159
174
  ...config.settings.controlPanelsIcons,
160
175
  'dropdown-menu-settings': menuSVG,
@@ -163,6 +178,7 @@ export default function applyConfig(voltoConfig) {
163
178
  'design-plone-settings': contentSVG,
164
179
  'bandi-settings': bookSVG,
165
180
  'social-settings': shareSVG,
181
+ 'release-log': logSVG,
166
182
  },
167
183
  defaultBlockType: 'text',
168
184
  defaultExcludedFromSearch: {
@@ -306,6 +322,7 @@ export default function applyConfig(voltoConfig) {
306
322
  config.settings.nonContentRoutes = config.settings.nonContentRoutes.filter(
307
323
  (route) => route !== '/contact-form',
308
324
  );
325
+ config.settings.nonContentRoutes.push('/release-log');
309
326
 
310
327
  /******************************************************************************
311
328
  * VIEWS
@@ -462,10 +479,9 @@ export default function applyConfig(voltoConfig) {
462
479
  },
463
480
  };
464
481
  // Remove Horizontal Menu variation of TOC Block
465
- config.blocks.blocksConfig.toc.variations =
466
- config.blocks.blocksConfig.toc.variations.filter(
467
- (v) => v.id !== 'horizontalMenu',
468
- );
482
+ config.blocks.blocksConfig.toc.variations = config.blocks.blocksConfig.toc.variations.filter(
483
+ (v) => v.id !== 'horizontalMenu',
484
+ );
469
485
 
470
486
  // REDUCERS
471
487
  config.addonReducers = {
@@ -484,6 +500,10 @@ export default function applyConfig(voltoConfig) {
484
500
  path: ['/login', '/**/login'],
485
501
  component: LoginAgid,
486
502
  },
503
+ {
504
+ path: ['/controlpanel/release-log', '/release-log'],
505
+ component: ReleaseLog,
506
+ },
487
507
  ];
488
508
 
489
509
  return config;
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="28" height="32" viewBox="0 0 28 32"><g fill="none" fill-rule="evenodd" transform="translate(0 1)"><path stroke="#000" d="M11,0 L7,0 L0,0 L0,30 L19,30 C20.654,30 22,28.654 22,27 L22,3 C22,1.346 20.654,0 19,0 L11,0 Z" transform="translate(3)"/><line x1="13" x2="21" y1="17" y2="17" stroke="#000" stroke-linecap="square"/><g transform="translate(0 22)"><rect width="27" height="8" x=".5" y=".5" fill="#FFF" stroke="#000"/><text fill="#000" font-family="Arial-Black, Arial Black" font-size="6" font-weight="700">
2
+ <tspan x="7.552" y="7">LOG</tspan>
3
+ </text></g><line x1="13" x2="21" y1="7" y2="7" stroke="#000" stroke-linecap="square"/><line x1="13" x2="21" y1="12" y2="12" stroke="#000" stroke-linecap="square"/><polygon fill="#000" points="9 8 7.824 8.618 8.049 7.309 7.098 6.382 8.412 6.191 9 5 9.588 6.191 10.902 6.382 9.951 7.309 10.176 8.618"/><polygon fill="#000" points="9 13 7.824 13.618 8.049 12.309 7.098 11.382 8.412 11.191 9 10 9.588 11.191 10.902 11.382 9.951 12.309 10.176 13.618"/><polygon fill="#000" points="9 18 7.824 18.618 8.049 17.309 7.098 16.382 8.412 16.191 9 15 9.588 16.191 10.902 16.382 9.951 17.309 10.176 18.618"/></g></svg>
@@ -1,3 +1,4 @@
1
+ @import 'cms-ui_container';
1
2
  body.cms-ui {
2
3
  .block {
3
4
  font-family: $font-family-serif;
@@ -0,0 +1,87 @@
1
+ $maxWidth: 100%;
2
+ $emSize: 14px;
3
+ $scrollbarWidth: 17px;
4
+ $toolbarWidth: 80px;
5
+ $sidebarWidth: 375px;
6
+ $collapsedWidth: 20px;
7
+
8
+ $tabletBreakpoint: 768px;
9
+ $largeMonitorBreakpoint: 1200px;
10
+ $computerBreakpoint: 992px;
11
+
12
+ $largestTabletScreen: ($computerBreakpoint - 1px);
13
+
14
+ /* Devices */
15
+ $mobileMinimumGutter: 0em;
16
+ $mobileWidth: auto;
17
+ $mobileGutter: 1em;
18
+
19
+ $tabletMinimumGutter: ($emSize * 1);
20
+ $tabletWidth: $tabletBreakpoint - ($tabletMinimumGutter * 2) - $scrollbarWidth;
21
+ $tabletGutter: auto;
22
+
23
+ $computerMinimumGutter: ($emSize * 1.5);
24
+ $computerWidth: $computerBreakpoint - ($computerMinimumGutter * 2) -
25
+ $scrollbarWidth;
26
+ $computerGutter: auto;
27
+
28
+ $largeMonitorMinimumGutter: ($emSize * 2);
29
+ $largeMonitorWidth: $largeMonitorBreakpoint - ($largeMonitorMinimumGutter * 2) -
30
+ $scrollbarWidth;
31
+ $largeMonitorGutter: auto;
32
+
33
+ @mixin contentWidthMedia($width, $gutter, $offset) {
34
+ .public-ui .container {
35
+ width: $width !important;
36
+ margin-right: $gutter !important;
37
+ margin-left: $gutter !important;
38
+ }
39
+ .public-ui .full-width > .px-4.container {
40
+ padding-left: 0 !important;
41
+ padding-right: 0 !important;
42
+ }
43
+ }
44
+
45
+ @mixin contentWidth($offset) {
46
+ @media only screen and (max-width: #{map-get($grid-breakpoints, sm)} + $offset) {
47
+ @include contentWidthMedia($mobileWidth, $mobileGutter, -12px);
48
+ }
49
+ @media only screen and (min-width: $tabletBreakpoint + $offset) and (max-width: $largestTabletScreen + $offset) {
50
+ @include contentWidthMedia($tabletWidth, $tabletGutter, -30px);
51
+ }
52
+ @media only screen and (min-width: $computerBreakpoint + $offset) {
53
+ @include contentWidthMedia($computerWidth, $computerGutter, -30px);
54
+ }
55
+
56
+ @media only screen and (min-width: $largeMonitorBreakpoint + $offset) {
57
+ @include contentWidthMedia($largeMonitorWidth, $largeMonitorGutter, -30px);
58
+ }
59
+ }
60
+
61
+ body.cms-ui:not(.has-toolbar):not(.has-sidebar):not(.has-toolbar-collapsed):not(.has-sidebar-collapsed) {
62
+ @include contentWidth(0);
63
+ }
64
+
65
+ body.cms-ui.has-toolbar:not(.has-sidebar):not(.has-sidebar-collapsed) {
66
+ @include contentWidth($toolbarWidth);
67
+ }
68
+
69
+ body.cms-ui.has-toolbar.has-sidebar {
70
+ @include contentWidth($toolbarWidth + $sidebarWidth);
71
+ }
72
+
73
+ body.cms-ui.has-toolbar.has-sidebar-collapsed {
74
+ @include contentWidth($toolbarWidth + $collapsedWidth);
75
+ }
76
+
77
+ body.cms-ui.has-toolbar-collapsed:not(.has-sidebar):not(.has-sidebar-collapsed) {
78
+ @include contentWidth($collapsedWidth);
79
+ }
80
+
81
+ body.cms-ui.has-toolbar-collapsed.has-sidebar {
82
+ @include contentWidth($collapsedWidth + $sidebarWidth);
83
+ }
84
+
85
+ body.cms-ui.has-toolbar-collapsed.has-sidebar-collapsed {
86
+ @include contentWidth($collapsedWidth + $collapsedWidth);
87
+ }