@eeacms/volto-cca-policy 0.1.82 → 0.1.83
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 +19 -0
- package/package.json +1 -1
- package/src/components/index.js +1 -0
- package/src/components/manage/Blocks/Listing/EventCardsListingView.jsx +167 -0
- package/src/components/manage/Blocks/Listing/index.js +8 -0
- package/src/components/manage/Blocks/Listing/styles.less +55 -0
- package/src/components/theme/BannerTitle/BannerTitle.jsx +38 -0
- package/src/components/theme/Views/ProjectView.jsx +4 -4
- package/src/customizations/volto/components/manage/Display/Display.jsx +266 -0
- package/src/customizations/volto/components/manage/Display/Readme.md +1 -0
- package/src/customizations/volto/components/theme/Sitemap/Sitemap.jsx +7 -4
- package/src/customizations/volto/components/theme/View/DefaultView.jsx +3 -0
- package/src/helpers/Utils.jsx +14 -16
- package/theme/globals/site.overrides +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file. Dates are d
|
|
|
4
4
|
|
|
5
5
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
6
6
|
|
|
7
|
+
### [0.1.83](https://github.com/eea/volto-cca-policy/compare/0.1.82...0.1.83) - 26 February 2024
|
|
8
|
+
|
|
9
|
+
#### :hammer_and_wrench: Others
|
|
10
|
+
|
|
11
|
+
- Refs #265786 - Fix go to contact info (in case of email vs website url). [GhitaB - [`38029dc`](https://github.com/eea/volto-cca-policy/commit/38029dc5bcb21423b8b9edea8aef9627cc06b8a5)]
|
|
12
|
+
- Refs #265786 - Fix go to contact info (in case of email vs website url). [GhitaB - [`4a45be0`](https://github.com/eea/volto-cca-policy/commit/4a45be04c57305874fb38952a354c7fc2e630c10)]
|
|
13
|
+
- Refs #265786 - Event cards listing: fix icon to stay on the same line. [GhitaB - [`d7c32ae`](https://github.com/eea/volto-cca-policy/commit/d7c32aed9d0a66cd618daeb38ae8a8bb9c400be4)]
|
|
14
|
+
- Refs #265786 - Event cards listing: improve styles, add email info and subjects tags. [GhitaB - [`3c92d54`](https://github.com/eea/volto-cca-policy/commit/3c92d54ceb88a4dd28536e99398412e1e4532b8d)]
|
|
15
|
+
- Refs #265786 - Event cards listing: improve styles, improve day display. [GhitaB - [`80b0fe0`](https://github.com/eea/volto-cca-policy/commit/80b0fe047f254483664e5528871e1d51c02830e1)]
|
|
16
|
+
- Refs #265786 - Implement events cards listing variation to be used for listing events. [GhitaB - [`73a77f2`](https://github.com/eea/volto-cca-policy/commit/73a77f2430568f3b20749f77c986720c6a5dab81)]
|
|
17
|
+
- Add Display customization, to avoid crash in homepage [Tiberiu Ichim - [`6e3196b`](https://github.com/eea/volto-cca-policy/commit/6e3196b4298c0ec6adfb73df682b9adfa3cd9fae)]
|
|
7
18
|
### [0.1.82](https://github.com/eea/volto-cca-policy/compare/0.1.81...0.1.82) - 24 February 2024
|
|
8
19
|
|
|
9
20
|
#### :house: Internal changes
|
|
@@ -398,10 +409,13 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
398
409
|
- Refs #260715 rast-block wip [Tripon Eugen - [`f19d54e`](https://github.com/eea/volto-cca-policy/commit/f19d54e0b9a6a86bf344eb85b6a1cda7f3de91bf)]
|
|
399
410
|
- Refs #260715 rast-block wip [Tripon Eugen - [`2828537`](https://github.com/eea/volto-cca-policy/commit/2828537b6c084cd1a82162d552fb4ef025b71f9f)]
|
|
400
411
|
- Refs #260715 rast-block updates [Tripon Eugen - [`1e803e5`](https://github.com/eea/volto-cca-policy/commit/1e803e5bd3d3fb7558f261c76c68866be7beb8b5)]
|
|
412
|
+
- test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`0a15e1b`](https://github.com/eea/volto-cca-policy/commit/0a15e1b2ad081233685e80d5b3c60a8663f6b896)]
|
|
413
|
+
- test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`9554e44`](https://github.com/eea/volto-cca-policy/commit/9554e44c92a621a52b2adb5a4830fb084ee5734b)]
|
|
401
414
|
### [0.1.49](https://github.com/eea/volto-cca-policy/compare/0.1.48...0.1.49) - 15 November 2023
|
|
402
415
|
|
|
403
416
|
#### :house: Internal changes
|
|
404
417
|
|
|
418
|
+
- chore: [JENKINS] Refactor automated testing [valentinab25 - [`7b820a6`](https://github.com/eea/volto-cca-policy/commit/7b820a6369c2ddd5203b1a4abe352cb4bb43db7a)]
|
|
405
419
|
- chore: husky, lint-staged use fixed versions [valentinab25 - [`f0a8061`](https://github.com/eea/volto-cca-policy/commit/f0a8061c275c236deb00087c23fac9860a073106)]
|
|
406
420
|
|
|
407
421
|
#### :hammer_and_wrench: Others
|
|
@@ -418,6 +432,9 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
418
432
|
- Refs #259267 - jenkins test [Tripon Eugen - [`cacd31e`](https://github.com/eea/volto-cca-policy/commit/cacd31e7b1afe0983674ed5c7632d2e1d7fa752e)]
|
|
419
433
|
- Refs #259267 - jenkins [Tripon Eugen - [`5b3affe`](https://github.com/eea/volto-cca-policy/commit/5b3affee8401239de10097884c1b7f2349d15ec0)]
|
|
420
434
|
- Refs #259267 - add When, lead image and title to files [Tripon Eugen - [`2cedb23`](https://github.com/eea/volto-cca-policy/commit/2cedb237f898af9057e13fba94b615ef71077204)]
|
|
435
|
+
- test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`4d607a5`](https://github.com/eea/volto-cca-policy/commit/4d607a576e9d0a5c34e48c41b409e7df616ee3d6)]
|
|
436
|
+
- test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`b7f74d5`](https://github.com/eea/volto-cca-policy/commit/b7f74d53513a6edbfbca5cb6d19687929bb1e5db)]
|
|
437
|
+
- test: [JENKINS] Improve cypress time [valentinab25 - [`db65617`](https://github.com/eea/volto-cca-policy/commit/db656173391f65157098d95d388c25f6429753d8)]
|
|
421
438
|
- Refs #259267 - cca event blocks attachments and check not mandatoty fields [Tripon Eugen - [`3138e5a`](https://github.com/eea/volto-cca-policy/commit/3138e5afb5bfbdbed14e27ed457b16867b7fa414)]
|
|
422
439
|
- Refs #256681 - Fix error in CCA Event view menu. ([React Intl] An id must be provided to format a message.) [GhitaB - [`517eeb8`](https://github.com/eea/volto-cca-policy/commit/517eeb817264a47bbfd6b9b7d22aaf22d44ed224)]
|
|
423
440
|
- Refs #161485 - Fix ECDE name conflict. [GhitaB - [`8bfd99f`](https://github.com/eea/volto-cca-policy/commit/8bfd99ff68bb82a04d1c0ed625fa514fcf46289e)]
|
|
@@ -634,6 +651,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
634
651
|
|
|
635
652
|
#### :house: Internal changes
|
|
636
653
|
|
|
654
|
+
- chore: [JENKINS] Remove alpha testing version [valentinab25 - [`ad1ced0`](https://github.com/eea/volto-cca-policy/commit/ad1ced0971ba116c13a3b5fcc039172cc915c919)]
|
|
637
655
|
|
|
638
656
|
#### :hammer_and_wrench: Others
|
|
639
657
|
|
|
@@ -1114,6 +1132,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
1114
1132
|
#### :hammer_and_wrench: Others
|
|
1115
1133
|
|
|
1116
1134
|
- Refs #158294 - Update supported languages list. [GhitaB - [`0a4f91f`](https://github.com/eea/volto-cca-policy/commit/0a4f91f39b7edc367bd4c127d6a8f273c7788361)]
|
|
1135
|
+
- Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`8f1f9ce`](https://github.com/eea/volto-cca-policy/commit/8f1f9ce6c22805670cc0800d3c779b6d619d0f31)]
|
|
1117
1136
|
### [0.1.1](https://github.com/eea/volto-cca-policy/compare/0.1.0...0.1.1) - 13 December 2022
|
|
1118
1137
|
|
|
1119
1138
|
#### :hammer_and_wrench: Others
|
package/package.json
CHANGED
package/src/components/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export BannerTitle from './theme/BannerTitle/BannerTitle';
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { connect } from 'react-redux';
|
|
4
|
+
import { compose } from 'redux';
|
|
5
|
+
import cx from 'classnames';
|
|
6
|
+
import './styles.less';
|
|
7
|
+
import { ConditionalLink } from '@plone/volto/components';
|
|
8
|
+
import { Icon } from 'semantic-ui-react';
|
|
9
|
+
import { When } from '@plone/volto/components/theme/View/EventDatesInfo';
|
|
10
|
+
import { Card, Grid } from 'semantic-ui-react';
|
|
11
|
+
import { Label } from 'semantic-ui-react';
|
|
12
|
+
|
|
13
|
+
const Separator = () => {
|
|
14
|
+
return <div className="sep"> ⎯ </div>;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const StartDate = (start) => {
|
|
18
|
+
const start_date = new Date(start);
|
|
19
|
+
|
|
20
|
+
const day = start_date.getDate();
|
|
21
|
+
const monthIndex = start_date.getMonth();
|
|
22
|
+
|
|
23
|
+
const monthNames = [
|
|
24
|
+
'Jan',
|
|
25
|
+
'Feb',
|
|
26
|
+
'Mar',
|
|
27
|
+
'Apr',
|
|
28
|
+
'May',
|
|
29
|
+
'Jun',
|
|
30
|
+
'Jul',
|
|
31
|
+
'Aug',
|
|
32
|
+
'Sep',
|
|
33
|
+
'Oct',
|
|
34
|
+
'Nov',
|
|
35
|
+
'Dec',
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
const monthName = monthNames[monthIndex];
|
|
39
|
+
|
|
40
|
+
const dayOfWeek = start_date
|
|
41
|
+
.toLocaleDateString('en', { weekday: 'short' })
|
|
42
|
+
.substring(0, 2);
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<div className="start-date">
|
|
46
|
+
<p className="day">{dayOfWeek}</p>
|
|
47
|
+
<p className="date">
|
|
48
|
+
{day}.{monthName}.
|
|
49
|
+
</p>
|
|
50
|
+
</div>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const EventCardsListingView = ({ items, isEditMode, token }) => {
|
|
55
|
+
const go_to_contact = (contact_info) => {
|
|
56
|
+
if (contact_info.includes('@')) {
|
|
57
|
+
return `mailto:${contact_info}`;
|
|
58
|
+
}
|
|
59
|
+
return contact_info;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<div className={cx('ui fluid eventCards')}>
|
|
64
|
+
{items.map((item, index) => (
|
|
65
|
+
<div
|
|
66
|
+
className={cx('u-item listing-item simple-listing-item')}
|
|
67
|
+
key={item['@id']}
|
|
68
|
+
>
|
|
69
|
+
<div className="wrapper">
|
|
70
|
+
<Card fluid>
|
|
71
|
+
<Card.Content>
|
|
72
|
+
<Grid stackable columns={12}>
|
|
73
|
+
<Grid.Column width={2}>
|
|
74
|
+
{!!item.start && StartDate(item.start)}
|
|
75
|
+
</Grid.Column>
|
|
76
|
+
<Grid.Column width={10}>
|
|
77
|
+
<div className="event-details">
|
|
78
|
+
<h3 className={'listing-header'}>
|
|
79
|
+
<a href={item.event_url}>
|
|
80
|
+
{item.title ? item.title : item.id}
|
|
81
|
+
</a>
|
|
82
|
+
</h3>
|
|
83
|
+
<div className="listing-body-dates">
|
|
84
|
+
{!!item.start && (
|
|
85
|
+
<span className="event-date">
|
|
86
|
+
<Icon className="ri-calendar-line" />
|
|
87
|
+
<When
|
|
88
|
+
start={item.start}
|
|
89
|
+
end={item.end}
|
|
90
|
+
whole_day={true}
|
|
91
|
+
open_end={item.open_end}
|
|
92
|
+
/>
|
|
93
|
+
</span>
|
|
94
|
+
)}
|
|
95
|
+
</div>
|
|
96
|
+
<div className="listing-body-dates">
|
|
97
|
+
{!!item['location'] && (
|
|
98
|
+
<span className="event-date">
|
|
99
|
+
<Icon className="map marker alternate" />
|
|
100
|
+
{item['location']}
|
|
101
|
+
</span>
|
|
102
|
+
)}
|
|
103
|
+
</div>
|
|
104
|
+
{item.description && (
|
|
105
|
+
<p className={'listing-description'}>
|
|
106
|
+
{item.description}
|
|
107
|
+
</p>
|
|
108
|
+
)}
|
|
109
|
+
<div className="bottom-info">
|
|
110
|
+
{!!item.subjects && item.subjects.length > 0 && (
|
|
111
|
+
<>
|
|
112
|
+
<div className="subjects">
|
|
113
|
+
{item.subjects.map((tag) => (
|
|
114
|
+
<Label key={tag} size="small">
|
|
115
|
+
{tag}
|
|
116
|
+
</Label>
|
|
117
|
+
))}
|
|
118
|
+
</div>
|
|
119
|
+
|
|
120
|
+
<Separator />
|
|
121
|
+
</>
|
|
122
|
+
)}
|
|
123
|
+
<div className="source">
|
|
124
|
+
<ConditionalLink item={item} condition={!isEditMode}>
|
|
125
|
+
Climate Adapt page for this event
|
|
126
|
+
</ConditionalLink>
|
|
127
|
+
</div>
|
|
128
|
+
{!!item.contact_email && (
|
|
129
|
+
<>
|
|
130
|
+
<Separator />
|
|
131
|
+
<div className="email-info">
|
|
132
|
+
<Icon className="mail" />
|
|
133
|
+
<a
|
|
134
|
+
className="contact_email"
|
|
135
|
+
title=""
|
|
136
|
+
href={go_to_contact(item.contact_email)}
|
|
137
|
+
target="_blank"
|
|
138
|
+
rel="noreferrer"
|
|
139
|
+
>
|
|
140
|
+
{item.contact_email}
|
|
141
|
+
</a>
|
|
142
|
+
</div>
|
|
143
|
+
</>
|
|
144
|
+
)}
|
|
145
|
+
</div>
|
|
146
|
+
</div>
|
|
147
|
+
</Grid.Column>
|
|
148
|
+
</Grid>
|
|
149
|
+
</Card.Content>
|
|
150
|
+
</Card>
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
))}
|
|
154
|
+
</div>
|
|
155
|
+
);
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
EventCardsListingView.propTypes = {
|
|
159
|
+
items: PropTypes.arrayOf(PropTypes.any).isRequired,
|
|
160
|
+
isEditMode: PropTypes.bool,
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
export default compose(
|
|
164
|
+
connect((state) => ({
|
|
165
|
+
token: state.userSession.token,
|
|
166
|
+
})),
|
|
167
|
+
)(EventCardsListingView);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import OrganisationCardsListingView from './OrganisationCardsListingView';
|
|
2
2
|
import IndicatorCardsListingView from './IndicatorCardsListingView';
|
|
3
|
+
import EventCardsListingView from './EventCardsListingView';
|
|
3
4
|
|
|
4
5
|
export default function installListing(config) {
|
|
5
6
|
config.blocks.blocksConfig.listing = {
|
|
@@ -20,6 +21,13 @@ export default function installListing(config) {
|
|
|
20
21
|
isDefault: false,
|
|
21
22
|
fullobjects: true,
|
|
22
23
|
},
|
|
24
|
+
{
|
|
25
|
+
id: 'eventCards',
|
|
26
|
+
title: 'Event Cards',
|
|
27
|
+
template: EventCardsListingView,
|
|
28
|
+
isDefault: false,
|
|
29
|
+
fullobjects: true,
|
|
30
|
+
},
|
|
23
31
|
],
|
|
24
32
|
};
|
|
25
33
|
|
|
@@ -44,3 +44,58 @@ div.indicatorCards {
|
|
|
44
44
|
margin-bottom: 1em !important;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
+
|
|
48
|
+
// Event Cards Listing
|
|
49
|
+
div.eventCards {
|
|
50
|
+
div.simple-listing-item {
|
|
51
|
+
border-bottom: 1px solid #ddd !important;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
a {
|
|
55
|
+
color: #006bb8 !important;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
div.start-date {
|
|
59
|
+
max-width: 80px;
|
|
60
|
+
|
|
61
|
+
.day {
|
|
62
|
+
border-bottom: 3px solid #ef7000;
|
|
63
|
+
color: #ef7000;
|
|
64
|
+
font-size: 2.5em;
|
|
65
|
+
font-weight: 900;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.date {
|
|
69
|
+
font-size: 1.5em;
|
|
70
|
+
font-weight: 600;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
div.bottom-info {
|
|
75
|
+
display: flex;
|
|
76
|
+
flex-wrap: wrap;
|
|
77
|
+
align-items: center;
|
|
78
|
+
justify-content: flex-start;
|
|
79
|
+
|
|
80
|
+
.sep {
|
|
81
|
+
position: relative;
|
|
82
|
+
top: -2px;
|
|
83
|
+
color: #ddd;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.email-info {
|
|
87
|
+
display: flex;
|
|
88
|
+
align-items: center;
|
|
89
|
+
justify-content: flex-start;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
div.subjects {
|
|
93
|
+
.label {
|
|
94
|
+
margin-right: 0.3em;
|
|
95
|
+
margin-bottom: 0.3em;
|
|
96
|
+
background: #eee;
|
|
97
|
+
color: #3d5265;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import config from '@plone/volto/registry';
|
|
2
|
+
|
|
3
|
+
const BannerTitle = (props) => {
|
|
4
|
+
const { content } = props;
|
|
5
|
+
const {
|
|
6
|
+
blocks: { blocksConfig },
|
|
7
|
+
} = config;
|
|
8
|
+
const TitleBlockView = blocksConfig?.title?.view;
|
|
9
|
+
const hasTitleBlock = content?.blocks
|
|
10
|
+
? Object.keys(content?.blocks).find(
|
|
11
|
+
(id) => content?.blocks?.[id]?.['@type'] === 'title',
|
|
12
|
+
)
|
|
13
|
+
: null;
|
|
14
|
+
const isHomePage =
|
|
15
|
+
['Subsite', 'LRF', 'Plone Site'].indexOf(content?.['@type']) > -1;
|
|
16
|
+
|
|
17
|
+
return !isHomePage ? (
|
|
18
|
+
<>
|
|
19
|
+
{!hasTitleBlock ? (
|
|
20
|
+
<TitleBlockView
|
|
21
|
+
{...props}
|
|
22
|
+
data={{
|
|
23
|
+
info: [{ description: '' }],
|
|
24
|
+
hideContentType: true,
|
|
25
|
+
hideCreationDate: true,
|
|
26
|
+
hideModificationDate: true,
|
|
27
|
+
hidePublishingDate: true,
|
|
28
|
+
hideDownloadButton: false,
|
|
29
|
+
hideShareButton: false,
|
|
30
|
+
}}
|
|
31
|
+
metadata={content}
|
|
32
|
+
/>
|
|
33
|
+
) : null}
|
|
34
|
+
</>
|
|
35
|
+
) : null;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export default BannerTitle;
|
|
@@ -23,10 +23,10 @@ function ProjectView(props) {
|
|
|
23
23
|
data={{
|
|
24
24
|
info: [{ description: '' }],
|
|
25
25
|
hideContentType: true,
|
|
26
|
-
hideCreationDate:
|
|
27
|
-
hideModificationDate:
|
|
28
|
-
hidePublishingDate:
|
|
29
|
-
hideDownloadButton:
|
|
26
|
+
hideCreationDate: false,
|
|
27
|
+
hideModificationDate: false,
|
|
28
|
+
hidePublishingDate: false,
|
|
29
|
+
hideDownloadButton: false,
|
|
30
30
|
hideShareButton: false,
|
|
31
31
|
subtitle: 'Project',
|
|
32
32
|
}}
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import React, { Component, Fragment } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { connect } from 'react-redux';
|
|
4
|
+
import { compose } from 'redux';
|
|
5
|
+
import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable';
|
|
6
|
+
|
|
7
|
+
import { getSchema, updateContent, getContent } from '@plone/volto/actions';
|
|
8
|
+
import { getLayoutFieldname } from '@plone/volto/helpers';
|
|
9
|
+
import { FormFieldWrapper, Icon } from '@plone/volto/components';
|
|
10
|
+
import { defineMessages, injectIntl } from 'react-intl';
|
|
11
|
+
import config from '@plone/volto/registry';
|
|
12
|
+
|
|
13
|
+
import downSVG from '@plone/volto/icons/down-key.svg';
|
|
14
|
+
import upSVG from '@plone/volto/icons/up-key.svg';
|
|
15
|
+
import checkSVG from '@plone/volto/icons/check.svg';
|
|
16
|
+
|
|
17
|
+
const messages = defineMessages({
|
|
18
|
+
Viewmode: {
|
|
19
|
+
id: 'Viewmode',
|
|
20
|
+
defaultMessage: 'View',
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const Option = injectLazyLibs('reactSelect')((props) => {
|
|
25
|
+
const { Option } = props.reactSelect.components;
|
|
26
|
+
return (
|
|
27
|
+
<Option {...props}>
|
|
28
|
+
<div>{props.label}</div>
|
|
29
|
+
{props.isFocused && !props.isSelected && (
|
|
30
|
+
<Icon name={checkSVG} size="18px" color="#b8c6c8" />
|
|
31
|
+
)}
|
|
32
|
+
{props.isSelected && <Icon name={checkSVG} size="18px" color="#007bc1" />}
|
|
33
|
+
</Option>
|
|
34
|
+
);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const DropdownIndicator = injectLazyLibs('reactSelect')((props) => {
|
|
38
|
+
const { DropdownIndicator } = props.reactSelect.components;
|
|
39
|
+
return (
|
|
40
|
+
<DropdownIndicator {...props}>
|
|
41
|
+
{props.selectProps.menuIsOpen ? (
|
|
42
|
+
<Icon name={upSVG} size="24px" color="#007bc1" />
|
|
43
|
+
) : (
|
|
44
|
+
<Icon name={downSVG} size="24px" color="#007bc1" />
|
|
45
|
+
)}
|
|
46
|
+
</DropdownIndicator>
|
|
47
|
+
);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const selectTheme = (theme) => ({
|
|
51
|
+
...theme,
|
|
52
|
+
borderRadius: 0,
|
|
53
|
+
colors: {
|
|
54
|
+
...theme.colors,
|
|
55
|
+
primary25: 'hotpink',
|
|
56
|
+
primary: '#b8c6c8',
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
const customSelectStyles = {
|
|
61
|
+
control: (styles, state) => ({
|
|
62
|
+
...styles,
|
|
63
|
+
border: 'none',
|
|
64
|
+
borderBottom: '2px solid #b8c6c8',
|
|
65
|
+
boxShadow: 'none',
|
|
66
|
+
borderBottomStyle: state.menuIsOpen ? 'dotted' : 'solid',
|
|
67
|
+
}),
|
|
68
|
+
menu: (styles, state) => ({
|
|
69
|
+
...styles,
|
|
70
|
+
top: null,
|
|
71
|
+
marginTop: 0,
|
|
72
|
+
boxShadow: 'none',
|
|
73
|
+
borderBottom: '2px solid #b8c6c8',
|
|
74
|
+
}),
|
|
75
|
+
menuList: (styles, state) => ({
|
|
76
|
+
...styles,
|
|
77
|
+
maxHeight: '400px',
|
|
78
|
+
}),
|
|
79
|
+
indicatorSeparator: (styles) => ({
|
|
80
|
+
...styles,
|
|
81
|
+
width: null,
|
|
82
|
+
}),
|
|
83
|
+
valueContainer: (styles) => ({
|
|
84
|
+
...styles,
|
|
85
|
+
padding: 0,
|
|
86
|
+
}),
|
|
87
|
+
option: (styles, state) => ({
|
|
88
|
+
...styles,
|
|
89
|
+
backgroundColor: null,
|
|
90
|
+
minHeight: '50px',
|
|
91
|
+
display: 'flex',
|
|
92
|
+
justifyContent: 'space-between',
|
|
93
|
+
alignItems: 'center',
|
|
94
|
+
padding: '12px 12px',
|
|
95
|
+
color: state.isSelected
|
|
96
|
+
? '#007bc1'
|
|
97
|
+
: state.isFocused
|
|
98
|
+
? '#4a4a4a'
|
|
99
|
+
: 'inherit',
|
|
100
|
+
':active': {
|
|
101
|
+
backgroundColor: null,
|
|
102
|
+
},
|
|
103
|
+
span: {
|
|
104
|
+
flex: '0 0 auto',
|
|
105
|
+
},
|
|
106
|
+
svg: {
|
|
107
|
+
flex: '0 0 auto',
|
|
108
|
+
},
|
|
109
|
+
}),
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Display container class.
|
|
114
|
+
* @class Display
|
|
115
|
+
* @extends Component
|
|
116
|
+
*/
|
|
117
|
+
class DisplaySelect extends Component {
|
|
118
|
+
/**
|
|
119
|
+
* Property types.
|
|
120
|
+
* @property {Object} propTypes Property types.
|
|
121
|
+
* @static
|
|
122
|
+
*/
|
|
123
|
+
static propTypes = {
|
|
124
|
+
getSchema: PropTypes.func.isRequired,
|
|
125
|
+
updateContent: PropTypes.func.isRequired,
|
|
126
|
+
getContent: PropTypes.func.isRequired,
|
|
127
|
+
loaded: PropTypes.bool.isRequired,
|
|
128
|
+
pathname: PropTypes.string.isRequired,
|
|
129
|
+
layouts: PropTypes.arrayOf(PropTypes.string),
|
|
130
|
+
layout: PropTypes.string,
|
|
131
|
+
type: PropTypes.string.isRequired,
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Default properties
|
|
136
|
+
* @property {Object} defaultProps Default properties.
|
|
137
|
+
* @static
|
|
138
|
+
*/
|
|
139
|
+
static defaultProps = {
|
|
140
|
+
layouts: [],
|
|
141
|
+
layout: '',
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
constructor(props) {
|
|
145
|
+
super(props);
|
|
146
|
+
|
|
147
|
+
const name = config.views.layoutViewsNamesMapping?.[this.props.layout];
|
|
148
|
+
this.state = {
|
|
149
|
+
selectedOption: {
|
|
150
|
+
value: this.props.layout,
|
|
151
|
+
label:
|
|
152
|
+
(name &&
|
|
153
|
+
this.props.intl.formatMessage({
|
|
154
|
+
id: name,
|
|
155
|
+
defaultMessage: name,
|
|
156
|
+
})) ||
|
|
157
|
+
this.props.layout,
|
|
158
|
+
},
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
componentDidMount() {
|
|
163
|
+
this.props.getSchema(this.props.type);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Component will receive props
|
|
168
|
+
* @method componentWillReceiveProps
|
|
169
|
+
* @param {Object} nextProps Next properties
|
|
170
|
+
* @returns {undefined}
|
|
171
|
+
*/
|
|
172
|
+
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
173
|
+
if (nextProps.pathname !== this.props.pathname) {
|
|
174
|
+
this.props.getSchema(nextProps.type);
|
|
175
|
+
}
|
|
176
|
+
if (!this.props.loaded && nextProps.loaded) {
|
|
177
|
+
this.props.getContent(nextProps.pathname);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* On set layout handler
|
|
183
|
+
* @method setLayout
|
|
184
|
+
* @param {Object} event Event object
|
|
185
|
+
* @returns {undefined}
|
|
186
|
+
*/
|
|
187
|
+
setLayout = (selectedOption) => {
|
|
188
|
+
this.props.updateContent(this.props.pathname, {
|
|
189
|
+
layout: selectedOption.value,
|
|
190
|
+
});
|
|
191
|
+
this.setState({ selectedOption });
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
selectValue = (option) => (
|
|
195
|
+
<Fragment>
|
|
196
|
+
<span className="Select-value-label">{option.label}</span>
|
|
197
|
+
</Fragment>
|
|
198
|
+
);
|
|
199
|
+
|
|
200
|
+
optionRenderer = (option) => (
|
|
201
|
+
<Fragment>
|
|
202
|
+
<span style={{ marginRight: 'auto' }}>{option.label}</span>
|
|
203
|
+
<Icon name={checkSVG} size="24px" />
|
|
204
|
+
</Fragment>
|
|
205
|
+
);
|
|
206
|
+
|
|
207
|
+
render() {
|
|
208
|
+
const { selectedOption } = this.state;
|
|
209
|
+
const Select = this.props.reactSelect.default;
|
|
210
|
+
const layoutsNames = config.views.layoutViewsNamesMapping;
|
|
211
|
+
const layoutOptions = this.props.layouts
|
|
212
|
+
.filter(
|
|
213
|
+
(layout) =>
|
|
214
|
+
Object.keys(config.views.contentTypesViews).includes(layout) ||
|
|
215
|
+
Object.keys(config.views.layoutViews).includes(layout),
|
|
216
|
+
)
|
|
217
|
+
.map((item) => ({
|
|
218
|
+
value: item,
|
|
219
|
+
label:
|
|
220
|
+
this.props.intl.formatMessage({
|
|
221
|
+
id: layoutsNames[item],
|
|
222
|
+
defaultMessage: layoutsNames[item],
|
|
223
|
+
}) || item,
|
|
224
|
+
}));
|
|
225
|
+
|
|
226
|
+
return layoutOptions?.length > 1 ? (
|
|
227
|
+
<FormFieldWrapper
|
|
228
|
+
id="display-select"
|
|
229
|
+
title={this.props.intl.formatMessage(messages.Viewmode)}
|
|
230
|
+
{...this.props}
|
|
231
|
+
>
|
|
232
|
+
<Select
|
|
233
|
+
name="display-select"
|
|
234
|
+
className="react-select-container"
|
|
235
|
+
classNamePrefix="react-select"
|
|
236
|
+
options={layoutOptions}
|
|
237
|
+
styles={customSelectStyles}
|
|
238
|
+
theme={selectTheme}
|
|
239
|
+
components={{ DropdownIndicator, Option }}
|
|
240
|
+
onChange={this.setLayout}
|
|
241
|
+
defaultValue={selectedOption}
|
|
242
|
+
isSearchable={false}
|
|
243
|
+
/>
|
|
244
|
+
</FormFieldWrapper>
|
|
245
|
+
) : null;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
export default compose(
|
|
250
|
+
injectIntl,
|
|
251
|
+
injectLazyLibs('reactSelect'),
|
|
252
|
+
connect(
|
|
253
|
+
(state) => ({
|
|
254
|
+
loaded: state.content.update.loaded,
|
|
255
|
+
layouts: state.schema.schema ? state.schema.schema.layouts : [],
|
|
256
|
+
layout: state.content.data
|
|
257
|
+
? state.content.data[getLayoutFieldname(state.content.data)]
|
|
258
|
+
: '',
|
|
259
|
+
layout_fieldname: state.content.data
|
|
260
|
+
? getLayoutFieldname(state.content.data)
|
|
261
|
+
: '',
|
|
262
|
+
type: state.content.data ? state.content.data['@type'] : '',
|
|
263
|
+
}),
|
|
264
|
+
{ getSchema, updateContent, getContent },
|
|
265
|
+
),
|
|
266
|
+
)(DisplaySelect);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Fixes https://github.com/plone/volto/issues/5802
|
|
@@ -7,13 +7,12 @@ import React, { Component } from 'react';
|
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { compose } from 'redux';
|
|
9
9
|
import { connect } from 'react-redux';
|
|
10
|
-
import { asyncConnect } from '@plone/volto/helpers';
|
|
10
|
+
import { asyncConnect, Helmet } from '@plone/volto/helpers';
|
|
11
11
|
import { defineMessages, injectIntl } from 'react-intl';
|
|
12
12
|
import { Container } from 'semantic-ui-react';
|
|
13
|
-
import { Helmet } from '@plone/volto/helpers';
|
|
14
13
|
import { Link } from 'react-router-dom';
|
|
15
14
|
import config from '@plone/volto/registry';
|
|
16
|
-
|
|
15
|
+
import { BannerTitle } from '@eeacms/volto-cca-policy/components';
|
|
17
16
|
import { getNavigation } from '@plone/volto/actions';
|
|
18
17
|
|
|
19
18
|
const messages = defineMessages({
|
|
@@ -97,13 +96,17 @@ class Sitemap extends Component {
|
|
|
97
96
|
</ul>
|
|
98
97
|
);
|
|
99
98
|
};
|
|
99
|
+
|
|
100
100
|
render() {
|
|
101
101
|
const { items } = this.props;
|
|
102
|
+
const content = {
|
|
103
|
+
title: this.props.intl.formatMessage(messages.Sitemap),
|
|
104
|
+
};
|
|
102
105
|
return (
|
|
103
106
|
<div id="page-sitemap">
|
|
104
107
|
<Helmet title={this.props.intl.formatMessage(messages.Sitemap)} />
|
|
108
|
+
<BannerTitle content={content} />
|
|
105
109
|
<Container className="view-wrapper">
|
|
106
|
-
<h1>{this.props.intl.formatMessage(messages.Sitemap)} </h1>
|
|
107
110
|
{items && this.renderItems(items)}
|
|
108
111
|
</Container>
|
|
109
112
|
</div>
|
|
@@ -21,6 +21,7 @@ import { hasBlocksData, getBaseUrl } from '@plone/volto/helpers';
|
|
|
21
21
|
import { useDispatch, useSelector } from 'react-redux';
|
|
22
22
|
import { RenderBlocks } from '@plone/volto/components';
|
|
23
23
|
import ContextNavigation from '@plone/volto/components/theme/Navigation/ContextNavigation';
|
|
24
|
+
import { BannerTitle } from '@eeacms/volto-cca-policy/components';
|
|
24
25
|
|
|
25
26
|
import { isEqual } from 'lodash';
|
|
26
27
|
|
|
@@ -83,6 +84,7 @@ const DefaultView = (props) => {
|
|
|
83
84
|
<Container id="page-document">
|
|
84
85
|
<Grid>
|
|
85
86
|
<Grid.Column width={12 - gridColumns}>
|
|
87
|
+
<BannerTitle {...props} />
|
|
86
88
|
<RenderBlocks {...props} path={path} />
|
|
87
89
|
</Grid.Column>
|
|
88
90
|
<Grid.Column width={gridColumns}>
|
|
@@ -101,6 +103,7 @@ const DefaultView = (props) => {
|
|
|
101
103
|
</Container>
|
|
102
104
|
) : (
|
|
103
105
|
<Container id="page-document">
|
|
106
|
+
<BannerTitle {...props} />
|
|
104
107
|
<RenderBlocks {...props} path={path} />
|
|
105
108
|
</Container>
|
|
106
109
|
)
|
package/src/helpers/Utils.jsx
CHANGED
|
@@ -77,22 +77,20 @@ export const BannerTitle = (props) => {
|
|
|
77
77
|
const TitleBlockView = blocksConfig?.title?.view;
|
|
78
78
|
|
|
79
79
|
return (
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
/>
|
|
95
|
-
</>
|
|
80
|
+
<TitleBlockView
|
|
81
|
+
{...props}
|
|
82
|
+
data={{
|
|
83
|
+
info: [{ description: '' }],
|
|
84
|
+
hideContentType: true,
|
|
85
|
+
hideCreationDate: false,
|
|
86
|
+
hideModificationDate: false,
|
|
87
|
+
hidePublishingDate: false,
|
|
88
|
+
hideDownloadButton: false,
|
|
89
|
+
hideShareButton: false,
|
|
90
|
+
subtitle: type,
|
|
91
|
+
}}
|
|
92
|
+
metadata={content}
|
|
93
|
+
/>
|
|
96
94
|
);
|
|
97
95
|
};
|
|
98
96
|
|
|
@@ -120,7 +120,7 @@ div.geochars-field {
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
div.share-info {
|
|
123
|
-
margin-top:
|
|
123
|
+
margin-top: 2.5em;
|
|
124
124
|
text-align: right;
|
|
125
125
|
}
|
|
126
126
|
|
|
@@ -205,8 +205,8 @@ body.subsite {
|
|
|
205
205
|
body.searchlib-page .searchlib-block {
|
|
206
206
|
.ui.secondary.pointing.content-section-tabs.menu {
|
|
207
207
|
.active.item .tab-icon .count {
|
|
208
|
-
background-color: @ccaGreenColor;
|
|
209
208
|
border-color: @ccaGreenColor;
|
|
209
|
+
background-color: @ccaGreenColor;
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
212
|
}
|
|
@@ -223,9 +223,9 @@ body.searchlib-page .searchlib-block {
|
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
#page-header .styled-group.has--useAsPageHeader--true {
|
|
226
|
-
margin-left: auto;
|
|
227
|
-
margin-right: auto;
|
|
228
226
|
width: 100%;
|
|
227
|
+
margin-right: auto;
|
|
228
|
+
margin-left: auto;
|
|
229
229
|
}
|
|
230
230
|
|
|
231
231
|
#toolbar .toolbar-content {
|