@eeacms/volto-eea-website-theme 3.5.3 → 3.5.5

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/locales/volto.pot CHANGED
@@ -1,74 +1,134 @@
1
1
  msgid ""
2
2
  msgstr ""
3
3
  "Project-Id-Version: Plone\n"
4
- "POT-Creation-Date: 2023-12-05T09:30:23.741Z\n"
4
+ "POT-Creation-Date: 2025-01-30T18:15:27.602Z\n"
5
5
  "Last-Translator: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
6
6
  "Language-Team: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
7
- "MIME-Version: 1.0\n"
8
7
  "Content-Type: text/plain; charset=utf-8\n"
9
8
  "Content-Transfer-Encoding: 8bit\n"
10
9
  "Plural-Forms: nplurals=1; plural=0;\n"
10
+ "MIME-Version: 1.0\n"
11
11
  "Language-Code: en\n"
12
12
  "Language-Name: English\n"
13
13
  "Preferred-Encodings: utf-8\n"
14
14
  "Domain: volto\n"
15
15
 
16
+ #. Default: "Choices"
17
+ #: components/theme/Widgets/CreatableSelectWidget
18
+ msgid "Choices"
19
+ msgstr ""
20
+
21
+ #. Default: "Close"
22
+ #: components/theme/Widgets/CreatableSelectWidget
23
+ msgid "Close"
24
+ msgstr ""
25
+
26
+ #. Default: "Created"
16
27
  #: components/theme/Banner/View
17
- # defaultMessage: Created
18
28
  msgid "Created"
19
29
  msgstr ""
20
30
 
31
+ #. Default: "Default"
32
+ #: components/theme/Widgets/CreatableSelectWidget
33
+ msgid "Default"
34
+ msgstr ""
35
+
36
+ #. Default: "Description"
37
+ #: components/theme/Widgets/CreatableSelectWidget
38
+ msgid "Description"
39
+ msgstr ""
40
+
41
+ #. Default: "Download"
21
42
  #: components/theme/Banner/View
22
- # defaultMessage: Download
23
43
  msgid "Download"
24
44
  msgstr ""
25
45
 
46
+ #. Default: "European Environment Agency"
26
47
  #: components/theme/Logo
27
- # defaultMessage: European Environment Agency
28
48
  msgid "European Environment Agency"
29
49
  msgstr ""
30
50
 
51
+ #. Default: "Invalid block - Will be removed on saving"
31
52
  #: components/manage/Blocks/GroupBlockTemplate/FlexGroup/RenderBlocks
32
- # defaultMessage: Invalid block - Will be removed on saving
33
53
  msgid "Invalid Block"
34
54
  msgstr ""
35
55
 
56
+ #. Default: "Modified"
36
57
  #: components/theme/Banner/View
37
- # defaultMessage: Modified
38
58
  msgid "Modified"
39
59
  msgstr ""
40
60
 
61
+ #. Default: "Navigation"
62
+ #: components/manage/Blocks/ContextNavigation/variations/Accordion
63
+ msgid "Navigation"
64
+ msgstr ""
65
+
66
+ #. Default: "No options"
67
+ #: components/theme/Widgets/CreatableSelectWidget
68
+ msgid "No options"
69
+ msgstr ""
70
+
71
+ #. Default: "No value"
72
+ #: components/theme/Widgets/CreatableSelectWidget
73
+ msgid "No value"
74
+ msgstr ""
75
+
76
+ #. Default: "Published"
41
77
  #: components/theme/Banner/View
42
- # defaultMessage: Published
43
78
  msgid "Published"
44
79
  msgstr ""
45
80
 
81
+ #. Default: "Required"
82
+ #: components/theme/Widgets/CreatableSelectWidget
83
+ msgid "Required"
84
+ msgstr ""
85
+
86
+ #. Default: "Select…"
87
+ #: components/theme/Widgets/CreatableSelectWidget
88
+ msgid "Select…"
89
+ msgstr ""
90
+
91
+ #. Default: "Share"
46
92
  #: components/theme/Banner/View
47
- # defaultMessage: Share
48
93
  msgid "Share"
49
94
  msgstr ""
50
95
 
96
+ #. Default: "Share to"
51
97
  #: components/theme/Banner/View
52
- # defaultMessage: Share to
53
98
  msgid "Share to"
54
99
  msgstr ""
55
100
 
101
+ #. Default: "Short Name"
102
+ #: components/theme/Widgets/CreatableSelectWidget
103
+ msgid "Short Name"
104
+ msgstr ""
105
+
106
+ #. Default: "Site"
56
107
  #: components/theme/Logo
57
- # defaultMessage: Site
58
108
  msgid "Site"
59
109
  msgstr ""
60
110
 
