@eeacms/volto-cca-policy 0.2.4 → 0.2.5
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 +55 -0
- package/locales/de/LC_MESSAGES/volto.po +15 -64
- package/locales/en/LC_MESSAGES/volto.po +15 -64
- package/locales/es/LC_MESSAGES/volto.po +15 -64
- package/locales/fr/LC_MESSAGES/volto.po +15 -64
- package/locales/it/LC_MESSAGES/volto.po +15 -64
- package/locales/pl/LC_MESSAGES/volto.po +15 -64
- package/locales/ro/LC_MESSAGES/volto.po +15 -64
- package/locales/volto.pot +16 -55
- package/package.json +1 -1
- package/src/components/manage/Blocks/CountryProfileDetail/CountryTabPane.js +72 -0
- package/src/components/manage/Blocks/CountryProfileDetail/CountryTabPane.test.jsx +47 -0
- package/src/components/manage/Blocks/CountryProfileDetail/View.js +59 -47
- package/src/components/manage/Blocks/CountryProfileDetail/View.test.jsx +40 -0
- package/src/components/manage/Blocks/CountryProfileDetail/styles.less +55 -0
- package/src/components/manage/Blocks/RASTBlock/RASTView.jsx +4 -2
- package/src/components/theme/ASTNavigation/ASTAccordion.jsx +20 -6
|
@@ -98,11 +98,6 @@ msgstr ""
|
|
|
98
98
|
msgid "Challenges"
|
|
99
99
|
msgstr ""
|
|
100
100
|
|
|
101
|
-
#. Default: "Choices"
|
|
102
|
-
#: components/manage/Widgets/CreatableSelectWidget
|
|
103
|
-
msgid "Choices"
|
|
104
|
-
msgstr ""
|
|
105
|
-
|
|
106
101
|
#. Default: "Choose a region"
|
|
107
102
|
#: components/manage/Blocks/TransRegionSelect/TransRegionSelectView
|
|
108
103
|
msgid "Choose a region"
|
|
@@ -119,7 +114,6 @@ msgid "City:"
|
|
|
119
114
|
msgstr ""
|
|
120
115
|
|
|
121
116
|
#. Default: "Climate impact"
|
|
122
|
-
#: components/manage/Blocks/FilterAceContent/FilterAceContentView copy
|
|
123
117
|
#: components/manage/Blocks/FilterAceContent/FilterAceContentView
|
|
124
118
|
msgid "Climate impact"
|
|
125
119
|
msgstr ""
|
|
@@ -140,11 +134,6 @@ msgstr ""
|
|
|
140
134
|
msgid "Climate-ADAPT page for this event"
|
|
141
135
|
msgstr ""
|
|
142
136
|
|
|
143
|
-
#. Default: "Close"
|
|
144
|
-
#: components/manage/Widgets/CreatableSelectWidget
|
|
145
|
-
msgid "Close"
|
|
146
|
-
msgstr ""
|
|
147
|
-
|
|
148
137
|
#. Default: "Contact"
|
|
149
138
|
#: components/theme/Views/CaseStudyView
|
|
150
139
|
#: components/theme/Views/CcaEventView
|
|
@@ -192,13 +181,7 @@ msgstr ""
|
|
|
192
181
|
msgid "Dec"
|
|
193
182
|
msgstr ""
|
|
194
183
|
|
|
195
|
-
#. Default: "Default"
|
|
196
|
-
#: components/manage/Widgets/CreatableSelectWidget
|
|
197
|
-
msgid "Default"
|
|
198
|
-
msgstr ""
|
|
199
|
-
|
|
200
184
|
#. Default: "Description"
|
|
201
|
-
#: components/manage/Widgets/CreatableSelectWidget
|
|
202
185
|
#: helpers/Utils
|
|
203
186
|
msgid "Description"
|
|
204
187
|
msgstr ""
|
|
@@ -248,6 +231,11 @@ msgstr ""
|
|
|
248
231
|
msgid "Geographic characterisation:"
|
|
249
232
|
msgstr ""
|
|
250
233
|
|
|
234
|
+
#. Default: "Getting started"
|
|
235
|
+
#: components/theme/ASTNavigation/ASTAccordion
|
|
236
|
+
msgid "Getting started"
|
|
237
|
+
msgstr ""
|
|
238
|
+
|
|
251
239
|
#. Default: "Go back"
|
|
252
240
|
#: components/theme/Views/C3SIndicatorView
|
|
253
241
|
msgid "Go back"
|
|
@@ -339,6 +327,11 @@ msgstr ""
|
|
|
339
327
|
msgid "Key activities within climate change and health"
|
|
340
328
|
msgstr ""
|
|
341
329
|
|
|
330
|
+
#. Default: "Key type measures"
|
|
331
|
+
#: components/manage/Blocks/CaseStudyExplorer/CaseStudyFilters
|
|
332
|
+
msgid "Key type measures"
|
|
333
|
+
msgstr ""
|
|
334
|
+
|
|
342
335
|
#. Default: "Keywords:"
|
|
343
336
|
#: helpers/ContentMetadata
|
|
344
337
|
msgid "Keywords:"
|
|
@@ -411,21 +404,11 @@ msgstr ""
|
|
|
411
404
|
msgid "No information"
|
|
412
405
|
msgstr ""
|
|
413
406
|
|
|
414
|
-
#. Default: "No options"
|
|
415
|
-
#: components/manage/Widgets/CreatableSelectWidget
|
|
416
|
-
msgid "No options"
|
|
417
|
-
msgstr ""
|
|
418
|
-
|
|
419
407
|
#. Default: "No results"
|
|
420
408
|
#: components/manage/Blocks/SearchAceContent/SearchAceContentView
|
|
421
409
|
msgid "No results"
|
|
422
410
|
msgstr ""
|
|
423
411
|
|
|
424
|
-
#. Default: "No value"
|
|
425
|
-
#: components/manage/Widgets/CreatableSelectWidget
|
|
426
|
-
msgid "No value"
|
|
427
|
-
msgstr ""
|
|
428
|
-
|
|
429
412
|
#. Default: "Nov"
|
|
430
413
|
#: components/manage/Blocks/Listing/EventCardsListingView
|
|
431
414
|
msgid "Nov"
|
|
@@ -533,18 +516,12 @@ msgstr ""
|
|
|
533
516
|
msgid "Relevance"
|
|
534
517
|
msgstr ""
|
|
535
518
|
|
|
536
|
-
#. Default: "Required"
|
|
537
|
-
#: components/manage/Widgets/CreatableSelectWidget
|
|
538
|
-
msgid "Required"
|
|
539
|
-
msgstr ""
|
|
540
|
-
|
|
541
519
|
#. Default: "Sa"
|
|
542
520
|
#: components/manage/Blocks/Listing/EventCardsListingView
|
|
543
521
|
msgid "Sa"
|
|
544
522
|
msgstr ""
|
|
545
523
|
|
|
546
524
|
#. Default: "Sector"
|
|
547
|
-
#: components/manage/Blocks/FilterAceContent/FilterAceContentView copy
|
|
548
525
|
#: components/manage/Blocks/FilterAceContent/FilterAceContentView
|
|
549
526
|
msgid "Sector"
|
|
550
527
|
msgstr ""
|
|
@@ -569,11 +546,6 @@ msgstr ""
|
|
|
569
546
|
msgid "See video outside Climate-ADAPT"
|
|
570
547
|
msgstr ""
|
|
571
548
|
|
|
572
|
-
#. Default: "Select…"
|
|
573
|
-
#: components/manage/Widgets/CreatableSelectWidget
|
|
574
|
-
msgid "Select…"
|
|
575
|
-
msgstr ""
|
|
576
|
-
|
|
577
549
|
#. Default: "Sep"
|
|
578
550
|
#: components/manage/Blocks/Listing/EventCardsListingView
|
|
579
551
|
msgid "Sep"
|
|
@@ -582,15 +554,9 @@ msgstr ""
|
|
|
582
554
|
#. Default: "Share your information"
|
|
583
555
|
#: components/manage/Blocks/SearchAceContent/SearchAceContentView
|
|
584
556
|
#: components/theme/ShareInfoButton/ShareInfoButton
|
|
585
|
-
#: helpers/ShareInfo
|
|
586
557
|
msgid "Share your information"
|
|
587
558
|
msgstr ""
|
|
588
559
|
|
|
589
|
-
#. Default: "Short Name"
|
|
590
|
-
#: components/manage/Widgets/CreatableSelectWidget
|
|
591
|
-
msgid "Short Name"
|
|
592
|
-
msgstr ""
|
|
593
|
-
|
|
594
560
|
#. Default: "Solutions"
|
|
595
561
|
#: components/theme/Views/CaseStudyView
|
|
596
562
|
msgid "Solutions"
|
|
@@ -640,6 +606,11 @@ msgstr ""
|
|
|
640
606
|
msgid "Th"
|
|
641
607
|
msgstr ""
|
|
642
608
|
|
|
609
|
+
#. Default: "The Adaptation Support Tool - Getting started"
|
|
610
|
+
#: components/theme/ASTNavigation/ASTAccordion
|
|
611
|
+
msgid "The Adaptation Support Tool - Getting started"
|
|
612
|
+
msgstr ""
|
|
613
|
+
|
|
643
614
|
#. Default: "The date refers to the date of release of the video"
|
|
644
615
|
#: helpers/ContentMetadata
|
|
645
616
|
msgid "The date refers to the date of release of the video"
|
|
@@ -655,21 +626,11 @@ msgstr ""
|
|
|
655
626
|
msgid "The date refers to the moment in which the item has been prepared or updated by contributing experts to be submitted for the publication in Climate ADAPT"
|
|
656
627
|
msgstr ""
|
|
657
628
|
|
|
658
|
-
#. Default: "Title"
|
|
659
|
-
#: components/manage/Widgets/CreatableSelectWidget
|
|
660
|
-
msgid "Title"
|
|
661
|
-
msgstr ""
|
|
662
|
-
|
|
663
629
|
#. Default: "Tu"
|
|
664
630
|
#: components/manage/Blocks/Listing/EventCardsListingView
|
|
665
631
|
msgid "Tu"
|
|
666
632
|
msgstr ""
|
|
667
633
|
|
|
668
|
-
#. Default: "Used for programmatic access to the fieldset."
|
|
669
|
-
#: components/manage/Widgets/CreatableSelectWidget
|
|
670
|
-
msgid "Used for programmatic access to the fieldset."
|
|
671
|
-
msgstr ""
|
|
672
|
-
|
|
673
634
|
#. Default: "View all contributions in the resource catalogue"
|
|
674
635
|
#: helpers/Utils
|
|
675
636
|
msgid "View all contributions in the resource catalogue"
|
|
@@ -3131,11 +3092,6 @@ msgstr ""
|
|
|
3131
3092
|
msgid "Geographic characterization:"
|
|
3132
3093
|
msgstr ""
|
|
3133
3094
|
|
|
3134
|
-
#. undefined
|
|
3135
|
-
#: ../../climateadapt/tiles/pt/urbanast_navigation.pt:50
|
|
3136
|
-
msgid "Getting started"
|
|
3137
|
-
msgstr ""
|
|
3138
|
-
|
|
3139
3095
|
#. undefined
|
|
3140
3096
|
#: ../../climateadapt/browser/pt/landing_page_forest.pt:300
|
|
3141
3097
|
#: ../../climateadapt/browser/pt/landing_page_urban.pt:255
|
|
@@ -3749,11 +3705,6 @@ msgstr ""
|
|
|
3749
3705
|
msgid "The <a href="https://www.fao.org/green-cities-initiative/en/">FAO Green Cities Initiative</a> focuses on improving the urban environment, strengthening urban-rural linkages and the resilience of urban systems, services and populations to external shocks."
|
|
3750
3706
|
msgstr ""
|
|
3751
3707
|
|
|
3752
|
-
#. undefined
|
|
3753
|
-
#: ../../climateadapt/tiles/pt/ast_navigation.pt:106
|
|
3754
|
-
msgid "The Adaptation Support Tool - Getting started"
|
|
3755
|
-
msgstr ""
|
|
3756
|
-
|
|
3757
3708
|
#. undefined
|
|
3758
3709
|
#: ../../climateadapt/browser/pt/landing_page_urban.pt:384
|
|
3759
3710
|
msgid "The EU Covenant of Mayors"
|
package/locales/volto.pot
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
msgid ""
|
|
2
2
|
msgstr ""
|
|
3
3
|
"Project-Id-Version: Plone\n"
|
|
4
|
-
"POT-Creation-Date: 2024-
|
|
4
|
+
"POT-Creation-Date: 2024-04-12T14:10:28.025Z\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
7
|
"Content-Type: text/plain; charset=utf-8\n"
|
|
@@ -100,11 +100,6 @@ msgstr ""
|
|
|
100
100
|
msgid "Challenges"
|
|
101
101
|
msgstr ""
|
|
102
102
|
|
|
103
|
-
#. Default: "Choices"
|
|
104
|
-
#: components/manage/Widgets/CreatableSelectWidget
|
|
105
|
-
msgid "Choices"
|
|
106
|
-
msgstr ""
|
|
107
|
-
|
|
108
103
|
#. Default: "Choose a region"
|
|
109
104
|
#: components/manage/Blocks/TransRegionSelect/TransRegionSelectView
|
|
110
105
|
msgid "Choose a region"
|
|
@@ -121,7 +116,6 @@ msgid "City:"
|
|
|
121
116
|
msgstr ""
|
|
122
117
|
|
|
123
118
|
#. Default: "Climate impact"
|
|
124
|
-
#: components/manage/Blocks/FilterAceContent/FilterAceContentView copy
|
|
125
119
|
#: components/manage/Blocks/FilterAceContent/FilterAceContentView
|
|
126
120
|
msgid "Climate impact"
|
|
127
121
|
msgstr ""
|
|
@@ -142,11 +136,6 @@ msgstr ""
|
|
|
142
136
|
msgid "Climate-ADAPT page for this event"
|
|
143
137
|
msgstr ""
|
|
144
138
|
|
|
145
|
-
#. Default: "Close"
|
|
146
|
-
#: components/manage/Widgets/CreatableSelectWidget
|
|
147
|
-
msgid "Close"
|
|
148
|
-
msgstr ""
|
|
149
|
-
|
|
150
139
|
#. Default: "Contact"
|
|
151
140
|
#: components/theme/Views/CaseStudyView
|
|
152
141
|
#: components/theme/Views/CcaEventView
|
|
@@ -194,13 +183,7 @@ msgstr ""
|
|
|
194
183
|
msgid "Dec"
|
|
195
184
|
msgstr ""
|
|
196
185
|
|
|
197
|
-
#. Default: "Default"
|
|
198
|
-
#: components/manage/Widgets/CreatableSelectWidget
|
|
199
|
-
msgid "Default"
|
|
200
|
-
msgstr ""
|
|
201
|
-
|
|
202
186
|
#. Default: "Description"
|
|
203
|
-
#: components/manage/Widgets/CreatableSelectWidget
|
|
204
187
|
#: helpers/Utils
|
|
205
188
|
msgid "Description"
|
|
206
189
|
msgstr ""
|
|
@@ -250,6 +233,11 @@ msgstr ""
|
|
|
250
233
|
msgid "Geographic characterisation:"
|
|
251
234
|
msgstr ""
|
|
252
235
|
|
|
236
|
+
#. Default: "Getting started"
|
|
237
|
+
#: components/theme/ASTNavigation/ASTAccordion
|
|
238
|
+
msgid "Getting started"
|
|
239
|
+
msgstr ""
|
|
240
|
+
|
|
253
241
|
#. Default: "Go back"
|
|
254
242
|
#: components/theme/Views/C3SIndicatorView
|
|
255
243
|
msgid "Go back"
|
|
@@ -341,6 +329,11 @@ msgstr ""
|
|
|
341
329
|
msgid "Key activities within climate change and health"
|
|
342
330
|
msgstr ""
|
|
343
331
|
|
|
332
|
+
#. Default: "Key type measures"
|
|
333
|
+
#: components/manage/Blocks/CaseStudyExplorer/CaseStudyFilters
|
|
334
|
+
msgid "Key type measures"
|
|
335
|
+
msgstr ""
|
|
336
|
+
|
|
344
337
|
#. Default: "Keywords:"
|
|
345
338
|
#: helpers/ContentMetadata
|
|
346
339
|
msgid "Keywords:"
|
|
@@ -413,21 +406,11 @@ msgstr ""
|
|
|
413
406
|
msgid "No information"
|
|
414
407
|
msgstr ""
|
|
415
408
|
|
|
416
|
-
#. Default: "No options"
|
|
417
|
-
#: components/manage/Widgets/CreatableSelectWidget
|
|
418
|
-
msgid "No options"
|
|
419
|
-
msgstr ""
|
|
420
|
-
|
|
421
409
|
#. Default: "No results"
|
|
422
410
|
#: components/manage/Blocks/SearchAceContent/SearchAceContentView
|
|
423
411
|
msgid "No results"
|
|
424
412
|
msgstr ""
|
|
425
413
|
|
|
426
|
-
#. Default: "No value"
|
|
427
|
-
#: components/manage/Widgets/CreatableSelectWidget
|
|
428
|
-
msgid "No value"
|
|
429
|
-
msgstr ""
|
|
430
|
-
|
|
431
414
|
#. Default: "Nov"
|
|
432
415
|
#: components/manage/Blocks/Listing/EventCardsListingView
|
|
433
416
|
msgid "Nov"
|
|
@@ -535,18 +518,12 @@ msgstr ""
|
|
|
535
518
|
msgid "Relevance"
|
|
536
519
|
msgstr ""
|
|
537
520
|
|
|
538
|
-
#. Default: "Required"
|
|
539
|
-
#: components/manage/Widgets/CreatableSelectWidget
|
|
540
|
-
msgid "Required"
|
|
541
|
-
msgstr ""
|
|
542
|
-
|
|
543
521
|
#. Default: "Sa"
|
|
544
522
|
#: components/manage/Blocks/Listing/EventCardsListingView
|
|
545
523
|
msgid "Sa"
|
|
546
524
|
msgstr ""
|
|
547
525
|
|
|
548
526
|
#. Default: "Sector"
|
|
549
|
-
#: components/manage/Blocks/FilterAceContent/FilterAceContentView copy
|
|
550
527
|
#: components/manage/Blocks/FilterAceContent/FilterAceContentView
|
|
551
528
|
msgid "Sector"
|
|
552
529
|
msgstr ""
|
|
@@ -571,11 +548,6 @@ msgstr ""
|
|
|
571
548
|
msgid "See video outside Climate-ADAPT"
|
|
572
549
|
msgstr ""
|
|
573
550
|
|
|
574
|
-
#. Default: "Select…"
|
|
575
|
-
#: components/manage/Widgets/CreatableSelectWidget
|
|
576
|
-
msgid "Select…"
|
|
577
|
-
msgstr ""
|
|
578
|
-
|
|
579
551
|
#. Default: "Sep"
|
|
580
552
|
#: components/manage/Blocks/Listing/EventCardsListingView
|
|
581
553
|
msgid "Sep"
|
|
@@ -584,15 +556,9 @@ msgstr ""
|
|
|
584
556
|
#. Default: "Share your information"
|
|
585
557
|
#: components/manage/Blocks/SearchAceContent/SearchAceContentView
|
|
586
558
|
#: components/theme/ShareInfoButton/ShareInfoButton
|
|
587
|
-
#: helpers/ShareInfo
|
|
588
559
|
msgid "Share your information"
|
|
589
560
|
msgstr ""
|
|
590
561
|
|
|
591
|
-
#. Default: "Short Name"
|
|
592
|
-
#: components/manage/Widgets/CreatableSelectWidget
|
|
593
|
-
msgid "Short Name"
|
|
594
|
-
msgstr ""
|
|
595
|
-
|
|
596
562
|
#. Default: "Solutions"
|
|
597
563
|
#: components/theme/Views/CaseStudyView
|
|
598
564
|
msgid "Solutions"
|
|
@@ -642,6 +608,11 @@ msgstr ""
|
|
|
642
608
|
msgid "Th"
|
|
643
609
|
msgstr ""
|
|
644
610
|
|
|
611
|
+
#. Default: "The Adaptation Support Tool - Getting started"
|
|
612
|
+
#: components/theme/ASTNavigation/ASTAccordion
|
|
613
|
+
msgid "The Adaptation Support Tool - Getting started"
|
|
614
|
+
msgstr ""
|
|
615
|
+
|
|
645
616
|
#. Default: "The date refers to the date of release of the video"
|
|
646
617
|
#: helpers/ContentMetadata
|
|
647
618
|
msgid "The date refers to the date of release of the video"
|
|
@@ -657,21 +628,11 @@ msgstr ""
|
|
|
657
628
|
msgid "The date refers to the moment in which the item has been prepared or updated by contributing experts to be submitted for the publication in Climate ADAPT"
|
|
658
629
|
msgstr ""
|
|
659
630
|
|
|
660
|
-
#. Default: "Title"
|
|
661
|
-
#: components/manage/Widgets/CreatableSelectWidget
|
|
662
|
-
msgid "Title"
|
|
663
|
-
msgstr ""
|
|
664
|
-
|
|
665
631
|
#. Default: "Tu"
|
|
666
632
|
#: components/manage/Blocks/Listing/EventCardsListingView
|
|
667
633
|
msgid "Tu"
|
|
668
634
|
msgstr ""
|
|
669
635
|
|
|
670
|
-
#. Default: "Used for programmatic access to the fieldset."
|
|
671
|
-
#: components/manage/Widgets/CreatableSelectWidget
|
|
672
|
-
msgid "Used for programmatic access to the fieldset."
|
|
673
|
-
msgstr ""
|
|
674
|
-
|
|
675
636
|
#. Default: "View all contributions in the resource catalogue"
|
|
676
637
|
#: helpers/Utils
|
|
677
638
|
msgid "View all contributions in the resource catalogue"
|
package/package.json
CHANGED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Accordion, Icon } from 'semantic-ui-react';
|
|
3
|
+
|
|
4
|
+
export default function CountryTabPane(props) {
|
|
5
|
+
const { contents, _index, activePanes, setActivePanes } = props;
|
|
6
|
+
return (
|
|
7
|
+
<>
|
|
8
|
+
{contents.map((element, index) => {
|
|
9
|
+
let indexKey = _index + '_' + index;
|
|
10
|
+
if (element.type === 'h2') {
|
|
11
|
+
return <h2 key={indexKey}>{element.value}</h2>;
|
|
12
|
+
}
|
|
13
|
+
if (element.type === 'h3') {
|
|
14
|
+
return <h3 key={indexKey}>{element.value}</h3>;
|
|
15
|
+
}
|
|
16
|
+
if (element.type === 'p') {
|
|
17
|
+
return (
|
|
18
|
+
<p
|
|
19
|
+
key={indexKey}
|
|
20
|
+
dangerouslySetInnerHTML={{ __html: element.value }}
|
|
21
|
+
></p>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
if (element.type === 'accordeon') {
|
|
25
|
+
return element.value.map((accordion, index) => {
|
|
26
|
+
return (
|
|
27
|
+
<Accordion className="secondary">
|
|
28
|
+
<Accordion.Title
|
|
29
|
+
role="button"
|
|
30
|
+
tabIndex={0}
|
|
31
|
+
active={activePanes[indexKey + '_' + index] || false}
|
|
32
|
+
onClick={(e) => {
|
|
33
|
+
const temp = JSON.parse(JSON.stringify(activePanes));
|
|
34
|
+
let val = temp[indexKey + '_' + index] || false;
|
|
35
|
+
temp[indexKey + '_' + index] = !val;
|
|
36
|
+
setActivePanes(temp);
|
|
37
|
+
}}
|
|
38
|
+
>
|
|
39
|
+
<span className="item-title">{accordion.title}</span>
|
|
40
|
+
<Icon className="ri-arrow-down-s-line" />
|
|
41
|
+
</Accordion.Title>
|
|
42
|
+
<Accordion.Content
|
|
43
|
+
active={activePanes[indexKey + '_' + index] || false}
|
|
44
|
+
dangerouslySetInnerHTML={{ __html: accordion.value }}
|
|
45
|
+
></Accordion.Content>
|
|
46
|
+
</Accordion>
|
|
47
|
+
);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
if (element.type === 'table') {
|
|
51
|
+
let _html_value = '';
|
|
52
|
+
for (let i = 0; i < element.value.length; i++) {
|
|
53
|
+
_html_value += element.value[i];
|
|
54
|
+
}
|
|
55
|
+
// return <table>{_html_value}</table>;
|
|
56
|
+
return (
|
|
57
|
+
<table dangerouslySetInnerHTML={{ __html: _html_value }}></table>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
if (element.type === 'div') {
|
|
61
|
+
let _html_value = '';
|
|
62
|
+
for (let i = 0; i < element.value.length; i++) {
|
|
63
|
+
_html_value += element.value[i];
|
|
64
|
+
}
|
|
65
|
+
// return <table>{_html_value}</table>;
|
|
66
|
+
return <div dangerouslySetInnerHTML={{ __html: _html_value }}></div>;
|
|
67
|
+
}
|
|
68
|
+
return null;
|
|
69
|
+
})}
|
|
70
|
+
</>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MemoryRouter } from 'react-router-dom';
|
|
3
|
+
import configureStore from 'redux-mock-store';
|
|
4
|
+
import { render } from '@testing-library/react';
|
|
5
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
6
|
+
import { Provider } from 'react-intl-redux';
|
|
7
|
+
import CountryTabPane from './CountryTabPane';
|
|
8
|
+
|
|
9
|
+
const mockStore = configureStore();
|
|
10
|
+
|
|
11
|
+
describe('CountryTabPane', () => {
|
|
12
|
+
const setActivePanes = () => {
|
|
13
|
+
return 0;
|
|
14
|
+
};
|
|
15
|
+
it('should render the component', () => {
|
|
16
|
+
const data = {
|
|
17
|
+
_index: 2,
|
|
18
|
+
contents: [
|
|
19
|
+
[
|
|
20
|
+
{
|
|
21
|
+
type: 'div',
|
|
22
|
+
value: '<div><p class="testing">Just a test</p></div>',
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
],
|
|
26
|
+
activePanes: 1,
|
|
27
|
+
setActivePanes: setActivePanes,
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const store = mockStore({
|
|
31
|
+
userSession: { token: '1234' },
|
|
32
|
+
intl: {
|
|
33
|
+
locale: 'en',
|
|
34
|
+
messages: {},
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const { container } = render(
|
|
39
|
+
<Provider store={store}>
|
|
40
|
+
<MemoryRouter>
|
|
41
|
+
<CountryTabPane {...data} />
|
|
42
|
+
</MemoryRouter>
|
|
43
|
+
</Provider>,
|
|
44
|
+
);
|
|
45
|
+
expect(container).toBeTruthy();
|
|
46
|
+
});
|
|
47
|
+
});
|
|
@@ -1,47 +1,29 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TabPane, Tab } from 'semantic-ui-react';
|
|
3
|
+
import { Accordion, Icon } from 'semantic-ui-react';
|
|
4
|
+
import CountryTabPane from './CountryTabPane';
|
|
3
5
|
|
|
4
|
-
|
|
5
|
-
let parser = new DOMParser();
|
|
6
|
-
let dom_document = parser.parseFromString(html_string, 'text/html');
|
|
7
|
-
|
|
8
|
-
let list = dom_document
|
|
9
|
-
.getElementById('third-level-menu')
|
|
10
|
-
.getElementsByTagName('a');
|
|
11
|
-
let response = { options: [], values: [] };
|
|
12
|
-
for (let i = 0; i < list.length; i++) {
|
|
13
|
-
let theId = list[i].href.split('#')[1];
|
|
14
|
-
response.options.push({
|
|
15
|
-
id: theId,
|
|
16
|
-
name: list[i].innerHTML.replace('&', '&'),
|
|
17
|
-
});
|
|
18
|
-
response.values.push(dom_document.getElementById(theId).innerHTML);
|
|
19
|
-
}
|
|
20
|
-
return response;
|
|
21
|
-
};
|
|
6
|
+
import './styles.less';
|
|
22
7
|
|
|
23
8
|
export default function View(props) {
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
React.useEffect(
|
|
28
|
-
() =>
|
|
29
|
-
setData(extract_body(html.replaceAll('\n', '').replaceAll('\\"', '"'))),
|
|
30
|
-
[html],
|
|
9
|
+
const dataJson = JSON.parse(
|
|
10
|
+
props?.properties['@components']?.countryprofile?.html,
|
|
31
11
|
);
|
|
12
|
+
const [activePanes, setActivePanes] = React.useState({});
|
|
32
13
|
|
|
33
14
|
const panes = [];
|
|
34
|
-
if (
|
|
35
|
-
|
|
15
|
+
if (dataJson?.menu) {
|
|
16
|
+
dataJson.menu.forEach((element, index) => {
|
|
36
17
|
panes.push({
|
|
37
|
-
menuItem: element
|
|
18
|
+
menuItem: element,
|
|
38
19
|
render: () => (
|
|
39
20
|
<TabPane>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
21
|
+
<CountryTabPane
|
|
22
|
+
_index={index}
|
|
23
|
+
contents={dataJson.content[index]}
|
|
24
|
+
activePanes={activePanes}
|
|
25
|
+
setActivePanes={setActivePanes}
|
|
26
|
+
></CountryTabPane>
|
|
45
27
|
</TabPane>
|
|
46
28
|
),
|
|
47
29
|
});
|
|
@@ -49,19 +31,49 @@ export default function View(props) {
|
|
|
49
31
|
}
|
|
50
32
|
|
|
51
33
|
return (
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
34
|
+
<>
|
|
35
|
+
{dataJson.message_top ? (
|
|
36
|
+
<div class="eea callout">{dataJson.message_top}</div>
|
|
37
|
+
) : null}
|
|
38
|
+
{dataJson.top_accordeon
|
|
39
|
+
? dataJson.top_accordeon.map((accordion, index) => (
|
|
40
|
+
<Accordion className="secondary">
|
|
41
|
+
<Accordion.Title
|
|
42
|
+
role="button"
|
|
43
|
+
tabIndex={0}
|
|
44
|
+
active={activePanes['_' + index] || false}
|
|
45
|
+
onClick={(e) => {
|
|
46
|
+
const temp = JSON.parse(JSON.stringify(activePanes));
|
|
47
|
+
let val = temp['_' + index] || false;
|
|
48
|
+
temp['_' + index] = !val;
|
|
49
|
+
setActivePanes(temp);
|
|
50
|
+
}}
|
|
51
|
+
>
|
|
52
|
+
<span className="item-title">{accordion.title}</span>
|
|
53
|
+
<Icon className="ri-arrow-down-s-line" />
|
|
54
|
+
</Accordion.Title>
|
|
55
|
+
<Accordion.Content
|
|
56
|
+
active={activePanes['_' + index] || false}
|
|
57
|
+
dangerouslySetInnerHTML={{ __html: accordion.value }}
|
|
58
|
+
></Accordion.Content>
|
|
59
|
+
</Accordion>
|
|
60
|
+
))
|
|
61
|
+
: null}
|
|
62
|
+
<Tab
|
|
63
|
+
className="secondary menu"
|
|
64
|
+
panes={panes}
|
|
65
|
+
grid={{ paneWidth: 8, tabWidth: 4 }}
|
|
66
|
+
menu={{
|
|
67
|
+
tabular: true,
|
|
68
|
+
vertical: true,
|
|
69
|
+
inverted: false,
|
|
70
|
+
pointing: true,
|
|
71
|
+
fluid: true,
|
|
72
|
+
className: 'secondary',
|
|
73
|
+
tabIndex: 0,
|
|
74
|
+
}}
|
|
75
|
+
/>
|
|
76
|
+
{dataJson.updated ? <p>Last updated:{dataJson.updated}</p> : null}
|
|
77
|
+
</>
|
|
66
78
|
);
|
|
67
79
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MemoryRouter } from 'react-router-dom';
|
|
3
|
+
import configureStore from 'redux-mock-store';
|
|
4
|
+
import { render } from '@testing-library/react';
|
|
5
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
6
|
+
import { Provider } from 'react-intl-redux';
|
|
7
|
+
import View from './View';
|
|
8
|
+
|
|
9
|
+
const mockStore = configureStore();
|
|
10
|
+
|
|
11
|
+
describe('View', () => {
|
|
12
|
+
it('should render the component', () => {
|
|
13
|
+
const properties = {
|
|
14
|
+
'@components': {
|
|
15
|
+
countryprofile: {
|
|
16
|
+
html:
|
|
17
|
+
'{"menu":[],"content":[],"html":"","updated":"","message_top":"", "top_accordeon":""}',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
const data = { properties: properties };
|
|
22
|
+
|
|
23
|
+
const store = mockStore({
|
|
24
|
+
userSession: { token: '1234' },
|
|
25
|
+
intl: {
|
|
26
|
+
locale: 'en',
|
|
27
|
+
messages: {},
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const { container } = render(
|
|
32
|
+
<Provider store={store}>
|
|
33
|
+
<MemoryRouter>
|
|
34
|
+
<View {...data} />
|
|
35
|
+
</MemoryRouter>
|
|
36
|
+
</Provider>,
|
|
37
|
+
);
|
|
38
|
+
expect(container).toBeTruthy();
|
|
39
|
+
});
|
|
40
|
+
});
|