@eeacms/volto-eea-design-system 1.32.1 → 1.32.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 +15 -0
- package/package.json +1 -1
- package/src/ui/Footer/Contact.jsx +10 -4
- package/src/ui/Footer/Footer.stories.js +1 -1
- package/src/ui/Footer/Footer.stories.test.js +51 -35
- package/src/ui/Footer/FooterSitesButton.jsx +5 -14
- package/src/ui/Footer/SubFooter.jsx +7 -6
- package/theme/themes/eea/extras/footer.less +22 -0
- package/theme/themes/eea/extras/footer.variables +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,21 @@ 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.32.3](https://github.com/eea/volto-eea-design-system/compare/1.32.2...1.32.3) - 29 August 2024
|
|
8
|
+
|
|
9
|
+
#### :bug: Bug Fixes
|
|
10
|
+
|
|
11
|
+
- fix: Update FooterSitesButton.jsx to use UniversalLink - refs #265857 [dobri1408 - [`c53fc12`](https://github.com/eea/volto-eea-design-system/commit/c53fc1297456290de0906552d873c00f8228758d)]
|
|
12
|
+
|
|
13
|
+
### [1.32.2](https://github.com/eea/volto-eea-design-system/compare/1.32.1...1.32.2) - 28 August 2024
|
|
14
|
+
|
|
15
|
+
#### :bug: Bug Fixes
|
|
16
|
+
|
|
17
|
+
- fix: Improve tablet layout for footer - refs #265857 [dobri1408 - [`4422ca4`](https://github.com/eea/volto-eea-design-system/commit/4422ca44740b405c20d5306a4a5bcb04a0085399)]
|
|
18
|
+
|
|
19
|
+
#### :hammer_and_wrench: Others
|
|
20
|
+
|
|
21
|
+
- test: use node 18 to build docusaurus [valentinab25 - [`f1495bb`](https://github.com/eea/volto-eea-design-system/commit/f1495bb849e08aebba8441bd20e26e3d9c1cc808)]
|
|
7
22
|
### [1.32.1](https://github.com/eea/volto-eea-design-system/compare/1.32.0...1.32.1) - 27 August 2024
|
|
8
23
|
|
|
9
24
|
#### :bug: Bug Fixes
|
package/package.json
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { Link } from 'react-router-dom';
|
|
4
|
-
|
|
4
|
+
import cx from 'classnames';
|
|
5
5
|
import { isInternalURL } from '@plone/volto/helpers/Url/Url';
|
|
6
6
|
|
|
7
|
-
const Contact = ({ children, contacts }) =>
|
|
8
|
-
children?.length ? (
|
|
7
|
+
const Contact = ({ children, contacts }) => {
|
|
8
|
+
return children?.length ? (
|
|
9
9
|
children
|
|
10
10
|
) : (
|
|
11
|
-
<div
|
|
11
|
+
<div
|
|
12
|
+
className={cx(
|
|
13
|
+
'contact-wrapper',
|
|
14
|
+
contacts?.length > 5 ? 'many-contacts' : '',
|
|
15
|
+
)}
|
|
16
|
+
>
|
|
12
17
|
{contacts?.map((contact, index) => (
|
|
13
18
|
<div className="contact" key={index}>
|
|
14
19
|
{isInternalURL(contact.url) ? (
|
|
@@ -50,6 +55,7 @@ const Contact = ({ children, contacts }) =>
|
|
|
50
55
|
))}
|
|
51
56
|
</div>
|
|
52
57
|
);
|
|
58
|
+
};
|
|
53
59
|
|
|
54
60
|
Contact.propTypes = {
|
|
55
61
|
contacts: PropTypes.array,
|
|
@@ -31,7 +31,7 @@ const Template = (args) => (
|
|
|
31
31
|
|
|
32
32
|
export const Default = Template.bind({});
|
|
33
33
|
Default.args = {
|
|
34
|
-
buttonName: 'Explore our
|
|
34
|
+
buttonName: 'Explore our environmental information systems',
|
|
35
35
|
hrefButton: 'https://www.eea.europa.eu/en/information-systems',
|
|
36
36
|
description: '',
|
|
37
37
|
actions: [
|
|
@@ -3,8 +3,10 @@ import { render } from '@testing-library/react';
|
|
|
3
3
|
import { createMemoryHistory } from 'history';
|
|
4
4
|
import { Router } from 'react-router-dom';
|
|
5
5
|
import { Default } from './Footer.stories';
|
|
6
|
+
import { Provider } from 'react-redux';
|
|
6
7
|
import Footer from './Footer';
|
|
7
8
|
import '@testing-library/jest-dom/extend-expect';
|
|
9
|
+
import configureStore from 'redux-mock-store';
|
|
8
10
|
|
|
9
11
|
describe('Default', () => {
|
|
10
12
|
let history;
|
|
@@ -22,11 +24,21 @@ describe('Default', () => {
|
|
|
22
24
|
});
|
|
23
25
|
});
|
|
24
26
|
|
|
27
|
+
const mockStore = configureStore();
|
|
28
|
+
const store = mockStore({
|
|
29
|
+
intl: {
|
|
30
|
+
locale: 'en',
|
|
31
|
+
messages: {},
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
|
|
25
35
|
it('renders correctly', () => {
|
|
26
36
|
const { container } = render(
|
|
27
|
-
<
|
|
28
|
-
<
|
|
29
|
-
|
|
37
|
+
<Provider store={store}>
|
|
38
|
+
<Router history={history}>
|
|
39
|
+
<Default {...Default.args} />
|
|
40
|
+
</Router>
|
|
41
|
+
</Provider>,
|
|
30
42
|
);
|
|
31
43
|
|
|
32
44
|
expect(container.querySelector('#footer')).toBeInTheDocument();
|
|
@@ -49,21 +61,23 @@ describe('Default', () => {
|
|
|
49
61
|
|
|
50
62
|
it('renders correctly', () => {
|
|
51
63
|
const { container, getByText } = render(
|
|
52
|
-
<
|
|
53
|
-
<
|
|
54
|
-
<Footer
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
<
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
<Provider store={store}>
|
|
65
|
+
<Router history={history}>
|
|
66
|
+
<Footer>
|
|
67
|
+
<Footer.SubFooter {...Default.args}>
|
|
68
|
+
<div>SubFooter test</div>
|
|
69
|
+
</Footer.SubFooter>
|
|
70
|
+
<Footer.Header>{Default.args.header}</Footer.Header>
|
|
71
|
+
<Footer.Sites sites={Default.args.sites}>
|
|
72
|
+
<div>Sites test</div>
|
|
73
|
+
</Footer.Sites>
|
|
74
|
+
<Footer.Actions
|
|
75
|
+
actions={Default.args.actions}
|
|
76
|
+
copyright={Default.args.copyright}
|
|
77
|
+
/>
|
|
78
|
+
</Footer>
|
|
79
|
+
</Router>
|
|
80
|
+
</Provider>,
|
|
67
81
|
);
|
|
68
82
|
|
|
69
83
|
expect(container.querySelector('#footer')).toBeInTheDocument();
|
|
@@ -82,23 +96,25 @@ describe('Default', () => {
|
|
|
82
96
|
|
|
83
97
|
it('renders correctly', () => {
|
|
84
98
|
const { container, getByText } = render(
|
|
85
|
-
<
|
|
86
|
-
<
|
|
87
|
-
<Footer
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
<Provider store={store}>
|
|
100
|
+
<Router history={history}>
|
|
101
|
+
<Footer>
|
|
102
|
+
<Footer.SubFooter
|
|
103
|
+
{...Default.args}
|
|
104
|
+
description={'test description'}
|
|
105
|
+
social={undefined}
|
|
106
|
+
/>
|
|
107
|
+
<Footer.Header>{Default.args.header}</Footer.Header>
|
|
108
|
+
<Footer.Sites sites={Default.args.sites} />
|
|
109
|
+
<Footer.Actions
|
|
110
|
+
actions={Default.args.actions}
|
|
111
|
+
copyright={Default.args.copyright}
|
|
112
|
+
>
|
|
113
|
+
<div>Actions test</div>
|
|
114
|
+
</Footer.Actions>
|
|
115
|
+
</Footer>
|
|
116
|
+
</Router>
|
|
117
|
+
</Provider>,
|
|
102
118
|
);
|
|
103
119
|
|
|
104
120
|
expect(container.querySelector('#footer')).toBeInTheDocument();
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Button } from 'semantic-ui-react';
|
|
3
1
|
import PropTypes from 'prop-types';
|
|
4
|
-
import {
|
|
2
|
+
import { UniversalLink } from '@plone/volto/components';
|
|
5
3
|
|
|
6
4
|
const SitesButton = (props) => {
|
|
7
5
|
if (props.children) {
|
|
@@ -11,20 +9,13 @@ const SitesButton = (props) => {
|
|
|
11
9
|
//fallback to props
|
|
12
10
|
return (
|
|
13
11
|
<div className="theme-sites">
|
|
14
|
-
<
|
|
12
|
+
<UniversalLink
|
|
13
|
+
href={props.hrefButton}
|
|
15
14
|
className="theme-sites-button"
|
|
16
|
-
|
|
17
|
-
if (__CLIENT__ && window) {
|
|
18
|
-
window.location.assign(
|
|
19
|
-
isInternalURL(props.hrefButton)
|
|
20
|
-
? flattenToAppURL(props.hrefButton)
|
|
21
|
-
: props.hrefButton,
|
|
22
|
-
);
|
|
23
|
-
}
|
|
24
|
-
}}
|
|
15
|
+
openLinkInNewTab={false}
|
|
25
16
|
>
|
|
26
17
|
{props.buttonName}
|
|
27
|
-
</
|
|
18
|
+
</UniversalLink>
|
|
28
19
|
</div>
|
|
29
20
|
);
|
|
30
21
|
};
|
|
@@ -33,12 +33,13 @@ const SubFooter = (props) => {
|
|
|
33
33
|
</div>
|
|
34
34
|
</Grid.Column>
|
|
35
35
|
))}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
{props.contacts?.length > 0 && (
|
|
37
|
+
<Grid.Column mobile={12} tablet={12} computer={4}>
|
|
38
|
+
<div className="item">
|
|
39
|
+
<Footer.Contact contacts={props.contacts} />
|
|
40
|
+
</div>
|
|
41
|
+
</Grid.Column>
|
|
42
|
+
)}
|
|
42
43
|
</Grid>
|
|
43
44
|
</div>
|
|
44
45
|
);
|
|
@@ -211,7 +211,22 @@ footer .footer-wrapper .menu {
|
|
|
211
211
|
footer .footer-header {
|
|
212
212
|
font-size: @tabletFooterTitleFontSize;
|
|
213
213
|
}
|
|
214
|
+
.contact-wrapper {
|
|
215
|
+
display: flex;
|
|
216
|
+
padding-top: @tabletContactWrapperPaddingTop;
|
|
217
|
+
gap: @tabletContactGap;
|
|
218
|
+
}
|
|
214
219
|
|
|
220
|
+
.contact-wrapper .subcontact {
|
|
221
|
+
display: block;
|
|
222
|
+
}
|
|
223
|
+
.many-contacts {
|
|
224
|
+
display: block;
|
|
225
|
+
padding-top: 0px;
|
|
226
|
+
}
|
|
227
|
+
.many-contacts .subcontact {
|
|
228
|
+
display: flex;
|
|
229
|
+
}
|
|
215
230
|
.subfooter .item {
|
|
216
231
|
.logo img {
|
|
217
232
|
max-height: 100px;
|
|
@@ -256,6 +271,13 @@ footer .footer-wrapper .menu {
|
|
|
256
271
|
}
|
|
257
272
|
|
|
258
273
|
@media only screen and (min-width: @computerBreakpoint) {
|
|
274
|
+
.contact-wrapper {
|
|
275
|
+
display: block;
|
|
276
|
+
padding-top: 0px;
|
|
277
|
+
}
|
|
278
|
+
.contact-wrapper .subcontact {
|
|
279
|
+
display: flex;
|
|
280
|
+
}
|
|
259
281
|
footer {
|
|
260
282
|
.footer-wrapper {
|
|
261
283
|
padding: @computerWrapperPadding;
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
@tabletContactBlockMarginBottom : @space-4;
|
|
50
50
|
@mobileContactMargin : @space-4 0;
|
|
51
51
|
@tabletContactMargin : @rem-space-050 0;
|
|
52
|
+
@tabletContactWrapperPaddingTop : @rem-space-8;
|
|
52
53
|
@contactFontSize : @font-size-2;
|
|
53
54
|
@tabletContactFontSize : @font-size-3;
|
|
54
55
|
@tabletContactGap : @rem-space-4;
|