111
+ #. Default: "Title"
112
+ #: components/theme/Widgets/CreatableSelectWidget
113
+ msgid "Title"
114
+ msgstr ""
115
+
116
+ #. Default: "Type the title…"
61
117
  #: components/manage/Blocks/Title/Edit
62
- # defaultMessage: Type the title…
63
118
  msgid "Type the title…"
64
119
  msgstr ""
65
120
 
121
+ #. Default: "Unknown Block {block}"
66
122
  #: components/manage/Blocks/GroupBlockTemplate/FlexGroup/RenderBlocks
67
- # defaultMessage: Unknown Block {block}
68
123
  msgid "Unknown Block"
69
124
  msgstr ""
70
125
 
126
+ #. Default: "Used for programmatic access to the fieldset."
127
+ #: components/theme/Widgets/CreatableSelectWidget
128
+ msgid "Used for programmatic access to the fieldset."
129
+ msgstr ""
130
+
131
+ #. Default: "RSS Feed"
71
132
  #: components/theme/Banner/View
72
- # defaultMessage: RSS Feed
73
133
  msgid "rssFeed"
74
134
  msgstr ""
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-website-theme",
3
- "version": "3.5.3",
3
+ "version": "3.5.5",
4
4
  "description": "@eeacms/volto-eea-website-theme: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -0,0 +1,3 @@
