@eeacms/volto-hero-block 6.0.0 → 7.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/CHANGELOG.md
CHANGED
|
@@ -4,7 +4,22 @@ 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
|
-
### [
|
|
7
|
+
### [7.0.0](https://github.com/eea/volto-hero-block/compare/6.0.1...7.0.0) - 22 April 2024
|
|
8
|
+
|
|
9
|
+
#### :rocket: New Features
|
|
10
|
+
|
|
11
|
+
- feat: Release 7.0.0 - Volto 17 support [alin - [`ae73069`](https://github.com/eea/volto-hero-block/commit/ae73069aca5ca8e7abd909d8692e7eeb3f05d15f)]
|
|
12
|
+
- feat: Volto 17 support - refs #264527 [valentinab25 - [`b35a1d7`](https://github.com/eea/volto-hero-block/commit/b35a1d7d7c367a54cefcc58107cccd60802f97d7)]
|
|
13
|
+
|
|
14
|
+
#### :hammer_and_wrench: Others
|
|
15
|
+
|
|
16
|
+
### [6.0.1](https://github.com/eea/volto-hero-block/compare/6.0.0...6.0.1) - 5 April 2024
|
|
17
|
+
|
|
18
|
+
#### :house: Internal changes
|
|
19
|
+
|
|
20
|
+
- chore: Fix package.json [alin - [`a6f6427`](https://github.com/eea/volto-hero-block/commit/a6f6427acc6789a0c4a9a9b07e73b8186638d872)]
|
|
21
|
+
|
|
22
|
+
## [6.0.0](https://github.com/eea/volto-hero-block/compare/5.5.0...6.0.0) - 5 April 2024
|
|
8
23
|
|
|
9
24
|
#### :boom: Breaking Change
|
|
10
25
|
|
|
@@ -17,6 +32,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
17
32
|
|
|
18
33
|
#### :hammer_and_wrench: Others
|
|
19
34
|
|
|
35
|
+
- Release 6.0.0 #45 from eea/develop [ichim-david - [`a0120da`](https://github.com/eea/volto-hero-block/commit/a0120da50fcf7d5962a9dd9a93abe88fcbee090d)]
|
|
20
36
|
- Fix onClick event in Hero block to select the block in Edit mode [David Ichim - [`1f38992`](https://github.com/eea/volto-hero-block/commit/1f389922d05a5a04cf11d023229aca156873f4b9)]
|
|
21
37
|
- Add ts-jest package to package.json [David Ichim - [`7c82b62`](https://github.com/eea/volto-hero-block/commit/7c82b626985bfdabcf10db6da159c13fa86b27e2)]
|
|
22
38
|
- bump package version to a major 6.0.0 to indicate breaking changes [David Ichim - [`472b675`](https://github.com/eea/volto-hero-block/commit/472b675fcc037c5ac31ceed52f60aa13998fa896)]
|
package/jest-addon.config.js
CHANGED
|
@@ -14,6 +14,8 @@ module.exports = {
|
|
|
14
14
|
'@package/(.*)$': '<rootDir>/node_modules/@plone/volto/src/$1',
|
|
15
15
|
'@root/(.*)$': '<rootDir>/node_modules/@plone/volto/src/$1',
|
|
16
16
|
'@plone/volto-quanta/(.*)$': '<rootDir>/src/addons/volto-quanta/src/$1',
|
|
17
|
+
'@eeacms/search/(.*)$': '<rootDir>/src/addons/volto-searchlib/searchlib/$1',
|
|
18
|
+
'@eeacms/search': '<rootDir>/src/addons/volto-searchlib/searchlib',
|
|
17
19
|
'@eeacms/(.*?)/(.*)$': '<rootDir>/node_modules/@eeacms/$1/src/$2',
|
|
18
20
|
'@plone/volto-slate$':
|
|
19
21
|
'<rootDir>/node_modules/@plone/volto/packages/volto-slate/src',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eeacms/volto-hero-block",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "@eeacms/volto-hero-block: Volto add-on",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"author": "European Environment Agency: IDM2 A-Team",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"babel-plugin-transform-class-properties": "^6.24.1",
|
|
30
30
|
"dotenv": "^16.3.2",
|
|
31
31
|
"husky": "^8.0.3",
|
|
32
|
-
"ts-jest": "^26.4.2",
|
|
33
32
|
"lint-staged": "^14.0.1",
|
|
34
|
-
"md5": "^2.3.0"
|
|
33
|
+
"md5": "^2.3.0",
|
|
34
|
+
"ts-jest": "^26.4.2"
|
|
35
35
|
},
|
|
36
36
|
"lint-staged": {
|
|
37
37
|
"src/**/*.{js,jsx,ts,tsx,json}": [
|
|
@@ -1,35 +1,62 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
import Copyright from './Copyright';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
4
3
|
import { Icon } from 'semantic-ui-react';
|
|
5
4
|
import { Provider } from 'react-intl-redux';
|
|
6
5
|
import configureStore from 'redux-mock-store';
|
|
7
6
|
import config from '@plone/volto/registry';
|
|
7
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
8
|
+
|
|
9
|
+
import Copyright from './Copyright';
|
|
8
10
|
|
|
9
11
|
const mockStore = configureStore();
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
describe('Copyright', () => {
|
|
12
14
|
const store = mockStore({
|
|
13
15
|
intl: {
|
|
14
16
|
locale: 'en',
|
|
15
17
|
messages: {},
|
|
16
18
|
},
|
|
17
19
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
it('renders copyright with left position', () => {
|
|
21
|
+
const copyrightPrefix =
|
|
22
|
+
config.blocks.blocksConfig.hero?.copyrightPrefix || '';
|
|
20
23
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
const { container } = render(
|
|
25
|
+
<Provider store={store}>
|
|
26
|
+
<Copyright copyrightPosition={'left'}>
|
|
27
|
+
<Copyright.Prefix>{copyrightPrefix}</Copyright.Prefix>
|
|
28
|
+
<Copyright.Icon>
|
|
29
|
+
<Icon className={'copyright outline'} />
|
|
30
|
+
</Copyright.Icon>
|
|
31
|
+
<Copyright.Text>Copyright Text Test</Copyright.Text>
|
|
32
|
+
</Copyright>
|
|
33
|
+
</Provider>,
|
|
34
|
+
);
|
|
32
35
|
|
|
33
|
-
|
|
34
|
-
|
|
36
|
+
expect(screen.getByText('Copyright Text Test')).toBeInTheDocument();
|
|
37
|
+
expect(container.querySelector('i.copyright.outline')).toBeInTheDocument();
|
|
38
|
+
expect(
|
|
39
|
+
container.querySelector('div.eea.copyright.left'),
|
|
40
|
+
).toBeInTheDocument();
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('renders copyright without prefix', () => {
|
|
44
|
+
const { container } = render(
|
|
45
|
+
<Provider store={store}>
|
|
46
|
+
<Copyright copyrightPosition={'right'}>
|
|
47
|
+
<Copyright.Icon>
|
|
48
|
+
<Icon className={'copyright outline'} />
|
|
49
|
+
</Copyright.Icon>
|
|
50
|
+
<Copyright.Text>Copyright Text Test</Copyright.Text>
|
|
51
|
+
</Copyright>
|
|
52
|
+
</Provider>,
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
expect(screen.queryByText('Prefix')).not.toBeInTheDocument();
|
|
56
|
+
expect(screen.getByText('Copyright Text Test')).toBeInTheDocument();
|
|
57
|
+
expect(container.querySelector('i.copyright.outline')).toBeInTheDocument();
|
|
58
|
+
expect(
|
|
59
|
+
container.querySelector('div.eea.copyright.right'),
|
|
60
|
+
).toBeInTheDocument();
|
|
61
|
+
});
|
|
35
62
|
});
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
import Hero from './Hero';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
4
3
|
import { Provider } from 'react-intl-redux';
|
|
5
4
|
import configureStore from 'redux-mock-store';
|
|
6
5
|
import config from '@plone/volto/registry';
|
|
6
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
7
|
+
|
|
8
|
+
import Hero from './Hero';
|
|
7
9
|
|
|
8
10
|
const { settings } = config;
|
|
9
11
|
|
|
@@ -28,7 +30,7 @@ describe('Hero block', () => {
|
|
|
28
30
|
messages: {},
|
|
29
31
|
},
|
|
30
32
|
});
|
|
31
|
-
const
|
|
33
|
+
const { container } = render(
|
|
32
34
|
<Provider store={store}>
|
|
33
35
|
<Hero
|
|
34
36
|
image=""
|
|
@@ -50,8 +52,10 @@ describe('Hero block', () => {
|
|
|
50
52
|
</Provider>,
|
|
51
53
|
);
|
|
52
54
|
|
|
53
|
-
|
|
54
|
-
expect(
|
|
55
|
+
expect(container.querySelector('.eea.hero-block')).toBeInTheDocument();
|
|
56
|
+
expect(container.querySelector('.inverted')).toBeInTheDocument();
|
|
57
|
+
expect(container.querySelector('.full-height')).toBeInTheDocument();
|
|
58
|
+
expect(container.querySelector('.full-width')).toBeInTheDocument();
|
|
55
59
|
});
|
|
56
60
|
|
|
57
61
|
it('renders a hero component', () => {
|
|
@@ -61,7 +65,7 @@ describe('Hero block', () => {
|
|
|
61
65
|
messages: {},
|
|
62
66
|
},
|
|
63
67
|
});
|
|
64
|
-
const
|
|
68
|
+
const { container } = render(
|
|
65
69
|
<Provider store={store}>
|
|
66
70
|
<Hero
|
|
67
71
|
image=""
|
|
@@ -83,8 +87,10 @@ describe('Hero block', () => {
|
|
|
83
87
|
</Provider>,
|
|
84
88
|
);
|
|
85
89
|
|
|
86
|
-
|
|
87
|
-
expect(
|
|
90
|
+
expect(container.querySelector('.eea.hero-block')).toBeInTheDocument();
|
|
91
|
+
expect(container.querySelector('.inverted')).toBeInTheDocument();
|
|
92
|
+
expect(container.querySelector('.full-height')).toBeInTheDocument();
|
|
93
|
+
expect(container.querySelector('.full-width')).not.toBeInTheDocument();
|
|
88
94
|
});
|
|
89
95
|
|
|
90
96
|
it('renders a hero component', () => {
|
|
@@ -94,7 +100,7 @@ describe('Hero block', () => {
|
|
|
94
100
|
messages: {},
|
|
95
101
|
},
|
|
96
102
|
});
|
|
97
|
-
const
|
|
103
|
+
const { container } = render(
|
|
98
104
|
<Provider store={store}>
|
|
99
105
|
<Hero
|
|
100
106
|
image={{ '@type': 'URL', url: 'url_url', href: 'href_url' }}
|
|
@@ -116,8 +122,10 @@ describe('Hero block', () => {
|
|
|
116
122
|
</Provider>,
|
|
117
123
|
);
|
|
118
124
|
|
|
119
|
-
|
|
120
|
-
expect(
|
|
125
|
+
expect(container.querySelector('.eea.hero-block')).toBeInTheDocument();
|
|
126
|
+
expect(container.querySelector('.hero-block-image')).toHaveStyle({
|
|
127
|
+
backgroundImage: 'url(url_url)',
|
|
128
|
+
});
|
|
121
129
|
});
|
|
122
130
|
|
|
123
131
|
it('renders a hero component', () => {
|
|
@@ -127,7 +135,7 @@ describe('Hero block', () => {
|
|
|
127
135
|
messages: {},
|
|
128
136
|
},
|
|
129
137
|
});
|
|
130
|
-
const
|
|
138
|
+
const { container } = render(
|
|
131
139
|
<Provider store={store}>
|
|
132
140
|
<Hero
|
|
133
141
|
image={`${settings.apiPath}/foo/bar`}
|
|
@@ -149,41 +157,10 @@ describe('Hero block', () => {
|
|
|
149
157
|
</Provider>,
|
|
150
158
|
);
|
|
151
159
|
|
|
152
|
-
|
|
153
|
-
expect(
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
it('renders a hero component', () => {
|
|
157
|
-
const store = mockStore({
|
|
158
|
-
intl: {
|
|
159
|
-
locale: 'en',
|
|
160
|
-
messages: {},
|
|
161
|
-
},
|
|
160
|
+
expect(container.querySelector('.eea.hero-block')).toBeInTheDocument();
|
|
161
|
+
expect(container.querySelector('.hero-block-image')).toHaveStyle({
|
|
162
|
+
backgroundImage: 'url(/foo/bar/@@images/image/huge)',
|
|
162
163
|
});
|
|
163
|
-
const component = renderer.create(
|
|
164
|
-
<Provider store={store}>
|
|
165
|
-
<Hero
|
|
166
|
-
image={`${settings.apiPath}/foo/bar.gif`}
|
|
167
|
-
overlay={true}
|
|
168
|
-
fullWidth={false}
|
|
169
|
-
fullHeight={true}
|
|
170
|
-
spaced={false}
|
|
171
|
-
inverted={true}
|
|
172
|
-
styles={{ alignContent: 'center', backgroundVariant: 'primary' }}
|
|
173
|
-
>
|
|
174
|
-
<Hero.Text
|
|
175
|
-
quoted={true}
|
|
176
|
-
styles={{ textVariant: 'white', textAlign: 'left' }}
|
|
177
|
-
>
|
|
178
|
-
Text test
|
|
179
|
-
</Hero.Text>
|
|
180
|
-
<Hero.Meta styles={{ buttonAlign: 'left' }}>Test meta</Hero.Meta>
|
|
181
|
-
</Hero>
|
|
182
|
-
</Provider>,
|
|
183
|
-
);
|
|
184
|
-
|
|
185
|
-
const json = component.toJSON();
|
|
186
|
-
expect(json).toMatchSnapshot();
|
|
187
164
|
});
|
|
188
165
|
|
|
189
166
|
it('renders a hero component', () => {
|
|
@@ -193,7 +170,7 @@ describe('Hero block', () => {
|
|
|
193
170
|
messages: {},
|
|
194
171
|
},
|
|
195
172
|
});
|
|
196
|
-
const
|
|
173
|
+
const { container } = render(
|
|
197
174
|
<Provider store={store}>
|
|
198
175
|
<Hero
|
|
199
176
|
image={`${settings.apiPath}/foo/bar.gif`}
|
|
@@ -210,8 +187,7 @@ describe('Hero block', () => {
|
|
|
210
187
|
</Provider>,
|
|
211
188
|
);
|
|
212
189
|
|
|
213
|
-
|
|
214
|
-
expect(json).toMatchSnapshot();
|
|
190
|
+
expect(container.querySelector('.quoted-wrapper')).toBeInTheDocument();
|
|
215
191
|
});
|
|
216
192
|
|
|
217
193
|
it('renders a hero component', () => {
|
|
@@ -221,7 +197,7 @@ describe('Hero block', () => {
|
|
|
221
197
|
messages: {},
|
|
222
198
|
},
|
|
223
199
|
});
|
|
224
|
-
const
|
|
200
|
+
const { container } = render(
|
|
225
201
|
<Provider store={store}>
|
|
226
202
|
<Hero image={`${settings.apiPath}/foo/bar.gif`} styles={undefined}>
|
|
227
203
|
<Hero.Text quoted={true} styles={undefined}>
|
|
@@ -232,7 +208,6 @@ describe('Hero block', () => {
|
|
|
232
208
|
</Provider>,
|
|
233
209
|
);
|
|
234
210
|
|
|
235
|
-
|
|
236
|
-
expect(json).toMatchSnapshot();
|
|
211
|
+
expect(container.querySelector('.quoted-wrapper')).toBeInTheDocument();
|
|
237
212
|
});
|
|
238
213
|
});
|
|
@@ -51,8 +51,7 @@ const messages = defineMessages({
|
|
|
51
51
|
defaultMessage: 'Fixed layout',
|
|
52
52
|
},
|
|
53
53
|
FixedlayoutNewPanesTabs: {
|
|
54
|
-
id:
|
|
55
|
-
'Fixed layout, New panes (tabs) created by Editor within this block will be ignored',
|
|
54
|
+
id: 'Fixed layout, New panes (tabs) created by Editor within this block will be ignored',
|
|
56
55
|
defaultMessage:
|
|
57
56
|
'Fixed layout, New panes (tabs) created by Editor within this block will be ignored',
|
|
58
57
|
},
|
|
@@ -98,7 +97,7 @@ const messages = defineMessages({
|
|
|
98
97
|
},
|
|
99
98
|
});
|
|
100
99
|
|
|
101
|
-
|
|
100
|
+
const layoutSchema = (intl) => ({
|
|
102
101
|
title: intl.formatMessage(messages.HeroBlockSettings),
|
|
103
102
|
fieldsets: [
|
|
104
103
|
{
|
|
@@ -172,3 +171,5 @@ export default (intl) => ({
|
|
|
172
171
|
},
|
|
173
172
|
required: [],
|
|
174
173
|
});
|
|
174
|
+
|
|
175
|
+
export default layoutSchema;
|