@eeacms/volto-eea-website-theme 1.25.0 → 1.26.1
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 +32 -2
- package/package.json +1 -1
- package/src/actions/index.js +1 -0
- package/src/actions/schema.js +5 -0
- package/src/components/theme/AppExtras/RemoveSchema.jsx +29 -0
- package/src/index.js +6 -1
- package/src/index.test.js +8 -0
- package/src/middleware/apiEnhancer.js +11 -0
- package/src/middleware/index.js +10 -0
- package/src/reducers/index.js +17 -0
- package/src/reducers/schema.js +48 -0
package/CHANGELOG.md
CHANGED
@@ -4,11 +4,25 @@ 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.
|
7
|
+
### [1.26.1](https://github.com/eea/volto-eea-website-theme/compare/1.26.0...1.26.1) - 14 December 2023
|
8
|
+
|
9
|
+
#### :rocket: New Features
|
10
|
+
|
11
|
+
- feat: add bg color to status [Miu Razvan - [`1f432cf`](https://github.com/eea/volto-eea-website-theme/commit/1f432cff747ae128e3743eeb484ff3812ecbb3a9)]
|
8
12
|
|
9
13
|
#### :bug: Bug Fixes
|
10
14
|
|
11
|
-
- fix:
|
15
|
+
- fix: remove schema if content type is not the same as for the schema [Miu Razvan - [`0056fa9`](https://github.com/eea/volto-eea-website-theme/commit/0056fa9d68efb7d2f118c9767d756efbfb100f21)]
|
16
|
+
|
17
|
+
#### :hammer_and_wrench: Others
|
18
|
+
|
19
|
+
- merge master into this branch [Miu Razvan - [`8e50b55`](https://github.com/eea/volto-eea-website-theme/commit/8e50b551029b99f1cb1e3f2456d1bc6066c3d30a)]
|
20
|
+
- bump version [Miu Razvan - [`69ee513`](https://github.com/eea/volto-eea-website-theme/commit/69ee51378cf6f5dddab0d5c54c3f5e4942756562)]
|
21
|
+
- fix tests [Miu Razvan - [`aa3d5c9`](https://github.com/eea/volto-eea-website-theme/commit/aa3d5c9aee1a49f7cdeb760c074f66029504c4de)]
|
22
|
+
- clean up [Miu Razvan - [`2a3f3dc`](https://github.com/eea/volto-eea-website-theme/commit/2a3f3dc14203b5641ee325256503527d550e9c5b)]
|
23
|
+
### [1.26.0](https://github.com/eea/volto-eea-website-theme/compare/1.25.0...1.26.0) - 13 December 2023
|
24
|
+
|
25
|
+
### [1.25.0](https://github.com/eea/volto-eea-website-theme/compare/1.24.3...1.25.0) - 13 December 2023
|
12
26
|
|
13
27
|
#### :house: Documentation changes
|
14
28
|
|
@@ -60,6 +74,11 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
60
74
|
- test: Add real image to cypress test [Alin Voinea - [`4ff591a`](https://github.com/eea/volto-eea-website-theme/commit/4ff591ae3318c9588b4e2114582c0fa6cfdf31ae)]
|
61
75
|
- test: Add cypress tests for Image block styling position and align [Alin Voinea - [`7341ef7`](https://github.com/eea/volto-eea-website-theme/commit/7341ef7b92714fc0cc3ab0c31c39033e7b3e19e7)]
|
62
76
|
- Revert "change(tests): commented out rss test since title block config is missing" [Alin Voinea - [`fb61191`](https://github.com/eea/volto-eea-website-theme/commit/fb611918d6ca380b89b594f283dcf9f685a4b294)]
|
77
|
+
- test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`6a3be30`](https://github.com/eea/volto-eea-website-theme/commit/6a3be3092589411af7808a235f76de5222fd3868)]
|
78
|
+
- test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`c3978f2`](https://github.com/eea/volto-eea-website-theme/commit/c3978f23375ef066e9fd6f6c2e34ba6c1c058f69)]
|
79
|
+
- test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`f672779`](https://github.com/eea/volto-eea-website-theme/commit/f672779e845bec9240ccc901e9f53ec80c5a1819)]
|
80
|
+
- test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`ae5d8e3`](https://github.com/eea/volto-eea-website-theme/commit/ae5d8e3f4e04dc2808d47ce2ee886e1b23b528da)]
|
81
|
+
- test: [JENKINS] Improve cypress time [valentinab25 - [`170ff0c`](https://github.com/eea/volto-eea-website-theme/commit/170ff0c8e3b30e69479bdf1117e811fea94f1027)]
|
63
82
|
### [1.23.0](https://github.com/eea/volto-eea-website-theme/compare/1.22.1...1.23.0) - 2 November 2023
|
64
83
|
|
65
84
|
#### :rocket: New Features
|
@@ -72,6 +91,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
72
91
|
|
73
92
|
#### :house: Internal changes
|
74
93
|
|
94
|
+
- chore: [JENKINS] Refactor automated testing [valentinab25 - [`f28fce3`](https://github.com/eea/volto-eea-website-theme/commit/f28fce3d1eb815f95fb9aa40de42b10b7e8e30c5)]
|
75
95
|
- chore: husky, lint-staged use fixed versions [valentinab25 - [`6d15088`](https://github.com/eea/volto-eea-website-theme/commit/6d150886c5aeb2ca0b569270486e60f7cc274e2c)]
|
76
96
|
- chore:volto 16 in tests, update docs, fix stylelint overrides [valentinab25 - [`20c0323`](https://github.com/eea/volto-eea-website-theme/commit/20c032380b33c0077c869a05136f93e2fb68e5d4)]
|
77
97
|
|
@@ -257,6 +277,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
257
277
|
|
258
278
|
#### :house: Internal changes
|
259
279
|
|
280
|
+
- chore: [JENKINS] Deprecate circularity website [valentinab25 - [`370dcbf`](https://github.com/eea/volto-eea-website-theme/commit/370dcbfbf1a8135ce7b1b3b271b004552a631837)]
|
260
281
|
|
261
282
|
#### :hammer_and_wrench: Others
|
262
283
|
|
@@ -412,6 +433,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
412
433
|
|
413
434
|
#### :hammer_and_wrench: Others
|
414
435
|
|
436
|
+
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`6c5e2f8`](https://github.com/eea/volto-eea-website-theme/commit/6c5e2f80456e2061d9e9c15fd0a0b91b9ac70568)]
|
415
437
|
### [1.9.1](https://github.com/eea/volto-eea-website-theme/compare/1.9.0...1.9.1) - 28 February 2023
|
416
438
|
|
417
439
|
#### :bug: Bug Fixes
|
@@ -558,6 +580,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
558
580
|
|
559
581
|
- For some reasons types is a string [Alin Voinea - [`3769a09`](https://github.com/eea/volto-eea-website-theme/commit/3769a0981181d5b633f3498daebbe96be8b4b833)]
|
560
582
|
- Fix(redirect): o.filter - refs #157627 [Alin Voinea - [`deb23da`](https://github.com/eea/volto-eea-website-theme/commit/deb23da846444cc96539697fd798429ae0abe89e)]
|
583
|
+
- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`f1fffc5`](https://github.com/eea/volto-eea-website-theme/commit/f1fffc5db96725440863d545580b4e76cce4b796)]
|
561
584
|
### [1.5.0](https://github.com/eea/volto-eea-website-theme/compare/1.4.2...1.5.0) - 9 January 2023
|
562
585
|
|
563
586
|
#### :hammer_and_wrench: Others
|
@@ -591,6 +614,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
591
614
|
|
592
615
|
- Release 1.4.0 [Alin Voinea - [`bd42a0d`](https://github.com/eea/volto-eea-website-theme/commit/bd42a0d26e928cac5d99933194755da3db06b341)]
|
593
616
|
- bump version to use as volto-eea-design-system [David Ichim - [`f4be047`](https://github.com/eea/volto-eea-website-theme/commit/f4be047328b46399b03b612d378b18aaf82e7dc1)]
|
617
|
+
- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`9b7cfef`](https://github.com/eea/volto-eea-website-theme/commit/9b7cfefb4d34fc1c948015e491feb370f9795bd8)]
|
594
618
|
- test(Jenkins): Run tests and cypress with latest canary @plone/volto [Alin Voinea - [`df252a9`](https://github.com/eea/volto-eea-website-theme/commit/df252a9bfed0bb86cadf53c59dd1603b1e2cd822)]
|
595
619
|
### [1.3.2](https://github.com/eea/volto-eea-website-theme/compare/1.3.1...1.3.2) - 16 December 2022
|
596
620
|
|
@@ -600,6 +624,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
600
624
|
|
601
625
|
#### :hammer_and_wrench: Others
|
602
626
|
|
627
|
+
- Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`a43c658`](https://github.com/eea/volto-eea-website-theme/commit/a43c658a7920c8df95e763b9a637f38ce77eba2c)]
|
603
628
|
- Better razzle.config [Tiberiu Ichim - [`81dbf48`](https://github.com/eea/volto-eea-website-theme/commit/81dbf48815fb27facb4f82c9b764540fdf188b2e)]
|
604
629
|
- Better razzle.config [Tiberiu Ichim - [`7bc9da2`](https://github.com/eea/volto-eea-website-theme/commit/7bc9da2cd837ab62a95cd29979cdd9b0055b7d67)]
|
605
630
|
### [1.3.1](https://github.com/eea/volto-eea-website-theme/compare/1.3.0...1.3.1) - 28 November 2022
|
@@ -610,6 +635,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
610
635
|
|
611
636
|
#### :hammer_and_wrench: Others
|
612
637
|
|
638
|
+
- yarn 3 [Alin Voinea - [`ea7a709`](https://github.com/eea/volto-eea-website-theme/commit/ea7a7094945312776e9b6f44e371178603e92139)]
|
613
639
|
### [1.3.0](https://github.com/eea/volto-eea-website-theme/compare/1.2.0...1.3.0) - 22 November 2022
|
614
640
|
|
615
641
|
#### :rocket: New Features
|
@@ -650,6 +676,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
650
676
|
- Add subsite class to body [Tiberiu Ichim - [`74d700f`](https://github.com/eea/volto-eea-website-theme/commit/74d700fbfd6249a8604762a7e4e49cce857db0f3)]
|
651
677
|
- Add subsite info to header [Tiberiu Ichim - [`47daf8b`](https://github.com/eea/volto-eea-website-theme/commit/47daf8bb6374a1222040626b19d4154df7ba1b83)]
|
652
678
|
- fix eslint [Miu Razvan - [`eb8d0a7`](https://github.com/eea/volto-eea-website-theme/commit/eb8d0a790bc70c0aae256c6ff35f63c4885f338e)]
|
679
|
+
- Add Sonarqube tag using circularity-frontend addons list [EEA Jenkins - [`cc578a4`](https://github.com/eea/volto-eea-website-theme/commit/cc578a413b205a8e61e091fab3a88f94cedefc89)]
|
653
680
|
### [1.1.0](https://github.com/eea/volto-eea-website-theme/compare/1.0.0...1.1.0) - 28 October 2022
|
654
681
|
|
655
682
|
#### :nail_care: Enhancements
|
@@ -697,6 +724,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
697
724
|
|
698
725
|
#### :hammer_and_wrench: Others
|
699
726
|
|
727
|
+
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`33b56ac`](https://github.com/eea/volto-eea-website-theme/commit/33b56acb13fbaf0c5b79e8fc6e13c4b699c79c90)]
|
700
728
|
### [0.7.3](https://github.com/eea/volto-eea-website-theme/compare/0.7.2...0.7.3) - 22 September 2022
|
701
729
|
|
702
730
|
#### :hammer_and_wrench: Others
|
@@ -964,6 +992,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
964
992
|
- Header refactor, add custom logo #5 [ichim-david - [`4950235`](https://github.com/eea/volto-eea-website-theme/commit/49502358105437cfeac3b144e6d301cb59aa2346)]
|
965
993
|
- Update footer.config with new publication card component [ichim-david - [`2e38e9a`](https://github.com/eea/volto-eea-website-theme/commit/2e38e9a417f835009d60c80d4eb4b30229f55e45)]
|
966
994
|
- feature(breadcrumbs): implement eea-design-system breadcrumb as Volto component #32 #7 [ichim-david - [`181af41`](https://github.com/eea/volto-eea-website-theme/commit/181af4125ce2b9ddac56dab4723cb11c26633221)]
|
995
|
+
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`da8ceb6`](https://github.com/eea/volto-eea-website-theme/commit/da8ceb68ea68bfbc9504e48ccd4d68277f11ab9a)]
|
967
996
|
- use breadcrumbs from eea-design-system [nileshgulia1 - [`db2f9e9`](https://github.com/eea/volto-eea-website-theme/commit/db2f9e9a4327420a3cce9a9903cd88549b129eab)]
|
968
997
|
- Update theme.config [ichim-david - [`8eca4f4`](https://github.com/eea/volto-eea-website-theme/commit/8eca4f40397a4aeca6d39029c92db78968d37064)]
|
969
998
|
- Added keyContent component to theme.config [ichim-david - [`d86f202`](https://github.com/eea/volto-eea-website-theme/commit/d86f202d0274d839487a88b51cae9a0e899beb23)]
|
@@ -1005,4 +1034,5 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
1005
1034
|
|
1006
1035
|
#### :hammer_and_wrench: Others
|
1007
1036
|
|
1037
|
+
- yarn bootstrap [Alin Voinea - [`6995e9e`](https://github.com/eea/volto-eea-website-theme/commit/6995e9e091f21fdbbdffa8a44fc0e2c626f6d46a)]
|
1008
1038
|
- Initial commit [Alin Voinea - [`6a9c03a`](https://github.com/eea/volto-eea-website-theme/commit/6a9c03a7cebe71ca87e82cf58c42904063e9d8d3)]
|
package/package.json
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
export * from './schema';
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { useEffect } from 'react';
|
2
|
+
import { connect } from 'react-redux';
|
3
|
+
import { removeSchema } from '@eeacms/volto-eea-website-theme/actions';
|
4
|
+
import { flattenToAppURL } from '@plone/volto/helpers';
|
5
|
+
|
6
|
+
function RemoveSchema({ removeSchema, contentLoading, content, schema }) {
|
7
|
+
useEffect(() => {
|
8
|
+
if (
|
9
|
+
!schema.loading &&
|
10
|
+
!contentLoading &&
|
11
|
+
schema.schema &&
|
12
|
+
(!content ||
|
13
|
+
(content && schema.contentUrl !== flattenToAppURL(content['@id'])))
|
14
|
+
) {
|
15
|
+
removeSchema();
|
16
|
+
}
|
17
|
+
}, [removeSchema, content, contentLoading, schema]);
|
18
|
+
|
19
|
+
return null;
|
20
|
+
}
|
21
|
+
|
22
|
+
export default connect(
|
23
|
+
(state) => ({
|
24
|
+
content: state.content.data,
|
25
|
+
contentLoading: state.content.get.loading,
|
26
|
+
schema: state.schema,
|
27
|
+
}),
|
28
|
+
{ removeSchema },
|
29
|
+
)(RemoveSchema);
|
package/src/index.js
CHANGED
@@ -26,6 +26,8 @@ import contentBoxSVG from './icons/content-box.svg';
|
|
26
26
|
import okMiddleware from './middleware/ok';
|
27
27
|
import voltoCustomMiddleware from './middleware/voltoCustom';
|
28
28
|
import installSlate from './slate';
|
29
|
+
import installReducers from './reducers';
|
30
|
+
import installMiddlewares from './middleware';
|
29
31
|
|
30
32
|
import * as eea from './config';
|
31
33
|
import React from 'react';
|
@@ -493,7 +495,10 @@ const applyConfig = (config) => {
|
|
493
495
|
});
|
494
496
|
|
495
497
|
// Custom blocks: Title
|
496
|
-
return [installCustomTitle].reduce(
|
498
|
+
return [installCustomTitle, installMiddlewares, installReducers].reduce(
|
499
|
+
(acc, apply) => apply(acc),
|
500
|
+
config,
|
501
|
+
);
|
497
502
|
};
|
498
503
|
|
499
504
|
export default applyConfig;
|
package/src/index.test.js
CHANGED
@@ -45,12 +45,17 @@ jest.mock(
|
|
45
45
|
jest.mock('@plone/volto/components', () => ({
|
46
46
|
Icon: 'MockedIcon',
|
47
47
|
}));
|
48
|
+
jest.mock(
|
49
|
+
'@eeacms/volto-eea-website-theme/components/theme/AppExtras/RemoveSchema',
|
50
|
+
() => 'MockedRemoveSchema',
|
51
|
+
);
|
48
52
|
|
49
53
|
global.__SERVER__ = true;
|
50
54
|
|
51
55
|
describe('applyConfig', () => {
|
52
56
|
it('should update the config settings with EEA specific settings', () => {
|
53
57
|
const originalConfig = {
|
58
|
+
addonReducers: {},
|
54
59
|
blocks: {
|
55
60
|
blocksConfig: {
|
56
61
|
title: {
|
@@ -139,6 +144,7 @@ describe('applyConfig', () => {
|
|
139
144
|
{ match: '', component: 'MockedDraftBackground' },
|
140
145
|
{ match: '', component: 'MockedSubsiteClass' },
|
141
146
|
{ match: '', component: BaseTag },
|
147
|
+
{ match: '*', component: 'MockedRemoveSchema' },
|
142
148
|
]);
|
143
149
|
expect(config.settings.available_colors).toEqual(eea.colors);
|
144
150
|
expect(config.settings.hasLanguageDropdown).toBe(false);
|
@@ -183,6 +189,7 @@ describe('applyConfig', () => {
|
|
183
189
|
|
184
190
|
it('should update the config settings with EEA specific settings', () => {
|
185
191
|
const originalConfig = {
|
192
|
+
addonReducers: {},
|
186
193
|
blocks: {
|
187
194
|
blocksConfig: {
|
188
195
|
title: {
|
@@ -296,6 +303,7 @@ describe('applyConfig', () => {
|
|
296
303
|
{ match: '', component: 'MockedDraftBackground' },
|
297
304
|
{ match: '', component: 'MockedSubsiteClass' },
|
298
305
|
{ match: '', component: BaseTag },
|
306
|
+
{ match: '*', component: 'MockedRemoveSchema' },
|
299
307
|
]);
|
300
308
|
expect(config.settings.available_colors).toEqual(eea.colors);
|
301
309
|
expect(config.settings.hasLanguageDropdown).toBe(false);
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import RemoveSchema from '@eeacms/volto-eea-website-theme/components/theme/AppExtras/RemoveSchema';
|
2
|
+
|
3
|
+
import schema from './schema';
|
4
|
+
|
5
|
+
export default function applyConfig(config) {
|
6
|
+
config.addonReducers.schema = schema;
|
7
|
+
|
8
|
+
config.settings.appExtras = [
|
9
|
+
...(config.settings.appExtras || []),
|
10
|
+
{
|
11
|
+
match: '*',
|
12
|
+
component: RemoveSchema,
|
13
|
+
},
|
14
|
+
];
|
15
|
+
|
16
|
+
return config;
|
17
|
+
}
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import voltoSchema from '@plone/volto/reducers/schema/schema';
|
2
|
+
|
3
|
+
const initialState = {
|
4
|
+
contentUrl: null,
|
5
|
+
contentType: null,
|
6
|
+
error: null,
|
7
|
+
loaded: false,
|
8
|
+
loading: false,
|
9
|
+
schema: null,
|
10
|
+
post: {
|
11
|
+
loaded: false,
|
12
|
+
loading: false,
|
13
|
+
error: null,
|
14
|
+
},
|
15
|
+
update: {
|
16
|
+
loaded: false,
|
17
|
+
loading: false,
|
18
|
+
error: null,
|
19
|
+
},
|
20
|
+
put: {
|
21
|
+
loaded: false,
|
22
|
+
loading: false,
|
23
|
+
error: null,
|
24
|
+
},
|
25
|
+
};
|
26
|
+
|
27
|
+
export default function schema(state = initialState, action = {}) {
|
28
|
+
if (action.type === 'REMOVE_SCHEMA') {
|
29
|
+
return {
|
30
|
+
...state,
|
31
|
+
error: null,
|
32
|
+
loading: false,
|
33
|
+
loaded: false,
|
34
|
+
schema: null,
|
35
|
+
};
|
36
|
+
}
|
37
|
+
|
38
|
+
if (action.type === 'GET_SCHEMA_SUCCESS') {
|
39
|
+
const [contentUrl, contentType] = action._request.path.split('/@types/');
|
40
|
+
return {
|
41
|
+
...voltoSchema(state, action),
|
42
|
+
contentUrl,
|
43
|
+
contentType,
|
44
|
+
};
|
45
|
+
}
|
46
|
+
|
47
|
+
return voltoSchema(state, action);
|
48
|
+
}
|