@eeacms/volto-eea-website-theme 1.27.1 → 1.27.2
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 +2 -2
- package/CHANGELOG.md +10 -0
- package/package.json +1 -1
- package/src/index.js +1 -6
- package/src/index.test.js +0 -6
- package/src/components/theme/AppExtras/RemoveSchema.jsx +0 -29
- package/src/middleware/apiEnhancer.js +0 -11
- package/src/middleware/index.js +0 -10
- package/src/reducers/index.js +0 -18
- package/src/reducers/schema.js +0 -48
package/.eslintrc.js
CHANGED
@@ -3,7 +3,7 @@ const path = require('path');
|
|
3
3
|
|
4
4
|
const projectRootPath = fs.existsSync('./project')
|
5
5
|
? fs.realpathSync('./project')
|
6
|
-
: fs.realpathSync('
|
6
|
+
: fs.realpathSync(__dirname + '/../../../');
|
7
7
|
const packageJson = require(path.join(projectRootPath, 'package.json'));
|
8
8
|
const jsConfig = require(path.join(projectRootPath, 'jsconfig.json')).compilerOptions;
|
9
9
|
|
@@ -51,6 +51,6 @@ module.exports = {
|
|
51
51
|
allowReferrer: true,
|
52
52
|
},
|
53
53
|
],
|
54
|
-
}
|
54
|
+
}
|
55
55
|
};
|
56
56
|
|
package/CHANGELOG.md
CHANGED
@@ -4,6 +4,16 @@ 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.27.2](https://github.com/eea/volto-eea-website-theme/compare/1.27.1...1.27.2) - 23 January 2024
|
8
|
+
|
9
|
+
#### :bug: Bug Fixes
|
10
|
+
|
11
|
+
- fix(lint): service so that it work with editor and command line tool [David Ichim - [`ad43bc2`](https://github.com/eea/volto-eea-website-theme/commit/ad43bc2f9bfc3e272d30b35db9d4b160a8edcbec)]
|
12
|
+
|
13
|
+
#### :hammer_and_wrench: Others
|
14
|
+
|
15
|
+
- fix tests [Razvan - [`042330b`](https://github.com/eea/volto-eea-website-theme/commit/042330bc97d32ffe7ba769b4f2453f71cffed706)]
|
16
|
+
- remove RemoveSchema logic [Razvan - [`08d10f8`](https://github.com/eea/volto-eea-website-theme/commit/08d10f8bf6f75478260e4e4c66d7316ba87b907a)]
|
7
17
|
### [1.27.1](https://github.com/eea/volto-eea-website-theme/compare/1.27.0...1.27.1) - 18 January 2024
|
8
18
|
|
9
19
|
#### :bug: Bug Fixes
|
package/package.json
CHANGED
package/src/index.js
CHANGED
@@ -26,8 +26,6 @@ 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';
|
31
29
|
|
32
30
|
import { nanoid } from '@plone/volto-slate/utils';
|
33
31
|
import { v4 as uuid } from 'uuid';
|
@@ -528,10 +526,7 @@ const applyConfig = (config) => {
|
|
528
526
|
});
|
529
527
|
|
530
528
|
// Custom blocks: Title
|
531
|
-
return [installCustomTitle,
|
532
|
-
(acc, apply) => apply(acc),
|
533
|
-
config,
|
534
|
-
);
|
529
|
+
return [installCustomTitle].reduce((acc, apply) => apply(acc), config);
|
535
530
|
};
|
536
531
|
|
537
532
|
export default applyConfig;
|
package/src/index.test.js
CHANGED
@@ -45,10 +45,6 @@ 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
|
-
);
|
52
48
|
|
53
49
|
global.__SERVER__ = true;
|
54
50
|
|
@@ -144,7 +140,6 @@ describe('applyConfig', () => {
|
|
144
140
|
{ match: '', component: 'MockedDraftBackground' },
|
145
141
|
{ match: '', component: 'MockedSubsiteClass' },
|
146
142
|
{ match: '', component: BaseTag },
|
147
|
-
{ match: '*', exclude: '/**/diff', component: 'MockedRemoveSchema' },
|
148
143
|
]);
|
149
144
|
expect(config.settings.available_colors).toEqual(eea.colors);
|
150
145
|
expect(config.settings.hasLanguageDropdown).toBe(false);
|
@@ -303,7 +298,6 @@ describe('applyConfig', () => {
|
|
303
298
|
{ match: '', component: 'MockedDraftBackground' },
|
304
299
|
{ match: '', component: 'MockedSubsiteClass' },
|
305
300
|
{ match: '', component: BaseTag },
|
306
|
-
{ match: '*', exclude: '/**/diff', component: 'MockedRemoveSchema' },
|
307
301
|
]);
|
308
302
|
expect(config.settings.available_colors).toEqual(eea.colors);
|
309
303
|
expect(config.settings.hasLanguageDropdown).toBe(false);
|
@@ -1,29 +0,0 @@
|
|
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/middleware/index.js
DELETED
package/src/reducers/index.js
DELETED
@@ -1,18 +0,0 @@
|
|
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
|
-
exclude: '/**/diff',
|
13
|
-
component: RemoveSchema,
|
14
|
-
},
|
15
|
-
];
|
16
|
-
|
17
|
-
return config;
|
18
|
-
}
|
package/src/reducers/schema.js
DELETED
@@ -1,48 +0,0 @@
|
|
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
|
-
}
|