@eeacms/volto-cca-policy 0.3.72 → 0.3.74
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/.eslintrc.js +8 -4
- package/CHANGELOG.md +78 -3
- package/locales/bg/LC_MESSAGES/volto.po +91 -34
- package/locales/cs/LC_MESSAGES/volto.po +91 -34
- package/locales/da/LC_MESSAGES/volto.po +91 -34
- package/locales/de/LC_MESSAGES/volto.po +91 -34
- package/locales/el/LC_MESSAGES/volto.po +91 -34
- package/locales/en/LC_MESSAGES/volto.po +67 -10
- package/locales/es/LC_MESSAGES/volto.po +91 -34
- package/locales/et/LC_MESSAGES/volto.po +91 -34
- package/locales/fi/LC_MESSAGES/volto.po +91 -34
- package/locales/fr/LC_MESSAGES/volto.po +91 -34
- package/locales/ga/LC_MESSAGES/volto.po +91 -34
- package/locales/hr/LC_MESSAGES/volto.po +91 -34
- package/locales/hu/LC_MESSAGES/volto.po +91 -34
- package/locales/is/LC_MESSAGES/volto.po +91 -34
- package/locales/it/LC_MESSAGES/volto.po +91 -34
- package/locales/lt/LC_MESSAGES/volto.po +91 -34
- package/locales/lv/LC_MESSAGES/volto.po +85 -27
- package/locales/mt/LC_MESSAGES/volto.po +91 -34
- package/locales/nl/LC_MESSAGES/volto.po +91 -34
- package/locales/nn/LC_MESSAGES/volto.po +37 -13
- package/locales/pl/LC_MESSAGES/volto.po +91 -34
- package/locales/pt/LC_MESSAGES/volto.po +91 -34
- package/locales/ro/LC_MESSAGES/volto.po +91 -34
- package/locales/sk/LC_MESSAGES/volto.po +91 -34
- package/locales/sl/LC_MESSAGES/volto.po +91 -34
- package/locales/sv/LC_MESSAGES/volto.po +91 -34
- package/locales/tr/LC_MESSAGES/volto.po +75 -34
- package/package.json +11 -10
- package/src/components/manage/Blocks/ASTNavigation/schema.js +3 -1
- package/src/components/manage/Blocks/C3SIndicatorsGlossaryBlock/schema.js +3 -1
- package/src/components/manage/Blocks/C3SIndicatorsListingBlock/schema.js +3 -1
- package/src/components/manage/Blocks/C3SIndicatorsOverviewBlock/schema.js +3 -1
- package/src/components/manage/Blocks/CaseStudyExplorer/FeatureDisplay.jsx +6 -1
- package/src/components/manage/Blocks/CaseStudyExplorer/styles.less +1 -1
- package/src/components/manage/Blocks/CollectionStatistics/styles.less +1 -1
- package/src/components/manage/Blocks/ContentLinks/schema.js +3 -1
- package/src/components/manage/Blocks/CountryMapHeatIndex/euro-countries-simplified.js +46197 -0
- package/src/components/manage/Blocks/CountryMapHeatIndex/styles.less +1 -1
- package/src/components/manage/Blocks/CountryMapObservatory/mapstyle.js +28 -26
- package/src/components/manage/Blocks/CountryMapObservatory/styles.less +1 -1
- package/src/components/manage/Blocks/CountryMapProfile/Interactions.jsx +1 -1
- package/src/components/manage/Blocks/CountryMapProfile/OLView.jsx +5 -5
- package/src/components/manage/Blocks/CountryMapProfile/euro-countries-simplified.js +46197 -0
- package/src/components/manage/Blocks/CountryMapProfile/styles.less +1 -1
- package/src/components/manage/Blocks/CountryProfileDetail/View.test.jsx +1 -2
- package/src/components/manage/Blocks/FlourishEmbedBlock/schema.js +3 -1
- package/src/components/manage/Blocks/RASTBlock/schema.js +3 -1
- package/src/components/manage/Blocks/ReadMore/schema.js +3 -1
- package/src/components/manage/Blocks/RelevantAceContent/schema.js +3 -1
- package/src/components/manage/Blocks/SearchAceContent/schema.js +3 -1
- package/src/components/manage/Blocks/TransRegionSelect/schema.js +3 -1
- package/src/components/manage/Blocks/index.js +0 -1
- package/src/components/theme/ASTNavigation/ASTNavigation.jsx +2 -3
- package/src/components/theme/BannerTitle/BannerTitle.jsx +2 -0
- package/src/components/theme/Header/Header.jsx +32 -22
- package/src/components/theme/Header/LanguageSwitch.jsx +2 -2
- package/src/components/theme/Views/BrokenLinks.jsx +0 -2
- package/src/components/theme/Views/CcaEventView.jsx +2 -4
- package/src/components/theme/Views/DatabaseItemView.test.jsx +1 -2
- package/src/components/theme/Widgets/GeolocationWidget.jsx +0 -2
- package/src/customizations/@plone/volto-slate/utils/volto-blocks.js +2 -5
- package/src/customizations/@plone/volto-slate/widgets/HtmlSlateWidget.jsx +27 -4
- package/src/customizations/@plone/volto-slate/widgets/README.md +2 -0
- package/src/customizations/volto/components/manage/Blocks/Grid/grid-1.svg +6 -0
- package/src/customizations/volto/components/manage/Blocks/Grid/grid-2.svg +9 -0
- package/src/customizations/volto/components/manage/Blocks/Grid/grid-3.svg +10 -0
- package/src/customizations/volto/components/manage/Blocks/Grid/grid-4.svg +11 -0
- package/src/customizations/volto/components/manage/Blocks/Grid/grid-5.svg +13 -0
- package/src/customizations/volto/components/manage/Blocks/Grid/grid-6.svg +14 -0
- package/src/customizations/volto/components/manage/Blocks/Grid/templates.js +61 -0
- package/src/customizations/volto/components/theme/App/App.jsx +3 -1
- package/src/customizations/volto/helpers/Html/Html.jsx +2 -9
- package/src/customizations/volto/middleware/api.js +190 -186
- package/src/customizations/volto/server.jsx +1 -1
- package/src/express-middleware.js +4 -2
- package/src/helpers/Utils.jsx +15 -2
- package/src/helpers/country_map/euro-countries-simplified.js +3 -1
- package/src/index.js +2 -8
- package/src/search/cca/config.js +0 -67
- package/src/search/cca/facets.js +12 -22
- package/src/search/cca/views.js +3 -1
- package/src/search/health_observatory/views-health.js +3 -1
- package/src/search/vocabulary.js +12 -0
- package/src/store/middleware.js +38 -37
- package/theme/globals/blocks.less +4 -0
- package/theme/globals/mission.less +2 -9
- package/theme/globals/observatory.less +2 -2
- package/theme/globals/views.less +25 -0
- package/src/components/theme/Views/brokenlinks.less +0 -21
- package/src/components/theme/Widgets/geolocation.css +0 -3
- package/src/customizations/volto/components/manage/UniversalLink/UniversalLink.test.jsx +0 -229
- package/src/customizations/volto/components/manage/Widgets/ArrayWidget.jsx +0 -428
- package/src/customizations/volto/components/manage/Widgets/Readme.md +0 -5
- package/src/customizations/volto/components/theme/Footer/Footer.jsx +0 -96
- package/src/policy.js +0 -135
package/src/search/cca/views.js
CHANGED
package/src/search/vocabulary.js
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
import { eea_languages } from '@eeacms/volto-cca-policy/constants';
|
|
2
|
+
import { defineMessages } from 'react-intl';
|
|
3
|
+
|
|
4
|
+
defineMessages({
|
|
5
|
+
publicationReference: {
|
|
6
|
+
id: 'Publication reference',
|
|
7
|
+
defaultMessage: 'Publications and reports',
|
|
8
|
+
},
|
|
9
|
+
video: {
|
|
10
|
+
id: 'Video',
|
|
11
|
+
defaultMessage: 'Videos and podcasts',
|
|
12
|
+
},
|
|
13
|
+
});
|
|
2
14
|
|
|
3
15
|
export const vocab = {
|
|
4
16
|
cluster_name: {
|
package/src/store/middleware.js
CHANGED
|
@@ -1,40 +1,41 @@
|
|
|
1
|
-
export const langRedirection =
|
|
2
|
-
|
|
3
|
-
) =>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
export const langRedirection =
|
|
2
|
+
({ dispatch, getState }) =>
|
|
3
|
+
(next) =>
|
|
4
|
+
(action) => {
|
|
5
|
+
if (typeof action === 'function') {
|
|
6
|
+
return next(action);
|
|
7
|
+
}
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
switch (action.type) {
|
|
10
|
+
case '@@router/LOCATION_CHANGE':
|
|
11
|
+
const { pathname } = action.payload.location;
|
|
12
|
+
const state = getState();
|
|
13
|
+
const locale = state.intl.locale || 'en';
|
|
14
|
+
const search = ['/data-and-downloads', '/advanced-search'];
|
|
15
|
+
const isSearchPage = search.some((el) => pathname.includes(el));
|
|
16
|
+
const queryString = action.payload.location.search;
|
|
17
|
+
const urlParams = new URLSearchParams(queryString);
|
|
18
|
+
const hasLanguageQueryParam = urlParams.has('set_language');
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
// sometimes there's Links where the target has moved
|
|
21
|
+
const nonApiPathname = pathname.replaceAll('++api++', '');
|
|
22
|
+
if (nonApiPathname !== pathname) {
|
|
23
|
+
action.payload.location.pathname = nonApiPathname;
|
|
24
|
+
window.history.replaceState(window.history.state, '', nonApiPathname);
|
|
25
|
+
}
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
};
|
|
27
|
+
if (
|
|
28
|
+
locale !== 'en' &&
|
|
29
|
+
!isSearchPage &&
|
|
30
|
+
!hasLanguageQueryParam &&
|
|
31
|
+
pathname.indexOf('/en/') > -1
|
|
32
|
+
) {
|
|
33
|
+
const newPathname = pathname.replaceAll('/en/', `/${locale}/`);
|
|
34
|
+
action.payload.location.pathname = newPathname;
|
|
35
|
+
window.history.replaceState(window.history.state, '', newPathname);
|
|
36
|
+
}
|
|
37
|
+
return next(action);
|
|
38
|
+
default:
|
|
39
|
+
return next(action);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
@@ -15,20 +15,13 @@
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
body.view-viewview.contenttype-subsite.section-mission
|
|
18
|
-
.block.
|
|
19
|
-
h2 {
|
|
20
|
-
color: #3d5265;
|
|
21
|
-
font-size: 23px;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
body.view-viewview.contenttype-subsite.section-mission
|
|
25
|
-
.block.__grid.teaserGrid.centered
|
|
18
|
+
.block.gridBlock
|
|
26
19
|
.image {
|
|
27
20
|
height: 260px;
|
|
28
21
|
}
|
|
29
22
|
|
|
30
23
|
body.view-viewview.contenttype-subsite.section-mission
|
|
31
|
-
.block.
|
|
24
|
+
.block.gridBlock
|
|
32
25
|
img {
|
|
33
26
|
height: 260px;
|
|
34
27
|
object-fit: contain;
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
.no-padding-tab .column-blocks-wrapper {
|
|
36
36
|
margin-bottom: 1rem;
|
|
37
37
|
|
|
38
|
-
.block.
|
|
38
|
+
.block.gridBlock {
|
|
39
39
|
margin-bottom: 0rem;
|
|
40
40
|
}
|
|
41
41
|
}
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
.block.call-to-action,
|
|
75
|
-
.block.
|
|
75
|
+
.block.gridBlock {
|
|
76
76
|
margin-bottom: 0rem;
|
|
77
77
|
}
|
|
78
78
|
|
package/theme/globals/views.less
CHANGED
|
@@ -33,6 +33,10 @@ div.geochars-field {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
.geolocation-field .ol-map {
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
}
|
|
39
|
+
|
|
36
40
|
.btn-right {
|
|
37
41
|
margin: calc(2rem - 0.1em) 0em 1rem;
|
|
38
42
|
float: right;
|
|
@@ -335,3 +339,24 @@ hr {
|
|
|
335
339
|
border-radius: 4px;
|
|
336
340
|
border: 1px solid #e5e5e5;
|
|
337
341
|
}
|
|
342
|
+
|
|
343
|
+
.broken-links-table {
|
|
344
|
+
td {
|
|
345
|
+
max-width: 200px;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
a {
|
|
349
|
+
display: block;
|
|
350
|
+
overflow: hidden;
|
|
351
|
+
text-overflow: ellipsis;
|
|
352
|
+
white-space: nowrap;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
.cursor-pointer {
|
|
356
|
+
cursor: pointer;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
.select-none {
|
|
360
|
+
user-select: none;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
.broken-links-table {
|
|
2
|
-
td {
|
|
3
|
-
max-width: 200px;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
a {
|
|
7
|
-
display: block;
|
|
8
|
-
overflow: hidden;
|
|
9
|
-
text-overflow: ellipsis;
|
|
10
|
-
white-space: nowrap;
|
|
11
|
-
// max-width: 200px;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.cursor-pointer {
|
|
15
|
-
cursor: pointer;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.select-none {
|
|
19
|
-
user-select: none;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import renderer from 'react-test-renderer';
|
|
3
|
-
import { Provider } from 'react-intl-redux';
|
|
4
|
-
import configureStore from 'redux-mock-store';
|
|
5
|
-
import { render } from '@testing-library/react';
|
|
6
|
-
import { MemoryRouter } from 'react-router-dom';
|
|
7
|
-
import UniversalLink from './UniversalLink';
|
|
8
|
-
import config from '@plone/volto/registry';
|
|
9
|
-
|
|
10
|
-
const mockStore = configureStore();
|
|
11
|
-
const store = mockStore({
|
|
12
|
-
userSession: {
|
|
13
|
-
token: null,
|
|
14
|
-
},
|
|
15
|
-
intl: {
|
|
16
|
-
locale: 'en',
|
|
17
|
-
messages: {},
|
|
18
|
-
},
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
global.console.error = jest.fn();
|
|
22
|
-
|
|
23
|
-
describe('UniversalLink', () => {
|
|
24
|
-
it('renders a UniversalLink component with internal link', () => {
|
|
25
|
-
const component = renderer.create(
|
|
26
|
-
<Provider store={store}>
|
|
27
|
-
<MemoryRouter>
|
|
28
|
-
<UniversalLink href={'/en/welcome-to-volto'}>
|
|
29
|
-
<h1>Title</h1>
|
|
30
|
-
</UniversalLink>
|
|
31
|
-
</MemoryRouter>
|
|
32
|
-
</Provider>,
|
|
33
|
-
);
|
|
34
|
-
const json = component.toJSON();
|
|
35
|
-
expect(json).toMatchSnapshot();
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
it('renders a UniversalLink component with external link', () => {
|
|
39
|
-
const component = renderer.create(
|
|
40
|
-
<Provider store={store}>
|
|
41
|
-
<MemoryRouter>
|
|
42
|
-
<UniversalLink href="https://github.com/plone/volto">
|
|
43
|
-
<h1>Title</h1>
|
|
44
|
-
</UniversalLink>
|
|
45
|
-
</MemoryRouter>
|
|
46
|
-
</Provider>,
|
|
47
|
-
);
|
|
48
|
-
const json = component.toJSON();
|
|
49
|
-
expect(json).toMatchSnapshot();
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
it('renders a UniversalLink component if no external(href) link passed', () => {
|
|
53
|
-
const component = renderer.create(
|
|
54
|
-
<Provider store={store}>
|
|
55
|
-
<MemoryRouter>
|
|
56
|
-
<UniversalLink
|
|
57
|
-
item={{
|
|
58
|
-
'@id': 'http://localhost:3000/en/welcome-to-volto',
|
|
59
|
-
}}
|
|
60
|
-
>
|
|
61
|
-
<h1>Title</h1>
|
|
62
|
-
</UniversalLink>
|
|
63
|
-
</MemoryRouter>
|
|
64
|
-
</Provider>,
|
|
65
|
-
);
|
|
66
|
-
const json = component.toJSON();
|
|
67
|
-
expect(json).toMatchSnapshot();
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
it('check UniversalLink set rel attribute for ext links', () => {
|
|
71
|
-
const { getByTitle } = render(
|
|
72
|
-
<Provider store={store}>
|
|
73
|
-
<MemoryRouter>
|
|
74
|
-
<UniversalLink
|
|
75
|
-
href="https://github.com/plone/volto"
|
|
76
|
-
title="Volto GitHub repository"
|
|
77
|
-
>
|
|
78
|
-
<h1>Title</h1>
|
|
79
|
-
</UniversalLink>
|
|
80
|
-
</MemoryRouter>
|
|
81
|
-
</Provider>,
|
|
82
|
-
);
|
|
83
|
-
|
|
84
|
-
expect(getByTitle('Volto GitHub repository').getAttribute('rel')).toBe(
|
|
85
|
-
'noopener',
|
|
86
|
-
);
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
it('check UniversalLink set target attribute for ext links', () => {
|
|
90
|
-
const { getByTitle } = render(
|
|
91
|
-
<Provider store={store}>
|
|
92
|
-
<MemoryRouter>
|
|
93
|
-
<UniversalLink
|
|
94
|
-
href="https://github.com/plone/volto"
|
|
95
|
-
title="Volto GitHub repository"
|
|
96
|
-
>
|
|
97
|
-
<h1>Title</h1>
|
|
98
|
-
</UniversalLink>
|
|
99
|
-
</MemoryRouter>
|
|
100
|
-
</Provider>,
|
|
101
|
-
);
|
|
102
|
-
|
|
103
|
-
expect(getByTitle('Volto GitHub repository').getAttribute('target')).toBe(
|
|
104
|
-
'_blank',
|
|
105
|
-
);
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
it('check UniversalLink can unset target for ext links with prop', () => {
|
|
109
|
-
const { getByTitle } = render(
|
|
110
|
-
<Provider store={store}>
|
|
111
|
-
<MemoryRouter>
|
|
112
|
-
<UniversalLink
|
|
113
|
-
href="https://github.com/plone/volto"
|
|
114
|
-
title="Volto GitHub repository"
|
|
115
|
-
openLinkInNewTab={false}
|
|
116
|
-
>
|
|
117
|
-
<h1>Title</h1>
|
|
118
|
-
</UniversalLink>
|
|
119
|
-
</MemoryRouter>
|
|
120
|
-
</Provider>,
|
|
121
|
-
);
|
|
122
|
-
|
|
123
|
-
expect(
|
|
124
|
-
getByTitle('Volto GitHub repository').getAttribute('target'),
|
|
125
|
-
).toBeNull();
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
it('check UniversalLink renders ext link for blacklisted urls', () => {
|
|
129
|
-
config.settings.externalRoutes = [
|
|
130
|
-
{
|
|
131
|
-
match: {
|
|
132
|
-
path: '/external-app',
|
|
133
|
-
exact: true,
|
|
134
|
-
strict: false,
|
|
135
|
-
},
|
|
136
|
-
url(payload) {
|
|
137
|
-
return payload.location.pathname;
|
|
138
|
-
},
|
|
139
|
-
},
|
|
140
|
-
];
|
|
141
|
-
|
|
142
|
-
const { getByTitle } = render(
|
|
143
|
-
<Provider store={store}>
|
|
144
|
-
<MemoryRouter>
|
|
145
|
-
<UniversalLink
|
|
146
|
-
href="http://localhost:3000/external-app"
|
|
147
|
-
title="Blacklisted route"
|
|
148
|
-
>
|
|
149
|
-
<h1>Title</h1>
|
|
150
|
-
</UniversalLink>
|
|
151
|
-
</MemoryRouter>
|
|
152
|
-
</Provider>,
|
|
153
|
-
);
|
|
154
|
-
|
|
155
|
-
expect(getByTitle('Blacklisted route').getAttribute('target')).toBe(
|
|
156
|
-
'_blank',
|
|
157
|
-
);
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
it('UniversalLink renders external link where link is blacklisted', () => {
|
|
161
|
-
const notInEN = /^(?!.*(#|\/en|\/static|\/controlpanel|\/cypress|\/login|\/logout|\/contact-form)).*$/;
|
|
162
|
-
config.settings.externalRoutes = [
|
|
163
|
-
{
|
|
164
|
-
match: {
|
|
165
|
-
path: notInEN,
|
|
166
|
-
exact: false,
|
|
167
|
-
strict: false,
|
|
168
|
-
},
|
|
169
|
-
url(payload) {
|
|
170
|
-
return payload.location.pathname;
|
|
171
|
-
},
|
|
172
|
-
},
|
|
173
|
-
];
|
|
174
|
-
|
|
175
|
-
const { getByTitle } = render(
|
|
176
|
-
<Provider store={store}>
|
|
177
|
-
<MemoryRouter>
|
|
178
|
-
<UniversalLink
|
|
179
|
-
href="http://localhost:3000/blacklisted-app"
|
|
180
|
-
title="External blacklisted app"
|
|
181
|
-
>
|
|
182
|
-
<h1>Title</h1>
|
|
183
|
-
</UniversalLink>
|
|
184
|
-
</MemoryRouter>
|
|
185
|
-
</Provider>,
|
|
186
|
-
);
|
|
187
|
-
|
|
188
|
-
expect(getByTitle('External blacklisted app').getAttribute('target')).toBe(
|
|
189
|
-
'_blank',
|
|
190
|
-
);
|
|
191
|
-
expect(getByTitle('External blacklisted app').getAttribute('rel')).toBe(
|
|
192
|
-
'noopener',
|
|
193
|
-
);
|
|
194
|
-
});
|
|
195
|
-
|
|
196
|
-
it('check UniversalLink does not break with error in item', () => {
|
|
197
|
-
const component = renderer.create(
|
|
198
|
-
<Provider store={store}>
|
|
199
|
-
<MemoryRouter>
|
|
200
|
-
<UniversalLink
|
|
201
|
-
item={{
|
|
202
|
-
error: 'Error while fetching content',
|
|
203
|
-
message: 'Something went wrong',
|
|
204
|
-
}}
|
|
205
|
-
>
|
|
206
|
-
<h1>Title</h1>
|
|
207
|
-
</UniversalLink>
|
|
208
|
-
</MemoryRouter>
|
|
209
|
-
</Provider>,
|
|
210
|
-
);
|
|
211
|
-
const json = component.toJSON();
|
|
212
|
-
expect(json).toMatchSnapshot();
|
|
213
|
-
expect(global.console.error).toHaveBeenCalled();
|
|
214
|
-
});
|
|
215
|
-
});
|
|
216
|
-
|
|
217
|
-
it('renders a UniversalLink component when url ends with @@display-file', () => {
|
|
218
|
-
const component = renderer.create(
|
|
219
|
-
<Provider store={store}>
|
|
220
|
-
<MemoryRouter>
|
|
221
|
-
<UniversalLink href="http://localhost:3000/en/welcome-to-volto/@@display-file">
|
|
222
|
-
<h1>Title</h1>
|
|
223
|
-
</UniversalLink>
|
|
224
|
-
</MemoryRouter>
|
|
225
|
-
</Provider>,
|
|
226
|
-
);
|
|
227
|
-
const json = component.toJSON();
|
|
228
|
-
expect(json).toMatchSnapshot();
|
|
229
|
-
});
|