@eeacms/volto-eea-design-system 1.32.2 → 1.32.4

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,6 +4,18 @@ 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.4](https://github.com/eea/volto-eea-design-system/compare/1.32.3...1.32.4) - 29 August 2024
8
+
9
+ #### :bug: Bug Fixes
10
+
11
+ - fix: Improve sites button to use design system classes - refs #265857 [dobri1408 - [`274ec63`](https://github.com/eea/volto-eea-design-system/commit/274ec63b45e8a69af3cf44b45e0a29a4d109750d)]
12
+
13
+ ### [1.32.3](https://github.com/eea/volto-eea-design-system/compare/1.32.2...1.32.3) - 29 August 2024
14
+
15
+ #### :bug: Bug Fixes
16
+
17
+ - fix: Update FooterSitesButton.jsx to use UniversalLink - refs #265857 [dobri1408 - [`c53fc12`](https://github.com/eea/volto-eea-design-system/commit/c53fc1297456290de0906552d873c00f8228758d)]
18
+
7
19
  ### [1.32.2](https://github.com/eea/volto-eea-design-system/compare/1.32.1...1.32.2) - 28 August 2024
8
20
 
9
21
  #### :bug: Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-design-system",
3
- "version": "1.32.2",
3
+ "version": "1.32.4",
4
4
  "description": "@eeacms/volto-eea-design-system: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -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
- <Router history={history}>
28
- <Default {...Default.args} />
29
- </Router>,
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
- <Router history={history}>
53
- <Footer>
54
- <Footer.SubFooter {...Default.args}>
55
- <div>SubFooter test</div>
56
- </Footer.SubFooter>
57
- <Footer.Header>{Default.args.header}</Footer.Header>
58
- <Footer.Sites sites={Default.args.sites}>
59
- <div>Sites test</div>
60
- </Footer.Sites>
61
- <Footer.Actions
62
- actions={Default.args.actions}
63
- copyright={Default.args.copyright}
64
- />
65
- </Footer>
66
- </Router>,
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
- <Router history={history}>
86
- <Footer>
87
- <Footer.SubFooter
88
- {...Default.args}
89
- description={'test description'}
90
- social={undefined}
91
- />
92
- <Footer.Header>{Default.args.header}</Footer.Header>
93
- <Footer.Sites sites={Default.args.sites} />
94
- <Footer.Actions
95
- actions={Default.args.actions}
96
- copyright={Default.args.copyright}
97
- >
98
- <div>Actions test</div>
99
- </Footer.Actions>
100
- </Footer>
101
- </Router>,
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 { isInternalURL, flattenToAppURL } from '@plone/volto/helpers';
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
- <Button
15
- className="theme-sites-button"
16
- onClick={() => {
17
- if (__CLIENT__ && window) {
18
- window.location.assign(
19
- isInternalURL(props.hrefButton)
20
- ? flattenToAppURL(props.hrefButton)
21
- : props.hrefButton,
22
- );
23
- }
24
- }}
12
+ <UniversalLink
13
+ href={props.hrefButton}
14
+ className="ui button white inverted theme-sites-button"
15
+ openLinkInNewTab={false}
25
16
  >
26
17
  {props.buttonName}
27
- </Button>
18
+ </UniversalLink>
28
19
  </div>
29
20
  );
30
21
  };
@@ -25,17 +25,19 @@ footer {
25
25
  width: @wrapperWidth;
26
26
  padding: @mobileWrapperPadding;
27
27
  }
28
+ .theme-sites {
29
+ display: flex;
30
+ width: 100%;
31
+ justify-content: center;
32
+ }
28
33
  .theme-sites-button {
29
- background: @themeSitesButtonBackground !important;
30
34
  font-size: @themeSitesButtonFontSize !important;
31
35
  padding: @themeSitesButtonPadding !important;
32
- color: @themeSitesButtonColor !important;
33
36
  border: @themeSitesButtonBorder !important;
34
37
  }
35
- .theme-sites {
36
- display: flex;
37
- width: 100%;
38
- justify-content: center;
38
+
39
+ .ui.button.theme-sites-button {
40
+ box-shadow: @themeSitesButtonBoxShadow !important;
39
41
  }
40
42
  }
41
43
 
@@ -31,6 +31,7 @@
31
31
  @themeSitesButtonPadding : 1rem 2rem;
32
32
  @themeSitesButtonColor : white;
33
33
  @themeSitesButtonBorder : 1px solid white;
34
+ @themeSitesButtonBoxShadow : none;
34
35
 
35
36
  /* Sub-footer Item */
36
37
  @subFooterItemDisplay: flex;