@eeacms/volto-eea-website-theme 0.5.2 → 0.5.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.
- package/CHANGELOG.md +11 -0
- package/package.json +1 -1
- package/src/components/manage/Blocks/Title/Edit.jsx +2 -3
- package/src/components/manage/Blocks/Title/schema.js +6 -6
- package/src/components/theme/Banner/Banner.jsx +3 -0
- package/src/components/theme/Banner/View.jsx +24 -28
- package/src/components/theme/DraftBackground/draft.css +1 -1
- package/src/customizations/volto/components/manage/Form/Form.jsx +775 -0
- package/src/customizations/volto/components/manage/Form/ModalForm.jsx +321 -0
- package/src/customizations/volto/components/manage/Sharing/Sharing.jsx +478 -0
- package/src/customizations/volto/components/manage/Widgets/ObjectBrowserWidget.jsx +426 -0
package/CHANGELOG.md
CHANGED
@@ -4,8 +4,19 @@ 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.5.3](https://github.com/eea/volto-eea-website-theme/compare/0.5.2...0.5.3)
|
8
|
+
|
9
|
+
- Apply Draft bg only on View [`8910d78`](https://github.com/eea/volto-eea-website-theme/commit/8910d78baf0663d9eb820a3846ae24dea8eaa674)
|
10
|
+
- lint fixes [`ffc9edd`](https://github.com/eea/volto-eea-website-theme/commit/ffc9edd7dd90033d9ed8ccbe17c5327e68128b6f)
|
11
|
+
- change(buttons): customized Form, Sharing and ObjectBrowserWidget.jsx [`c307131`](https://github.com/eea/volto-eea-website-theme/commit/c307131f911dc05c2a9ef7d9c79357cd85de0fc4)
|
12
|
+
- change(ModalForm): added circular class to modal action buttons [`c418021`](https://github.com/eea/volto-eea-website-theme/commit/c418021da30aee28113edecea53ebd9d2316dfcd)
|
13
|
+
- Improved Title block banner + add social icons [`eeb049b`](https://github.com/eea/volto-eea-website-theme/commit/eeb049bb02146a48949b8ff5f5d09727e99fe192)
|
14
|
+
|
7
15
|
#### [0.5.2](https://github.com/eea/volto-eea-website-theme/compare/0.5.1...0.5.2)
|
8
16
|
|
17
|
+
> 8 April 2022
|
18
|
+
|
19
|
+
- Release [`#22`](https://github.com/eea/volto-eea-website-theme/pull/22)
|
9
20
|
- fix(banner): Friendly name for content-type if not available via RestAPI [`e9ea96f`](https://github.com/eea/volto-eea-website-theme/commit/e9ea96f3d74998e9d4e5ee9494183cdd40500666)
|
10
21
|
- Small fix on replace all [`98fe72e`](https://github.com/eea/volto-eea-website-theme/commit/98fe72e4493aa322b704da1ddff91ee5021b66ce)
|
11
22
|
- Make '@type' friendly in Page header [`9d15a78`](https://github.com/eea/volto-eea-website-theme/commit/9d15a78d445482ffe58b14839a2176b82c55bf71)
|
package/package.json
CHANGED
@@ -53,19 +53,18 @@ export const TitleBlockEdit = (props) => {
|
|
53
53
|
onFocusNextBlock,
|
54
54
|
block,
|
55
55
|
blockNode,
|
56
|
-
properties,
|
57
|
-
metadata,
|
58
56
|
data,
|
59
57
|
detached,
|
60
58
|
editable,
|
61
59
|
} = props;
|
60
|
+
const metadata = props.metadata || props.properties;
|
62
61
|
|
63
62
|
const editor = useMemo(() => withReact(createEditor()), []);
|
64
63
|
const intl = useIntl();
|
65
64
|
|
66
65
|
const disableNewBlocks = data.disableNewBlocks || detached;
|
67
66
|
|
68
|
-
const text = metadata?.['title'] ||
|
67
|
+
const text = metadata?.['title'] || '';
|
69
68
|
|
70
69
|
const handleChange = useCallback(
|
71
70
|
(value) => {
|
@@ -1,5 +1,5 @@
|
|
1
|
-
const
|
2
|
-
title: '
|
1
|
+
const infoSchema = {
|
2
|
+
title: 'Info',
|
3
3
|
fieldsets: [
|
4
4
|
{
|
5
5
|
id: 'default',
|
@@ -27,7 +27,7 @@ export default {
|
|
27
27
|
'hideCreationDate',
|
28
28
|
'hidePublishingDate',
|
29
29
|
'hideModificationDate',
|
30
|
-
'
|
30
|
+
'info',
|
31
31
|
],
|
32
32
|
},
|
33
33
|
{
|
@@ -66,10 +66,10 @@ export default {
|
|
66
66
|
title: 'Hide download button',
|
67
67
|
type: 'boolean',
|
68
68
|
},
|
69
|
-
|
70
|
-
title: 'Extra
|
69
|
+
info: {
|
70
|
+
title: 'Extra info',
|
71
71
|
widget: 'object_list',
|
72
|
-
schema:
|
72
|
+
schema: infoSchema,
|
73
73
|
},
|
74
74
|
// contentType: {
|
75
75
|
// title: 'Type',
|
@@ -16,6 +16,9 @@ const socialPlatforms = {
|
|
16
16
|
shareLink: (url) =>
|
17
17
|
`https://www.linkedin.com/sharing/share-offsite/?url=${url}`,
|
18
18
|
},
|
19
|
+
reddit: {
|
20
|
+
shareLink: (url, title) => `https://reddit.com/submit?url=${url}`,
|
21
|
+
},
|
19
22
|
};
|
20
23
|
|
21
24
|
export const getImageSource = (image) => {
|
@@ -74,17 +74,10 @@ const Title = ({ config = {}, properties }) => {
|
|
74
74
|
};
|
75
75
|
|
76
76
|
const View = (props) => {
|
77
|
+
const { banner = {}, moment, fluid, intl, location, types = [] } = props;
|
78
|
+
const metadata = props.metadata || props.properties;
|
77
79
|
const {
|
78
|
-
|
79
|
-
properties,
|
80
|
-
moment,
|
81
|
-
fluid,
|
82
|
-
intl,
|
83
|
-
location,
|
84
|
-
types = [],
|
85
|
-
} = props;
|
86
|
-
const {
|
87
|
-
metadata = [],
|
80
|
+
info = [],
|
88
81
|
hideContentType,
|
89
82
|
hideCreationDate,
|
90
83
|
hidePublishingDate,
|
@@ -101,11 +94,9 @@ const View = (props) => {
|
|
101
94
|
// Set dates
|
102
95
|
const getDate = useCallback(
|
103
96
|
(hidden, key) => {
|
104
|
-
return !hidden &&
|
105
|
-
? moment.default(properties[key])
|
106
|
-
: null;
|
97
|
+
return !hidden && metadata[key] ? moment.default(metadata[key]) : null;
|
107
98
|
},
|
108
|
-
[moment,
|
99
|
+
[moment, metadata],
|
109
100
|
);
|
110
101
|
const creationDate = useMemo(() => getDate(hideCreationDate, 'created'), [
|
111
102
|
getDate,
|
@@ -120,20 +111,20 @@ const View = (props) => {
|
|
120
111
|
[getDate, hideModificationDate],
|
121
112
|
);
|
122
113
|
// Set image source
|
123
|
-
const image = getImageSource(
|
114
|
+
const image = getImageSource(metadata['image']);
|
124
115
|
// Get type
|
125
116
|
const type = useMemo(() => {
|
126
117
|
return (
|
127
118
|
types.filter(
|
128
119
|
(type) =>
|
129
120
|
flattenToAppURL(type['@id']) ===
|
130
|
-
`/@types/${
|
121
|
+
`/@types/${metadata['@type'] || parameters.type}`,
|
131
122
|
)[0]?.title ||
|
132
|
-
friendlyId(
|
133
|
-
|
123
|
+
friendlyId(metadata['@type']) ||
|
124
|
+
metadata['@type'] ||
|
134
125
|
parameters.type
|
135
126
|
);
|
136
|
-
}, [types,
|
127
|
+
}, [types, metadata, parameters]);
|
137
128
|
|
138
129
|
return (
|
139
130
|
<Banner {...props}>
|
@@ -155,25 +146,30 @@ const View = (props) => {
|
|
155
146
|
<div className="actions">
|
156
147
|
<Banner.Action
|
157
148
|
icon="ri-facebook-fill"
|
158
|
-
color="blue"
|
159
149
|
onClick={() => {
|
160
|
-
sharePage(
|
150
|
+
sharePage(metadata['@id'], 'facebook');
|
161
151
|
}}
|
162
152
|
/>
|
163
153
|
<Banner.Action
|
164
154
|
icon="ri-twitter-fill"
|
165
|
-
color="blue"
|
166
155
|
onClick={() => {
|
167
|
-
sharePage(
|
156
|
+
sharePage(metadata['@id'], 'twitter');
|
168
157
|
}}
|
169
158
|
/>
|
170
159
|
<Banner.Action
|
171
160
|
icon="ri-linkedin-fill"
|
172
|
-
color="blue"
|
173
161
|
onClick={() => {
|
174
|
-
sharePage(
|
162
|
+
sharePage(metadata['@id'], 'linkedin');
|
163
|
+
}}
|
164
|
+
/>
|
165
|
+
<Banner.Action icon="blogger b" />
|
166
|
+
<Banner.Action
|
167
|
+
icon="ri-reddit-line"
|
168
|
+
onClick={() => {
|
169
|
+
sharePage(metadata['@id'], 'reddit');
|
175
170
|
}}
|
176
171
|
/>
|
172
|
+
<Banner.Action icon="stumbleupon circle" />
|
177
173
|
</div>
|
178
174
|
</>
|
179
175
|
)}
|
@@ -202,7 +198,7 @@ const View = (props) => {
|
|
202
198
|
</>
|
203
199
|
}
|
204
200
|
>
|
205
|
-
<Title config={banner.title} properties={
|
201
|
+
<Title config={banner.title} properties={metadata} />
|
206
202
|
<Banner.Metadata>
|
207
203
|
<Banner.MetadataField
|
208
204
|
type="type"
|
@@ -228,9 +224,9 @@ const View = (props) => {
|
|
228
224
|
value={modificationDate}
|
229
225
|
title={`${intl.formatMessage(messages.modified_on)} {}`}
|
230
226
|
/>
|
231
|
-
{
|
227
|
+
{info.map((item, index) => (
|
232
228
|
<Banner.MetadataField
|
233
|
-
key={`header-
|
229
|
+
key={`header-info-${index}`}
|
234
230
|
value={item.description}
|
235
231
|
/>
|
236
232
|
))}
|