@eeacms/volto-timeline-block 2.0.0 → 3.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/CHANGELOG.md +15 -1
- package/DEVELOP.md +19 -17
- package/README.md +33 -19
- package/docker-compose.yml +1 -1
- package/jest-addon.config.js +11 -4
- package/locales/de/LC_MESSAGES/volto.po +128 -0
- package/locales/en/LC_MESSAGES/volto.po +128 -0
- package/locales/it/LC_MESSAGES/volto.po +128 -0
- package/locales/ro/LC_MESSAGES/volto.po +128 -0
- package/locales/volto.pot +130 -2
- package/package.json +1 -1
- package/src/TimelineBlock/Edit.jsx +10 -3
- package/src/TimelineBlock/View.jsx +12 -1
- package/src/TimelineBlock/View.test.jsx +13 -4
- package/src/TimelineBlock/index.js +8 -0
- package/src/TimelineBlock/schema.js +133 -32
package/CHANGELOG.md
CHANGED
|
@@ -4,7 +4,21 @@ 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
|
-
### [
|
|
7
|
+
### [3.0.0](https://github.com/eea/volto-timeline-block/compare/2.0.1...3.0.0) - 25 March 2026
|
|
8
|
+
|
|
9
|
+
#### :rocket: New Features
|
|
10
|
+
|
|
11
|
+
- feat: Volto 18 support - refs #287700 [Alin Voinea - [`13eb695`](https://github.com/eea/volto-timeline-block/commit/13eb695942ed8f4c0c69b9aac7688e6ceec2f3ef)]
|
|
12
|
+
|
|
13
|
+
#### :house: Internal changes
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
#### :hammer_and_wrench: Others
|
|
17
|
+
|
|
18
|
+
- tests: Fix Sonar Qube tags - refs #297339 [Alin Voinea - [`4461c68`](https://github.com/eea/volto-timeline-block/commit/4461c686427cf899b7b8d3d7e397ebaf2183b231)]
|
|
19
|
+
### [2.0.1](https://github.com/eea/volto-timeline-block/compare/2.0.0...2.0.1) - 30 January 2025
|
|
20
|
+
|
|
21
|
+
## [2.0.0](https://github.com/eea/volto-timeline-block/compare/1.1.5...2.0.0) - 22 April 2024
|
|
8
22
|
|
|
9
23
|
#### :rocket: New Features
|
|
10
24
|
|
package/DEVELOP.md
CHANGED
|
@@ -26,21 +26,20 @@
|
|
|
26
26
|
|
|
27
27
|
### Or add @eeacms/volto-timeline-block to your Volto project
|
|
28
28
|
|
|
29
|
-
Before starting make sure your development environment is properly set. See [Volto
|
|
29
|
+
Before starting make sure your development environment is properly set. See the official Plone documentation for [creating a project with Cookieplone](https://6.docs.plone.org/install/create-project-cookieplone.html) and [installing an add-on in development mode in Volto 18 and 19](https://6.docs.plone.org/volto/development/add-ons/install-an-add-on-dev-18.html).
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
For new Volto 18+ projects, use Cookieplone. It includes `mrs-developer` by default.
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
1. Create a new Volto project with Cookieplone
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
yo @plone/volto my-volto-project --addon @eeacms/volto-timeline-block --skip-install
|
|
38
|
-
cd my-volto-project
|
|
35
|
+
uvx cookieplone project
|
|
36
|
+
cd project-title
|
|
39
37
|
|
|
40
38
|
1. Add the following to `mrs.developer.json`:
|
|
41
39
|
|
|
42
40
|
{
|
|
43
41
|
"volto-timeline-block": {
|
|
42
|
+
"output": "packages",
|
|
44
43
|
"url": "https://github.com/eea/volto-timeline-block.git",
|
|
45
44
|
"package": "@eeacms/volto-timeline-block",
|
|
46
45
|
"branch": "develop",
|
|
@@ -48,28 +47,31 @@ Before starting make sure your development environment is properly set. See [Vol
|
|
|
48
47
|
}
|
|
49
48
|
}
|
|
50
49
|
|
|
51
|
-
1.
|
|
50
|
+
1. Add `@eeacms/volto-timeline-block` to the `addons` key in your project `volto.config.js`
|
|
51
|
+
|
|
52
|
+
1. Install or refresh the project setup
|
|
52
53
|
|
|
53
|
-
make
|
|
54
|
-
yarn
|
|
54
|
+
make install
|
|
55
55
|
|
|
56
|
-
1. Start backend
|
|
56
|
+
1. Start backend in one terminal
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
make backend-start
|
|
59
59
|
|
|
60
|
-
...wait for backend to setup and start
|
|
60
|
+
...wait for backend to setup and start, ending with `Ready to handle requests`
|
|
61
61
|
|
|
62
62
|
...you can also check http://localhost:8080/Plone
|
|
63
63
|
|
|
64
|
-
1. Start frontend
|
|
64
|
+
1. Start frontend in a second terminal
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
make frontend-start
|
|
67
67
|
|
|
68
68
|
1. Go to http://localhost:3000
|
|
69
69
|
|
|
70
70
|
1. Happy hacking!
|
|
71
71
|
|
|
72
|
-
cd
|
|
72
|
+
cd packages/volto-timeline-block
|
|
73
|
+
|
|
74
|
+
For legacy Volto 17 projects, keep using the yarn-based workflow from the Volto 17 documentation.
|
|
73
75
|
|
|
74
76
|
## Cypress
|
|
75
77
|
|
|
@@ -81,7 +83,7 @@ project where you added `volto-timeline-block` to `mrs.developer.json`
|
|
|
81
83
|
Go to:
|
|
82
84
|
|
|
83
85
|
```BASH
|
|
84
|
-
cd
|
|
86
|
+
cd packages/volto-timeline-block/
|
|
85
87
|
```
|
|
86
88
|
|
|
87
89
|
Start:
|
package/README.md
CHANGED
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
[](https://github.com/eea/volto-timeline-block/releases)
|
|
4
4
|
|
|
5
5
|
[](https://ci.eionet.europa.eu/view/Github/job/volto-addons/job/volto-timeline-block/job/master/display/redirect)
|
|
6
|
-
[](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-timeline-block
|
|
6
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-timeline-block)
|
|
7
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-timeline-block)
|
|
8
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-timeline-block)
|
|
9
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-timeline-block)
|
|
10
10
|
|
|
11
11
|
[](https://ci.eionet.europa.eu/view/Github/job/volto-addons/job/volto-timeline-block/job/develop/display/redirect)
|
|
12
|
-
[](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-timeline-block
|
|
12
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-timeline-block&branch=develop)
|
|
13
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-timeline-block&branch=develop)
|
|
14
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-timeline-block&branch=develop)
|
|
15
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-timeline-block&branch=develop)
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
[Volto](https://github.com/plone/volto) add-on: [Timeline block](https://eea.github.io/volto-kitkat-frontend/?path=/story/components-timeline--multiple-reversed)
|
|
@@ -33,6 +33,11 @@
|
|
|
33
33
|
|
|
34
34
|
Go to http://localhost:3000
|
|
35
35
|
|
|
36
|
+
`make start` now defaults to Volto 18. To run the same setup against Volto 17, use:
|
|
37
|
+
|
|
38
|
+
VOLTO_VERSION=17 make
|
|
39
|
+
VOLTO_VERSION=17 make start
|
|
40
|
+
|
|
36
41
|
### Add volto-timeline-block to your Volto project
|
|
37
42
|
|
|
38
43
|
1. Make sure you have a [Plone backend](https://plone.org/download) up-and-running at http://localhost:8080/Plone
|
|
@@ -46,30 +51,39 @@ Go to http://localhost:3000
|
|
|
46
51
|
* If you already have a volto project, just update `package.json`:
|
|
47
52
|
|
|
48
53
|
```JSON
|
|
49
|
-
"addons": [
|
|
50
|
-
"@eeacms/volto-timeline-block"
|
|
51
|
-
],
|
|
52
|
-
|
|
53
54
|
"dependencies": {
|
|
54
55
|
"@eeacms/volto-timeline-block": "*"
|
|
55
56
|
}
|
|
56
57
|
```
|
|
57
58
|
|
|
58
|
-
|
|
59
|
+
and `volto.config.js`:
|
|
60
|
+
|
|
61
|
+
```JavaScript
|
|
62
|
+
const addons = ['@eeacms/volto-timeline-block'];
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
* If not, create one with Cookieplone, as recommended by the official Plone documentation for Volto 18+:
|
|
59
66
|
|
|
60
67
|
```
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
cd my-volto-project
|
|
68
|
+
uvx cookieplone project
|
|
69
|
+
cd project-title
|
|
64
70
|
```
|
|
65
71
|
|
|
66
|
-
1. Install
|
|
72
|
+
1. Install or update dependencies, then start the project:
|
|
67
73
|
|
|
68
74
|
```
|
|
69
|
-
|
|
70
|
-
yarn start
|
|
75
|
+
make install
|
|
71
76
|
```
|
|
72
77
|
|
|
78
|
+
For a Cookieplone project, start the backend and frontend in separate terminals:
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
make backend-start
|
|
82
|
+
make frontend-start
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
For a legacy Volto 17 project, install the package with `yarn` and restart the frontend as usual.
|
|
86
|
+
|
|
73
87
|
1. Go to http://localhost:3000
|
|
74
88
|
|
|
75
89
|
1. Happy editing!
|
package/docker-compose.yml
CHANGED
package/jest-addon.config.js
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
require('dotenv').config({ path: __dirname + '/.env' })
|
|
2
2
|
|
|
3
|
+
const fs = require('fs')
|
|
4
|
+
const path = require('path')
|
|
5
|
+
|
|
6
|
+
const voltoSlatePath = fs.existsSync(
|
|
7
|
+
path.join(__dirname, '../../../node_modules/@plone/volto-slate/src'),
|
|
8
|
+
)
|
|
9
|
+
? '<rootDir>/node_modules/@plone/volto-slate/src'
|
|
10
|
+
: '<rootDir>/node_modules/@plone/volto/packages/volto-slate/src'
|
|
11
|
+
|
|
3
12
|
module.exports = {
|
|
4
13
|
testMatch: ['**/src/addons/**/?(*.)+(spec|test).[jt]s?(x)'],
|
|
5
14
|
collectCoverageFrom: [
|
|
@@ -17,10 +26,8 @@ module.exports = {
|
|
|
17
26
|
'@eeacms/search/(.*)$': '<rootDir>/src/addons/volto-searchlib/searchlib/$1',
|
|
18
27
|
'@eeacms/search': '<rootDir>/src/addons/volto-searchlib/searchlib',
|
|
19
28
|
'@eeacms/(.*?)/(.*)$': '<rootDir>/node_modules/@eeacms/$1/src/$2',
|
|
20
|
-
'@plone/volto-slate$':
|
|
21
|
-
|
|
22
|
-
'@plone/volto-slate/(.*)$':
|
|
23
|
-
'<rootDir>/node_modules/@plone/volto/packages/volto-slate/src/$1',
|
|
29
|
+
'@plone/volto-slate$': voltoSlatePath,
|
|
30
|
+
'@plone/volto-slate/(.*)$': `${voltoSlatePath}/$1`,
|
|
24
31
|
'~/(.*)$': '<rootDir>/src/$1',
|
|
25
32
|
'load-volto-addons':
|
|
26
33
|
'<rootDir>/node_modules/@plone/volto/jest-addons-loader.js',
|
|
@@ -11,4 +11,132 @@ msgstr ""
|
|
|
11
11
|
"Content-Transfer-Encoding: \n"
|
|
12
12
|
"Plural-Forms: \n"
|
|
13
13
|
|
|
14
|
+
#. Default: "Add Timeline items"
|
|
15
|
+
#: TimelineBlock/View
|
|
16
|
+
msgid "Add Timeline items"
|
|
17
|
+
msgstr "Zeitstrahl Elemente hinzufügen"
|
|
14
18
|
|
|
19
|
+
#. Default: "Timeline"
|
|
20
|
+
#: TimelineBlock/index
|
|
21
|
+
msgid "Timeline"
|
|
22
|
+
msgstr "Zeitstrahl"
|
|
23
|
+
|
|
24
|
+
#. Default: "Date and time"
|
|
25
|
+
#: TimelineBlock/schema
|
|
26
|
+
msgid "dateAndTime"
|
|
27
|
+
msgstr "Datum und Uhrzeit"
|
|
28
|
+
|
|
29
|
+
#. Default: "Hide time"
|
|
30
|
+
#: TimelineBlock/schema
|
|
31
|
+
msgid "hideTime"
|
|
32
|
+
msgstr "Zeit ausblenden"
|
|
33
|
+
|
|
34
|
+
#. Default: "Icon"
|
|
35
|
+
#: TimelineBlock/schema
|
|
36
|
+
msgid "icon"
|
|
37
|
+
msgstr ""
|
|
38
|
+
|
|
39
|
+
#. Default: "Check here for a list with all the icons"
|
|
40
|
+
#: TimelineBlock/schema
|
|
41
|
+
msgid "iconDescription"
|
|
42
|
+
msgstr "Hier finden Sie eine Liste mit allen Icons"
|
|
43
|
+
|
|
44
|
+
#. Default: "Reversed"
|
|
45
|
+
#: TimelineBlock/schema
|
|
46
|
+
msgid "reversedTitle"
|
|
47
|
+
msgstr "Umgekehrt"
|
|
48
|
+
|
|
49
|
+
#. Default: "Timeline block"
|
|
50
|
+
#: TimelineBlock/schema
|
|
51
|
+
msgid "timelineBlock"
|
|
52
|
+
msgstr "Zeitstrahl Block"
|
|
53
|
+
|
|
54
|
+
#. Default: "Color"
|
|
55
|
+
#: TimelineBlock/schema
|
|
56
|
+
msgid "timelineColor"
|
|
57
|
+
msgstr "Farbe"
|
|
58
|
+
|
|
59
|
+
#. Default: "Timeline item"
|
|
60
|
+
#: TimelineBlock/schema
|
|
61
|
+
msgid "timelineItem"
|
|
62
|
+
msgstr "Zeitstrahl Element"
|
|
63
|
+
|
|
64
|
+
#. Default: "Black"
|
|
65
|
+
#: TimelineBlock/schema
|
|
66
|
+
msgid "timelineItem.color.black"
|
|
67
|
+
msgstr "Schwarz"
|
|
68
|
+
|
|
69
|
+
#. Default: "Blue"
|
|
70
|
+
#: TimelineBlock/schema
|
|
71
|
+
msgid "timelineItem.color.blue"
|
|
72
|
+
msgstr "Blau"
|
|
73
|
+
|
|
74
|
+
#. Default: "Brown"
|
|
75
|
+
#: TimelineBlock/schema
|
|
76
|
+
msgid "timelineItem.color.brown"
|
|
77
|
+
msgstr "Braun"
|
|
78
|
+
|
|
79
|
+
#. Default: "Green"
|
|
80
|
+
#: TimelineBlock/schema
|
|
81
|
+
msgid "timelineItem.color.green"
|
|
82
|
+
msgstr "Grün"
|
|
83
|
+
|
|
84
|
+
#. Default: "Grey"
|
|
85
|
+
#: TimelineBlock/schema
|
|
86
|
+
msgid "timelineItem.color.grey"
|
|
87
|
+
msgstr "Grau"
|
|
88
|
+
|
|
89
|
+
#. Default: "Olive"
|
|
90
|
+
#: TimelineBlock/schema
|
|
91
|
+
msgid "timelineItem.color.olive"
|
|
92
|
+
msgstr ""
|
|
93
|
+
|
|
94
|
+
#. Default: "Orange"
|
|
95
|
+
#: TimelineBlock/schema
|
|
96
|
+
msgid "timelineItem.color.orange"
|
|
97
|
+
msgstr ""
|
|
98
|
+
|
|
99
|
+
#. Default: "Pink"
|
|
100
|
+
#: TimelineBlock/schema
|
|
101
|
+
msgid "timelineItem.color.pink"
|
|
102
|
+
msgstr ""
|
|
103
|
+
|
|
104
|
+
#. Default: "Purple"
|
|
105
|
+
#: TimelineBlock/schema
|
|
106
|
+
msgid "timelineItem.color.purple"
|
|
107
|
+
msgstr "Lila"
|
|
108
|
+
|
|
109
|
+
#. Default: "Red"
|
|
110
|
+
#: TimelineBlock/schema
|
|
111
|
+
msgid "timelineItem.color.red"
|
|
112
|
+
msgstr "Rot"
|
|
113
|
+
|
|
114
|
+
#. Default: "Teal"
|
|
115
|
+
#: TimelineBlock/schema
|
|
116
|
+
msgid "timelineItem.color.teal"
|
|
117
|
+
msgstr "Türkisblau"
|
|
118
|
+
|
|
119
|
+
#. Default: "Violet"
|
|
120
|
+
#: TimelineBlock/schema
|
|
121
|
+
msgid "timelineItem.color.violet"
|
|
122
|
+
msgstr "Violett"
|
|
123
|
+
|
|
124
|
+
#. Default: "Yellow"
|
|
125
|
+
#: TimelineBlock/schema
|
|
126
|
+
msgid "timelineItem.color.yellow"
|
|
127
|
+
msgstr "Gelb"
|
|
128
|
+
|
|
129
|
+
#. Default: "Description"
|
|
130
|
+
#: TimelineBlock/schema
|
|
131
|
+
msgid "timelineItemDescription"
|
|
132
|
+
msgstr "Beschreibung"
|
|
133
|
+
|
|
134
|
+
#. Default: "Timeline items"
|
|
135
|
+
#: TimelineBlock/schema
|
|
136
|
+
msgid "timelineItems"
|
|
137
|
+
msgstr "Zeitstrahl Elemente"
|
|
138
|
+
|
|
139
|
+
#. Default: "Title"
|
|
140
|
+
#: TimelineBlock/schema
|
|
141
|
+
msgid "title"
|
|
142
|
+
msgstr "Titel"
|
|
@@ -11,4 +11,132 @@ msgstr ""
|
|
|
11
11
|
"Content-Transfer-Encoding: \n"
|
|
12
12
|
"Plural-Forms: \n"
|
|
13
13
|
|
|
14
|
+
#. Default: "Add Timeline items"
|
|
15
|
+
#: TimelineBlock/View
|
|
16
|
+
msgid "Add Timeline items"
|
|
17
|
+
msgstr ""
|
|
18
|
+
|
|
19
|
+
#. Default: "Timeline"
|
|
20
|
+
#: TimelineBlock/index
|
|
21
|
+
msgid "Timeline"
|
|
22
|
+
msgstr ""
|
|
23
|
+
|
|
24
|
+
#. Default: "Date and time"
|
|
25
|
+
#: TimelineBlock/schema
|
|
26
|
+
msgid "dateAndTime"
|
|
27
|
+
msgstr ""
|
|
28
|
+
|
|
29
|
+
#. Default: "Hide time"
|
|
30
|
+
#: TimelineBlock/schema
|
|
31
|
+
msgid "hideTime"
|
|
32
|
+
msgstr ""
|
|
33
|
+
|
|
34
|
+
#. Default: "Icon"
|
|
35
|
+
#: TimelineBlock/schema
|
|
36
|
+
msgid "icon"
|
|
37
|
+
msgstr ""
|
|
38
|
+
|
|
39
|
+
#. Default: "Check here for a list with all the icons"
|
|
40
|
+
#: TimelineBlock/schema
|
|
41
|
+
msgid "iconDescription"
|
|
42
|
+
msgstr ""
|
|
43
|
+
|
|
44
|
+
#. Default: "Reversed"
|
|
45
|
+
#: TimelineBlock/schema
|
|
46
|
+
msgid "reversedTitle"
|
|
47
|
+
msgstr ""
|
|
48
|
+
|
|
49
|
+
#. Default: "Timeline block"
|
|
50
|
+
#: TimelineBlock/schema
|
|
51
|
+
msgid "timelineBlock"
|
|
52
|
+
msgstr ""
|
|
53
|
+
|
|
54
|
+
#. Default: "Color"
|
|
55
|
+
#: TimelineBlock/schema
|
|
56
|
+
msgid "timelineColor"
|
|
57
|
+
msgstr ""
|
|
58
|
+
|
|
59
|
+
#. Default: "Timeline item"
|
|
60
|
+
#: TimelineBlock/schema
|
|
61
|
+
msgid "timelineItem"
|
|
62
|
+
msgstr ""
|
|
63
|
+
|
|
64
|
+
#. Default: "Black"
|
|
65
|
+
#: TimelineBlock/schema
|
|
66
|
+
msgid "timelineItem.color.black"
|
|
67
|
+
msgstr ""
|
|
68
|
+
|
|
69
|
+
#. Default: "Blue"
|
|
70
|
+
#: TimelineBlock/schema
|
|
71
|
+
msgid "timelineItem.color.blue"
|
|
72
|
+
msgstr ""
|
|
73
|
+
|
|
74
|
+
#. Default: "Brown"
|
|
75
|
+
#: TimelineBlock/schema
|
|
76
|
+
msgid "timelineItem.color.brown"
|
|
77
|
+
msgstr ""
|
|
14
78
|
|
|
79
|
+
#. Default: "Green"
|
|
80
|
+
#: TimelineBlock/schema
|
|
81
|
+
msgid "timelineItem.color.green"
|
|
82
|
+
msgstr ""
|
|
83
|
+
|
|
84
|
+
#. Default: "Grey"
|
|
85
|
+
#: TimelineBlock/schema
|
|
86
|
+
msgid "timelineItem.color.grey"
|
|
87
|
+
msgstr ""
|
|
88
|
+
|
|
89
|
+
#. Default: "Olive"
|
|
90
|
+
#: TimelineBlock/schema
|
|
91
|
+
msgid "timelineItem.color.olive"
|
|
92
|
+
msgstr ""
|
|
93
|
+
|
|
94
|
+
#. Default: "Orange"
|
|
95
|
+
#: TimelineBlock/schema
|
|
96
|
+
msgid "timelineItem.color.orange"
|
|
97
|
+
msgstr ""
|
|
98
|
+
|
|
99
|
+
#. Default: "Pink"
|
|
100
|
+
#: TimelineBlock/schema
|
|
101
|
+
msgid "timelineItem.color.pink"
|
|
102
|
+
msgstr ""
|
|
103
|
+
|
|
104
|
+
#. Default: "Purple"
|
|
105
|
+
#: TimelineBlock/schema
|
|
106
|
+
msgid "timelineItem.color.purple"
|
|
107
|
+
msgstr ""
|
|
108
|
+
|
|
109
|
+
#. Default: "Red"
|
|
110
|
+
#: TimelineBlock/schema
|
|
111
|
+
msgid "timelineItem.color.red"
|
|
112
|
+
msgstr ""
|
|
113
|
+
|
|
114
|
+
#. Default: "Teal"
|
|
115
|
+
#: TimelineBlock/schema
|
|
116
|
+
msgid "timelineItem.color.teal"
|
|
117
|
+
msgstr ""
|
|
118
|
+
|
|
119
|
+
#. Default: "Violet"
|
|
120
|
+
#: TimelineBlock/schema
|
|
121
|
+
msgid "timelineItem.color.violet"
|
|
122
|
+
msgstr ""
|
|
123
|
+
|
|
124
|
+
#. Default: "Yellow"
|
|
125
|
+
#: TimelineBlock/schema
|
|
126
|
+
msgid "timelineItem.color.yellow"
|
|
127
|
+
msgstr ""
|
|
128
|
+
|
|
129
|
+
#. Default: "Description"
|
|
130
|
+
#: TimelineBlock/schema
|
|
131
|
+
msgid "timelineItemDescription"
|
|
132
|
+
msgstr ""
|
|
133
|
+
|
|
134
|
+
#. Default: "Timeline items"
|
|
135
|
+
#: TimelineBlock/schema
|
|
136
|
+
msgid "timelineItems"
|
|
137
|
+
msgstr ""
|
|
138
|
+
|
|
139
|
+
#. Default: "Title"
|
|
140
|
+
#: TimelineBlock/schema
|
|
141
|
+
msgid "title"
|
|
142
|
+
msgstr ""
|
|
@@ -11,4 +11,132 @@ msgstr ""
|
|
|
11
11
|
"Content-Transfer-Encoding: \n"
|
|
12
12
|
"Plural-Forms: \n"
|
|
13
13
|
|
|
14
|
+
#. Default: "Add Timeline items"
|
|
15
|
+
#: TimelineBlock/View
|
|
16
|
+
msgid "Add Timeline items"
|
|
17
|
+
msgstr ""
|
|
18
|
+
|
|
19
|
+
#. Default: "Timeline"
|
|
20
|
+
#: TimelineBlock/index
|
|
21
|
+
msgid "Timeline"
|
|
22
|
+
msgstr ""
|
|
23
|
+
|
|
24
|
+
#. Default: "Date and time"
|
|
25
|
+
#: TimelineBlock/schema
|
|
26
|
+
msgid "dateAndTime"
|
|
27
|
+
msgstr ""
|
|
28
|
+
|
|
29
|
+
#. Default: "Hide time"
|
|
30
|
+
#: TimelineBlock/schema
|
|
31
|
+
msgid "hideTime"
|
|
32
|
+
msgstr ""
|
|
33
|
+
|
|
34
|
+
#. Default: "Icon"
|
|
35
|
+
#: TimelineBlock/schema
|
|
36
|
+
msgid "icon"
|
|
37
|
+
msgstr ""
|
|
38
|
+
|
|
39
|
+
#. Default: "Check here for a list with all the icons"
|
|
40
|
+
#: TimelineBlock/schema
|
|
41
|
+
msgid "iconDescription"
|
|
42
|
+
msgstr ""
|
|
43
|
+
|
|
44
|
+
#. Default: "Reversed"
|
|
45
|
+
#: TimelineBlock/schema
|
|
46
|
+
msgid "reversedTitle"
|
|
47
|
+
msgstr ""
|
|
48
|
+
|
|
49
|
+
#. Default: "Timeline block"
|
|
50
|
+
#: TimelineBlock/schema
|
|
51
|
+
msgid "timelineBlock"
|
|
52
|
+
msgstr ""
|
|
53
|
+
|
|
54
|
+
#. Default: "Color"
|
|
55
|
+
#: TimelineBlock/schema
|
|
56
|
+
msgid "timelineColor"
|
|
57
|
+
msgstr ""
|
|
58
|
+
|
|
59
|
+
#. Default: "Timeline item"
|
|
60
|
+
#: TimelineBlock/schema
|
|
61
|
+
msgid "timelineItem"
|
|
62
|
+
msgstr ""
|
|
63
|
+
|
|
64
|
+
#. Default: "Black"
|
|
65
|
+
#: TimelineBlock/schema
|
|
66
|
+
msgid "timelineItem.color.black"
|
|
67
|
+
msgstr ""
|
|
68
|
+
|
|
69
|
+
#. Default: "Blue"
|
|
70
|
+
#: TimelineBlock/schema
|
|
71
|
+
msgid "timelineItem.color.blue"
|
|
72
|
+
msgstr ""
|
|
73
|
+
|
|
74
|
+
#. Default: "Brown"
|
|
75
|
+
#: TimelineBlock/schema
|
|
76
|
+
msgid "timelineItem.color.brown"
|
|
77
|
+
msgstr ""
|
|
14
78
|
|
|
79
|
+
#. Default: "Green"
|
|
80
|
+
#: TimelineBlock/schema
|
|
81
|
+
msgid "timelineItem.color.green"
|
|
82
|
+
msgstr ""
|
|
83
|
+
|
|
84
|
+
#. Default: "Grey"
|
|
85
|
+
#: TimelineBlock/schema
|
|
86
|
+
msgid "timelineItem.color.grey"
|
|
87
|
+
msgstr ""
|
|
88
|
+
|
|
89
|
+
#. Default: "Olive"
|
|
90
|
+
#: TimelineBlock/schema
|
|
91
|
+
msgid "timelineItem.color.olive"
|
|
92
|
+
msgstr ""
|
|
93
|
+
|
|
94
|
+
#. Default: "Orange"
|
|
95
|
+
#: TimelineBlock/schema
|
|
96
|
+
msgid "timelineItem.color.orange"
|
|
97
|
+
msgstr ""
|
|
98
|
+
|
|
99
|
+
#. Default: "Pink"
|
|
100
|
+
#: TimelineBlock/schema
|
|
101
|
+
msgid "timelineItem.color.pink"
|
|
102
|
+
msgstr ""
|
|
103
|
+
|
|
104
|
+
#. Default: "Purple"
|
|
105
|
+
#: TimelineBlock/schema
|
|
106
|
+
msgid "timelineItem.color.purple"
|
|
107
|
+
msgstr ""
|
|
108
|
+
|
|
109
|
+
#. Default: "Red"
|
|
110
|
+
#: TimelineBlock/schema
|
|
111
|
+
msgid "timelineItem.color.red"
|
|
112
|
+
msgstr ""
|
|
113
|
+
|
|
114
|
+
#. Default: "Teal"
|
|
115
|
+
#: TimelineBlock/schema
|
|
116
|
+
msgid "timelineItem.color.teal"
|
|
117
|
+
msgstr ""
|
|
118
|
+
|
|
119
|
+
#. Default: "Violet"
|
|
120
|
+
#: TimelineBlock/schema
|
|
121
|
+
msgid "timelineItem.color.violet"
|
|
122
|
+
msgstr ""
|
|
123
|
+
|
|
124
|
+
#. Default: "Yellow"
|
|
125
|
+
#: TimelineBlock/schema
|
|
126
|
+
msgid "timelineItem.color.yellow"
|
|
127
|
+
msgstr ""
|
|
128
|
+
|
|
129
|
+
#. Default: "Description"
|
|
130
|
+
#: TimelineBlock/schema
|
|
131
|
+
msgid "timelineItemDescription"
|
|
132
|
+
msgstr ""
|
|
133
|
+
|
|
134
|
+
#. Default: "Timeline items"
|
|
135
|
+
#: TimelineBlock/schema
|
|
136
|
+
msgid "timelineItems"
|
|
137
|
+
msgstr ""
|
|
138
|
+
|
|
139
|
+
#. Default: "Title"
|
|
140
|
+
#: TimelineBlock/schema
|
|
141
|
+
msgid "title"
|
|
142
|
+
msgstr ""
|
|
@@ -11,4 +11,132 @@ msgstr ""
|
|
|
11
11
|
"Content-Transfer-Encoding: \n"
|
|
12
12
|
"Plural-Forms: \n"
|
|
13
13
|
|
|
14
|
+
#. Default: "Add Timeline items"
|
|
15
|
+
#: TimelineBlock/View
|
|
16
|
+
msgid "Add Timeline items"
|
|
17
|
+
msgstr ""
|
|
18
|
+
|
|
19
|
+
#. Default: "Timeline"
|
|
20
|
+
#: TimelineBlock/index
|
|
21
|
+
msgid "Timeline"
|
|
22
|
+
msgstr ""
|
|
23
|
+
|
|
24
|
+
#. Default: "Date and time"
|
|
25
|
+
#: TimelineBlock/schema
|
|
26
|
+
msgid "dateAndTime"
|
|
27
|
+
msgstr ""
|
|
28
|
+
|
|
29
|
+
#. Default: "Hide time"
|
|
30
|
+
#: TimelineBlock/schema
|
|
31
|
+
msgid "hideTime"
|
|
32
|
+
msgstr ""
|
|
33
|
+
|
|
34
|
+
#. Default: "Icon"
|
|
35
|
+
#: TimelineBlock/schema
|
|
36
|
+
msgid "icon"
|
|
37
|
+
msgstr ""
|
|
38
|
+
|
|
39
|
+
#. Default: "Check here for a list with all the icons"
|
|
40
|
+
#: TimelineBlock/schema
|
|
41
|
+
msgid "iconDescription"
|
|
42
|
+
msgstr ""
|
|
43
|
+
|
|
44
|
+
#. Default: "Reversed"
|
|
45
|
+
#: TimelineBlock/schema
|
|
46
|
+
msgid "reversedTitle"
|
|
47
|
+
msgstr ""
|
|
48
|
+
|
|
49
|
+
#. Default: "Timeline block"
|
|
50
|
+
#: TimelineBlock/schema
|
|
51
|
+
msgid "timelineBlock"
|
|
52
|
+
msgstr ""
|
|
53
|
+
|
|
54
|
+
#. Default: "Color"
|
|
55
|
+
#: TimelineBlock/schema
|
|
56
|
+
msgid "timelineColor"
|
|
57
|
+
msgstr ""
|
|
58
|
+
|
|
59
|
+
#. Default: "Timeline item"
|
|
60
|
+
#: TimelineBlock/schema
|
|
61
|
+
msgid "timelineItem"
|
|
62
|
+
msgstr ""
|
|
63
|
+
|
|
64
|
+
#. Default: "Black"
|
|
65
|
+
#: TimelineBlock/schema
|
|
66
|
+
msgid "timelineItem.color.black"
|
|
67
|
+
msgstr ""
|
|
68
|
+
|
|
69
|
+
#. Default: "Blue"
|
|
70
|
+
#: TimelineBlock/schema
|
|
71
|
+
msgid "timelineItem.color.blue"
|
|
72
|
+
msgstr ""
|
|
73
|
+
|
|
74
|
+
#. Default: "Brown"
|
|
75
|
+
#: TimelineBlock/schema
|
|
76
|
+
msgid "timelineItem.color.brown"
|
|
77
|
+
msgstr ""
|
|
14
78
|
|
|
79
|
+
#. Default: "Green"
|
|
80
|
+
#: TimelineBlock/schema
|
|
81
|
+
msgid "timelineItem.color.green"
|
|
82
|
+
msgstr ""
|
|
83
|
+
|
|
84
|
+
#. Default: "Grey"
|
|
85
|
+
#: TimelineBlock/schema
|
|
86
|
+
msgid "timelineItem.color.grey"
|
|
87
|
+
msgstr ""
|
|
88
|
+
|
|
89
|
+
#. Default: "Olive"
|
|
90
|
+
#: TimelineBlock/schema
|
|
91
|
+
msgid "timelineItem.color.olive"
|
|
92
|
+
msgstr ""
|
|
93
|
+
|
|
94
|
+
#. Default: "Orange"
|
|
95
|
+
#: TimelineBlock/schema
|
|
96
|
+
msgid "timelineItem.color.orange"
|
|
97
|
+
msgstr ""
|
|
98
|
+
|
|
99
|
+
#. Default: "Pink"
|
|
100
|
+
#: TimelineBlock/schema
|
|
101
|
+
msgid "timelineItem.color.pink"
|
|
102
|
+
msgstr ""
|
|
103
|
+
|
|
104
|
+
#. Default: "Purple"
|
|
105
|
+
#: TimelineBlock/schema
|
|
106
|
+
msgid "timelineItem.color.purple"
|
|
107
|
+
msgstr ""
|
|
108
|
+
|
|
109
|
+
#. Default: "Red"
|
|
110
|
+
#: TimelineBlock/schema
|
|
111
|
+
msgid "timelineItem.color.red"
|
|
112
|
+
msgstr ""
|
|
113
|
+
|
|
114
|
+
#. Default: "Teal"
|
|
115
|
+
#: TimelineBlock/schema
|
|
116
|
+
msgid "timelineItem.color.teal"
|
|
117
|
+
msgstr ""
|
|
118
|
+
|
|
119
|
+
#. Default: "Violet"
|
|
120
|
+
#: TimelineBlock/schema
|
|
121
|
+
msgid "timelineItem.color.violet"
|
|
122
|
+
msgstr ""
|
|
123
|
+
|
|
124
|
+
#. Default: "Yellow"
|
|
125
|
+
#: TimelineBlock/schema
|
|
126
|
+
msgid "timelineItem.color.yellow"
|
|
127
|
+
msgstr ""
|
|
128
|
+
|
|
129
|
+
#. Default: "Description"
|
|
130
|
+
#: TimelineBlock/schema
|
|
131
|
+
msgid "timelineItemDescription"
|
|
132
|
+
msgstr ""
|
|
133
|
+
|
|
134
|
+
#. Default: "Timeline items"
|
|
135
|
+
#: TimelineBlock/schema
|
|
136
|
+
msgid "timelineItems"
|
|
137
|
+
msgstr ""
|
|
138
|
+
|
|
139
|
+
#. Default: "Title"
|
|
140
|
+
#: TimelineBlock/schema
|
|
141
|
+
msgid "title"
|
|
142
|
+
msgstr ""
|
package/locales/volto.pot
CHANGED
|
@@ -1,16 +1,144 @@
|
|
|
1
1
|
msgid ""
|
|
2
2
|
msgstr ""
|
|
3
3
|
"Project-Id-Version: Plone\n"
|
|
4
|
-
"POT-Creation-Date:
|
|
4
|
+
"POT-Creation-Date: 2025-01-14T11:29:00.204Z\n"
|
|
5
5
|
"Last-Translator: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
|
|
6
6
|
"Language-Team: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
|
|
7
|
-
"MIME-Version: 1.0\n"
|
|
8
7
|
"Content-Type: text/plain; charset=utf-8\n"
|
|
9
8
|
"Content-Transfer-Encoding: 8bit\n"
|
|
10
9
|
"Plural-Forms: nplurals=1; plural=0;\n"
|
|
10
|
+
"MIME-Version: 1.0\n"
|
|
11
11
|
"Language-Code: en\n"
|
|
12
12
|
"Language-Name: English\n"
|
|
13
13
|
"Preferred-Encodings: utf-8\n"
|
|
14
14
|
"Domain: volto\n"
|
|
15
15
|
|
|
16
|
+
#. Default: "Add Timeline items"
|
|
17
|
+
#: TimelineBlock/View
|
|
18
|
+
msgid "Add Timeline items"
|
|
19
|
+
msgstr ""
|
|
20
|
+
|
|
21
|
+
#. Default: "Timeline"
|
|
22
|
+
#: TimelineBlock/index
|
|
23
|
+
msgid "Timeline"
|
|
24
|
+
msgstr ""
|
|
25
|
+
|
|
26
|
+
#. Default: "Date and time"
|
|
27
|
+
#: TimelineBlock/schema
|
|
28
|
+
msgid "dateAndTime"
|
|
29
|
+
msgstr ""
|
|
30
|
+
|
|
31
|
+
#. Default: "Hide time"
|
|
32
|
+
#: TimelineBlock/schema
|
|
33
|
+
msgid "hideTime"
|
|
34
|
+
msgstr ""
|
|
35
|
+
|
|
36
|
+
#. Default: "Icon"
|
|
37
|
+
#: TimelineBlock/schema
|
|
38
|
+
msgid "icon"
|
|
39
|
+
msgstr ""
|
|
40
|
+
|
|
41
|
+
#. Default: "Check here for a list with all the icons"
|
|
42
|
+
#: TimelineBlock/schema
|
|
43
|
+
msgid "iconDescription"
|
|
44
|
+
msgstr ""
|
|
45
|
+
|
|
46
|
+
#. Default: "Reversed"
|
|
47
|
+
#: TimelineBlock/schema
|
|
48
|
+
msgid "reversedTitle"
|
|
49
|
+
msgstr ""
|
|
50
|
+
|
|
51
|
+
#. Default: "Timeline block"
|
|
52
|
+
#: TimelineBlock/schema
|
|
53
|
+
msgid "timelineBlock"
|
|
54
|
+
msgstr ""
|
|
55
|
+
|
|
56
|
+
#. Default: "Color"
|
|
57
|
+
#: TimelineBlock/schema
|
|
58
|
+
msgid "timelineColor"
|
|
59
|
+
msgstr ""
|
|
60
|
+
|
|
61
|
+
#. Default: "Timeline item"
|
|
62
|
+
#: TimelineBlock/schema
|
|
63
|
+
msgid "timelineItem"
|
|
64
|
+
msgstr ""
|
|
65
|
+
|
|
66
|
+
#. Default: "Black"
|
|
67
|
+
#: TimelineBlock/schema
|
|
68
|
+
msgid "timelineItem.color.black"
|
|
69
|
+
msgstr ""
|
|
70
|
+
|
|
71
|
+
#. Default: "Blue"
|
|
72
|
+
#: TimelineBlock/schema
|
|
73
|
+
msgid "timelineItem.color.blue"
|
|
74
|
+
msgstr ""
|
|
75
|
+
|
|
76
|
+
#. Default: "Brown"
|
|
77
|
+
#: TimelineBlock/schema
|
|
78
|
+
msgid "timelineItem.color.brown"
|
|
79
|
+
msgstr ""
|
|
80
|
+
|
|
81
|
+
#. Default: "Green"
|
|
82
|
+
#: TimelineBlock/schema
|
|
83
|
+
msgid "timelineItem.color.green"
|
|
84
|
+
msgstr ""
|
|
85
|
+
|
|
86
|
+
#. Default: "Grey"
|
|
87
|
+
#: TimelineBlock/schema
|
|
88
|
+
msgid "timelineItem.color.grey"
|
|
89
|
+
msgstr ""
|
|
90
|
+
|
|
91
|
+
#. Default: "Olive"
|
|
92
|
+
#: TimelineBlock/schema
|
|
93
|
+
msgid "timelineItem.color.olive"
|
|
94
|
+
msgstr ""
|
|
95
|
+
|
|
96
|
+
#. Default: "Orange"
|
|
97
|
+
#: TimelineBlock/schema
|
|
98
|
+
msgid "timelineItem.color.orange"
|
|
99
|
+
msgstr ""
|
|
100
|
+
|
|
101
|
+
#. Default: "Pink"
|
|
102
|
+
#: TimelineBlock/schema
|
|
103
|
+
msgid "timelineItem.color.pink"
|
|
104
|
+
msgstr ""
|
|
105
|
+
|
|
106
|
+
#. Default: "Purple"
|
|
107
|
+
#: TimelineBlock/schema
|
|
108
|
+
msgid "timelineItem.color.purple"
|
|
109
|
+
msgstr ""
|
|
16
110
|
|
|
111
|
+
#. Default: "Red"
|
|
112
|
+
#: TimelineBlock/schema
|
|
113
|
+
msgid "timelineItem.color.red"
|
|
114
|
+
msgstr ""
|
|
115
|
+
|
|
116
|
+
#. Default: "Teal"
|
|
117
|
+
#: TimelineBlock/schema
|
|
118
|
+
msgid "timelineItem.color.teal"
|
|
119
|
+
msgstr ""
|
|
120
|
+
|
|
121
|
+
#. Default: "Violet"
|
|
122
|
+
#: TimelineBlock/schema
|
|
123
|
+
msgid "timelineItem.color.violet"
|
|
124
|
+
msgstr ""
|
|
125
|
+
|
|
126
|
+
#. Default: "Yellow"
|
|
127
|
+
#: TimelineBlock/schema
|
|
128
|
+
msgid "timelineItem.color.yellow"
|
|
129
|
+
msgstr ""
|
|
130
|
+
|
|
131
|
+
#. Default: "Description"
|
|
132
|
+
#: TimelineBlock/schema
|
|
133
|
+
msgid "timelineItemDescription"
|
|
134
|
+
msgstr ""
|
|
135
|
+
|
|
136
|
+
#. Default: "Timeline items"
|
|
137
|
+
#: TimelineBlock/schema
|
|
138
|
+
msgid "timelineItems"
|
|
139
|
+
msgstr ""
|
|
140
|
+
|
|
141
|
+
#. Default: "Title"
|
|
142
|
+
#: TimelineBlock/schema
|
|
143
|
+
msgid "title"
|
|
144
|
+
msgstr ""
|
package/package.json
CHANGED
|
@@ -5,7 +5,14 @@ import View from './View';
|
|
|
5
5
|
import schema from './schema';
|
|
6
6
|
|
|
7
7
|
const Edit = (props) => {
|
|
8
|
-
const {
|
|
8
|
+
const {
|
|
9
|
+
data = {},
|
|
10
|
+
block = null,
|
|
11
|
+
selected = false,
|
|
12
|
+
onChangeBlock,
|
|
13
|
+
intl,
|
|
14
|
+
} = props;
|
|
15
|
+
const blockSchema = schema(intl);
|
|
9
16
|
|
|
10
17
|
return (
|
|
11
18
|
<>
|
|
@@ -13,8 +20,8 @@ const Edit = (props) => {
|
|
|
13
20
|
|
|
14
21
|
<SidebarPortal selected={selected}>
|
|
15
22
|
<InlineForm
|
|
16
|
-
schema={
|
|
17
|
-
title={
|
|
23
|
+
schema={blockSchema}
|
|
24
|
+
title={blockSchema.title}
|
|
18
25
|
onChangeField={(id, value) => {
|
|
19
26
|
onChangeBlock(block, {
|
|
20
27
|
...data,
|
|
@@ -3,6 +3,15 @@ import { compose } from 'redux';
|
|
|
3
3
|
import cx from 'classnames';
|
|
4
4
|
import { Grid, Card, Label, Icon } from 'semantic-ui-react';
|
|
5
5
|
import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable';
|
|
6
|
+
import { defineMessages, useIntl } from 'react-intl';
|
|
7
|
+
|
|
8
|
+
const messages = defineMessages({
|
|
9
|
+
addTimelineItem: {
|
|
10
|
+
id: 'Add Timeline items',
|
|
11
|
+
defaultMessage: 'Add Timeline items',
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
|
|
6
15
|
function Timeline({ children, reversed }) {
|
|
7
16
|
return (
|
|
8
17
|
<div className="eea timeline">
|
|
@@ -44,9 +53,11 @@ Timeline.Icon = (args) => (
|
|
|
44
53
|
);
|
|
45
54
|
|
|
46
55
|
const View = ({ data, mode, moment }) => {
|
|
56
|
+
const intl = useIntl();
|
|
47
57
|
const { items = [], reversed, hideTime } = data;
|
|
48
58
|
|
|
49
|
-
if (!items.length && mode === 'edit')
|
|
59
|
+
if (!items.length && mode === 'edit')
|
|
60
|
+
return <p>{intl.formatMessage(messages.addTimelineItem)}</p>;
|
|
50
61
|
return (
|
|
51
62
|
<React.Fragment>
|
|
52
63
|
{items.map((item, index) => {
|
|
@@ -3,7 +3,8 @@ import { render, screen } from '@testing-library/react';
|
|
|
3
3
|
import { unmountComponentAtNode } from 'react-dom';
|
|
4
4
|
import View from './View';
|
|
5
5
|
import moment from 'moment';
|
|
6
|
-
import '@testing-library/jest-dom
|
|
6
|
+
import '@testing-library/jest-dom';
|
|
7
|
+
import { IntlProvider } from 'react-intl';
|
|
7
8
|
|
|
8
9
|
jest.mock('@plone/volto/helpers/Loadable/Loadable', () => ({
|
|
9
10
|
injectLazyLibs: () => (component) => component,
|
|
@@ -30,7 +31,7 @@ describe('View and Timeline components', () => {
|
|
|
30
31
|
});
|
|
31
32
|
|
|
32
33
|
it('should render empty timeline in edit mode', () => {
|
|
33
|
-
|
|
34
|
+
renderWithIntl(<View data={{ items: undefined }} mode="edit" />, container);
|
|
34
35
|
|
|
35
36
|
expect(screen.getByText('Add Timeline items')).toBeInTheDocument();
|
|
36
37
|
});
|
|
@@ -45,7 +46,7 @@ describe('View and Timeline components', () => {
|
|
|
45
46
|
};
|
|
46
47
|
const data = { items: [item], reversed: false };
|
|
47
48
|
|
|
48
|
-
const { getByText } =
|
|
49
|
+
const { getByText } = renderWithIntl(
|
|
49
50
|
<View data={data} mode="view" moment={moment} />,
|
|
50
51
|
container,
|
|
51
52
|
);
|
|
@@ -65,7 +66,7 @@ describe('View and Timeline components', () => {
|
|
|
65
66
|
};
|
|
66
67
|
const data = { items: [item], reversed: true, hideTime: true };
|
|
67
68
|
|
|
68
|
-
const { getByText } =
|
|
69
|
+
const { getByText } = renderWithIntl(
|
|
69
70
|
<View data={data} mode="view" moment={moment} />,
|
|
70
71
|
container,
|
|
71
72
|
);
|
|
@@ -75,3 +76,11 @@ describe('View and Timeline components', () => {
|
|
|
75
76
|
expect(getByText('Jan 1, 2023')).toBeInTheDocument();
|
|
76
77
|
});
|
|
77
78
|
});
|
|
79
|
+
|
|
80
|
+
const renderWithIntl = (ui, { locale = 'en', messages = {} } = {}) => {
|
|
81
|
+
return render(
|
|
82
|
+
<IntlProvider locale={locale} messages={messages}>
|
|
83
|
+
{ui}
|
|
84
|
+
</IntlProvider>,
|
|
85
|
+
);
|
|
86
|
+
};
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import iconSVG from '@plone/volto/icons/calendar.svg';
|
|
2
2
|
import TimelineBlockEdit from './Edit';
|
|
3
3
|
import TimelineBlockView from './View';
|
|
4
|
+
import { defineMessages } from 'react-intl';
|
|
5
|
+
|
|
6
|
+
defineMessages({
|
|
7
|
+
timeline: {
|
|
8
|
+
id: 'Timeline',
|
|
9
|
+
defaultMessage: 'Timeline',
|
|
10
|
+
},
|
|
11
|
+
});
|
|
4
12
|
|
|
5
13
|
const applyConfig = (config) => {
|
|
6
14
|
config.blocks.blocksConfig.timeline_block = {
|
|
@@ -1,83 +1,184 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { defineMessages } from 'react-intl';
|
|
2
|
+
|
|
3
|
+
const messages = defineMessages({
|
|
4
|
+
timelineBlockTitle: {
|
|
5
|
+
id: 'timelineBlock',
|
|
6
|
+
defaultMessage: 'Timeline block',
|
|
7
|
+
},
|
|
8
|
+
reversedTitle: {
|
|
9
|
+
id: 'reversedTitle',
|
|
10
|
+
defaultMessage: 'Reversed',
|
|
11
|
+
},
|
|
12
|
+
hideTimeTitle: {
|
|
13
|
+
id: 'hideTime',
|
|
14
|
+
defaultMessage: 'Hide time',
|
|
15
|
+
},
|
|
16
|
+
timelineItemsTitle: {
|
|
17
|
+
id: 'timelineItems',
|
|
18
|
+
defaultMessage: 'Timeline items',
|
|
19
|
+
},
|
|
20
|
+
timelineItemTitle: {
|
|
21
|
+
id: 'timelineItem',
|
|
22
|
+
defaultMessage: 'Timeline item',
|
|
23
|
+
},
|
|
24
|
+
dateTimeTitle: {
|
|
25
|
+
id: 'dateAndTime',
|
|
26
|
+
defaultMessage: 'Date and time',
|
|
27
|
+
},
|
|
28
|
+
title: {
|
|
29
|
+
id: 'title',
|
|
30
|
+
defaultMessage: 'Title',
|
|
31
|
+
},
|
|
32
|
+
descriptionTitle: {
|
|
33
|
+
id: 'timelineItemDescription',
|
|
34
|
+
defaultMessage: 'Description',
|
|
35
|
+
},
|
|
36
|
+
iconTitle: {
|
|
37
|
+
id: 'icon',
|
|
38
|
+
defaultMessage: 'Icon',
|
|
39
|
+
},
|
|
40
|
+
iconDescription: {
|
|
41
|
+
id: 'iconDescription',
|
|
42
|
+
defaultMessage: 'Check here for a list with all the icons',
|
|
43
|
+
},
|
|
44
|
+
colorTitle: {
|
|
45
|
+
id: 'timelineColor',
|
|
46
|
+
defaultMessage: 'Color',
|
|
47
|
+
},
|
|
48
|
+
colorRed: {
|
|
49
|
+
id: 'timelineItem.color.red',
|
|
50
|
+
defaultMessage: 'Red',
|
|
51
|
+
},
|
|
52
|
+
colorOrange: {
|
|
53
|
+
id: 'timelineItem.color.orange',
|
|
54
|
+
defaultMessage: 'Orange',
|
|
55
|
+
},
|
|
56
|
+
colorYellow: {
|
|
57
|
+
id: 'timelineItem.color.yellow',
|
|
58
|
+
defaultMessage: 'Yellow',
|
|
59
|
+
},
|
|
60
|
+
colorOlive: {
|
|
61
|
+
id: 'timelineItem.color.olive',
|
|
62
|
+
defaultMessage: 'Olive',
|
|
63
|
+
},
|
|
64
|
+
colorGreen: {
|
|
65
|
+
id: 'timelineItem.color.green',
|
|
66
|
+
defaultMessage: 'Green',
|
|
67
|
+
},
|
|
68
|
+
colorTeal: {
|
|
69
|
+
id: 'timelineItem.color.teal',
|
|
70
|
+
defaultMessage: 'Teal',
|
|
71
|
+
},
|
|
72
|
+
colorBlue: {
|
|
73
|
+
id: 'timelineItem.color.blue',
|
|
74
|
+
defaultMessage: 'Blue',
|
|
75
|
+
},
|
|
76
|
+
colorViolet: {
|
|
77
|
+
id: 'timelineItem.color.violet',
|
|
78
|
+
defaultMessage: 'Violet',
|
|
79
|
+
},
|
|
80
|
+
colorPurple: {
|
|
81
|
+
id: 'timelineItem.color.purple',
|
|
82
|
+
defaultMessage: 'Purple',
|
|
83
|
+
},
|
|
84
|
+
colorPink: {
|
|
85
|
+
id: 'timelineItem.color.pink',
|
|
86
|
+
defaultMessage: 'Pink',
|
|
87
|
+
},
|
|
88
|
+
colorBrown: {
|
|
89
|
+
id: 'timelineItem.color.brown',
|
|
90
|
+
defaultMessage: 'Brown',
|
|
91
|
+
},
|
|
92
|
+
colorGrey: {
|
|
93
|
+
id: 'timelineItem.color.grey',
|
|
94
|
+
defaultMessage: 'Grey',
|
|
95
|
+
},
|
|
96
|
+
colorBlack: {
|
|
97
|
+
id: 'timelineItem.color.black',
|
|
98
|
+
defaultMessage: 'Black',
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
const timelineSchema = (intl) => ({
|
|
103
|
+
title: intl.formatMessage(messages.timelineItemTitle),
|
|
3
104
|
fieldsets: [
|
|
4
105
|
{
|
|
5
106
|
id: 'default',
|
|
6
|
-
title:
|
|
107
|
+
title: intl.formatMessage(messages.timelineItemTitle),
|
|
7
108
|
fields: ['datetime', 'title', 'description', 'icon', 'color'],
|
|
8
109
|
},
|
|
9
110
|
],
|
|
10
111
|
properties: {
|
|
11
112
|
datetime: {
|
|
12
|
-
title:
|
|
113
|
+
title: intl.formatMessage(messages.dateTimeTitle),
|
|
13
114
|
widget: 'datetime',
|
|
14
115
|
},
|
|
15
116
|
title: {
|
|
16
|
-
title:
|
|
117
|
+
title: intl.formatMessage(messages.title),
|
|
17
118
|
},
|
|
18
119
|
description: {
|
|
19
|
-
title:
|
|
120
|
+
title: intl.formatMessage(messages.descriptionTitle),
|
|
20
121
|
},
|
|
21
122
|
icon: {
|
|
22
|
-
title:
|
|
123
|
+
title: intl.formatMessage(messages.iconTitle),
|
|
23
124
|
description: (
|
|
24
125
|
<>
|
|
25
|
-
|
|
26
|
-
|
|
126
|
+
{intl.formatMessage(messages.iconDescription)}{' '}
|
|
127
|
+
<a href="https://react.semantic-ui.com/elements/icon/">here</a>
|
|
27
128
|
</>
|
|
28
129
|
),
|
|
29
130
|
},
|
|
30
131
|
color: {
|
|
31
|
-
title:
|
|
132
|
+
title: intl.formatMessage(messages.colorTitle),
|
|
32
133
|
defaultValue: 'blue',
|
|
33
134
|
choices: [
|
|
34
|
-
['red',
|
|
35
|
-
['orange',
|
|
36
|
-
['yellow',
|
|
37
|
-
['olive',
|
|
38
|
-
['green',
|
|
39
|
-
['teal',
|
|
40
|
-
['blue',
|
|
41
|
-
['violet',
|
|
42
|
-
['purple',
|
|
43
|
-
['pink',
|
|
44
|
-
['brown',
|
|
45
|
-
['grey',
|
|
46
|
-
['black',
|
|
135
|
+
['red', intl.formatMessage(messages.colorRed)],
|
|
136
|
+
['orange', intl.formatMessage(messages.colorOrange)],
|
|
137
|
+
['yellow', intl.formatMessage(messages.colorYellow)],
|
|
138
|
+
['olive', intl.formatMessage(messages.colorOlive)],
|
|
139
|
+
['green', intl.formatMessage(messages.colorGreen)],
|
|
140
|
+
['teal', intl.formatMessage(messages.colorTeal)],
|
|
141
|
+
['blue', intl.formatMessage(messages.colorBlue)],
|
|
142
|
+
['violet', intl.formatMessage(messages.colorViolet)],
|
|
143
|
+
['purple', intl.formatMessage(messages.colorPurple)],
|
|
144
|
+
['pink', intl.formatMessage(messages.colorPink)],
|
|
145
|
+
['brown', intl.formatMessage(messages.colorBrown)],
|
|
146
|
+
['grey', intl.formatMessage(messages.colorGrey)],
|
|
147
|
+
['black', intl.formatMessage(messages.colorBlack)],
|
|
47
148
|
],
|
|
48
149
|
},
|
|
49
150
|
},
|
|
50
151
|
required: [],
|
|
51
|
-
};
|
|
152
|
+
});
|
|
52
153
|
|
|
53
|
-
const schema = {
|
|
54
|
-
title:
|
|
154
|
+
const schema = (intl) => ({
|
|
155
|
+
title: intl.formatMessage(messages.timelineBlockTitle),
|
|
55
156
|
|
|
56
157
|
fieldsets: [
|
|
57
158
|
{
|
|
58
159
|
id: 'default',
|
|
59
|
-
title:
|
|
160
|
+
title: intl.formatMessage(messages.timelineBlockTitle),
|
|
60
161
|
fields: ['reversed', 'hideTime', 'items'],
|
|
61
162
|
},
|
|
62
163
|
],
|
|
63
164
|
|
|
64
165
|
properties: {
|
|
65
166
|
reversed: {
|
|
66
|
-
title:
|
|
167
|
+
title: intl.formatMessage(messages.reversedTitle),
|
|
67
168
|
type: 'boolean',
|
|
68
169
|
},
|
|
69
170
|
hideTime: {
|
|
70
|
-
title:
|
|
171
|
+
title: intl.formatMessage(messages.hideTimeTitle),
|
|
71
172
|
type: 'boolean',
|
|
72
173
|
},
|
|
73
174
|
items: {
|
|
74
|
-
title:
|
|
175
|
+
title: intl.formatMessage(messages.timelineItemsTitle),
|
|
75
176
|
widget: 'object_list',
|
|
76
|
-
schema: timelineSchema,
|
|
177
|
+
schema: timelineSchema(intl),
|
|
77
178
|
},
|
|
78
179
|
},
|
|
79
180
|
|
|
80
181
|
required: [],
|
|
81
|
-
};
|
|
182
|
+
});
|
|
82
183
|
|
|
83
184
|
export default schema;
|