@eeacms/volto-timeline-block 1.1.0 → 1.1.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/CHANGELOG.md CHANGED
@@ -4,17 +4,40 @@ 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.1.2](https://github.com/eea/volto-timeline-block/compare/1.1.1...1.1.2) - 24 July 2023
8
+
9
+ ### [1.1.1](https://github.com/eea/volto-timeline-block/compare/1.1.0...1.1.1) - 12 June 2023
10
+
11
+ #### :hammer_and_wrench: Others
12
+
13
+ - test: jest should look for addons in node_modules Refs #253277 [valentinab25 - [`9e46798`](https://github.com/eea/volto-timeline-block/commit/9e46798e251fba50d9ef8756f3f72de4684f6c44)]
14
+ - 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)]
15
+ - test: Fix test config, coverage Refs #253277 [valentinab25 - [`66e4928`](https://github.com/eea/volto-timeline-block/commit/66e4928bc2d940a81ad73ce27107ad0d1d471135)]
16
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`c0c83df`](https://github.com/eea/volto-timeline-block/commit/c0c83dff921bf4e4c4d81f60754c9f928aa5ce79)]
17
+ - Add Sonarqube tag using industry-frontend addons list [EEA Jenkins - [`90db0d4`](https://github.com/eea/volto-timeline-block/commit/90db0d4c8df4925a23fae6a55443ced5c256c645)]
7
18
  ### [1.1.0](https://github.com/eea/volto-timeline-block/compare/1.0.1...1.1.0) - 27 March 2023
8
19
 
9
20
  #### :hammer_and_wrench: Others
10
21
 
11
- - Release 1.1.0 [Alin Voinea - [`a667b7d`](https://github.com/eea/volto-timeline-block/commit/a667b7d7a42504ce81c0718ee00b768212f7a6dd)]
22
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`33e1837`](https://github.com/eea/volto-timeline-block/commit/33e183750b62be6c1fcfbdb8dad10db469169266)]
23
+ - Add Sonarqube tag using ims-frontend addons list [EEA Jenkins - [`41833c2`](https://github.com/eea/volto-timeline-block/commit/41833c236ec95bd60a693d5394c8c128e30f4ecf)]
24
+ - Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`5c12df2`](https://github.com/eea/volto-timeline-block/commit/5c12df222354499cbffe93e34c3c6a31f9f52124)]
25
+ - Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`abc6930`](https://github.com/eea/volto-timeline-block/commit/abc693081a2ed229adf27dbe0315c44a6735c28e)]
26
+ - Add Sonarqube tag using climate-energy-frontend addons list [EEA Jenkins - [`ed6e2b0`](https://github.com/eea/volto-timeline-block/commit/ed6e2b0b15a2437f456a227fdefe2336aeda98b2)]
12
27
  - test(Jenkins): Run tests and cypress with latest canary @plone/volto [Alin Voinea - [`ff4d170`](https://github.com/eea/volto-timeline-block/commit/ff4d1705b90bbffcc54f7182e6799a8fac303104)]
28
+ - Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`4ed90fb`](https://github.com/eea/volto-timeline-block/commit/4ed90fb54c0aec76c8f2287a83a14c8acc8c1ca8)]
29
+ - Add Sonarqube tag using bise-frontend addons list [EEA Jenkins - [`01e1ac8`](https://github.com/eea/volto-timeline-block/commit/01e1ac8bf4cc04713c643ef30f5dfa8d628b6e2b)]
30
+ - yarn 3 [Alin Voinea - [`a234a4c`](https://github.com/eea/volto-timeline-block/commit/a234a4c8d1717cf9039195e7246a07265a6b8b49)]
31
+ - Add Sonarqube tag using marine-frontend addons list [EEA Jenkins - [`4a25463`](https://github.com/eea/volto-timeline-block/commit/4a25463070164b31656e20c5ace164da225fd3fb)]
32
+ - Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`5b687d5`](https://github.com/eea/volto-timeline-block/commit/5b687d5a91c4cc566e4428084c9d1d78df2de676)]
33
+ - Add Sonarqube tag using demo-kitkat-frontend addons list [EEA Jenkins - [`c9e0a49`](https://github.com/eea/volto-timeline-block/commit/c9e0a49e8a3c291833bb6c002441907b74df0875)]
34
+ - Add Sonarqube tag using forests-frontend addons list [EEA Jenkins - [`25df72a`](https://github.com/eea/volto-timeline-block/commit/25df72a779fd975ab4e42c39cfdc6968f7f04945)]
13
35
  ### [1.0.1](https://github.com/eea/volto-timeline-block/compare/1.0.0...1.0.1) - 16 November 2022
14
36
 
15
37
  #### :hammer_and_wrench: Others
16
38
 
17
39
  - test(estlint): Fix .project.eslintrc.js [Alin Voinea - [`742fb19`](https://github.com/eea/volto-timeline-block/commit/742fb1986b76ed5b775a7895aa91df452bf601e6)]
40
+ - Add Sonarqube tag using circularity-frontend addons list [EEA Jenkins - [`c4e6e36`](https://github.com/eea/volto-timeline-block/commit/c4e6e36aaabb02bea84695411cfb2d3ca586b210)]
18
41
  ## [1.0.0](https://github.com/eea/volto-timeline-block/compare/0.2.3...1.0.0) - 28 October 2022
19
42
 
20
43
  #### :nail_care: Enhancements
@@ -27,6 +50,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
27
50
  - test(cypress): Cypress 10 / Razzle 4 [Alin Voinea - [`ca50ec9`](https://github.com/eea/volto-timeline-block/commit/ca50ec9a9ab4db0faf0b33fa250814d788741478)]
28
51
  - Cleanup [Alin Voinea - [`28c2444`](https://github.com/eea/volto-timeline-block/commit/28c244491045ca3ba6a3c182818364f73951f765)]
29
52
  - Update dependencies [Alin Voinea - [`ab59000`](https://github.com/eea/volto-timeline-block/commit/ab590002fdef3c95d4580893b6e407b51746a290)]
53
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`bfa44a6`](https://github.com/eea/volto-timeline-block/commit/bfa44a64c026b2a5f9f22fbfcb3119f60c78d461)]
30
54
  ### [0.2.3](https://github.com/eea/volto-timeline-block/compare/0.2.2...0.2.3) - 30 June 2022
31
55
 
32
56
  ### [0.2.2](https://github.com/eea/volto-timeline-block/compare/0.2.1...0.2.2) - 8 June 2022
@@ -42,6 +66,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
42
66
 
43
67
  #### :hammer_and_wrench: Others
44
68
 
69
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`21fea4e`](https://github.com/eea/volto-timeline-block/commit/21fea4edb8da738f81c12ca1f70696b63581159b)]
45
70
  ### [0.2.0](https://github.com/eea/volto-timeline-block/compare/0.1.0...0.2.0) - 29 March 2022
46
71
 
47
72
  #### :hammer_and_wrench: Others
package/README.md CHANGED
@@ -20,6 +20,8 @@
20
20
  ## Features
21
21
 
22
22
  ![Timeline Block](https://github.com/eea/volto-timeline-block/raw/develop/docs/timeline-block.png)
23
+ ![Timeline Block Demo](https://github.com/eea/volto-timeline-block/raw/docs/docs/volto-timeline.gif)
24
+
23
25
 
24
26
  ## Getting started
25
27
 
@@ -5,19 +5,19 @@ module.exports = {
5
5
  '!src/**/*.d.ts',
6
6
  ],
7
7
  moduleNameMapper: {
8
+ '\\.(css|less|scss|sass)$': 'identity-obj-proxy',
8
9
  '@plone/volto/cypress': '<rootDir>/node_modules/@plone/volto/cypress',
9
10
  '@plone/volto/babel': '<rootDir>/node_modules/@plone/volto/babel',
10
11
  '@plone/volto/(.*)$': '<rootDir>/node_modules/@plone/volto/src/$1',
11
12
  '@package/(.*)$': '<rootDir>/src/$1',
12
13
  '@root/(.*)$': '<rootDir>/src/$1',
13
14
  '@plone/volto-quanta/(.*)$': '<rootDir>/src/addons/volto-quanta/src/$1',
14
- '@eeacms/(.*?)/(.*)$': '<rootDir>/src/addons/$1/src/$2',
15
+ '@eeacms/(.*?)/(.*)$': '<rootDir>/node_modules/@eeacms/$1/src/$2',
15
16
  '@plone/volto-slate':
16
17
  '<rootDir>/node_modules/@plone/volto/packages/volto-slate/src',
17
18
  '~/(.*)$': '<rootDir>/src/$1',
18
19
  'load-volto-addons':
19
20
  '<rootDir>/node_modules/@plone/volto/jest-addons-loader.js',
20
- '\\.(css|less|scss|sass)$': 'identity-obj-proxy',
21
21
  },
22
22
  transform: {
23
23
  '^.+\\.js(x)?$': 'babel-jest',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-timeline-block",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
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",
@@ -0,0 +1,77 @@
1
+ import React from 'react';
2
+ import { render, screen } from '@testing-library/react';
3
+ import { unmountComponentAtNode } from 'react-dom';
4
+ import View from './View';
5
+ import moment from 'moment';
6
+ import '@testing-library/jest-dom/extend-expect';
7
+
8
+ jest.mock('@plone/volto/helpers/Loadable/Loadable', () => ({
9
+ injectLazyLibs: () => (component) => component,
10
+ }));
11
+
12
+ jest.mock('moment', () => {
13
+ const moment = jest.requireActual('moment');
14
+
15
+ return { default: moment };
16
+ });
17
+
18
+ describe('View and Timeline components', () => {
19
+ let container = null;
20
+
21
+ beforeEach(() => {
22
+ container = document.createElement('div');
23
+ document.body.appendChild(container);
24
+ });
25
+
26
+ afterEach(() => {
27
+ unmountComponentAtNode(container);
28
+ container.remove();
29
+ container = null;
30
+ });
31
+
32
+ it('should render empty timeline in edit mode', () => {
33
+ render(<View data={{ items: undefined }} mode="edit" />, container);
34
+
35
+ expect(screen.getByText('Add Timeline items')).toBeInTheDocument();
36
+ });
37
+
38
+ it('should render timeline item with correct data', () => {
39
+ const item = {
40
+ datetime: '2023-01-01',
41
+ title: 'Test Event',
42
+ description: 'Test Description',
43
+ color: 'blue',
44
+ icon: 'star',
45
+ };
46
+ const data = { items: [item], reversed: false };
47
+
48
+ const { getByText } = render(
49
+ <View data={data} mode="view" moment={moment} />,
50
+ container,
51
+ );
52
+
53
+ expect(getByText('Test Event')).toBeInTheDocument();
54
+ expect(getByText('Test Description')).toBeInTheDocument();
55
+ expect(getByText('Jan 1, 2023 12:00 AM')).toBeInTheDocument();
56
+ });
57
+
58
+ it('should render timeline item with correct data', () => {
59
+ const item = {
60
+ datetime: '2023-01-01',
61
+ title: 'Test Event',
62
+ description: 'Test Description',
63
+ color: undefined,
64
+ icon: 'star',
65
+ };
66
+ const data = { items: [item], reversed: true, hideTime: true };
67
+
68
+ const { getByText } = render(
69
+ <View data={data} mode="view" moment={moment} />,
70
+ container,
71
+ );
72
+
73
+ expect(getByText('Test Event')).toBeInTheDocument();
74
+ expect(getByText('Test Description')).toBeInTheDocument();
75
+ expect(getByText('Jan 1, 2023')).toBeInTheDocument();
76
+ });
77
+ });