@eeacms/volto-bise-policy 1.0.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/.coverage.babel.config.js +9 -0
- package/.i18n.babel.config.js +1 -0
- package/.project.eslintrc.js +47 -0
- package/.release-it.json +17 -0
- package/CHANGELOG.md +27 -0
- package/DEVELOP.md +53 -0
- package/LICENSE.md +9 -0
- package/README.md +84 -0
- package/RELEASE.md +74 -0
- package/babel.config.js +17 -0
- package/bootstrap +41 -0
- package/cypress.config.js +27 -0
- package/jest-addon.config.js +36 -0
- package/locales/bg/LC_MESSAGES/volto.po +14 -0
- package/locales/bg.json +1 -0
- package/locales/bs/LC_MESSAGES/volto.po +14 -0
- package/locales/bs.json +1 -0
- package/locales/cs/LC_MESSAGES/volto.po +14 -0
- package/locales/cs.json +1 -0
- package/locales/da/LC_MESSAGES/volto.po +14 -0
- package/locales/da.json +1 -0
- package/locales/de/LC_MESSAGES/volto.po +29 -0
- package/locales/de.json +1 -0
- package/locales/el/LC_MESSAGES/volto.po +14 -0
- package/locales/el.json +1 -0
- package/locales/en/LC_MESSAGES/volto.po +14 -0
- package/locales/en.json +1 -0
- package/locales/es/LC_MESSAGES/volto.po +24 -0
- package/locales/es.json +1 -0
- package/locales/et/LC_MESSAGES/volto.po +14 -0
- package/locales/et.json +1 -0
- package/locales/eu/LC_MESSAGES/volto.po +19 -0
- package/locales/eu.json +1 -0
- package/locales/fi/LC_MESSAGES/volto.po +14 -0
- package/locales/fi.json +1 -0
- package/locales/fr/LC_MESSAGES/volto.po +29 -0
- package/locales/fr.json +1 -0
- package/locales/ga/LC_MESSAGES/volto.po +14 -0
- package/locales/ga.json +1 -0
- package/locales/hr/LC_MESSAGES/volto.po +14 -0
- package/locales/hr.json +1 -0
- package/locales/hu/LC_MESSAGES/volto.po +14 -0
- package/locales/hu.json +1 -0
- package/locales/is/LC_MESSAGES/volto.po +14 -0
- package/locales/is.json +1 -0
- package/locales/it/LC_MESSAGES/volto.po +14 -0
- package/locales/it.json +1 -0
- package/locales/ja/LC_MESSAGES/volto.po +21 -0
- package/locales/ja.json +1 -0
- package/locales/lt/LC_MESSAGES/volto.po +14 -0
- package/locales/lt.json +1 -0
- package/locales/lv/LC_MESSAGES/volto.po +14 -0
- package/locales/lv.json +1 -0
- package/locales/mk/LC_MESSAGES/volto.po +14 -0
- package/locales/mk.json +1 -0
- package/locales/mt/LC_MESSAGES/volto.po +14 -0
- package/locales/mt.json +1 -0
- package/locales/nl/LC_MESSAGES/volto.po +33 -0
- package/locales/nl.json +1 -0
- package/locales/no/LC_MESSAGES/volto.po +14 -0
- package/locales/no.json +1 -0
- package/locales/pl/LC_MESSAGES/volto.po +14 -0
- package/locales/pl.json +1 -0
- package/locales/pt/LC_MESSAGES/volto.po +22 -0
- package/locales/pt.json +1 -0
- package/locales/pt_BR/LC_MESSAGES/volto.po +20 -0
- package/locales/pt_BR.json +1 -0
- package/locales/ro/LC_MESSAGES/volto.po +20 -0
- package/locales/ro.json +1 -0
- package/locales/sh/LC_MESSAGES/volto.po +14 -0
- package/locales/sh.json +1 -0
- package/locales/sk/LC_MESSAGES/volto.po +14 -0
- package/locales/sk.json +1 -0
- package/locales/sl/LC_MESSAGES/volto.po +14 -0
- package/locales/sl.json +1 -0
- package/locales/sq/LC_MESSAGES/volto.po +14 -0
- package/locales/sq.json +1 -0
- package/locales/sv/LC_MESSAGES/volto.po +14 -0
- package/locales/sv.json +1 -0
- package/locales/tr/LC_MESSAGES/volto.po +14 -0
- package/locales/tr.json +1 -0
- package/locales/volto.pot +16 -0
- package/package.json +57 -0
- package/razzle.extend.js +29 -0
- package/src/components/manage/Blocks/BodyClass/Edit.jsx +30 -0
- package/src/components/manage/Blocks/BodyClass/View.jsx +12 -0
- package/src/components/manage/Blocks/BodyClass/index.js +24 -0
- package/src/components/manage/Blocks/BodyClass/schema.js +20 -0
- package/src/components/manage/Blocks/FactsheetsListing/FactsheetsListingEdit.jsx +32 -0
- package/src/components/manage/Blocks/FactsheetsListing/FactsheetsListingView.jsx +81 -0
- package/src/components/manage/Blocks/FactsheetsListing/index.js +24 -0
- package/src/components/manage/Blocks/FactsheetsListing/schema.js +20 -0
- package/src/components/manage/Blocks/KeyFacts/KeyFactsEdit.jsx +34 -0
- package/src/components/manage/Blocks/KeyFacts/KeyFactsView.jsx +68 -0
- package/src/components/manage/Blocks/KeyFacts/index.js +22 -0
- package/src/components/manage/Blocks/KeyFacts/schema.jsx +74 -0
- package/src/components/manage/Blocks/MaesViewer/MaesViewerEdit.jsx +64 -0
- package/src/components/manage/Blocks/MaesViewer/MaesViewerView.jsx +136 -0
- package/src/components/manage/Blocks/MaesViewer/constants.js +1 -0
- package/src/components/manage/Blocks/MaesViewer/index.js +22 -0
- package/src/components/manage/Blocks/MaesViewer/schema.js +60 -0
- package/src/components/manage/Blocks/MaesViewer/style.css +64 -0
- package/src/components/manage/Blocks/MaesViewer/utils.js +473 -0
- package/src/components/manage/Blocks/Navigation/Edit.jsx +27 -0
- package/src/components/manage/Blocks/Navigation/View.jsx +43 -0
- package/src/components/manage/Blocks/Navigation/index.js +22 -0
- package/src/components/manage/Blocks/Navigation/schema.js +43 -0
- package/src/components/manage/Blocks/Navigation/styles.less +42 -0
- package/src/components/manage/Blocks/Redirect/Edit.jsx +29 -0
- package/src/components/manage/Blocks/Redirect/View.jsx +13 -0
- package/src/components/manage/Blocks/Redirect/index.js +24 -0
- package/src/components/manage/Blocks/Redirect/schema.js +20 -0
- package/src/components/manage/Blocks/index.js +17 -0
- package/src/components/manage/Styles/index.js +163 -0
- package/src/customizations/@eeacms/volto-block-style/StyleWrapper/schema.js +206 -0
- package/src/customizations/volto/components/manage/Toolbar/More.jsx +547 -0
- package/src/customizations/volto/components/theme/Footer/Footer.jsx +25 -0
- package/src/customizations/volto/components/theme/Header/Header.jsx +301 -0
- package/src/index.js +77 -0
- package/theme/assets/icons/plus.png +0 -0
- package/theme/assets/icons/plus.svg +6 -0
- package/theme/assets/icons/search.svg +3 -0
- package/theme/assets/images/Header/bise-logo-white.svg +47 -0
- package/theme/assets/images/Header/bise-logo.svg +132 -0
- package/theme/collections/table.variables +17 -0
- package/theme/extras/banner.variables +5 -0
- package/theme/extras/factsheets.less +76 -0
- package/theme/extras/footer.variables +6 -0
- package/theme/extras/header.overrides +30 -0
- package/theme/extras/header.variables +7 -0
- package/theme/extras/hero.overrides +4 -0
- package/theme/extras/inpageNavigation.variables +5 -0
- package/theme/extras/keyfacts.less +202 -0
- package/theme/extras/pluggables.less +191 -0
- package/theme/extras/stylemenu.less +48 -0
- package/theme/extras/tocnav.less +158 -0
- package/theme/globals/site.overrides +78 -0
- package/theme/globals/site.variables +22 -0
- package/theme/theme.config +135 -0
- package/theme/tokens/colors.less +15 -0
- package/theme/tokens/tokens.less +1 -0
|
@@ -0,0 +1,547 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* More component.
|
|
3
|
+
* @module components/manage/Toolbar/More
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import React, { Component } from 'react';
|
|
7
|
+
import { defineMessages, injectIntl } from 'react-intl';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
9
|
+
import { connect } from 'react-redux';
|
|
10
|
+
import { compose } from 'redux';
|
|
11
|
+
import { Link, withRouter } from 'react-router-dom';
|
|
12
|
+
import { find } from 'lodash';
|
|
13
|
+
import { toast } from 'react-toastify';
|
|
14
|
+
import { Toast } from '@plone/volto/components';
|
|
15
|
+
import { Pluggable, Plug } from '@plone/volto/components/manage/Pluggable';
|
|
16
|
+
import {
|
|
17
|
+
FormattedDate,
|
|
18
|
+
Icon,
|
|
19
|
+
Display,
|
|
20
|
+
Workflow,
|
|
21
|
+
} from '@plone/volto/components';
|
|
22
|
+
import {
|
|
23
|
+
applyWorkingCopy,
|
|
24
|
+
createWorkingCopy,
|
|
25
|
+
removeWorkingCopy,
|
|
26
|
+
} from '@plone/volto/actions';
|
|
27
|
+
import { flattenToAppURL, getBaseUrl } from '@plone/volto/helpers';
|
|
28
|
+
import config from '@plone/volto/registry';
|
|
29
|
+
|
|
30
|
+
import rightArrowSVG from '@plone/volto/icons/right-key.svg';
|
|
31
|
+
import userSVG from '@plone/volto/icons/user.svg';
|
|
32
|
+
import applySVG from '@plone/volto/icons/ready.svg';
|
|
33
|
+
import removeSVG from '@plone/volto/icons/circle-dismiss.svg';
|
|
34
|
+
|
|
35
|
+
const messages = defineMessages({
|
|
36
|
+
personalTools: {
|
|
37
|
+
id: 'Personal tools',
|
|
38
|
+
defaultMessage: 'Personal tools',
|
|
39
|
+
},
|
|
40
|
+
history: {
|
|
41
|
+
id: 'History',
|
|
42
|
+
defaultMessage: 'History',
|
|
43
|
+
},
|
|
44
|
+
sharing: {
|
|
45
|
+
id: 'Sharing',
|
|
46
|
+
defaultMessage: 'Sharing',
|
|
47
|
+
},
|
|
48
|
+
rules: {
|
|
49
|
+
id: 'Rules',
|
|
50
|
+
defaultMessage: 'Rules',
|
|
51
|
+
},
|
|
52
|
+
aliases: {
|
|
53
|
+
id: 'URL Management',
|
|
54
|
+
defaultMessage: 'URL Management',
|
|
55
|
+
},
|
|
56
|
+
ManageTranslations: {
|
|
57
|
+
id: 'Manage Translations',
|
|
58
|
+
defaultMessage: 'Manage Translations',
|
|
59
|
+
},
|
|
60
|
+
manageContent: {
|
|
61
|
+
id: 'Manage content…',
|
|
62
|
+
defaultMessage: 'Manage content…',
|
|
63
|
+
},
|
|
64
|
+
CreateWorkingCopy: {
|
|
65
|
+
id: 'Create working copy',
|
|
66
|
+
defaultMessage: 'Create working copy',
|
|
67
|
+
},
|
|
68
|
+
applyWorkingCopy: {
|
|
69
|
+
id: 'Apply working copy',
|
|
70
|
+
defaultMessage: 'Apply working copy',
|
|
71
|
+
},
|
|
72
|
+
removeWorkingCopy: {
|
|
73
|
+
id: 'Remove working copy',
|
|
74
|
+
defaultMessage: 'Remove working copy',
|
|
75
|
+
},
|
|
76
|
+
viewWorkingCopy: {
|
|
77
|
+
id: 'View working copy',
|
|
78
|
+
defaultMessage: 'View working copy',
|
|
79
|
+
},
|
|
80
|
+
workingAppliedTitle: {
|
|
81
|
+
id: 'Changes applied.',
|
|
82
|
+
defaultMessage: 'Changes applied',
|
|
83
|
+
},
|
|
84
|
+
workingCopyAppliedBy: {
|
|
85
|
+
id:
|
|
86
|
+
'Made by {creator} on {date}. This is not a working copy anymore, but the main content.',
|
|
87
|
+
defaultMessage:
|
|
88
|
+
'Made by {creator} on {date}. This is not a working copy anymore, but the main content.',
|
|
89
|
+
},
|
|
90
|
+
workingCopyRemovedTitle: {
|
|
91
|
+
id: 'The working copy was discarded',
|
|
92
|
+
defaultMessage: 'The working copy was discarded',
|
|
93
|
+
},
|
|
94
|
+
Unauthorized: {
|
|
95
|
+
id: 'Unauthorized',
|
|
96
|
+
defaultMessage: 'Unauthorized',
|
|
97
|
+
},
|
|
98
|
+
workingCopyErrorUnauthorized: {
|
|
99
|
+
id: 'workingCopyErrorUnauthorized',
|
|
100
|
+
defaultMessage: 'You are not authorized to perform this operation.',
|
|
101
|
+
},
|
|
102
|
+
Error: {
|
|
103
|
+
id: 'Error',
|
|
104
|
+
defaultMessage: 'Error',
|
|
105
|
+
},
|
|
106
|
+
workingCopyGenericError: {
|
|
107
|
+
id: 'workingCopyGenericError',
|
|
108
|
+
defaultMessage: 'An error occurred while performing this operation.',
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* More container class.
|
|
114
|
+
* @class More
|
|
115
|
+
* @extends Component
|
|
116
|
+
*/
|
|
117
|
+
class More extends Component {
|
|
118
|
+
static propTypes = {
|
|
119
|
+
actions: PropTypes.shape({
|
|
120
|
+
object: PropTypes.arrayOf(PropTypes.object),
|
|
121
|
+
object_buttons: PropTypes.arrayOf(PropTypes.object),
|
|
122
|
+
user: PropTypes.arrayOf(PropTypes.object),
|
|
123
|
+
}),
|
|
124
|
+
pathname: PropTypes.string.isRequired,
|
|
125
|
+
content: PropTypes.shape({
|
|
126
|
+
title: PropTypes.string,
|
|
127
|
+
'@type': PropTypes.string,
|
|
128
|
+
is_folderish: PropTypes.bool,
|
|
129
|
+
review_state: PropTypes.string,
|
|
130
|
+
}),
|
|
131
|
+
loadComponent: PropTypes.func.isRequired,
|
|
132
|
+
closeMenu: PropTypes.func.isRequired,
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Default properties.
|
|
137
|
+
* @property {Object} defaultProps Default properties.
|
|
138
|
+
* @static
|
|
139
|
+
*/
|
|
140
|
+
static defaultProps = {
|
|
141
|
+
actions: null,
|
|
142
|
+
content: null,
|
|
143
|
+
};
|
|
144
|
+
state = {
|
|
145
|
+
openManageTranslations: false,
|
|
146
|
+
pushed: false,
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
push = (selector) => {
|
|
150
|
+
this.setState(() => ({
|
|
151
|
+
pushed: true,
|
|
152
|
+
}));
|
|
153
|
+
this.props.loadComponent(selector);
|
|
154
|
+
document.removeEventListener('mousedown', this.handleClickOutside, false);
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
componentDidUpdate(prevProps, prevState) {
|
|
158
|
+
let erroredAction = '';
|
|
159
|
+
if (
|
|
160
|
+
prevProps.workingCopy.apply.loading &&
|
|
161
|
+
this.props.workingCopy.apply.error
|
|
162
|
+
) {
|
|
163
|
+
erroredAction = 'apply';
|
|
164
|
+
} else if (
|
|
165
|
+
prevProps.workingCopy.create.loading &&
|
|
166
|
+
this.props.workingCopy.create.error
|
|
167
|
+
) {
|
|
168
|
+
erroredAction = 'create';
|
|
169
|
+
} else if (
|
|
170
|
+
prevProps.workingCopy.remove.loading &&
|
|
171
|
+
this.props.workingCopy.remove.error
|
|
172
|
+
) {
|
|
173
|
+
erroredAction = 'remove';
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
if (erroredAction) {
|
|
177
|
+
const errorStatus = this.props.workingCopy[erroredAction].error.status;
|
|
178
|
+
if (errorStatus === 401 || errorStatus === 403) {
|
|
179
|
+
toast.error(
|
|
180
|
+
<Toast
|
|
181
|
+
error
|
|
182
|
+
title={this.props.intl.formatMessage(messages.Unauthorized)}
|
|
183
|
+
content={this.props.intl.formatMessage(
|
|
184
|
+
messages.workingCopyErrorUnauthorized,
|
|
185
|
+
)}
|
|
186
|
+
/>,
|
|
187
|
+
{
|
|
188
|
+
toastId: 'workingCopyErrorUnauthorized',
|
|
189
|
+
autoClose: 10000,
|
|
190
|
+
},
|
|
191
|
+
);
|
|
192
|
+
} else {
|
|
193
|
+
toast.error(
|
|
194
|
+
<Toast
|
|
195
|
+
error
|
|
196
|
+
title={this.props.intl.formatMessage(messages.Error)}
|
|
197
|
+
content={this.props.intl.formatMessage(
|
|
198
|
+
messages.workingCopyGenericError,
|
|
199
|
+
)}
|
|
200
|
+
/>,
|
|
201
|
+
{
|
|
202
|
+
toastId: 'workingCopyGenericError',
|
|
203
|
+
autoClose: 10000,
|
|
204
|
+
},
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Render method.
|
|
212
|
+
* @method render
|
|
213
|
+
* @returns {string} Markup for the component.
|
|
214
|
+
*/
|
|
215
|
+
render() {
|
|
216
|
+
const path = getBaseUrl(this.props.pathname);
|
|
217
|
+
const editAction = find(this.props.actions.object, { id: 'edit' });
|
|
218
|
+
const historyAction = find(this.props.actions.object, { id: 'history' });
|
|
219
|
+
const sharingAction = find(this.props.actions.object, {
|
|
220
|
+
id: 'local_roles',
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
const rulesAction = find(this.props.actions.object, {
|
|
224
|
+
id: 'contentrules',
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
const aliasesAction = find(this.props.actions.object_buttons, {
|
|
228
|
+
id: 'redirection',
|
|
229
|
+
});
|
|
230
|
+
const { content, intl } = this.props;
|
|
231
|
+
|
|
232
|
+
const dateOptions = {
|
|
233
|
+
year: 'numeric',
|
|
234
|
+
month: 'long',
|
|
235
|
+
day: 'numeric',
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
const isMultilingual =
|
|
239
|
+
config.settings.isMultilingual ||
|
|
240
|
+
(this.props.subsite &&
|
|
241
|
+
config.settings.bise.multilingualSubsites.includes(
|
|
242
|
+
flattenToAppURL(this.props.subsite['@id']),
|
|
243
|
+
));
|
|
244
|
+
|
|
245
|
+
return (
|
|
246
|
+
<div
|
|
247
|
+
className="menu-more pastanaga-menu"
|
|
248
|
+
style={{
|
|
249
|
+
flex: this.props.theToolbar.current
|
|
250
|
+
? `0 0 ${
|
|
251
|
+
this.props.theToolbar.current.getBoundingClientRect().width
|
|
252
|
+
}px`
|
|
253
|
+
: null,
|
|
254
|
+
}}
|
|
255
|
+
>
|
|
256
|
+
<header>
|
|
257
|
+
<h2>{this.props.content.title}</h2>
|
|
258
|
+
<button
|
|
259
|
+
className="more-user"
|
|
260
|
+
aria-label={this.props.intl.formatMessage(messages.personalTools)}
|
|
261
|
+
onClick={() => this.push('personalTools')}
|
|
262
|
+
tabIndex={0}
|
|
263
|
+
>
|
|
264
|
+
<Icon
|
|
265
|
+
name={userSVG}
|
|
266
|
+
size="30px"
|
|
267
|
+
title={this.props.intl.formatMessage(messages.personalTools)}
|
|
268
|
+
/>
|
|
269
|
+
</button>
|
|
270
|
+
</header>
|
|
271
|
+
<div className="pastanaga-menu-list">
|
|
272
|
+
<ul>
|
|
273
|
+
<Pluggable name="toolbar-more-menu-list" />
|
|
274
|
+
<Plug pluggable="toolbar-more-menu-list" id="state">
|
|
275
|
+
{this.props.content['@type'] !== 'Plone Site' && (
|
|
276
|
+
// Plone Site does not have workflow
|
|
277
|
+
<li className="state-select">
|
|
278
|
+
<Workflow pathname={path} />
|
|
279
|
+
</li>
|
|
280
|
+
)}
|
|
281
|
+
</Plug>
|
|
282
|
+
<Plug pluggable="toolbar-more-menu-list" id="view">
|
|
283
|
+
{this.props.content['@type'] !== 'Plone Site' && (
|
|
284
|
+
// Plone Site does not have view (yet)
|
|
285
|
+
<li className="display-select">
|
|
286
|
+
{editAction && <Display pathname={path} />}
|
|
287
|
+
</li>
|
|
288
|
+
)}
|
|
289
|
+
</Plug>
|
|
290
|
+
<Plug pluggable="toolbar-more-menu-list" id="history">
|
|
291
|
+
{this.props.content['@type'] !== 'Plone Site' && (
|
|
292
|
+
// Plone Site does not have history (yet)
|
|
293
|
+
<li>
|
|
294
|
+
<Link to={`${path}/historyview`}>
|
|
295
|
+
<div>
|
|
296
|
+
<span className="pastanaga-menu-label">
|
|
297
|
+
{historyAction?.title ||
|
|
298
|
+
this.props.intl.formatMessage(messages.history)}
|
|
299
|
+
</span>
|
|
300
|
+
<span className="pastanaga-menu-value" />
|
|
301
|
+
</div>
|
|
302
|
+
<Icon name={rightArrowSVG} size="24px" />
|
|
303
|
+
</Link>
|
|
304
|
+
</li>
|
|
305
|
+
)}
|
|
306
|
+
</Plug>
|
|
307
|
+
<Plug pluggable="toolbar-more-menu-list" id="sharing">
|
|
308
|
+
{sharingAction && (
|
|
309
|
+
<li>
|
|
310
|
+
<Link to={`${path}/sharing`}>
|
|
311
|
+
{this.props.intl.formatMessage(messages.sharing)}
|
|
312
|
+
<Icon name={rightArrowSVG} size="24px" />
|
|
313
|
+
</Link>
|
|
314
|
+
</li>
|
|
315
|
+
)}
|
|
316
|
+
</Plug>
|
|
317
|
+
<Plug pluggable="toolbar-more-menu-list" id="aliases">
|
|
318
|
+
{aliasesAction && (
|
|
319
|
+
<li>
|
|
320
|
+
<Link to={`${path}/aliases`}>
|
|
321
|
+
{this.props.intl.formatMessage(messages.aliases)}
|
|
322
|
+
<Icon name={rightArrowSVG} size="24px" />
|
|
323
|
+
</Link>
|
|
324
|
+
</li>
|
|
325
|
+
)}
|
|
326
|
+
</Plug>
|
|
327
|
+
<Plug pluggable="toolbar-more-menu-list" id="rules">
|
|
328
|
+
{rulesAction && (
|
|
329
|
+
<li>
|
|
330
|
+
<Link to={`${path}/rules`}>
|
|
331
|
+
{this.props.intl.formatMessage(messages.rules)}
|
|
332
|
+
<Icon name={rightArrowSVG} size="24px" />
|
|
333
|
+
</Link>
|
|
334
|
+
</li>
|
|
335
|
+
)}
|
|
336
|
+
</Plug>
|
|
337
|
+
</ul>
|
|
338
|
+
</div>
|
|
339
|
+
<Pluggable name="toolbar-more-manage-content">
|
|
340
|
+
{(pluggables) => (
|
|
341
|
+
<>
|
|
342
|
+
{pluggables.length > 0 && (
|
|
343
|
+
<>
|
|
344
|
+
<header>
|
|
345
|
+
<h2>
|
|
346
|
+
{this.props.intl.formatMessage(messages.manageContent)}
|
|
347
|
+
</h2>
|
|
348
|
+
</header>
|
|
349
|
+
<div className="pastanaga-menu-list">
|
|
350
|
+
<ul>
|
|
351
|
+
{pluggables.map((p) => (
|
|
352
|
+
<>{p()}</>
|
|
353
|
+
))}
|
|
354
|
+
</ul>
|
|
355
|
+
</div>
|
|
356
|
+
</>
|
|
357
|
+
)}
|
|
358
|
+
</>
|
|
359
|
+
)}
|
|
360
|
+
</Pluggable>
|
|
361
|
+
{config.settings.hasWorkingCopySupport &&
|
|
362
|
+
this.props.content['@type'] !== 'Plone Site' && (
|
|
363
|
+
<>
|
|
364
|
+
{!this.props.content.working_copy && (
|
|
365
|
+
<Plug pluggable="toolbar-more-manage-content" id="workingcopy">
|
|
366
|
+
<li>
|
|
367
|
+
<button
|
|
368
|
+
aria-label={this.props.intl.formatMessage(
|
|
369
|
+
messages.CreateWorkingCopy,
|
|
370
|
+
)}
|
|
371
|
+
onClick={() => {
|
|
372
|
+
this.props.createWorkingCopy(path).then((response) => {
|
|
373
|
+
this.props.history.push(
|
|
374
|
+
flattenToAppURL(response['@id']),
|
|
375
|
+
);
|
|
376
|
+
this.props.closeMenu();
|
|
377
|
+
});
|
|
378
|
+
}}
|
|
379
|
+
>
|
|
380
|
+
{this.props.intl.formatMessage(
|
|
381
|
+
messages.CreateWorkingCopy,
|
|
382
|
+
)}
|
|
383
|
+
|
|
384
|
+
<Icon name={rightArrowSVG} size="24px" />
|
|
385
|
+
</button>
|
|
386
|
+
</li>
|
|
387
|
+
</Plug>
|
|
388
|
+
)}
|
|
389
|
+
{this.props.content.working_copy &&
|
|
390
|
+
this.props.content.working_copy_of && (
|
|
391
|
+
<Plug
|
|
392
|
+
pluggable="toolbar-more-manage-content"
|
|
393
|
+
id="workingcopy"
|
|
394
|
+
>
|
|
395
|
+
<li>
|
|
396
|
+
<button
|
|
397
|
+
aria-label={this.props.intl.formatMessage(
|
|
398
|
+
messages.applyWorkingCopy,
|
|
399
|
+
)}
|
|
400
|
+
onClick={() => {
|
|
401
|
+
this.props.applyWorkingCopy(path).then((response) => {
|
|
402
|
+
this.props.history.push(
|
|
403
|
+
flattenToAppURL(
|
|
404
|
+
this.props.content.working_copy_of['@id'],
|
|
405
|
+
),
|
|
406
|
+
);
|
|
407
|
+
this.props.closeMenu();
|
|
408
|
+
toast.info(
|
|
409
|
+
<Toast
|
|
410
|
+
info
|
|
411
|
+
title={intl.formatMessage(
|
|
412
|
+
messages.workingAppliedTitle,
|
|
413
|
+
)}
|
|
414
|
+
content={intl.formatMessage(
|
|
415
|
+
messages.workingCopyAppliedBy,
|
|
416
|
+
{
|
|
417
|
+
creator: content.working_copy?.creator_name,
|
|
418
|
+
date: (
|
|
419
|
+
<FormattedDate
|
|
420
|
+
date={content.working_copy?.created}
|
|
421
|
+
format={dateOptions}
|
|
422
|
+
/>
|
|
423
|
+
),
|
|
424
|
+
},
|
|
425
|
+
)}
|
|
426
|
+
/>,
|
|
427
|
+
{
|
|
428
|
+
toastId: 'workingcopyapplyinfo',
|
|
429
|
+
autoClose: 10000,
|
|
430
|
+
},
|
|
431
|
+
);
|
|
432
|
+
});
|
|
433
|
+
}}
|
|
434
|
+
>
|
|
435
|
+
{this.props.intl.formatMessage(
|
|
436
|
+
messages.applyWorkingCopy,
|
|
437
|
+
)}
|
|
438
|
+
|
|
439
|
+
<Icon
|
|
440
|
+
name={applySVG}
|
|
441
|
+
size="24px"
|
|
442
|
+
title={this.props.intl.formatMessage(
|
|
443
|
+
messages.applyWorkingCopy,
|
|
444
|
+
)}
|
|
445
|
+
/>
|
|
446
|
+
</button>
|
|
447
|
+
</li>
|
|
448
|
+
<li>
|
|
449
|
+
<button
|
|
450
|
+
aria-label={this.props.intl.formatMessage(
|
|
451
|
+
messages.removeWorkingCopy,
|
|
452
|
+
)}
|
|
453
|
+
onClick={() => {
|
|
454
|
+
this.props
|
|
455
|
+
.removeWorkingCopy(path)
|
|
456
|
+
.then((response) => {
|
|
457
|
+
this.props.history.push(
|
|
458
|
+
flattenToAppURL(
|
|
459
|
+
this.props.content.working_copy_of['@id'],
|
|
460
|
+
),
|
|
461
|
+
);
|
|
462
|
+
this.props.closeMenu();
|
|
463
|
+
toast.info(
|
|
464
|
+
<Toast
|
|
465
|
+
info
|
|
466
|
+
title={intl.formatMessage(
|
|
467
|
+
messages.workingCopyRemovedTitle,
|
|
468
|
+
)}
|
|
469
|
+
/>,
|
|
470
|
+
{
|
|
471
|
+
toastId: 'workingcopyremovednotice',
|
|
472
|
+
autoClose: 10000,
|
|
473
|
+
},
|
|
474
|
+
);
|
|
475
|
+
});
|
|
476
|
+
}}
|
|
477
|
+
>
|
|
478
|
+
{this.props.intl.formatMessage(
|
|
479
|
+
messages.removeWorkingCopy,
|
|
480
|
+
)}
|
|
481
|
+
|
|
482
|
+
<Icon
|
|
483
|
+
name={removeSVG}
|
|
484
|
+
size="24px"
|
|
485
|
+
color="#e40166"
|
|
486
|
+
title={this.props.intl.formatMessage(
|
|
487
|
+
messages.removeWorkingCopy,
|
|
488
|
+
)}
|
|
489
|
+
/>
|
|
490
|
+
</button>
|
|
491
|
+
</li>
|
|
492
|
+
</Plug>
|
|
493
|
+
)}
|
|
494
|
+
{this.props.content.working_copy &&
|
|
495
|
+
!this.props.content.working_copy_of && (
|
|
496
|
+
<Plug
|
|
497
|
+
pluggable="toolbar-more-manage-content"
|
|
498
|
+
id="workingcopy"
|
|
499
|
+
>
|
|
500
|
+
<li>
|
|
501
|
+
<Link
|
|
502
|
+
to={flattenToAppURL(
|
|
503
|
+
this.props.content.working_copy['@id'],
|
|
504
|
+
)}
|
|
505
|
+
onClick={() => this.props.closeMenu()}
|
|
506
|
+
>
|
|
507
|
+
{this.props.intl.formatMessage(
|
|
508
|
+
messages.viewWorkingCopy,
|
|
509
|
+
)}
|
|
510
|
+
<Icon name={rightArrowSVG} size="24px" />
|
|
511
|
+
</Link>
|
|
512
|
+
</li>
|
|
513
|
+
</Plug>
|
|
514
|
+
)}
|
|
515
|
+
</>
|
|
516
|
+
)}
|
|
517
|
+
{editAction && isMultilingual && (
|
|
518
|
+
<Plug pluggable="toolbar-more-manage-content" id="multilingual">
|
|
519
|
+
<li>
|
|
520
|
+
<Link to={`${path}/manage-translations`}>
|
|
521
|
+
{this.props.intl.formatMessage(messages.ManageTranslations)}
|
|
522
|
+
|
|
523
|
+
<Icon name={rightArrowSVG} size="24px" />
|
|
524
|
+
</Link>
|
|
525
|
+
</li>
|
|
526
|
+
</Plug>
|
|
527
|
+
)}
|
|
528
|
+
</div>
|
|
529
|
+
);
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
export default compose(
|
|
534
|
+
injectIntl,
|
|
535
|
+
withRouter,
|
|
536
|
+
connect(
|
|
537
|
+
(state, props) => ({
|
|
538
|
+
actions: state.actions.actions,
|
|
539
|
+
pathname: props.pathname,
|
|
540
|
+
content: state.content.data,
|
|
541
|
+
lang: state.intl.locale,
|
|
542
|
+
workingCopy: state.workingCopy,
|
|
543
|
+
subsite: state.content.data?.['@components']?.subsite,
|
|
544
|
+
}),
|
|
545
|
+
{ applyWorkingCopy, createWorkingCopy, removeWorkingCopy },
|
|
546
|
+
),
|
|
547
|
+
)(More);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Footer component.
|
|
3
|
+
* @module components/theme/Footer/Footer
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import EEAFooter from '@eeacms/volto-eea-design-system/ui/Footer/Footer';
|
|
8
|
+
import config from '@plone/volto/registry';
|
|
9
|
+
|
|
10
|
+
const Footer = (props) => {
|
|
11
|
+
const { eea } = config.settings;
|
|
12
|
+
return (
|
|
13
|
+
<EEAFooter>
|
|
14
|
+
<EEAFooter.SubFooter {...eea.footerOpts} />
|
|
15
|
+
<EEAFooter.Header>{eea.footerOpts.header}</EEAFooter.Header>
|
|
16
|
+
<EEAFooter.Sites sites={eea.footerOpts.sites} />
|
|
17
|
+
<EEAFooter.Actions
|
|
18
|
+
actions={eea.footerOpts.actions}
|
|
19
|
+
copyright={eea.footerOpts.copyright}
|
|
20
|
+
/>
|
|
21
|
+
</EEAFooter>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default Footer;
|