1
+ export default function ImageViewWidget({ value }) {
2
+ return <img src={value.download} alt={value.filename} />;
3
+ }
@@ -0,0 +1,15 @@
1
+ diff --git a/src/customizations/volto/components/manage/Controlpanels/Groups/RenderGroups.jsx b/src/customizations/volto/components/manage/Controlpanels/Groups/RenderGroups.jsx
2
+ index 816ad59..3b4df8f 100644
3
+ --- a/src/customizations/volto/components/manage/Controlpanels/Groups/RenderGroups.jsx
4
+ +++ b/src/customizations/volto/components/manage/Controlpanels/Groups/RenderGroups.jsx
5
+ @@ -77,7 +77,9 @@ class RenderGroups extends Component {
6
+ render() {
7
+ return (
8
+ <Table.Row key={this.props.group.title}>
9
+ - <Table.Cell>{this.props.group.groupname}</Table.Cell>
10
+ + <Table.Cell>
11
+ + {this.props.group.title || this.props.group.groupname}
12
+ + </Table.Cell>
13
+ {this.props.roles.map((role) => (
14
+ <Table.Cell key={role.id}>
15
+ {this.props.inheritedRole &&
@@ -0,0 +1,125 @@
1
+ /**
2
+ * Users controlpanel groups.
3
+ * @module components/manage/Controlpanels/UsersControlpanelGroups
4
+ */
5
+ import PropTypes from 'prop-types';
6
+ import React, { Component } from 'react';
7
+ import { FormattedMessage, injectIntl } from 'react-intl';
8
+ import { Dropdown, Table, Checkbox } from 'semantic-ui-react';
9
+ import trashSVG from '@plone/volto/icons/delete.svg';
10
+ import ploneSVG from '@plone/volto/icons/plone.svg';
11
+ import { Icon } from '@plone/volto/components';
12
+
13
+ /**
14
+ * UsersControlpanelGroups class.
15
+ * @class UsersControlpanelGroups
16
+ * @extends Component
17
+ */
18
+ class RenderGroups extends Component {
19
+ /**
20
+ * Property types.
21
+ * @property {Object} propTypes Property types.
22
+ * @static
23
+ */
24
+ static propTypes = {
25
+ //single group
26
+ group: PropTypes.shape({
27
+ title: PropTypes.string,
28
+ description: PropTypes.string,
29
+ email: PropTypes.string,
30
+ groupname: PropTypes.string,
31
+ roles: PropTypes.arrayOf(PropTypes.string),
32
+ }).isRequired,
33
+
34
+ roles: PropTypes.arrayOf(
35
+ PropTypes.shape({
36
+ id: PropTypes.string,
37
+ }),
38
+ ).isRequired,
39
+ inheritedRole: PropTypes.array,
40
+ onDelete: PropTypes.func.isRequired,
41
+ };
42
+
43
+ /**
44
+ * Constructor
45
+ * @method constructor
46
+ * @param {Object} props Component properties
47
+ * @constructs Sharing
48
+ */
49
+ constructor(props) {
50
+ super(props);
51
+ this.onChange = this.onChange.bind(this);
52
+ }
53
+
54
+ /**
55
+ * @param {*} event
56
+ * @param {*} { value }
57
+ * @memberof UsersControlpanelUser
58
+ */
59
+ onChange(event, { value }) {
60
+ const [group, role] = value.split('&role=');
61
+ this.props.updateGroups(group, role);
62
+ }
63
+
64
+ /**
65
+ *@param {*}
66
+ *@returns {Boolean}
67
+ *@memberof RenderGroups
68
+ */
69
+ isAuthGroup = (roleId) => {
70
+ return this.props.inheritedRole.includes(roleId);
71
+ };
72
+ /**
73
+ * Render method.
74
+ * @method render
75
+ * @returns {string} Markup for the component.
76
+ */
77
+ render() {
78
+ return (
79
+ <Table.Row key={this.props.group.title}>
80
+ <Table.Cell>
81
+ {this.props.group.title || this.props.group.groupname}
82
+ </Table.Cell>
83
+ {this.props.roles.map((role) => (
84
+ <Table.Cell key={role.id}>
85
+ {this.props.inheritedRole &&
86
+ this.props.inheritedRole.includes(role.id) &&
87
+ this.props.group.roles.includes('Authenticated') ? (
88
+ <Icon
89
+ name={ploneSVG}
90
+ size="20px"
91
+ color="#007EB1"
92
+ title={'plone-svg'}
93
+ />
94
+ ) : (
95
+ <Checkbox
96
+ checked={
97
+ this.props.group.id === 'AuthenticatedUsers'
98
+ ? this.isAuthGroup(role.id)
99
+ : this.props.group.roles.includes(role.id)
100
+ }
101
+ onChange={this.onChange}
102
+ value={`${this.props.group.id}&role=${role.id}`}
103
+ />
104
+ )}
105
+ </Table.Cell>
106
+ ))}
107
+ <Table.Cell textAlign="right">
108
+ <Dropdown icon="ellipsis horizontal">
109
+ <Dropdown.Menu className="left">
110
+ <Dropdown.Item
111
+ onClick={this.props.onDelete}
112
+ value={this.props.group['@id']}
113
+ >
114
+ <Icon name={trashSVG} size="15px" />
115
+ <FormattedMessage id="Delete" defaultMessage="Delete" />
116
+ </Dropdown.Item>
117
+ </Dropdown.Menu>
118
+ </Dropdown>
119
+ </Table.Cell>
120
+ </Table.Row>
121
+ );
122
+ }
123
+ }
124
+
125
+ export default injectIntl(RenderGroups);
@@ -0,0 +1,58 @@
1
+ import React from 'react';
2
+ import renderer from 'react-test-renderer';
3
+ import configureStore from 'redux-mock-store';
4
+ import { Provider } from 'react-intl-redux';
5
+
6
+ import RenderGroups from './RenderGroups';
7
+
8
+ const mockStore = configureStore();
9
+
10
+ const testGroups = {
11
+ '@id': 'http://localhost:55001/plone/@groups/Administrators',
12
+ description: '',
13
+ email: '',
14
+ groupname: 'Administrators',
15
+ id: 'Administrators',
16
+ title: 'Administrators',
17
+ roles: ['Manager'],
18
+ };
19
+
20
+ const testRoles = [
21
+ {
22
+ '@id': 'http://localhost:8080/Plone/@roles/Member',
23
+ '@type': 'role',
24
+ id: 'Member',
25
+ },
26
+ {
27
+ '@id': 'http://localhost:8080/Plone/@roles/Reader',
28
+ '@type': 'role',
29
+ id: 'Reader',
30
+ },
31
+ {
32
+ '@id': 'http://localhost:8080/Plone/@roles/Manager',
33
+ '@type': 'role',
34
+ id: 'Manager',
35
+ },
36
+ ];
37
+
38
+ describe('UsersControlpanelGroups', () => {
39
+ it('renders a UsersControlpanelGroups component', () => {
40
+ const store = mockStore({
41
+ intl: {
42
+ locale: 'en',
43
+ messages: {},
44
+ },
45
+ });
46
+ const component = renderer.create(
47
+ <Provider store={store}>
48
+ <RenderGroups
49
+ group={testGroups}
50
+ roles={testRoles}
51
+ onDelete={() => {}}
52
+ />
53
+ </Provider>,
54
+ );
55
+ const json = component.toJSON();
56
+ expect(json).toMatchSnapshot();
57
+ });
58
+ });
@@ -0,0 +1,150 @@
1
+ diff --git a/src/customizations/volto/components/manage/Diff/DiffField.jsx b/src/customizations/volto/components/manage/Diff/DiffField.jsx
2
+ index a9bad2a..5d306e5 100644
3
+ --- a/src/customizations/volto/components/manage/Diff/DiffField.jsx
4
+ +++ b/src/customizations/volto/components/manage/Diff/DiffField.jsx
5
+ @@ -135,6 +135,17 @@ const formatDiffPart = (part, value, side) => {
6
+ }
7
+ };
8
+
9
+ +const getWidgetByBehavior = (behavior) =>
10
+ + config.widgets.views.behavior?.[behavior] || null;
11
+ +
12
+ +const getWidgetByFactory = (factory) =>
13
+ + config.widgets.views.factory?.[factory] || null;
14
+ +
15
+ +const getDefaultWidget =
16
+ + () =>
17
+ + ({ diff }) =>
18
+ + diff;
19
+ +
20
+ /**
21
+ * Diff field component.
22
+ * @function DiffField
23
+ @@ -164,8 +175,11 @@ const DiffField = ({
24
+ splitWords(String(twoStr)),
25
+ );
26
+ };
27
+ -
28
+ let parts, oneArray, twoArray;
29
+ + const Widget =
30
+ + getWidgetByBehavior(schema.behavior) ||
31
+ + getWidgetByFactory(schema.factory) ||
32
+ + getDefaultWidget();
33
+ if (schema.widget) {
34
+ switch (schema.widget) {
35
+ case 'richtext':
36
+ @@ -272,33 +286,49 @@ const DiffField = ({
37
+ {view === 'split' && (
38
+ <Grid.Row>
39
+ <Grid.Column width={6} verticalAlign="top">
40
+ - <span
41
+ - dangerouslySetInnerHTML={{
42
+ - __html: join(
43
+ - map(parts, (part) => {
44
+ - let combined = (part.value || []).reduce((acc, value) => {
45
+ - return acc + formatDiffPart(part, value, 'left');
46
+ - }, '');
47
+ - return combined;
48
+ - }),
49
+ - '',
50
+ - ),
51
+ - }}
52
+ + <Widget
53
+ + value={one}
54
+ + diff={
55
+ + <span
56
+ + dangerouslySetInnerHTML={{
57
+ + __html: join(
58
+ + map(parts, (part) => {
59
+ + let combined = (part.value || []).reduce(
60
+ + (acc, value) => {
61
+ + return acc + formatDiffPart(part, value, 'left');
62
+ + },
63
+ + '',
64
+ + );
65
+ + return combined;
66
+ + }),
67
+ + '',
68
+ + ),
69
+ + }}
70
+ + />
71
+ + }
72
+ />
73
+ </Grid.Column>
74
+ <Grid.Column width={6} verticalAlign="top">
75
+ - <span
76
+ - dangerouslySetInnerHTML={{
77
+ - __html: join(
78
+ - map(parts, (part) => {
79
+ - let combined = (part.value || []).reduce((acc, value) => {
80
+ - return acc + formatDiffPart(part, value, 'right');
81
+ - }, '');
82
+ - return combined;
83
+ - }),
84
+ - '',
85
+ - ),
86
+ - }}
87
+ + <Widget
88
+ + value={two}
89
+ + diff={
90
+ + <span
91
+ + dangerouslySetInnerHTML={{
92
+ + __html: join(
93
+ + map(parts, (part) => {
94
+ + let combined = (part.value || []).reduce(
95
+ + (acc, value) => {
96
+ + return acc + formatDiffPart(part, value, 'right');
97
+ + },
98
+ + '',
99
+ + );
100
+ + return combined;
101
+ + }),
102
+ + '',
103
+ + ),
104
+ + }}
105
+ + />
106
+ + }
107
+ />
108
+ </Grid.Column>
109
+ </Grid.Row>
110
+ @@ -306,18 +336,28 @@ const DiffField = ({
111
+ {view === 'unified' && (
112
+ <Grid.Row>
113
+ <Grid.Column width={16} verticalAlign="top">
114
+ - <span
115
+ - dangerouslySetInnerHTML={{
116
+ - __html: join(
117
+ - map(parts, (part) => {
118
+ - let combined = (part.value || []).reduce((acc, value) => {
119
+ - return acc + formatDiffPart(part, value, 'unified');
120
+ - }, '');
121
+ - return combined;
122
+ - }),
123
+ - '',
124
+ - ),
125
+ - }}
126
+ + <Widget
127
+ + value={two}
128
+ + one={one}
129
+ + two={two}
130
+ + diff={
131
+ + <span
132
+ + dangerouslySetInnerHTML={{
133
+ + __html: join(
134
+ + map(parts, (part) => {
135
+ + let combined = (part.value || []).reduce(
136
+ + (acc, value) => {
137
+ + return acc + formatDiffPart(part, value, 'unified');
138
+ + },
139
+ + '',
140
+ + );
141
+ + return combined;
142
+ + }),
143
+ + '',
144
+ + ),
145
+ + }}
146
+ + />
147
+ + }
148
+ />
149
+ </Grid.Column>
150
+ </Grid.Row>