@eeacms/volto-eea-website-policy 1.9.2 → 1.11.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 +20 -5
- package/RELEASE.md +14 -14
- package/cypress.config.js +3 -3
- package/package.json +3 -3
- package/src/customizations/volto/components/manage/Toolbar/More.jsx +542 -0
- package/src/index.js +7 -3
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,26 @@ 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
|
+
### [1.11.0](https://github.com/eea/volto-eea-website-policy/compare/1.10.0...1.11.0) - 27 November 2023
|
|
8
|
+
|
|
9
|
+
#### :rocket: New Features
|
|
10
|
+
|
|
11
|
+
- feat: include data visualizations blocks - refs #261264 [Miu Razvan - [`5bfc1fb`](https://github.com/eea/volto-eea-website-policy/commit/5bfc1fb0deb6b17c4dadbe3c1ff0c35eb3b32bfd)]
|
|
12
|
+
|
|
13
|
+
#### :hammer_and_wrench: Others
|
|
14
|
+
|
|
15
|
+
- Release 1.11.0 [Alin Voinea - [`3249160`](https://github.com/eea/volto-eea-website-policy/commit/3249160422c6c6e0cf14823b614f8885101a847a)]
|
|
16
|
+
### [1.10.0](https://github.com/eea/volto-eea-website-policy/compare/1.9.2...1.10.0) - 2 November 2023
|
|
17
|
+
|
|
18
|
+
#### :rocket: New Features
|
|
19
|
+
|
|
20
|
+
- feat: remove working copy and translations for ims indicators - refs #258076 [dobri1408 - [`52d588d`](https://github.com/eea/volto-eea-website-policy/commit/52d588df35dc644eba1268309d95126700c0b6e5)]
|
|
21
|
+
|
|
22
|
+
#### :house: Internal changes
|
|
23
|
+
|
|
24
|
+
- chore: husky, lint-staged use fixed versions [valentinab25 - [`44ac62e`](https://github.com/eea/volto-eea-website-policy/commit/44ac62e6f8b7e5b7d57edfbf82812c91dc5d6bba)]
|
|
25
|
+
- chore:volto 16 in tests, update docs, fix stylelint overrides [valentinab25 - [`b9a46d8`](https://github.com/eea/volto-eea-website-policy/commit/b9a46d85a64739188a3df9e8cbe645418b5d8b0a)]
|
|
26
|
+
|
|
7
27
|
### [1.9.2](https://github.com/eea/volto-eea-website-policy/compare/1.9.1...1.9.2) - 29 September 2023
|
|
8
28
|
|
|
9
29
|
#### :house: Documentation changes
|
|
@@ -121,7 +141,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
121
141
|
|
|
122
142
|
- Release 1.5.0 [Alin Voinea - [`a3dea8e`](https://github.com/eea/volto-eea-website-policy/commit/a3dea8ea15cb8d2a876dc10da926ece3a5707ea9)]
|
|
123
143
|
- test(Jenkinsfile): Use latest stable volto for testing [Alin Voinea - [`a8f7123`](https://github.com/eea/volto-eea-website-policy/commit/a8f712364187f9638886667c249fa102cb49b5c0)]
|
|
124
|
-
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`124a8f8`](https://github.com/eea/volto-eea-website-policy/commit/124a8f8ad4ced507aeec27012d725f2e2b977e08)]
|
|
125
144
|
### [1.4.0](https://github.com/eea/volto-eea-website-policy/compare/1.3.4...1.4.0) - 21 February 2023
|
|
126
145
|
|
|
127
146
|
#### :rocket: New Features
|
|
@@ -201,7 +220,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
201
220
|
#### :hammer_and_wrench: Others
|
|
202
221
|
|
|
203
222
|
- Release 1.1.0 [Alin Voinea - [`0291b3b`](https://github.com/eea/volto-eea-website-policy/commit/0291b3bb7b4c6ab09ca98728885cea4051eac8e3)]
|
|
204
|
-
- yarn 3 [Alin Voinea - [`593aa58`](https://github.com/eea/volto-eea-website-policy/commit/593aa58eaa4d28aced0603b7f7dd125c857a6f54)]
|
|
205
223
|
### [1.0.4](https://github.com/eea/volto-eea-website-policy/compare/1.0.3...1.0.4) - 22 November 2022
|
|
206
224
|
|
|
207
225
|
#### :nail_care: Enhancements
|
|
@@ -247,7 +265,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
247
265
|
|
|
248
266
|
#### :hammer_and_wrench: Others
|
|
249
267
|
|
|
250
|
-
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`d153f54`](https://github.com/eea/volto-eea-website-policy/commit/d153f54e55e918fa4746e05488c734624eaf14a9)]
|
|
251
268
|
### [0.4.0](https://github.com/eea/volto-eea-website-policy/compare/0.3.3...0.4.0) - 19 September 2022
|
|
252
269
|
|
|
253
270
|
#### :hammer_and_wrench: Others
|
|
@@ -323,7 +340,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
323
340
|
- format index.js [Andrei Grigore - [`db4481a`](https://github.com/eea/volto-eea-website-policy/commit/db4481aeeba59a769272659f33278c902fc69bec)]
|
|
324
341
|
- Update index.js [Alexandru Ghica - [`dc09886`](https://github.com/eea/volto-eea-website-policy/commit/dc0988640a76a9914381b120f58bb61a9ab1eb39)]
|
|
325
342
|
- Added externalRoutes [Alexandru Ghica - [`b68135b`](https://github.com/eea/volto-eea-website-policy/commit/b68135b013fafa93a41ea602ea2fad30879abe0f)]
|
|
326
|
-
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`575cca6`](https://github.com/eea/volto-eea-website-policy/commit/575cca674602ca2e1c2a41300c47ba594ff49aa0)]
|
|
327
343
|
### [0.1.1](https://github.com/eea/volto-eea-website-policy/compare/0.1.0...0.1.1) - 4 March 2022
|
|
328
344
|
|
|
329
345
|
#### :hammer_and_wrench: Others
|
|
@@ -336,5 +352,4 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
336
352
|
|
|
337
353
|
#### :hammer_and_wrench: Others
|
|
338
354
|
|
|
339
|
-
- yarn bootstrap [Alin Voinea - [`9b4d197`](https://github.com/eea/volto-eea-website-policy/commit/9b4d197cbc7992566cb36524d190078d5ad21a44)]
|
|
340
355
|
- Initial commit [Alin Voinea - [`3800692`](https://github.com/eea/volto-eea-website-policy/commit/3800692f7a4de6460815bd6061facacb986cbef0)]
|
package/RELEASE.md
CHANGED
|
@@ -20,9 +20,9 @@ You need to first install the [release-it](https://github.com/release-it/release
|
|
|
20
20
|
```
|
|
21
21
|
npm install -g release-it
|
|
22
22
|
```
|
|
23
|
-
|
|
23
|
+
|
|
24
24
|
Release-it uses the configuration written in the [`.release-it.json`](./.release-it.json) file located in the root of the repository.
|
|
25
|
-
|
|
25
|
+
|
|
26
26
|
Release-it is a tool that automates 4 important steps in the release process:
|
|
27
27
|
|
|
28
28
|
1. Version increase in `package.json` ( increased from the current version in `package.json`)
|
|
@@ -30,45 +30,45 @@ Release-it is a tool that automates 4 important steps in the release process:
|
|
|
30
30
|
3. GitHub release on the commit with the changelog and package.json modification on the develop branch
|
|
31
31
|
4. NPM release ( by default it's disabled, but can be enabled in the configuration file )
|
|
32
32
|
|
|
33
|
-
To configure the authentification, you need to export GITHUB_TOKEN for [GitHub](https://github.com/settings/tokens)
|
|
33
|
+
To configure the authentification, you need to export GITHUB_TOKEN for [GitHub](https://github.com/settings/tokens)
|
|
34
34
|
|
|
35
35
|
```
|
|
36
36
|
export GITHUB_TOKEN=XXX-XXXXXXXXXXXXXXXXXXXXXX
|
|
37
37
|
```
|
|
38
|
-
|
|
38
|
+
|
|
39
39
|
To configure npm, you can use the `npm login` command or use a configuration file with a TOKEN :
|
|
40
|
-
|
|
40
|
+
|
|
41
41
|
```
|
|
42
42
|
echo "//registry.npmjs.org/:_authToken=YYYYYYYYYYYYYYYYYYYYYYYYYYYYYY" > .npmrc
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
#### Using release-it tool
|
|
46
|
-
|
|
46
|
+
|
|
47
47
|
There are 3 yarn scripts that can be run to do the release
|
|
48
48
|
|
|
49
49
|
##### yarn release-beta
|
|
50
50
|
|
|
51
|
-
Automatically calculates and presents 3 beta versions - patch, minor and major for you to choose ( or Other for manual input).
|
|
51
|
+
Automatically calculates and presents 3 beta versions - patch, minor and major for you to choose ( or Other for manual input).
|
|
52
52
|
|
|
53
53
|
```
|
|
54
|
-
? Select increment (next version):
|
|
55
|
-
❯ prepatch (0.1.1-beta.0)
|
|
56
|
-
preminor (0.2.0-beta.0)
|
|
57
|
-
premajor (1.0.0-beta.0)
|
|
58
|
-
Other, please specify...
|
|
54
|
+
? Select increment (next version):
|
|
55
|
+
❯ prepatch (0.1.1-beta.0)
|
|
56
|
+
preminor (0.2.0-beta.0)
|
|
57
|
+
premajor (1.0.0-beta.0)
|
|
58
|
+
Other, please specify...
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
##### yarn release-major-beta
|
|
62
62
|
|
|
63
63
|
Same as `yarn release-beta`, but with premajor version pre-selected.
|
|
64
|
-
|
|
64
|
+
|
|
65
65
|
##### yarn release
|
|
66
66
|
|
|
67
67
|
Generic command, does not automatically add the `beta` to version, but you can still manually write it if you choose Other.
|
|
68
68
|
|
|
69
69
|
#### Important notes
|
|
70
70
|
|
|
71
|
-
> Do not use release-it tool on master branch, the commit on CHANGELOG.md file and the version increase in the package.json file can't be done without a PULL REQUEST.
|
|
71
|
+
> Do not use release-it tool on master branch, the commit on CHANGELOG.md file and the version increase in the package.json file can't be done without a PULL REQUEST.
|
|
72
72
|
|
|
73
73
|
> Do not keep Pull Requests from develop to master branches open when you are doing beta releases from the develop branch. As long as a PR to master is open, an automatic script will run on every commit and will update both the version and the changelog to a production-ready state - ( MAJOR.MINOR.PATCH mandatory format for version).
|
|
74
74
|
|
package/cypress.config.js
CHANGED
|
@@ -2,12 +2,12 @@ const { defineConfig } = require('cypress');
|
|
|
2
2
|
|
|
3
3
|
module.exports = defineConfig({
|
|
4
4
|
viewportWidth: 1280,
|
|
5
|
-
defaultCommandTimeout:
|
|
5
|
+
defaultCommandTimeout: 8888,
|
|
6
6
|
chromeWebSecurity: false,
|
|
7
7
|
reporter: 'junit',
|
|
8
|
-
video:
|
|
8
|
+
video: false,
|
|
9
9
|
retries: {
|
|
10
|
-
runMode:
|
|
10
|
+
runMode: 2,
|
|
11
11
|
openMode: 0,
|
|
12
12
|
},
|
|
13
13
|
reporterOptions: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eeacms/volto-eea-website-policy",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"description": "@eeacms/volto-eea-website-policy: Volto add-on",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"author": "European Environment Agency: IDM2 A-Team",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"@cypress/code-coverage": "^3.10.0",
|
|
27
27
|
"@plone/scripts": "*",
|
|
28
28
|
"babel-plugin-transform-class-properties": "^6.24.1",
|
|
29
|
-
"husky": "
|
|
30
|
-
"lint-staged": "
|
|
29
|
+
"husky": "^8.0.3",
|
|
30
|
+
"lint-staged": "^14.0.1",
|
|
31
31
|
"md5": "^2.3.0"
|
|
32
32
|
},
|
|
33
33
|
"lint-staged": {
|
|
@@ -0,0 +1,542 @@
|
|
|
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
|
+
return (
|
|
239
|
+
<div
|
|
240
|
+
className="menu-more pastanaga-menu"
|
|
241
|
+
style={{
|
|
242
|
+
flex: this.props.theToolbar.current
|
|
243
|
+
? `0 0 ${
|
|
244
|
+
this.props.theToolbar.current.getBoundingClientRect().width
|
|
245
|
+
}px`
|
|
246
|
+
: null,
|
|
247
|
+
}}
|
|
248
|
+
>
|
|
249
|
+
<header>
|
|
250
|
+
<h2>{this.props.content.title}</h2>
|
|
251
|
+
<button
|
|
252
|
+
className="more-user"
|
|
253
|
+
aria-label={this.props.intl.formatMessage(messages.personalTools)}
|
|
254
|
+
onClick={() => this.push('personalTools')}
|
|
255
|
+
tabIndex={0}
|
|
256
|
+
>
|
|
257
|
+
<Icon
|
|
258
|
+
name={userSVG}
|
|
259
|
+
size="30px"
|
|
260
|
+
title={this.props.intl.formatMessage(messages.personalTools)}
|
|
261
|
+
/>
|
|
262
|
+
</button>
|
|
263
|
+
</header>
|
|
264
|
+
<div className="pastanaga-menu-list">
|
|
265
|
+
<ul>
|
|
266
|
+
<Pluggable name="toolbar-more-menu-list" />
|
|
267
|
+
<Plug pluggable="toolbar-more-menu-list" id="state">
|
|
268
|
+
{this.props.content['@type'] !== 'Plone Site' && (
|
|
269
|
+
// Plone Site does not have workflow
|
|
270
|
+
<li className="state-select">
|
|
271
|
+
<Workflow pathname={path} />
|
|
272
|
+
</li>
|
|
273
|
+
)}
|
|
274
|
+
</Plug>
|
|
275
|
+
<Plug pluggable="toolbar-more-menu-list" id="view">
|
|
276
|
+
{this.props.content['@type'] !== 'Plone Site' && (
|
|
277
|
+
// Plone Site does not have view (yet)
|
|
278
|
+
<li className="display-select">
|
|
279
|
+
{editAction && <Display pathname={path} />}
|
|
280
|
+
</li>
|
|
281
|
+
)}
|
|
282
|
+
</Plug>
|
|
283
|
+
<Plug pluggable="toolbar-more-menu-list" id="history">
|
|
284
|
+
{this.props.content['@type'] !== 'Plone Site' && (
|
|
285
|
+
// Plone Site does not have history (yet)
|
|
286
|
+
<li>
|
|
287
|
+
<Link to={`${path}/historyview`}>
|
|
288
|
+
<div>
|
|
289
|
+
<span className="pastanaga-menu-label">
|
|
290
|
+
{historyAction?.title ||
|
|
291
|
+
this.props.intl.formatMessage(messages.history)}
|
|
292
|
+
</span>
|
|
293
|
+
<span className="pastanaga-menu-value" />
|
|
294
|
+
</div>
|
|
295
|
+
<Icon name={rightArrowSVG} size="24px" />
|
|
296
|
+
</Link>
|
|
297
|
+
</li>
|
|
298
|
+
)}
|
|
299
|
+
</Plug>
|
|
300
|
+
<Plug pluggable="toolbar-more-menu-list" id="sharing">
|
|
301
|
+
{sharingAction && (
|
|
302
|
+
<li>
|
|
303
|
+
<Link to={`${path}/sharing`}>
|
|
304
|
+
{this.props.intl.formatMessage(messages.sharing)}
|
|
305
|
+
<Icon name={rightArrowSVG} size="24px" />
|
|
306
|
+
</Link>
|
|
307
|
+
</li>
|
|
308
|
+
)}
|
|
309
|
+
</Plug>
|
|
310
|
+
<Plug pluggable="toolbar-more-menu-list" id="aliases">
|
|
311
|
+
{aliasesAction && (
|
|
312
|
+
<li>
|
|
313
|
+
<Link to={`${path}/aliases`}>
|
|
314
|
+
{this.props.intl.formatMessage(messages.aliases)}
|
|
315
|
+
<Icon name={rightArrowSVG} size="24px" />
|
|
316
|
+
</Link>
|
|
317
|
+
</li>
|
|
318
|
+
)}
|
|
319
|
+
</Plug>
|
|
320
|
+
<Plug pluggable="toolbar-more-menu-list" id="rules">
|
|
321
|
+
{rulesAction && (
|
|
322
|
+
<li>
|
|
323
|
+
<Link to={`${path}/rules`}>
|
|
324
|
+
{this.props.intl.formatMessage(messages.rules)}
|
|
325
|
+
<Icon name={rightArrowSVG} size="24px" />
|
|
326
|
+
</Link>
|
|
327
|
+
</li>
|
|
328
|
+
)}
|
|
329
|
+
</Plug>
|
|
330
|
+
</ul>
|
|
331
|
+
</div>
|
|
332
|
+
<Pluggable name="toolbar-more-manage-content">
|
|
333
|
+
{(pluggables) => (
|
|
334
|
+
<>
|
|
335
|
+
{pluggables.length > 0 && (
|
|
336
|
+
<>
|
|
337
|
+
<header>
|
|
338
|
+
<h2>
|
|
339
|
+
{this.props.intl.formatMessage(messages.manageContent)}
|
|
340
|
+
</h2>
|
|
341
|
+
</header>
|
|
342
|
+
<div className="pastanaga-menu-list">
|
|
343
|
+
<ul>
|
|
344
|
+
{pluggables.map((p) => (
|
|
345
|
+
<>{p()}</>
|
|
346
|
+
))}
|
|
347
|
+
</ul>
|
|
348
|
+
</div>
|
|
349
|
+
</>
|
|
350
|
+
)}
|
|
351
|
+
</>
|
|
352
|
+
)}
|
|
353
|
+
</Pluggable>
|
|
354
|
+
{config.settings.hasWorkingCopySupport &&
|
|
355
|
+
this.props.content['@type'] !== 'Plone Site' &&
|
|
356
|
+
this.props.content['@type'] !== 'ims_indicator' && (
|
|
357
|
+
<>
|
|
358
|
+
{!this.props.content.working_copy && (
|
|
359
|
+
<Plug pluggable="toolbar-more-manage-content" id="workingcopy">
|
|
360
|
+
<li>
|
|
361
|
+
<button
|
|
362
|
+
aria-label={this.props.intl.formatMessage(
|
|
363
|
+
messages.CreateWorkingCopy,
|
|
364
|
+
)}
|
|
365
|
+
onClick={() => {
|
|
366
|
+
this.props.createWorkingCopy(path).then((response) => {
|
|
367
|
+
this.props.history.push(
|
|
368
|
+
flattenToAppURL(response['@id']),
|
|
369
|
+
);
|
|
370
|
+
this.props.closeMenu();
|
|
371
|
+
});
|
|
372
|
+
}}
|
|
373
|
+
>
|
|
374
|
+
{this.props.intl.formatMessage(
|
|
375
|
+
messages.CreateWorkingCopy,
|
|
376
|
+
)}
|
|
377
|
+
|
|
378
|
+
<Icon name={rightArrowSVG} size="24px" />
|
|
379
|
+
</button>
|
|
380
|
+
</li>
|
|
381
|
+
</Plug>
|
|
382
|
+
)}
|
|
383
|
+
{this.props.content.working_copy &&
|
|
384
|
+
this.props.content.working_copy_of && (
|
|
385
|
+
<Plug
|
|
386
|
+
pluggable="toolbar-more-manage-content"
|
|
387
|
+
id="workingcopy"
|
|
388
|
+
>
|
|
389
|
+
<li>
|
|
390
|
+
<button
|
|
391
|
+
aria-label={this.props.intl.formatMessage(
|
|
392
|
+
messages.applyWorkingCopy,
|
|
393
|
+
)}
|
|
394
|
+
onClick={() => {
|
|
395
|
+
this.props.applyWorkingCopy(path).then((response) => {
|
|
396
|
+
this.props.history.push(
|
|
397
|
+
flattenToAppURL(
|
|
398
|
+
this.props.content.working_copy_of['@id'],
|
|
399
|
+
),
|
|
400
|
+
);
|
|
401
|
+
this.props.closeMenu();
|
|
402
|
+
toast.info(
|
|
403
|
+
<Toast
|
|
404
|
+
info
|
|
405
|
+
title={intl.formatMessage(
|
|
406
|
+
messages.workingAppliedTitle,
|
|
407
|
+
)}
|
|
408
|
+
content={intl.formatMessage(
|
|
409
|
+
messages.workingCopyAppliedBy,
|
|
410
|
+
{
|
|
411
|
+
creator: content.working_copy?.creator_name,
|
|
412
|
+
date: (
|
|
413
|
+
<FormattedDate
|
|
414
|
+
date={content.working_copy?.created}
|
|
415
|
+
format={dateOptions}
|
|
416
|
+
/>
|
|
417
|
+
),
|
|
418
|
+
},
|
|
419
|
+
)}
|
|
420
|
+
/>,
|
|
421
|
+
{
|
|
422
|
+
toastId: 'workingcopyapplyinfo',
|
|
423
|
+
autoClose: 10000,
|
|
424
|
+
},
|
|
425
|
+
);
|
|
426
|
+
});
|
|
427
|
+
}}
|
|
428
|
+
>
|
|
429
|
+
{this.props.intl.formatMessage(
|
|
430
|
+
messages.applyWorkingCopy,
|
|
431
|
+
)}
|
|
432
|
+
|
|
433
|
+
<Icon
|
|
434
|
+
name={applySVG}
|
|
435
|
+
size="24px"
|
|
436
|
+
title={this.props.intl.formatMessage(
|
|
437
|
+
messages.applyWorkingCopy,
|
|
438
|
+
)}
|
|
439
|
+
/>
|
|
440
|
+
</button>
|
|
441
|
+
</li>
|
|
442
|
+
<li>
|
|
443
|
+
<button
|
|
444
|
+
aria-label={this.props.intl.formatMessage(
|
|
445
|
+
messages.removeWorkingCopy,
|
|
446
|
+
)}
|
|
447
|
+
onClick={() => {
|
|
448
|
+
this.props
|
|
449
|
+
.removeWorkingCopy(path)
|
|
450
|
+
.then((response) => {
|
|
451
|
+
this.props.history.push(
|
|
452
|
+
flattenToAppURL(
|
|
453
|
+
this.props.content.working_copy_of['@id'],
|
|
454
|
+
),
|
|
455
|
+
);
|
|
456
|
+
this.props.closeMenu();
|
|
457
|
+
toast.info(
|
|
458
|
+
<Toast
|
|
459
|
+
info
|
|
460
|
+
title={intl.formatMessage(
|
|
461
|
+
messages.workingCopyRemovedTitle,
|
|
462
|
+
)}
|
|
463
|
+
/>,
|
|
464
|
+
{
|
|
465
|
+
toastId: 'workingcopyremovednotice',
|
|
466
|
+
autoClose: 10000,
|
|
467
|
+
},
|
|
468
|
+
);
|
|
469
|
+
});
|
|
470
|
+
}}
|
|
471
|
+
>
|
|
472
|
+
{this.props.intl.formatMessage(
|
|
473
|
+
messages.removeWorkingCopy,
|
|
474
|
+
)}
|
|
475
|
+
|
|
476
|
+
<Icon
|
|
477
|
+
name={removeSVG}
|
|
478
|
+
size="24px"
|
|
479
|
+
color="#e40166"
|
|
480
|
+
title={this.props.intl.formatMessage(
|
|
481
|
+
messages.removeWorkingCopy,
|
|
482
|
+
)}
|
|
483
|
+
/>
|
|
484
|
+
</button>
|
|
485
|
+
</li>
|
|
486
|
+
</Plug>
|
|
487
|
+
)}
|
|
488
|
+
{this.props.content.working_copy &&
|
|
489
|
+
!this.props.content.working_copy_of && (
|
|
490
|
+
<Plug
|
|
491
|
+
pluggable="toolbar-more-manage-content"
|
|
492
|
+
id="workingcopy"
|
|
493
|
+
>
|
|
494
|
+
<li>
|
|
495
|
+
<Link
|
|
496
|
+
to={flattenToAppURL(
|
|
497
|
+
this.props.content.working_copy['@id'],
|
|
498
|
+
)}
|
|
499
|
+
onClick={() => this.props.closeMenu()}
|
|
500
|
+
>
|
|
501
|
+
{this.props.intl.formatMessage(
|
|
502
|
+
messages.viewWorkingCopy,
|
|
503
|
+
)}
|
|
504
|
+
<Icon name={rightArrowSVG} size="24px" />
|
|
505
|
+
</Link>
|
|
506
|
+
</li>
|
|
507
|
+
</Plug>
|
|
508
|
+
)}
|
|
509
|
+
</>
|
|
510
|
+
)}
|
|
511
|
+
{editAction &&
|
|
512
|
+
config.settings.isMultilingual &&
|
|
513
|
+
this.props.content['@type'] !== 'ims_indicator' && (
|
|
514
|
+
<Plug pluggable="toolbar-more-manage-content" id="multilingual">
|
|
515
|
+
<li>
|
|
516
|
+
<Link to={`${path}/manage-translations`}>
|
|
517
|
+
{this.props.intl.formatMessage(messages.ManageTranslations)}
|
|
518
|
+
|
|
519
|
+
<Icon name={rightArrowSVG} size="24px" />
|
|
520
|
+
</Link>
|
|
521
|
+
</li>
|
|
522
|
+
</Plug>
|
|
523
|
+
)}
|
|
524
|
+
</div>
|
|
525
|
+
);
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
export default compose(
|
|
530
|
+
injectIntl,
|
|
531
|
+
withRouter,
|
|
532
|
+
connect(
|
|
533
|
+
(state, props) => ({
|
|
534
|
+
actions: state.actions.actions,
|
|
535
|
+
pathname: props.pathname,
|
|
536
|
+
content: state.content.data,
|
|
537
|
+
lang: state.intl.locale,
|
|
538
|
+
workingCopy: state.workingCopy,
|
|
539
|
+
}),
|
|
540
|
+
{ applyWorkingCopy, createWorkingCopy, removeWorkingCopy },
|
|
541
|
+
),
|
|
542
|
+
)(More);
|
package/src/index.js
CHANGED
|
@@ -16,16 +16,20 @@ const restrictedBlocks = [
|
|
|
16
16
|
];
|
|
17
17
|
|
|
18
18
|
const overrideBlocks = {
|
|
19
|
+
embed_visualization: {
|
|
20
|
+
group: 'data_visualizations',
|
|
21
|
+
},
|
|
19
22
|
embed_tableau_visualization: {
|
|
20
23
|
group: 'data_visualizations',
|
|
21
|
-
restricted: true,
|
|
22
24
|
},
|
|
23
|
-
|
|
25
|
+
embed_maps: {
|
|
24
26
|
group: 'data_visualizations',
|
|
25
|
-
restricted: true,
|
|
26
27
|
},
|
|
27
28
|
embed_eea_map_block: {
|
|
28
29
|
group: 'data_visualizations',
|
|
30
|
+
},
|
|
31
|
+
tableau_block: {
|
|
32
|
+
group: 'data_visualizations',
|
|
29
33
|
restricted: true,
|
|
30
34
|
},
|
|
31
35
|
dataFigure: {
|