@eeacms/volto-eea-website-theme 4.2.0 → 4.3.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 +36 -3
- package/package.json +1 -1
- package/src/customizations/@root/theme.js +1 -0
- package/src/customizations/@root/toast.less +99 -0
- package/src/customizations/volto/components/manage/Contents/ContentsItem.jsx +425 -0
- package/src/customizations/volto/components/manage/Contents/ContentsItem.jsx.diff +73 -0
- package/src/customizations/volto/components/manage/Contents/ContentsItem.jsx.md +19 -0
- package/src/customizations/volto/components/manage/Toast/Toast.jsx +55 -0
- package/src/customizations/volto/components/manage/Toast/Toast.test.jsx +41 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,11 +4,18 @@ 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
|
-
### [4.
|
|
7
|
+
### [4.3.1](https://github.com/eea/volto-eea-website-theme/compare/4.3.0...4.3.1) - 14 May 2026
|
|
8
8
|
|
|
9
|
-
#### :
|
|
9
|
+
#### :bug: Bug Fixes
|
|
10
|
+
|
|
11
|
+
- fix: Scheduled label in contents - refs #303325 [Teodor Voicu - [`7c7d4d4`](https://github.com/eea/volto-eea-website-theme/commit/7c7d4d43ced32570f2ea1dd104992f5da4164594)]
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
### [4.3.0](https://github.com/eea/volto-eea-website-theme/compare/4.2.0...4.3.0) - 24 April 2026
|
|
14
|
+
|
|
15
|
+
#### :hammer_and_wrench: Others
|
|
16
|
+
|
|
17
|
+
- Release 4.3.0 [Alin Voinea - [`707331f`](https://github.com/eea/volto-eea-website-theme/commit/707331fa7d26a22e5dfdbcb816d62ff18277ac07)]
|
|
18
|
+
### [4.2.0](https://github.com/eea/volto-eea-website-theme/compare/4.1.1...4.2.0) - 21 April 2026
|
|
12
19
|
|
|
13
20
|
#### :hammer_and_wrench: Others
|
|
14
21
|
|
|
@@ -72,6 +79,8 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
72
79
|
|
|
73
80
|
#### :house: Internal changes
|
|
74
81
|
|
|
82
|
+
- chore: [JENKINSFILE] add package version in sonarqube [valentinab25 - [`b15b302`](https://github.com/eea/volto-eea-website-theme/commit/b15b302ff88ec6afa6901ee7e1726cc4e04a8739)]
|
|
83
|
+
- chore: [JENKINSFILE] use sonarqube branches [EEA Jenkins - [`36f2e1e`](https://github.com/eea/volto-eea-website-theme/commit/36f2e1e176471b3753d77ab8aaf0cba577b43b36)]
|
|
75
84
|
|
|
76
85
|
### [3.19.0](https://github.com/eea/volto-eea-website-theme/compare/3.18.1...3.19.0) - 11 February 2026
|
|
77
86
|
|
|
@@ -134,6 +143,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
134
143
|
#### :hammer_and_wrench: Others
|
|
135
144
|
|
|
136
145
|
- Release 3.12.0 [Alin Voinea - [`ea1e961`](https://github.com/eea/volto-eea-website-theme/commit/ea1e96144684b2a8238ae476fd8d47de82ff42b4)]
|
|
146
|
+
- Add Sonarqube tag using bise-frontend addons list [EEA Jenkins - [`2cac56e`](https://github.com/eea/volto-eea-website-theme/commit/2cac56e22e580e042d368b69254172539ed33b65)]
|
|
137
147
|
### [3.11.0](https://github.com/eea/volto-eea-website-theme/compare/3.10.1...3.11.0) - 29 September 2025
|
|
138
148
|
|
|
139
149
|
#### :bug: Bug Fixes
|
|
@@ -227,6 +237,8 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
227
237
|
|
|
228
238
|
#### :hammer_and_wrench: Others
|
|
229
239
|
|
|
240
|
+
- Add Sonarqube tag using fise-frontend addons list [EEA Jenkins - [`3d50874`](https://github.com/eea/volto-eea-website-theme/commit/3d50874281ebcb91a1ae3727248f656a6f26c603)]
|
|
241
|
+
- Add Sonarqube tag using ied-frontend addons list [EEA Jenkins - [`a3f7676`](https://github.com/eea/volto-eea-website-theme/commit/a3f76767d99cb6dd93cc7fa0eafdea57e9000b2c)]
|
|
230
242
|
### [3.5.4](https://github.com/eea/volto-eea-website-theme/compare/3.5.3...3.5.4) - 30 January 2025
|
|
231
243
|
|
|
232
244
|
#### :bug: Bug Fixes
|
|
@@ -327,6 +339,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
327
339
|
|
|
328
340
|
#### :hammer_and_wrench: Others
|
|
329
341
|
|
|
342
|
+
- Add Sonarqube tag using bise-frontend addons list [EEA Jenkins - [`e417f83`](https://github.com/eea/volto-eea-website-theme/commit/e417f839312045c56b67ab8134fe5b0622b3e2c3)]
|
|
330
343
|
## [3.0.0](https://github.com/eea/volto-eea-website-theme/compare/2.4.0...3.0.0) - 21 October 2024
|
|
331
344
|
|
|
332
345
|
#### :nail_care: Enhancements
|
|
@@ -412,6 +425,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
412
425
|
- Refs #269520 - other_organisation test [Tripon Eugen - [`7558b27`](https://github.com/eea/volto-eea-website-theme/commit/7558b27a9d1cd6d3480a32b296c7325c796006c9)]
|
|
413
426
|
- Refs #269520 - other_organisation token widget edit mode [Tripon Eugen - [`b6df127`](https://github.com/eea/volto-eea-website-theme/commit/b6df127bd91b6f55dda8f468e1107037d43752ff)]
|
|
414
427
|
- Refs #269520 - other_organisation token widget [Tripon Eugen - [`6fd7543`](https://github.com/eea/volto-eea-website-theme/commit/6fd7543894bd2c593a1729116befd95c82ea3c8f)]
|
|
428
|
+
- Add Sonarqube tag using marine-frontend addons list [EEA Jenkins - [`cbc36c7`](https://github.com/eea/volto-eea-website-theme/commit/cbc36c74dfcd5f7cb1013a4c673d9c02e0023766)]
|
|
415
429
|
### [2.1.1](https://github.com/eea/volto-eea-website-theme/compare/2.1.0...2.1.1) - 28 May 2024
|
|
416
430
|
|
|
417
431
|
#### :bug: Bug Fixes
|
|
@@ -496,6 +510,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
496
510
|
|
|
497
511
|
#### :hammer_and_wrench: Others
|
|
498
512
|
|
|
513
|
+
- Add Sonarqube tag using insitu-frontend addons list [EEA Jenkins - [`adc6730`](https://github.com/eea/volto-eea-website-theme/commit/adc6730e21a37afb865b842182624401de6a29f5)]
|
|
499
514
|
### [1.33.1](https://github.com/eea/volto-eea-website-theme/compare/1.33.0...1.33.1) - 4 April 2024
|
|
500
515
|
|
|
501
516
|
#### :bug: Bug Fixes
|
|
@@ -629,6 +644,8 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
629
644
|
|
|
630
645
|
- bump version [Razvan - [`721e939`](https://github.com/eea/volto-eea-website-theme/commit/721e939d12e324b459ebfa78a2e656ee7142a3d6)]
|
|
631
646
|
- merge master into this branch [Razvan - [`586c8f9`](https://github.com/eea/volto-eea-website-theme/commit/586c8f910bac55a043bd8dda60e9444bd2ae1663)]
|
|
647
|
+
- Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`fd90044`](https://github.com/eea/volto-eea-website-theme/commit/fd9004442a9d1d465f7601ecdefe3e23c61e6a9c)]
|
|
648
|
+
- Add Sonarqube tag using insitu-frontend addons list [EEA Jenkins - [`4bc3dd3`](https://github.com/eea/volto-eea-website-theme/commit/4bc3dd3ae412a66befd04b5b80fab3716c929240)]
|
|
632
649
|
- test: Update jest,Jenkinsfile,lint to volto-addons-template PR30 [valentinab25 - [`c4dbd28`](https://github.com/eea/volto-eea-website-theme/commit/c4dbd289358205bc2d849aab7edb11ccf3b89cee)]
|
|
633
650
|
- fix tests [Razvan - [`042330b`](https://github.com/eea/volto-eea-website-theme/commit/042330bc97d32ffe7ba769b4f2453f71cffed706)]
|
|
634
651
|
- remove RemoveSchema logic [Razvan - [`08d10f8`](https://github.com/eea/volto-eea-website-theme/commit/08d10f8bf6f75478260e4e4c66d7316ba87b907a)]
|
|
@@ -723,6 +740,11 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
723
740
|
- test: Add real image to cypress test [Alin Voinea - [`4ff591a`](https://github.com/eea/volto-eea-website-theme/commit/4ff591ae3318c9588b4e2114582c0fa6cfdf31ae)]
|
|
724
741
|
- test: Add cypress tests for Image block styling position and align [Alin Voinea - [`7341ef7`](https://github.com/eea/volto-eea-website-theme/commit/7341ef7b92714fc0cc3ab0c31c39033e7b3e19e7)]
|
|
725
742
|
- 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)]
|
|
743
|
+
- test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`6a3be30`](https://github.com/eea/volto-eea-website-theme/commit/6a3be3092589411af7808a235f76de5222fd3868)]
|
|
744
|
+
- test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`c3978f2`](https://github.com/eea/volto-eea-website-theme/commit/c3978f23375ef066e9fd6f6c2e34ba6c1c058f69)]
|
|
745
|
+
- test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`f672779`](https://github.com/eea/volto-eea-website-theme/commit/f672779e845bec9240ccc901e9f53ec80c5a1819)]
|
|
746
|
+
- test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`ae5d8e3`](https://github.com/eea/volto-eea-website-theme/commit/ae5d8e3f4e04dc2808d47ce2ee886e1b23b528da)]
|
|
747
|
+
- test: [JENKINS] Improve cypress time [valentinab25 - [`170ff0c`](https://github.com/eea/volto-eea-website-theme/commit/170ff0c8e3b30e69479bdf1117e811fea94f1027)]
|
|
726
748
|
### [1.23.0](https://github.com/eea/volto-eea-website-theme/compare/1.22.1...1.23.0) - 2 November 2023
|
|
727
749
|
|
|
728
750
|
#### :rocket: New Features
|
|
@@ -735,6 +757,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
735
757
|
|
|
736
758
|
#### :house: Internal changes
|
|
737
759
|
|
|
760
|
+
- chore: [JENKINS] Refactor automated testing [valentinab25 - [`f28fce3`](https://github.com/eea/volto-eea-website-theme/commit/f28fce3d1eb815f95fb9aa40de42b10b7e8e30c5)]
|
|
738
761
|
- chore: husky, lint-staged use fixed versions [valentinab25 - [`6d15088`](https://github.com/eea/volto-eea-website-theme/commit/6d150886c5aeb2ca0b569270486e60f7cc274e2c)]
|
|
739
762
|
- chore:volto 16 in tests, update docs, fix stylelint overrides [valentinab25 - [`20c0323`](https://github.com/eea/volto-eea-website-theme/commit/20c032380b33c0077c869a05136f93e2fb68e5d4)]
|
|
740
763
|
|
|
@@ -920,6 +943,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
920
943
|
|
|
921
944
|
#### :house: Internal changes
|
|
922
945
|
|
|
946
|
+
- chore: [JENKINS] Deprecate circularity website [valentinab25 - [`370dcbf`](https://github.com/eea/volto-eea-website-theme/commit/370dcbfbf1a8135ce7b1b3b271b004552a631837)]
|
|
923
947
|
|
|
924
948
|
#### :hammer_and_wrench: Others
|
|
925
949
|
|
|
@@ -1075,6 +1099,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
1075
1099
|
|
|
1076
1100
|
#### :hammer_and_wrench: Others
|
|
1077
1101
|
|
|
1102
|
+
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`6c5e2f8`](https://github.com/eea/volto-eea-website-theme/commit/6c5e2f80456e2061d9e9c15fd0a0b91b9ac70568)]
|
|
1078
1103
|
### [1.9.1](https://github.com/eea/volto-eea-website-theme/compare/1.9.0...1.9.1) - 28 February 2023
|
|
1079
1104
|
|
|
1080
1105
|
#### :bug: Bug Fixes
|
|
@@ -1221,6 +1246,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
1221
1246
|
|
|
1222
1247
|
- For some reasons types is a string [Alin Voinea - [`3769a09`](https://github.com/eea/volto-eea-website-theme/commit/3769a0981181d5b633f3498daebbe96be8b4b833)]
|
|
1223
1248
|
- Fix(redirect): o.filter - refs #157627 [Alin Voinea - [`deb23da`](https://github.com/eea/volto-eea-website-theme/commit/deb23da846444cc96539697fd798429ae0abe89e)]
|
|
1249
|
+
- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`f1fffc5`](https://github.com/eea/volto-eea-website-theme/commit/f1fffc5db96725440863d545580b4e76cce4b796)]
|
|
1224
1250
|
### [1.5.0](https://github.com/eea/volto-eea-website-theme/compare/1.4.2...1.5.0) - 9 January 2023
|
|
1225
1251
|
|
|
1226
1252
|
#### :hammer_and_wrench: Others
|
|
@@ -1254,6 +1280,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
1254
1280
|
|
|
1255
1281
|
- Release 1.4.0 [Alin Voinea - [`bd42a0d`](https://github.com/eea/volto-eea-website-theme/commit/bd42a0d26e928cac5d99933194755da3db06b341)]
|
|
1256
1282
|
- bump version to use as volto-eea-design-system [David Ichim - [`f4be047`](https://github.com/eea/volto-eea-website-theme/commit/f4be047328b46399b03b612d378b18aaf82e7dc1)]
|
|
1283
|
+
- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`9b7cfef`](https://github.com/eea/volto-eea-website-theme/commit/9b7cfefb4d34fc1c948015e491feb370f9795bd8)]
|
|
1257
1284
|
- test(Jenkins): Run tests and cypress with latest canary @plone/volto [Alin Voinea - [`df252a9`](https://github.com/eea/volto-eea-website-theme/commit/df252a9bfed0bb86cadf53c59dd1603b1e2cd822)]
|
|
1258
1285
|
### [1.3.2](https://github.com/eea/volto-eea-website-theme/compare/1.3.1...1.3.2) - 16 December 2022
|
|
1259
1286
|
|
|
@@ -1263,6 +1290,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
1263
1290
|
|
|
1264
1291
|
#### :hammer_and_wrench: Others
|
|
1265
1292
|
|
|
1293
|
+
- Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`a43c658`](https://github.com/eea/volto-eea-website-theme/commit/a43c658a7920c8df95e763b9a637f38ce77eba2c)]
|
|
1266
1294
|
- Better razzle.config [Tiberiu Ichim - [`81dbf48`](https://github.com/eea/volto-eea-website-theme/commit/81dbf48815fb27facb4f82c9b764540fdf188b2e)]
|
|
1267
1295
|
- Better razzle.config [Tiberiu Ichim - [`7bc9da2`](https://github.com/eea/volto-eea-website-theme/commit/7bc9da2cd837ab62a95cd29979cdd9b0055b7d67)]
|
|
1268
1296
|
### [1.3.1](https://github.com/eea/volto-eea-website-theme/compare/1.3.0...1.3.1) - 28 November 2022
|
|
@@ -1273,6 +1301,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
1273
1301
|
|
|
1274
1302
|
#### :hammer_and_wrench: Others
|
|
1275
1303
|
|
|
1304
|
+
- yarn 3 [Alin Voinea - [`ea7a709`](https://github.com/eea/volto-eea-website-theme/commit/ea7a7094945312776e9b6f44e371178603e92139)]
|
|
1276
1305
|
### [1.3.0](https://github.com/eea/volto-eea-website-theme/compare/1.2.0...1.3.0) - 22 November 2022
|
|
1277
1306
|
|
|
1278
1307
|
#### :rocket: New Features
|
|
@@ -1313,6 +1342,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
1313
1342
|
- Add subsite class to body [Tiberiu Ichim - [`74d700f`](https://github.com/eea/volto-eea-website-theme/commit/74d700fbfd6249a8604762a7e4e49cce857db0f3)]
|
|
1314
1343
|
- Add subsite info to header [Tiberiu Ichim - [`47daf8b`](https://github.com/eea/volto-eea-website-theme/commit/47daf8bb6374a1222040626b19d4154df7ba1b83)]
|
|
1315
1344
|
- fix eslint [Miu Razvan - [`eb8d0a7`](https://github.com/eea/volto-eea-website-theme/commit/eb8d0a790bc70c0aae256c6ff35f63c4885f338e)]
|
|
1345
|
+
- Add Sonarqube tag using circularity-frontend addons list [EEA Jenkins - [`cc578a4`](https://github.com/eea/volto-eea-website-theme/commit/cc578a413b205a8e61e091fab3a88f94cedefc89)]
|
|
1316
1346
|
### [1.1.0](https://github.com/eea/volto-eea-website-theme/compare/1.0.0...1.1.0) - 28 October 2022
|
|
1317
1347
|
|
|
1318
1348
|
#### :nail_care: Enhancements
|
|
@@ -1360,6 +1390,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
1360
1390
|
|
|
1361
1391
|
#### :hammer_and_wrench: Others
|
|
1362
1392
|
|
|
1393
|
+
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`33b56ac`](https://github.com/eea/volto-eea-website-theme/commit/33b56acb13fbaf0c5b79e8fc6e13c4b699c79c90)]
|
|
1363
1394
|
### [0.7.3](https://github.com/eea/volto-eea-website-theme/compare/0.7.2...0.7.3) - 22 September 2022
|
|
1364
1395
|
|
|
1365
1396
|
#### :hammer_and_wrench: Others
|
|
@@ -1627,6 +1658,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
1627
1658
|
- Header refactor, add custom logo #5 [ichim-david - [`4950235`](https://github.com/eea/volto-eea-website-theme/commit/49502358105437cfeac3b144e6d301cb59aa2346)]
|
|
1628
1659
|
- Update footer.config with new publication card component [ichim-david - [`2e38e9a`](https://github.com/eea/volto-eea-website-theme/commit/2e38e9a417f835009d60c80d4eb4b30229f55e45)]
|
|
1629
1660
|
- 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)]
|
|
1661
|
+
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`da8ceb6`](https://github.com/eea/volto-eea-website-theme/commit/da8ceb68ea68bfbc9504e48ccd4d68277f11ab9a)]
|
|
1630
1662
|
- use breadcrumbs from eea-design-system [nileshgulia1 - [`db2f9e9`](https://github.com/eea/volto-eea-website-theme/commit/db2f9e9a4327420a3cce9a9903cd88549b129eab)]
|
|
1631
1663
|
- Update theme.config [ichim-david - [`8eca4f4`](https://github.com/eea/volto-eea-website-theme/commit/8eca4f40397a4aeca6d39029c92db78968d37064)]
|
|
1632
1664
|
- Added keyContent component to theme.config [ichim-david - [`d86f202`](https://github.com/eea/volto-eea-website-theme/commit/d86f202d0274d839487a88b51cae9a0e899beb23)]
|
|
@@ -1668,4 +1700,5 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
1668
1700
|
|
|
1669
1701
|
#### :hammer_and_wrench: Others
|
|
1670
1702
|
|
|
1703
|
+
- yarn bootstrap [Alin Voinea - [`6995e9e`](https://github.com/eea/volto-eea-website-theme/commit/6995e9e091f21fdbbdffa8a44fc0e2c626f6d46a)]
|
|
1671
1704
|
- Initial commit [Alin Voinea - [`6a9c03a`](https://github.com/eea/volto-eea-website-theme/commit/6a9c03a7cebe71ca87e82cf58c42904063e9d8d3)]
|
package/package.json
CHANGED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
.Toastify__toast-container--bottom-center {
|
|
2
|
+
top: 24px;
|
|
3
|
+
bottom: auto;
|
|
4
|
+
left: 50%;
|
|
5
|
+
width: ~'min(480px, calc(100vw - 32px))';
|
|
6
|
+
padding: 0;
|
|
7
|
+
margin-left: 0;
|
|
8
|
+
-webkit-transform: translateX(-50%);
|
|
9
|
+
transform: translateX(-50%);
|
|
10
|
+
|
|
11
|
+
.Toastify__toast {
|
|
12
|
+
display: flex;
|
|
13
|
+
overflow: visible;
|
|
14
|
+
min-height: 0;
|
|
15
|
+
align-items: flex-start;
|
|
16
|
+
padding: 0;
|
|
17
|
+
border: 0;
|
|
18
|
+
border-radius: 0;
|
|
19
|
+
margin-bottom: 12px;
|
|
20
|
+
background: transparent;
|
|
21
|
+
box-shadow: none;
|
|
22
|
+
color: inherit;
|
|
23
|
+
cursor: default;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.Toastify__toast-body {
|
|
27
|
+
min-width: 0;
|
|
28
|
+
flex: 1 1 auto;
|
|
29
|
+
padding: 0;
|
|
30
|
+
margin: 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.Toastify__close-button {
|
|
34
|
+
flex: 0 0 auto;
|
|
35
|
+
align-self: flex-start;
|
|
36
|
+
padding: 4px;
|
|
37
|
+
border: 0;
|
|
38
|
+
margin: -4px -4px -4px 12px;
|
|
39
|
+
background: transparent;
|
|
40
|
+
color: inherit;
|
|
41
|
+
opacity: 1;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.Toastify__close-button:hover,
|
|
45
|
+
.Toastify__close-button:focus {
|
|
46
|
+
opacity: 1;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.Toastify__toast--info .Toastify__close-button {
|
|
50
|
+
color: #003052;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.Toastify__toast--success .Toastify__close-button {
|
|
54
|
+
color: #005248;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.Toastify__toast--error .Toastify__close-button {
|
|
58
|
+
color: #b83230;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.Toastify__toast--warning .Toastify__close-button {
|
|
62
|
+
color: #3d2201;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.toast-dismiss-action {
|
|
66
|
+
display: none;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.toast-dismiss-action svg {
|
|
70
|
+
fill: currentColor;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.ui.message.eea-toast {
|
|
74
|
+
width: 100%;
|
|
75
|
+
margin: 0;
|
|
76
|
+
cursor: default;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.toast-inner-content {
|
|
80
|
+
min-width: 0;
|
|
81
|
+
margin-left: 0;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@media only screen and (max-width: 767px) {
|
|
86
|
+
.Toastify__toast-container--bottom-center {
|
|
87
|
+
top: 16px;
|
|
88
|
+
bottom: auto;
|
|
89
|
+
width: ~'min(480px, calc(100vw - 24px))';
|
|
90
|
+
|
|
91
|
+
.Toastify__toast {
|
|
92
|
+
margin-bottom: 8px;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.Toastify__close-button {
|
|
96
|
+
margin-left: 8px;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contents item component.
|
|
3
|
+
* @module components/manage/Contents/ContentsItem
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { Button, Table, Menu, Divider } from 'semantic-ui-react';
|
|
8
|
+
import { Link } from 'react-router-dom';
|
|
9
|
+
import PropTypes from 'prop-types';
|
|
10
|
+
import map from 'lodash/map';
|
|
11
|
+
import { useIntl, defineMessages, FormattedMessage } from 'react-intl';
|
|
12
|
+
import Circle from '@plone/volto/components/manage/Contents/circle';
|
|
13
|
+
import FormattedDate from '@plone/volto/components/theme/FormattedDate/FormattedDate';
|
|
14
|
+
import Icon from '@plone/volto/components/theme/Icon/Icon';
|
|
15
|
+
import Popup from '@plone/volto/components/theme/Popup/Popup';
|
|
16
|
+
import { getContentIcon } from '@plone/volto/helpers/Content/Content';
|
|
17
|
+
import moreSVG from '@plone/volto/icons/more.svg';
|
|
18
|
+
import checkboxUncheckedSVG from '@plone/volto/icons/checkbox-unchecked.svg';
|
|
19
|
+
import checkboxCheckedSVG from '@plone/volto/icons/checkbox-checked.svg';
|
|
20
|
+
import cutSVG from '@plone/volto/icons/cut.svg';
|
|
21
|
+
import deleteSVG from '@plone/volto/icons/delete.svg';
|
|
22
|
+
import copySVG from '@plone/volto/icons/copy.svg';
|
|
23
|
+
import showSVG from '@plone/volto/icons/show.svg';
|
|
24
|
+
import moveUpSVG from '@plone/volto/icons/move-up.svg';
|
|
25
|
+
import moveDownSVG from '@plone/volto/icons/move-down.svg';
|
|
26
|
+
import editingSVG from '@plone/volto/icons/editing.svg';
|
|
27
|
+
import dragSVG from '@plone/volto/icons/drag.svg';
|
|
28
|
+
import cx from 'classnames';
|
|
29
|
+
|
|
30
|
+
import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable';
|
|
31
|
+
|
|
32
|
+
const messages = defineMessages({
|
|
33
|
+
private: {
|
|
34
|
+
id: 'private',
|
|
35
|
+
defaultMessage: 'Private',
|
|
36
|
+
},
|
|
37
|
+
pending: {
|
|
38
|
+
id: 'pending',
|
|
39
|
+
defaultMessage: 'Pending',
|
|
40
|
+
},
|
|
41
|
+
published: {
|
|
42
|
+
id: 'published',
|
|
43
|
+
defaultMessage: 'Published',
|
|
44
|
+
},
|
|
45
|
+
intranet: {
|
|
46
|
+
id: 'intranet',
|
|
47
|
+
defaultMessage: 'Intranet',
|
|
48
|
+
},
|
|
49
|
+
draft: {
|
|
50
|
+
id: 'draft',
|
|
51
|
+
defaultMessage: 'Draft',
|
|
52
|
+
},
|
|
53
|
+
no_workflow_state: {
|
|
54
|
+
id: 'no workflow state',
|
|
55
|
+
defaultMessage: 'No workflow state',
|
|
56
|
+
},
|
|
57
|
+
none: {
|
|
58
|
+
id: 'Not available',
|
|
59
|
+
defaultMessage: 'None',
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
function getColor(string) {
|
|
64
|
+
switch (string) {
|
|
65
|
+
case 'private':
|
|
66
|
+
return '#ed4033';
|
|
67
|
+
case 'published':
|
|
68
|
+
return '#007bc1';
|
|
69
|
+
case 'intranet':
|
|
70
|
+
return '#51aa55';
|
|
71
|
+
case 'draft':
|
|
72
|
+
return '#f6a808';
|
|
73
|
+
default:
|
|
74
|
+
return 'grey';
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Contents item component class.
|
|
80
|
+
* @function ContentsItemComponent
|
|
81
|
+
* @returns {string} Markup of the component.
|
|
82
|
+
*/
|
|
83
|
+
export const ContentsItemComponent = ({
|
|
84
|
+
item,
|
|
85
|
+
selected,
|
|
86
|
+
onClick,
|
|
87
|
+
indexes,
|
|
88
|
+
onCut,
|
|
89
|
+
onCopy,
|
|
90
|
+
onDelete,
|
|
91
|
+
onMoveToTop,
|
|
92
|
+
onMoveToBottom,
|
|
93
|
+
connectDragPreview,
|
|
94
|
+
connectDragSource,
|
|
95
|
+
connectDropTarget,
|
|
96
|
+
isDragging,
|
|
97
|
+
order,
|
|
98
|
+
}) => {
|
|
99
|
+
const intl = useIntl();
|
|
100
|
+
const now = Date.now();
|
|
101
|
+
const expirationTime = new Date(item.ExpirationDate).getTime();
|
|
102
|
+
const effectiveTime = new Date(item.EffectiveDate).getTime();
|
|
103
|
+
const isExpired = item.ExpirationDate !== 'None' && expirationTime < now;
|
|
104
|
+
const isScheduled = item.EffectiveDate !== 'None' && effectiveTime > now;
|
|
105
|
+
|
|
106
|
+
return connectDropTarget(
|
|
107
|
+
connectDragPreview(
|
|
108
|
+
<tr
|
|
109
|
+
key={item['@id']}
|
|
110
|
+
className={cx('', { 'dragging-row': isDragging })}
|
|
111
|
+
aria-label={item['@id']}
|
|
112
|
+
>
|
|
113
|
+
<Table.Cell className={cx('', { 'dragging-cell': isDragging })}>
|
|
114
|
+
{connectDragSource(
|
|
115
|
+
<div style={{ display: 'inline-block' }}>
|
|
116
|
+
<Button icon basic>
|
|
117
|
+
<Icon
|
|
118
|
+
name={dragSVG}
|
|
119
|
+
size="20px"
|
|
120
|
+
color="#878f93"
|
|
121
|
+
className="content drag handle"
|
|
122
|
+
/>
|
|
123
|
+
</Button>
|
|
124
|
+
</div>,
|
|
125
|
+
)}
|
|
126
|
+
</Table.Cell>
|
|
127
|
+
<Table.Cell className={cx('', { 'dragging-cell': isDragging })}>
|
|
128
|
+
{selected ? (
|
|
129
|
+
<Button
|
|
130
|
+
icon
|
|
131
|
+
basic
|
|
132
|
+
aria-label="Unchecked"
|
|
133
|
+
onClick={(e) => onClick(e, item['@id'])}
|
|
134
|
+
>
|
|
135
|
+
<Icon
|
|
136
|
+
name={checkboxCheckedSVG}
|
|
137
|
+
color="#007eb1"
|
|
138
|
+
size="24px"
|
|
139
|
+
className="checked"
|
|
140
|
+
/>
|
|
141
|
+
</Button>
|
|
142
|
+
) : (
|
|
143
|
+
<Button
|
|
144
|
+
icon
|
|
145
|
+
basic
|
|
146
|
+
aria-label="Checked"
|
|
147
|
+
onClick={(e) => onClick(e, item['@id'])}
|
|
148
|
+
>
|
|
149
|
+
<Icon
|
|
150
|
+
name={checkboxUncheckedSVG}
|
|
151
|
+
color="#826a6a"
|
|
152
|
+
size="24px"
|
|
153
|
+
className="unchecked"
|
|
154
|
+
/>
|
|
155
|
+
</Button>
|
|
156
|
+
)}
|
|
157
|
+
</Table.Cell>
|
|
158
|
+
<Table.Cell className={cx('', { 'dragging-cell': isDragging })}>
|
|
159
|
+
<Link
|
|
160
|
+
className="icon-align-name"
|
|
161
|
+
to={`${item['@id']}${item.is_folderish ? '/contents' : ''}`}
|
|
162
|
+
>
|
|
163
|
+
<div
|
|
164
|
+
className="expire-align"
|
|
165
|
+
style={{ flex: '1 1 auto', minWidth: 0 }}
|
|
166
|
+
>
|
|
167
|
+
<Icon
|
|
168
|
+
name={getContentIcon(item['@type'], item.is_folderish)}
|
|
169
|
+
size="20px"
|
|
170
|
+
className="icon-margin"
|
|
171
|
+
color="#878f93"
|
|
172
|
+
title={item['Type'] || item['@type']}
|
|
173
|
+
/>{' '}
|
|
174
|
+
<span
|
|
175
|
+
title={item.title}
|
|
176
|
+
style={{ flex: '1 1 auto', minWidth: 0 }}
|
|
177
|
+
>
|
|
178
|
+
{' '}
|
|
179
|
+
{item.title}
|
|
180
|
+
</span>
|
|
181
|
+
</div>
|
|
182
|
+
{isExpired && (
|
|
183
|
+
<Button
|
|
184
|
+
className="button-margin"
|
|
185
|
+
size="mini"
|
|
186
|
+
style={{ flexShrink: 0 }}
|
|
187
|
+
>
|
|
188
|
+
<FormattedMessage id="Expired" defaultMessage="Expired" />
|
|
189
|
+
</Button>
|
|
190
|
+
)}
|
|
191
|
+
{isScheduled && (
|
|
192
|
+
<Button
|
|
193
|
+
className="button-margin effective-future"
|
|
194
|
+
size="mini"
|
|
195
|
+
style={{ flexShrink: 0 }}
|
|
196
|
+
>
|
|
197
|
+
<FormattedMessage id="Scheduled" defaultMessage="Scheduled" />
|
|
198
|
+
</Button>
|
|
199
|
+
)}
|
|
200
|
+
</Link>
|
|
201
|
+
</Table.Cell>
|
|
202
|
+
{map(indexes, (index) => (
|
|
203
|
+
<Table.Cell
|
|
204
|
+
className={cx('', { 'dragging-cell': isDragging })}
|
|
205
|
+
key={index.id}
|
|
206
|
+
>
|
|
207
|
+
{index.type === 'boolean' &&
|
|
208
|
+
(item[index.id] ? (
|
|
209
|
+
<FormattedMessage id="Yes" defaultMessage="Yes" />
|
|
210
|
+
) : (
|
|
211
|
+
<FormattedMessage id="No" defaultMessage="No" />
|
|
212
|
+
))}
|
|
213
|
+
{index.type === 'string' &&
|
|
214
|
+
index.id !== 'review_state' &&
|
|
215
|
+
item[index.id]}
|
|
216
|
+
{index.id === 'review_state' && (
|
|
217
|
+
<div>
|
|
218
|
+
<span>
|
|
219
|
+
<Circle color={getColor(item[index.id])} size="15px" />
|
|
220
|
+
</span>
|
|
221
|
+
{messages[item[index.id]]
|
|
222
|
+
? intl.formatMessage(messages[item[index.id]])
|
|
223
|
+
: item['review_title'] ||
|
|
224
|
+
item['review_state'] ||
|
|
225
|
+
intl.formatMessage(messages.no_workflow_state)}
|
|
226
|
+
</div>
|
|
227
|
+
)}
|
|
228
|
+
{index.type === 'date' && (
|
|
229
|
+
<>
|
|
230
|
+
{item[index?.id] && item[index.id] !== 'None' ? (
|
|
231
|
+
<FormattedDate date={item[index.id]} />
|
|
232
|
+
) : (
|
|
233
|
+
intl.formatMessage(messages.none)
|
|
234
|
+
)}
|
|
235
|
+
</>
|
|
236
|
+
)}
|
|
237
|
+
{index.type === 'array' && (
|
|
238
|
+
<span>{item[index.id]?.join(', ')}</span>
|
|
239
|
+
)}
|
|
240
|
+
</Table.Cell>
|
|
241
|
+
))}
|
|
242
|
+
<Table.Cell
|
|
243
|
+
className={cx('', { 'dragging-cell': isDragging })}
|
|
244
|
+
textAlign="right"
|
|
245
|
+
>
|
|
246
|
+
<Popup
|
|
247
|
+
menu={true}
|
|
248
|
+
position="bottom right"
|
|
249
|
+
flowing={true}
|
|
250
|
+
basic={true}
|
|
251
|
+
on="click"
|
|
252
|
+
popper={{
|
|
253
|
+
className: 'dropdown-popup',
|
|
254
|
+
}}
|
|
255
|
+
trigger={
|
|
256
|
+
<Icon
|
|
257
|
+
name={moreSVG}
|
|
258
|
+
className="dropdown-popup-trigger"
|
|
259
|
+
size="24px"
|
|
260
|
+
color="#007eb1"
|
|
261
|
+
/>
|
|
262
|
+
}
|
|
263
|
+
>
|
|
264
|
+
<Menu vertical borderless fluid>
|
|
265
|
+
<Link className="item icon-align" to={`${item['@id']}/edit`}>
|
|
266
|
+
<Icon name={editingSVG} color="#007eb1" size="24px" />{' '}
|
|
267
|
+
<FormattedMessage id="Edit" defaultMessage="Edit" />
|
|
268
|
+
</Link>
|
|
269
|
+
<Link className="item right-dropdown icon-align" to={item['@id']}>
|
|
270
|
+
<Icon name={showSVG} color="#007eb1" size="24px" />{' '}
|
|
271
|
+
<FormattedMessage id="View" defaultMessage="View" />
|
|
272
|
+
</Link>
|
|
273
|
+
<Divider />
|
|
274
|
+
<Menu.Item
|
|
275
|
+
onClick={onCut}
|
|
276
|
+
value={item['@id']}
|
|
277
|
+
className="right-dropdown icon-align"
|
|
278
|
+
>
|
|
279
|
+
<Icon name={cutSVG} color="#007eb1" size="24px" />{' '}
|
|
280
|
+
<FormattedMessage id="Cut" defaultMessage="Cut" />
|
|
281
|
+
</Menu.Item>
|
|
282
|
+
<Menu.Item
|
|
283
|
+
onClick={onCopy}
|
|
284
|
+
value={item['@id']}
|
|
285
|
+
className="right-dropdown icon-align"
|
|
286
|
+
>
|
|
287
|
+
<Icon name={copySVG} color="#007eb1" size="24px" />{' '}
|
|
288
|
+
<FormattedMessage id="Copy" defaultMessage="Copy" />
|
|
289
|
+
</Menu.Item>
|
|
290
|
+
<Menu.Item
|
|
291
|
+
onClick={onDelete}
|
|
292
|
+
value={item['@id']}
|
|
293
|
+
className="right-dropdown icon-align"
|
|
294
|
+
>
|
|
295
|
+
<Icon name={deleteSVG} color="#e40166" size="24px" />{' '}
|
|
296
|
+
<FormattedMessage id="Delete" defaultMessage="Delete" />
|
|
297
|
+
</Menu.Item>
|
|
298
|
+
<Divider />
|
|
299
|
+
<Menu.Item
|
|
300
|
+
onClick={onMoveToTop}
|
|
301
|
+
value={order}
|
|
302
|
+
className="right-dropdown icon-align"
|
|
303
|
+
>
|
|
304
|
+
<Icon name={moveUpSVG} color="#007eb1" size="24px" />{' '}
|
|
305
|
+
<FormattedMessage
|
|
306
|
+
id="Move to top of folder"
|
|
307
|
+
defaultMessage="Move to top of folder"
|
|
308
|
+
/>
|
|
309
|
+
</Menu.Item>
|
|
310
|
+
<Menu.Item
|
|
311
|
+
onClick={onMoveToBottom}
|
|
312
|
+
value={order}
|
|
313
|
+
className="right-dropdown icon-align"
|
|
314
|
+
>
|
|
315
|
+
<Icon name={moveDownSVG} color="#007eb1" size="24px" />{' '}
|
|
316
|
+
<FormattedMessage
|
|
317
|
+
id="Move to bottom of folder"
|
|
318
|
+
defaultMessage="Move to bottom of folder"
|
|
319
|
+
/>
|
|
320
|
+
</Menu.Item>
|
|
321
|
+
</Menu>
|
|
322
|
+
</Popup>
|
|
323
|
+
</Table.Cell>
|
|
324
|
+
</tr>,
|
|
325
|
+
),
|
|
326
|
+
);
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* Property types.
|
|
331
|
+
* @property {Object} propTypes Property types.
|
|
332
|
+
* @static
|
|
333
|
+
*/
|
|
334
|
+
ContentsItemComponent.propTypes = {
|
|
335
|
+
item: PropTypes.shape({
|
|
336
|
+
'@id': PropTypes.string,
|
|
337
|
+
title: PropTypes.string,
|
|
338
|
+
is_folderish: PropTypes.bool,
|
|
339
|
+
'@type': PropTypes.string,
|
|
340
|
+
}).isRequired,
|
|
341
|
+
selected: PropTypes.bool.isRequired,
|
|
342
|
+
onClick: PropTypes.func.isRequired,
|
|
343
|
+
indexes: PropTypes.arrayOf(
|
|
344
|
+
PropTypes.shape({
|
|
345
|
+
id: PropTypes.string,
|
|
346
|
+
type: PropTypes.string,
|
|
347
|
+
}),
|
|
348
|
+
).isRequired,
|
|
349
|
+
onCut: PropTypes.func.isRequired,
|
|
350
|
+
onCopy: PropTypes.func.isRequired,
|
|
351
|
+
onDelete: PropTypes.func.isRequired,
|
|
352
|
+
onMoveToTop: PropTypes.func.isRequired,
|
|
353
|
+
onMoveToBottom: PropTypes.func.isRequired,
|
|
354
|
+
connectDragPreview: PropTypes.func.isRequired,
|
|
355
|
+
connectDragSource: PropTypes.func.isRequired,
|
|
356
|
+
connectDropTarget: PropTypes.func.isRequired,
|
|
357
|
+
isDragging: PropTypes.bool.isRequired,
|
|
358
|
+
order: PropTypes.number.isRequired,
|
|
359
|
+
onOrderItem: PropTypes.func.isRequired,
|
|
360
|
+
};
|
|
361
|
+
|
|
362
|
+
const DragDropConnector = (props) => {
|
|
363
|
+
const { DropTarget, DragSource } = props.reactDnd;
|
|
364
|
+
|
|
365
|
+
const DndConnectedContentsItem = React.useMemo(
|
|
366
|
+
() =>
|
|
367
|
+
DropTarget(
|
|
368
|
+
'item',
|
|
369
|
+
{
|
|
370
|
+
hover(props, monitor) {
|
|
371
|
+
const id = monitor.getItem().id;
|
|
372
|
+
const dragOrder = monitor.getItem().order;
|
|
373
|
+
const hoverOrder = props.order;
|
|
374
|
+
|
|
375
|
+
if (dragOrder === hoverOrder) {
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
props.onOrderItem(id, dragOrder, hoverOrder - dragOrder, false);
|
|
380
|
+
|
|
381
|
+
monitor.getItem().order = hoverOrder;
|
|
382
|
+
},
|
|
383
|
+
drop(props, monitor) {
|
|
384
|
+
const id = monitor.getItem().id;
|
|
385
|
+
const dragOrder = monitor.getItem().startOrder;
|
|
386
|
+
const dropOrder = props.order;
|
|
387
|
+
|
|
388
|
+
if (dragOrder === dropOrder) {
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
props.onOrderItem(id, dragOrder, dropOrder - dragOrder, true);
|
|
393
|
+
|
|
394
|
+
monitor.getItem().order = dropOrder;
|
|
395
|
+
},
|
|
396
|
+
},
|
|
397
|
+
(connect) => ({
|
|
398
|
+
connectDropTarget: connect.dropTarget(),
|
|
399
|
+
}),
|
|
400
|
+
)(
|
|
401
|
+
DragSource(
|
|
402
|
+
'item',
|
|
403
|
+
{
|
|
404
|
+
beginDrag(props) {
|
|
405
|
+
return {
|
|
406
|
+
id: props.item['@id'],
|
|
407
|
+
order: props.order,
|
|
408
|
+
startOrder: props.order,
|
|
409
|
+
};
|
|
410
|
+
},
|
|
411
|
+
},
|
|
412
|
+
(connect, monitor) => ({
|
|
413
|
+
connectDragSource: connect.dragSource(),
|
|
414
|
+
connectDragPreview: connect.dragPreview(),
|
|
415
|
+
isDragging: monitor.isDragging(),
|
|
416
|
+
}),
|
|
417
|
+
)(ContentsItemComponent),
|
|
418
|
+
),
|
|
419
|
+
[DragSource, DropTarget],
|
|
420
|
+
);
|
|
421
|
+
|
|
422
|
+
return <DndConnectedContentsItem {...props} />;
|
|
423
|
+
};
|
|
424
|
+
|
|
425
|
+
export default injectLazyLibs('reactDnd')(DragDropConnector);
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
--- node_modules/@plone/volto/src/components/manage/Contents/ContentsItem.jsx
|
|
2
|
+
+++ src/customizations/volto/components/manage/Contents/ContentsItem.jsx
|
|
3
|
+
@@ -97,6 +97,11 @@
|
|
4
|
+
order,
|
|
5
|
+
}) => {
|
|
6
|
+
const intl = useIntl();
|
|
7
|
+
+ const now = Date.now();
|
|
8
|
+
+ const expirationTime = new Date(item.ExpirationDate).getTime();
|
|
9
|
+
+ const effectiveTime = new Date(item.EffectiveDate).getTime();
|
|
10
|
+
+ const isExpired = item.ExpirationDate !== 'None' && expirationTime < now;
|
|
11
|
+
+ const isScheduled = item.EffectiveDate !== 'None' && effectiveTime > now;
|
|
12
|
+
|
|
13
|
+
return connectDropTarget(
|
|
14
|
+
connectDragPreview(
|
|
15
|
+
@@ -155,7 +160,10 @@
|
|
16
|
+
className="icon-align-name"
|
|
17
|
+
to={`${item['@id']}${item.is_folderish ? '/contents' : ''}`}
|
|
18
|
+
>
|
|
19
|
+
- <div className="expire-align">
|
|
20
|
+
+ <div
|
|
21
|
+
+ className="expire-align"
|
|
22
|
+
+ style={{ flex: '1 1 auto', minWidth: 0 }}
|
|
23
|
+
+ >
|
|
24
|
+
<Icon
|
|
25
|
+
name={getContentIcon(item['@type'], item.is_folderish)}
|
|
26
|
+
size="20px"
|
|
27
|
+
@@ -163,21 +171,32 @@
|
|
28
|
+
color="#878f93"
|
|
29
|
+
title={item['Type'] || item['@type']}
|
|
30
|
+
/>{' '}
|
|
31
|
+
- <span title={item.title}> {item.title}</span>
|
|
32
|
+
+ <span
|
|
33
|
+
+ title={item.title}
|
|
34
|
+
+ style={{ flex: '1 1 auto', minWidth: 0 }}
|
|
35
|
+
+ >
|
|
36
|
+
+ {' '}
|
|
37
|
+
+ {item.title}
|
|
38
|
+
+ </span>
|
|
39
|
+
</div>
|
|
40
|
+
- {item.ExpirationDate !== 'None' &&
|
|
41
|
+
- new Date(item.ExpirationDate).getTime() <
|
|
42
|
+
- new Date().getTime() && (
|
|
43
|
+
- <Button className="button-margin" size="mini">
|
|
44
|
+
- <FormattedMessage id="Expired" defaultMessage="Expired" />
|
|
45
|
+
- </Button>
|
|
46
|
+
- )}
|
|
47
|
+
- {item.EffectiveDate !== 'None' &&
|
|
48
|
+
- new Date(item.EffectiveDate).getTime() > new Date().getTime() && (
|
|
49
|
+
- <Button className="button-margin effective-future" size="mini">
|
|
50
|
+
- <FormattedMessage id="Scheduled" defaultMessage="Scheduled" />
|
|
51
|
+
- </Button>
|
|
52
|
+
- )}
|
|
53
|
+
+ {isExpired && (
|
|
54
|
+
+ <Button
|
|
55
|
+
+ className="button-margin"
|
|
56
|
+
+ size="mini"
|
|
57
|
+
+ style={{ flexShrink: 0 }}
|
|
58
|
+
+ >
|
|
59
|
+
+ <FormattedMessage id="Expired" defaultMessage="Expired" />
|
|
60
|
+
+ </Button>
|
|
61
|
+
+ )}
|
|
62
|
+
+ {isScheduled && (
|
|
63
|
+
+ <Button
|
|
64
|
+
+ className="button-margin effective-future"
|
|
65
|
+
+ size="mini"
|
|
66
|
+
+ style={{ flexShrink: 0 }}
|
|
67
|
+
+ >
|
|
68
|
+
+ <FormattedMessage id="Scheduled" defaultMessage="Scheduled" />
|
|
69
|
+
+ </Button>
|
|
70
|
+
+ )}
|
|
71
|
+
</Link>
|
|
72
|
+
</Table.Cell>
|
|
73
|
+
{map(indexes, (index) => (
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# ContentsItem.jsx customization
|
|
2
|
+
|
|
3
|
+
This customization shadows Volto core's
|
|
4
|
+
`src/components/manage/Contents/ContentsItem.jsx` from `@plone/volto` 18.33.1.
|
|
5
|
+
|
|
6
|
+
The functional changes are limited to the contents table item link:
|
|
7
|
+
|
|
8
|
+
- The expired and scheduled date checks are computed once per render as
|
|
9
|
+
`isExpired` and `isScheduled`, then reused by the badge rendering.
|
|
10
|
+
- The title wrapper and title text are allowed to shrink with flexbox
|
|
11
|
+
(`flex: '1 1 auto'` and `minWidth: 0`), while the status badges keep their
|
|
12
|
+
intrinsic width with `flexShrink: 0`.
|
|
13
|
+
|
|
14
|
+
The goal is to avoid title text colliding with the `Expired` or `Scheduled`
|
|
15
|
+
badges without hardcoding a pixel width for the title.
|
|
16
|
+
|
|
17
|
+
When upgrading Volto, compare the new core component with this override and
|
|
18
|
+
refresh `ContentsItem.jsx.diff` if upstream changed around the contents item
|
|
19
|
+
title or badge rendering.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import cx from 'classnames';
|
|
4
|
+
import { Icon, Message } from 'semantic-ui-react';
|
|
5
|
+
|
|
6
|
+
const Toast = (props) => {
|
|
7
|
+
function getStatus(props) {
|
|
8
|
+
if (props.info) {
|
|
9
|
+
return 'info';
|
|
10
|
+
} else if (props.success) {
|
|
11
|
+
return 'success';
|
|
12
|
+
} else if (props.error) {
|
|
13
|
+
return 'error';
|
|
14
|
+
} else if (props.warning) {
|
|
15
|
+
return 'warning';
|
|
16
|
+
} else {
|
|
17
|
+
return 'success';
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const { title, content } = props;
|
|
22
|
+
const status = getStatus(props);
|
|
23
|
+
const statusProps = {
|
|
24
|
+
info: status === 'info',
|
|
25
|
+
success: status === 'success',
|
|
26
|
+
error: status === 'error',
|
|
27
|
+
warning: status === 'warning',
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<Message
|
|
32
|
+
icon
|
|
33
|
+
size="large"
|
|
34
|
+
className={cx('eea-toast', `eea-toast--${status}`)}
|
|
35
|
+
{...statusProps}
|
|
36
|
+
>
|
|
37
|
+
<Icon name="exclamation circle" />
|
|
38
|
+
<Message.Content className="toast-inner-content">
|
|
39
|
+
{title && <Message.Header>{title}</Message.Header>}
|
|
40
|
+
<div>{content}</div>
|
|
41
|
+
</Message.Content>
|
|
42
|
+
</Message>
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
Toast.propTypes = {
|
|
47
|
+
title: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
|
|
48
|
+
content: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired,
|
|
49
|
+
info: PropTypes.bool,
|
|
50
|
+
success: PropTypes.bool,
|
|
51
|
+
error: PropTypes.bool,
|
|
52
|
+
warning: PropTypes.bool,
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export default Toast;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import '@testing-library/jest-dom';
|
|
4
|
+
|
|
5
|
+
import Toast from './Toast';
|
|
6
|
+
|
|
7
|
+
describe('Toast', () => {
|
|
8
|
+
it('renders the title, content, and Volto compatibility class', () => {
|
|
9
|
+
const { container, getByText } = render(
|
|
10
|
+
<Toast success title="Saved" content="The content was saved." />,
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
expect(getByText('Saved')).toBeInTheDocument();
|
|
14
|
+
expect(getByText('The content was saved.')).toBeInTheDocument();
|
|
15
|
+
expect(container.querySelector('.eea-toast')).toHaveClass(
|
|
16
|
+
'ui',
|
|
17
|
+
'message',
|
|
18
|
+
'success',
|
|
19
|
+
'large',
|
|
20
|
+
'icon',
|
|
21
|
+
'eea-toast--success',
|
|
22
|
+
);
|
|
23
|
+
expect(
|
|
24
|
+
container.querySelector('.exclamation.circle.icon'),
|
|
25
|
+
).toBeInTheDocument();
|
|
26
|
+
expect(container.querySelector('.toast-inner-content')).toBeInTheDocument();
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it.each([
|
|
30
|
+
['info', { info: true }, 'eea-toast--info'],
|
|
31
|
+
['success', { success: true }, 'eea-toast--success'],
|
|
32
|
+
['error', { error: true }, 'eea-toast--error'],
|
|
33
|
+
['warning', { warning: true }, 'eea-toast--warning'],
|
|
34
|
+
])('applies the %s status class', (status, props, className) => {
|
|
35
|
+
const { container } = render(
|
|
36
|
+
<Toast {...props} title={status} content={`${status} content`} />,
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
expect(container.querySelector('.eea-toast')).toHaveClass(className);
|
|
40
|
+
});
|
|
41
|
+
});
|