@eeacms/volto-timeline-block 1.1.4 → 2.0.0
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 +65 -0
- package/CHANGELOG.md +21 -18
- package/README.md +2 -2
- package/cypress.config.js +3 -3
- package/jest-addon.config.js +19 -4
- package/jest.setup.js +65 -0
- package/package.json +4 -3
- package/src/TimelineBlock/index.js +3 -1
- package/src/TimelineBlock/schema.js +3 -1
- package/.project.eslintrc.js +0 -48
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const projectRootPath = fs.realpathSync(__dirname + '/../../../');
|
|
4
|
+
|
|
5
|
+
let voltoPath = path.join(projectRootPath, 'node_modules/@plone/volto');
|
|
6
|
+
let configFile;
|
|
7
|
+
if (fs.existsSync(`${projectRootPath}/tsconfig.json`))
|
|
8
|
+
configFile = `${projectRootPath}/tsconfig.json`;
|
|
9
|
+
else if (fs.existsSync(`${projectRootPath}/jsconfig.json`))
|
|
10
|
+
configFile = `${projectRootPath}/jsconfig.json`;
|
|
11
|
+
|
|
12
|
+
if (configFile) {
|
|
13
|
+
const jsConfig = require(configFile).compilerOptions;
|
|
14
|
+
const pathsConfig = jsConfig.paths;
|
|
15
|
+
if (pathsConfig['@plone/volto'])
|
|
16
|
+
voltoPath = `./${jsConfig.baseUrl}/${pathsConfig['@plone/volto'][0]}`;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const AddonConfigurationRegistry = require(`${voltoPath}/addon-registry.js`);
|
|
20
|
+
const reg = new AddonConfigurationRegistry(projectRootPath);
|
|
21
|
+
|
|
22
|
+
// Extends ESlint configuration for adding the aliases to `src` directories in Volto addons
|
|
23
|
+
const addonAliases = Object.keys(reg.packages).map((o) => [
|
|
24
|
+
o,
|
|
25
|
+
reg.packages[o].modulePath,
|
|
26
|
+
]);
|
|
27
|
+
|
|
28
|
+
const addonExtenders = reg.getEslintExtenders().map((m) => require(m));
|
|
29
|
+
|
|
30
|
+
const defaultConfig = {
|
|
31
|
+
extends: `${voltoPath}/.eslintrc`,
|
|
32
|
+
settings: {
|
|
33
|
+
'import/resolver': {
|
|
34
|
+
alias: {
|
|
35
|
+
map: [
|
|
36
|
+
['@plone/volto', '@plone/volto/src'],
|
|
37
|
+
['@plone/volto-slate', '@plone/volto/packages/volto-slate/src'],
|
|
38
|
+
...addonAliases,
|
|
39
|
+
['@package', `${__dirname}/src`],
|
|
40
|
+
['@root', `${__dirname}/src`],
|
|
41
|
+
['~', `${__dirname}/src`],
|
|
42
|
+
],
|
|
43
|
+
extensions: ['.js', '.jsx', '.json'],
|
|
44
|
+
},
|
|
45
|
+
'babel-plugin-root-import': {
|
|
46
|
+
rootPathSuffix: 'src',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
rules: {
|
|
51
|
+
'react/jsx-no-target-blank': [
|
|
52
|
+
'error',
|
|
53
|
+
{
|
|
54
|
+
allowReferrer: true,
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const config = addonExtenders.reduce(
|
|
61
|
+
(acc, extender) => extender.modify(acc),
|
|
62
|
+
defaultConfig,
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
module.exports = config;
|
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,27 @@ 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
|
+
### [2.0.0](https://github.com/eea/volto-timeline-block/compare/1.1.5...2.0.0) - 22 April 2024
|
|
8
|
+
|
|
9
|
+
#### :rocket: New Features
|
|
10
|
+
|
|
11
|
+
- feat: Release 2.0.0 - Volto 17 support [alin - [`00f65bb`](https://github.com/eea/volto-timeline-block/commit/00f65bba9d2fa20bf0095a8942933e73c8e8f300)]
|
|
12
|
+
- feat: Volto 17 support - refs #264527 [EEA Jenkins - [`a32dec9`](https://github.com/eea/volto-timeline-block/commit/a32dec9354dcdaaa907b96fee85b67c0c5fe433a)]
|
|
13
|
+
|
|
14
|
+
#### :house: Internal changes
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
#### :hammer_and_wrench: Others
|
|
18
|
+
|
|
19
|
+
### [1.1.5](https://github.com/eea/volto-timeline-block/compare/1.1.4...1.1.5) - 22 October 2023
|
|
20
|
+
|
|
21
|
+
#### :house: Internal changes
|
|
22
|
+
|
|
23
|
+
- chore: husky, lint-staged use fixed versions [valentinab25 - [`5ae7016`](https://github.com/eea/volto-timeline-block/commit/5ae701608171d5309e51d3aa1875f2649849256f)]
|
|
24
|
+
|
|
25
|
+
#### :hammer_and_wrench: Others
|
|
26
|
+
|
|
27
|
+
- Update README.md [ana-oprea - [`89ccacc`](https://github.com/eea/volto-timeline-block/commit/89ccacc7bc9b69bbbedcc0fc8ca455153c2905e1)]
|
|
7
28
|
### [1.1.4](https://github.com/eea/volto-timeline-block/compare/1.1.3...1.1.4) - 13 October 2023
|
|
8
29
|
|
|
9
30
|
#### :house: Internal changes
|
|
@@ -30,7 +51,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
30
51
|
- test: Add cypress test for timeline in DX Layout - refs #254894 [Crețu Mihaela - [`f144abd`](https://github.com/eea/volto-timeline-block/commit/f144abd41e77557cac5308b248d825b24c95893f)]
|
|
31
52
|
- i18n: Add en [Alin Voinea - [`eb85ad0`](https://github.com/eea/volto-timeline-block/commit/eb85ad074e8dfe027c4751ed4e7b99bf727ddc70)]
|
|
32
53
|
- test: Update Makefile and docker-compose to align it with Jenkinsfile [valentinab25 - [`2c84c80`](https://github.com/eea/volto-timeline-block/commit/2c84c80259b0d1aeaa397b80a563c4d863d6755f)]
|
|
33
|
-
- Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`31e6132`](https://github.com/eea/volto-timeline-block/commit/31e613228a5a4ad1253914671bfb37b162b5c3a9)]
|
|
34
54
|
### [1.1.2](https://github.com/eea/volto-timeline-block/compare/1.1.1...1.1.2) - 24 July 2023
|
|
35
55
|
|
|
36
56
|
### [1.1.1](https://github.com/eea/volto-timeline-block/compare/1.1.0...1.1.1) - 12 June 2023
|
|
@@ -40,31 +60,16 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
40
60
|
- test: jest should look for addons in node_modules Refs #253277 [valentinab25 - [`9e46798`](https://github.com/eea/volto-timeline-block/commit/9e46798e251fba50d9ef8756f3f72de4684f6c44)]
|
|
41
61
|
- test: Add cypress test for basic functionality and demo gif to README - refs #253277 [ana-oprea - [`5afd16a`](https://github.com/eea/volto-timeline-block/commit/5afd16ab58e0a4f6b4d303f61c54ea3ed3a7baf7)]
|
|
42
62
|
- test: Fix test config, coverage Refs #253277 [valentinab25 - [`66e4928`](https://github.com/eea/volto-timeline-block/commit/66e4928bc2d940a81ad73ce27107ad0d1d471135)]
|
|
43
|
-
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`c0c83df`](https://github.com/eea/volto-timeline-block/commit/c0c83dff921bf4e4c4d81f60754c9f928aa5ce79)]
|
|
44
|
-
- Add Sonarqube tag using industry-frontend addons list [EEA Jenkins - [`90db0d4`](https://github.com/eea/volto-timeline-block/commit/90db0d4c8df4925a23fae6a55443ced5c256c645)]
|
|
45
63
|
### [1.1.0](https://github.com/eea/volto-timeline-block/compare/1.0.1...1.1.0) - 27 March 2023
|
|
46
64
|
|
|
47
65
|
#### :hammer_and_wrench: Others
|
|
48
66
|
|
|
49
|
-
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`33e1837`](https://github.com/eea/volto-timeline-block/commit/33e183750b62be6c1fcfbdb8dad10db469169266)]
|
|
50
|
-
- Add Sonarqube tag using ims-frontend addons list [EEA Jenkins - [`41833c2`](https://github.com/eea/volto-timeline-block/commit/41833c236ec95bd60a693d5394c8c128e30f4ecf)]
|
|
51
|
-
- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`5c12df2`](https://github.com/eea/volto-timeline-block/commit/5c12df222354499cbffe93e34c3c6a31f9f52124)]
|
|
52
|
-
- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`abc6930`](https://github.com/eea/volto-timeline-block/commit/abc693081a2ed229adf27dbe0315c44a6735c28e)]
|
|
53
|
-
- Add Sonarqube tag using climate-energy-frontend addons list [EEA Jenkins - [`ed6e2b0`](https://github.com/eea/volto-timeline-block/commit/ed6e2b0b15a2437f456a227fdefe2336aeda98b2)]
|
|
54
67
|
- test(Jenkins): Run tests and cypress with latest canary @plone/volto [Alin Voinea - [`ff4d170`](https://github.com/eea/volto-timeline-block/commit/ff4d1705b90bbffcc54f7182e6799a8fac303104)]
|
|
55
|
-
- Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`4ed90fb`](https://github.com/eea/volto-timeline-block/commit/4ed90fb54c0aec76c8f2287a83a14c8acc8c1ca8)]
|
|
56
|
-
- Add Sonarqube tag using bise-frontend addons list [EEA Jenkins - [`01e1ac8`](https://github.com/eea/volto-timeline-block/commit/01e1ac8bf4cc04713c643ef30f5dfa8d628b6e2b)]
|
|
57
|
-
- yarn 3 [Alin Voinea - [`a234a4c`](https://github.com/eea/volto-timeline-block/commit/a234a4c8d1717cf9039195e7246a07265a6b8b49)]
|
|
58
|
-
- Add Sonarqube tag using marine-frontend addons list [EEA Jenkins - [`4a25463`](https://github.com/eea/volto-timeline-block/commit/4a25463070164b31656e20c5ace164da225fd3fb)]
|
|
59
|
-
- Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`5b687d5`](https://github.com/eea/volto-timeline-block/commit/5b687d5a91c4cc566e4428084c9d1d78df2de676)]
|
|
60
|
-
- Add Sonarqube tag using demo-kitkat-frontend addons list [EEA Jenkins - [`c9e0a49`](https://github.com/eea/volto-timeline-block/commit/c9e0a49e8a3c291833bb6c002441907b74df0875)]
|
|
61
|
-
- Add Sonarqube tag using forests-frontend addons list [EEA Jenkins - [`25df72a`](https://github.com/eea/volto-timeline-block/commit/25df72a779fd975ab4e42c39cfdc6968f7f04945)]
|
|
62
68
|
### [1.0.1](https://github.com/eea/volto-timeline-block/compare/1.0.0...1.0.1) - 16 November 2022
|
|
63
69
|
|
|
64
70
|
#### :hammer_and_wrench: Others
|
|
65
71
|
|
|
66
72
|
- test(estlint): Fix .project.eslintrc.js [Alin Voinea - [`742fb19`](https://github.com/eea/volto-timeline-block/commit/742fb1986b76ed5b775a7895aa91df452bf601e6)]
|
|
67
|
-
- Add Sonarqube tag using circularity-frontend addons list [EEA Jenkins - [`c4e6e36`](https://github.com/eea/volto-timeline-block/commit/c4e6e36aaabb02bea84695411cfb2d3ca586b210)]
|
|
68
73
|
## [1.0.0](https://github.com/eea/volto-timeline-block/compare/0.2.3...1.0.0) - 28 October 2022
|
|
69
74
|
|
|
70
75
|
#### :nail_care: Enhancements
|
|
@@ -77,7 +82,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
77
82
|
- test(cypress): Cypress 10 / Razzle 4 [Alin Voinea - [`ca50ec9`](https://github.com/eea/volto-timeline-block/commit/ca50ec9a9ab4db0faf0b33fa250814d788741478)]
|
|
78
83
|
- Cleanup [Alin Voinea - [`28c2444`](https://github.com/eea/volto-timeline-block/commit/28c244491045ca3ba6a3c182818364f73951f765)]
|
|
79
84
|
- Update dependencies [Alin Voinea - [`ab59000`](https://github.com/eea/volto-timeline-block/commit/ab590002fdef3c95d4580893b6e407b51746a290)]
|
|
80
|
-
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`bfa44a6`](https://github.com/eea/volto-timeline-block/commit/bfa44a64c026b2a5f9f22fbfcb3119f60c78d461)]
|
|
81
85
|
### [0.2.3](https://github.com/eea/volto-timeline-block/compare/0.2.2...0.2.3) - 30 June 2022
|
|
82
86
|
|
|
83
87
|
### [0.2.2](https://github.com/eea/volto-timeline-block/compare/0.2.1...0.2.2) - 8 June 2022
|
|
@@ -93,7 +97,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
93
97
|
|
|
94
98
|
#### :hammer_and_wrench: Others
|
|
95
99
|
|
|
96
|
-
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`21fea4e`](https://github.com/eea/volto-timeline-block/commit/21fea4edb8da738f81c12ca1f70696b63581159b)]
|
|
97
100
|
### [0.2.0](https://github.com/eea/volto-timeline-block/compare/0.1.0...0.2.0) - 29 March 2022
|
|
98
101
|
|
|
99
102
|
#### :hammer_and_wrench: Others
|
package/README.md
CHANGED
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
|
|
20
20
|
## Features
|
|
21
21
|
|
|
22
|
-

|
|
23
|
+

|
|
24
24
|
|
|
25
25
|
## Getting started
|
|
26
26
|
|
package/cypress.config.js
CHANGED
|
@@ -2,12 +2,12 @@ const { defineConfig } = require('cypress');
|
|
|
2
2
|
|
|
3
3
|
module.exports = defineConfig({
|
|
4
4
|
viewportWidth: 1280,
|
|
5
|
-
defaultCommandTimeout:
|
|
5
|
+
defaultCommandTimeout: 8888,
|
|
6
6
|
chromeWebSecurity: false,
|
|
7
7
|
reporter: 'junit',
|
|
8
|
-
video:
|
|
8
|
+
video: false,
|
|
9
9
|
retries: {
|
|
10
|
-
runMode:
|
|
10
|
+
runMode: 2,
|
|
11
11
|
openMode: 0,
|
|
12
12
|
},
|
|
13
13
|
reporterOptions: {
|
package/jest-addon.config.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
require('dotenv').config({ path: __dirname + '/.env' })
|
|
2
|
+
|
|
1
3
|
module.exports = {
|
|
2
4
|
testMatch: ['**/src/addons/**/?(*.)+(spec|test).[jt]s?(x)'],
|
|
3
5
|
collectCoverageFrom: [
|
|
@@ -9,18 +11,26 @@ module.exports = {
|
|
|
9
11
|
'@plone/volto/cypress': '<rootDir>/node_modules/@plone/volto/cypress',
|
|
10
12
|
'@plone/volto/babel': '<rootDir>/node_modules/@plone/volto/babel',
|
|
11
13
|
'@plone/volto/(.*)$': '<rootDir>/node_modules/@plone/volto/src/$1',
|
|
12
|
-
'@package/(.*)$': '<rootDir>/src/$1',
|
|
13
|
-
'@root/(.*)$': '<rootDir>/src/$1',
|
|
14
|
+
'@package/(.*)$': '<rootDir>/node_modules/@plone/volto/src/$1',
|
|
15
|
+
'@root/(.*)$': '<rootDir>/node_modules/@plone/volto/src/$1',
|
|
14
16
|
'@plone/volto-quanta/(.*)$': '<rootDir>/src/addons/volto-quanta/src/$1',
|
|
17
|
+
'@eeacms/search/(.*)$': '<rootDir>/src/addons/volto-searchlib/searchlib/$1',
|
|
18
|
+
'@eeacms/search': '<rootDir>/src/addons/volto-searchlib/searchlib',
|
|
15
19
|
'@eeacms/(.*?)/(.*)$': '<rootDir>/node_modules/@eeacms/$1/src/$2',
|
|
16
|
-
'@plone/volto-slate':
|
|
20
|
+
'@plone/volto-slate$':
|
|
17
21
|
'<rootDir>/node_modules/@plone/volto/packages/volto-slate/src',
|
|
22
|
+
'@plone/volto-slate/(.*)$':
|
|
23
|
+
'<rootDir>/node_modules/@plone/volto/packages/volto-slate/src/$1',
|
|
18
24
|
'~/(.*)$': '<rootDir>/src/$1',
|
|
19
25
|
'load-volto-addons':
|
|
20
26
|
'<rootDir>/node_modules/@plone/volto/jest-addons-loader.js',
|
|
21
27
|
},
|
|
28
|
+
transformIgnorePatterns: [
|
|
29
|
+
'/node_modules/(?!(@plone|@root|@package|@eeacms)/).*/',
|
|
30
|
+
],
|
|
22
31
|
transform: {
|
|
23
32
|
'^.+\\.js(x)?$': 'babel-jest',
|
|
33
|
+
'^.+\\.ts(x)?$': 'babel-jest',
|
|
24
34
|
'^.+\\.(png)$': 'jest-file',
|
|
25
35
|
'^.+\\.(jpg)$': 'jest-file',
|
|
26
36
|
'^.+\\.(svg)$': './node_modules/@plone/volto/jest-svgsystem-transform.js',
|
|
@@ -33,4 +43,9 @@ module.exports = {
|
|
|
33
43
|
statements: 5,
|
|
34
44
|
},
|
|
35
45
|
},
|
|
36
|
-
|
|
46
|
+
...(process.env.JEST_USE_SETUP === 'ON' && {
|
|
47
|
+
setupFilesAfterEnv: [
|
|
48
|
+
'<rootDir>/node_modules/@eeacms/volto-timeline-block/jest.setup.js',
|
|
49
|
+
],
|
|
50
|
+
}),
|
|
51
|
+
}
|
package/jest.setup.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jest } from '@jest/globals';
|
|
2
|
+
import configureStore from 'redux-mock-store';
|
|
3
|
+
import thunk from 'redux-thunk';
|
|
4
|
+
import { blocksConfig } from '@plone/volto/config/Blocks';
|
|
5
|
+
import installSlate from '@plone/volto-slate/index';
|
|
6
|
+
|
|
7
|
+
var mockSemanticComponents = jest.requireActual('semantic-ui-react');
|
|
8
|
+
var mockComponents = jest.requireActual('@plone/volto/components');
|
|
9
|
+
var config = jest.requireActual('@plone/volto/registry').default;
|
|
10
|
+
|
|
11
|
+
config.blocks.blocksConfig = {
|
|
12
|
+
...blocksConfig,
|
|
13
|
+
...config.blocks.blocksConfig,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
jest.doMock('semantic-ui-react', () => ({
|
|
17
|
+
__esModule: true,
|
|
18
|
+
...mockSemanticComponents,
|
|
19
|
+
Popup: ({ content, trigger }) => {
|
|
20
|
+
return (
|
|
21
|
+
<div className="popup">
|
|
22
|
+
<div className="trigger">{trigger}</div>
|
|
23
|
+
<div className="content">{content}</div>
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
26
|
+
},
|
|
27
|
+
}));
|
|
28
|
+
|
|
29
|
+
jest.doMock('@plone/volto/components', () => {
|
|
30
|
+
return {
|
|
31
|
+
__esModule: true,
|
|
32
|
+
...mockComponents,
|
|
33
|
+
SidebarPortal: ({ children }) => <div id="sidebar">{children}</div>,
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
jest.doMock('@plone/volto/registry', () =>
|
|
38
|
+
[installSlate].reduce((acc, apply) => apply(acc), config),
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
const mockStore = configureStore([thunk]);
|
|
42
|
+
|
|
43
|
+
global.fetch = jest.fn(() =>
|
|
44
|
+
Promise.resolve({
|
|
45
|
+
json: () => Promise.resolve({}),
|
|
46
|
+
}),
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
global.store = mockStore({
|
|
50
|
+
intl: {
|
|
51
|
+
locale: 'en',
|
|
52
|
+
messages: {},
|
|
53
|
+
formatMessage: jest.fn(),
|
|
54
|
+
},
|
|
55
|
+
content: {
|
|
56
|
+
create: {},
|
|
57
|
+
subrequests: [],
|
|
58
|
+
},
|
|
59
|
+
connected_data_parameters: {},
|
|
60
|
+
screen: {
|
|
61
|
+
page: {
|
|
62
|
+
width: 768,
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eeacms/volto-timeline-block",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "@eeacms/volto-timeline-block: Volto add-on",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"author": "European Environment Agency: IDM2 A-Team",
|
|
@@ -20,8 +20,9 @@
|
|
|
20
20
|
"@cypress/code-coverage": "^3.10.0",
|
|
21
21
|
"@plone/scripts": "*",
|
|
22
22
|
"babel-plugin-transform-class-properties": "^6.24.1",
|
|
23
|
-
"
|
|
24
|
-
"
|
|
23
|
+
"dotenv": "^16.3.2",
|
|
24
|
+
"husky": "^8.0.3",
|
|
25
|
+
"lint-staged": "^14.0.1",
|
|
25
26
|
"md5": "^2.3.0"
|
|
26
27
|
},
|
|
27
28
|
"lint-staged": {
|
|
@@ -2,7 +2,7 @@ import iconSVG from '@plone/volto/icons/calendar.svg';
|
|
|
2
2
|
import TimelineBlockEdit from './Edit';
|
|
3
3
|
import TimelineBlockView from './View';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const applyConfig = (config) => {
|
|
6
6
|
config.blocks.blocksConfig.timeline_block = {
|
|
7
7
|
id: 'timeline_block',
|
|
8
8
|
title: 'Timeline',
|
|
@@ -20,3 +20,5 @@ export default (config) => {
|
|
|
20
20
|
};
|
|
21
21
|
return config;
|
|
22
22
|
};
|
|
23
|
+
|
|
24
|
+
export default applyConfig;
|
package/.project.eslintrc.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
|
|
4
|
-
const projectRootPath = fs.existsSync('./project')
|
|
5
|
-
? fs.realpathSync('./project')
|
|
6
|
-
: fs.realpathSync('./../../../');
|
|
7
|
-
const packageJson = require(path.join(projectRootPath, 'package.json'));
|
|
8
|
-
const jsConfig = require(path.join(projectRootPath, 'jsconfig.json')).compilerOptions;
|
|
9
|
-
|
|
10
|
-
const pathsConfig = jsConfig.paths;
|
|
11
|
-
|
|
12
|
-
let voltoPath = path.join(projectRootPath, 'node_modules/@plone/volto');
|
|
13
|
-
|
|
14
|
-
Object.keys(pathsConfig).forEach(pkg => {
|
|
15
|
-
if (pkg === '@plone/volto') {
|
|
16
|
-
voltoPath = `./${jsConfig.baseUrl}/${pathsConfig[pkg][0]}`;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const AddonConfigurationRegistry = require(`${voltoPath}/addon-registry.js`);
|
|
20
|
-
const reg = new AddonConfigurationRegistry(projectRootPath);
|
|
21
|
-
|
|
22
|
-
// Extends ESlint configuration for adding the aliases to `src` directories in Volto addons
|
|
23
|
-
const addonAliases = Object.keys(reg.packages).map(o => [
|
|
24
|
-
o,
|
|
25
|
-
reg.packages[o].modulePath,
|
|
26
|
-
]);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
module.exports = {
|
|
30
|
-
extends: `${projectRootPath}/node_modules/@plone/volto/.eslintrc`,
|
|
31
|
-
settings: {
|
|
32
|
-
'import/resolver': {
|
|
33
|
-
alias: {
|
|
34
|
-
map: [
|
|
35
|
-
['@plone/volto', '@plone/volto/src'],
|
|
36
|
-
...addonAliases,
|
|
37
|
-
['@package', `${__dirname}/src`],
|
|
38
|
-
['~', `${__dirname}/src`],
|
|
39
|
-
],
|
|
40
|
-
extensions: ['.js', '.jsx', '.json'],
|
|
41
|
-
},
|
|
42
|
-
'babel-plugin-root-import': {
|
|
43
|
-
rootPathSuffix: 'src',
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
};
|
|
48
|
-
|