@eeacms/volto-clms-theme 1.0.40 → 1.0.41

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.
Files changed (35) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/locales/bg/LC_MESSAGES/volto.po +208 -14
  3. package/locales/cs/LC_MESSAGES/volto.po +208 -14
  4. package/locales/da/LC_MESSAGES/volto.po +208 -14
  5. package/locales/de/LC_MESSAGES/volto.po +208 -14
  6. package/locales/el/LC_MESSAGES/volto.po +208 -14
  7. package/locales/en/LC_MESSAGES/volto.po +208 -14
  8. package/locales/es/LC_MESSAGES/volto.po +208 -14
  9. package/locales/et/LC_MESSAGES/volto.po +208 -14
  10. package/locales/fi/LC_MESSAGES/volto.po +208 -14
  11. package/locales/fr/LC_MESSAGES/volto.po +208 -14
  12. package/locales/hr/LC_MESSAGES/volto.po +208 -14
  13. package/locales/hu/LC_MESSAGES/volto.po +208 -14
  14. package/locales/it/LC_MESSAGES/volto.po +208 -14
  15. package/locales/lt/LC_MESSAGES/volto.po +208 -14
  16. package/locales/lv/LC_MESSAGES/volto.po +208 -14
  17. package/locales/mt/LC_MESSAGES/volto.po +208 -14
  18. package/locales/nl/LC_MESSAGES/volto.po +208 -14
  19. package/locales/pl/LC_MESSAGES/volto.po +208 -14
  20. package/locales/pt/LC_MESSAGES/volto.po +208 -14
  21. package/locales/ro/LC_MESSAGES/volto.po +208 -14
  22. package/locales/sk/LC_MESSAGES/volto.po +208 -14
  23. package/locales/sl/LC_MESSAGES/volto.po +208 -14
  24. package/locales/sv/LC_MESSAGES/volto.po +208 -14
  25. package/locales/volto.pot +258 -17
  26. package/package.json +1 -1
  27. package/src/components/Blocks/CustomTemplates/VoltoTabsBlock/CclProductTabsView.jsx +36 -0
  28. package/src/components/Blocks/CustomTemplates/VoltoTabsBlock/CclVerticalTabsView.jsx +3 -47
  29. package/src/components/Blocks/CustomTemplates/VoltoTabsBlock/RoutingHOC.jsx +63 -0
  30. package/src/components/Blocks/CustomTemplates/VoltoTabsBlock/index.js +4 -2
  31. package/src/components/Blocks/customBlocks.js +10 -10
  32. package/src/components/CLMSDatasetDetailView/CLMSDatasetDetailView.jsx +2 -4
  33. package/theme/clms/css/maps.css +2 -1
  34. package/theme/clms/css/maps.less +2 -1
  35. package/src/components/Blocks/CustomTemplates/VoltoTabsBlock/VerticalRouteTabsView.jsx +0 -156
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: 2021-07-14T06:49:06.709Z\n"
4
+ "POT-Creation-Date: 2021-11-25T09:38:45.965Z\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
  "MIME-Version: 1.0\n"
@@ -24,7 +24,11 @@ msgstr ""
24
24
  msgid "Add"
25
25
  msgstr ""
26
26
 
27
- #: components/CLMSProfileView/CLMSProfileView
27
+ #: components/CLMSProfileView/CLMSApiTokensView
28
+ # defaultMessage: API Tokens
29
+ msgid "ApiTokens"
30
+ msgstr ""
31
+
28
32
  #: customizations/volto/components/manage/Toolbar/Toolbar
29
33
  # defaultMessage: Back
30
34
  msgid "Back"
@@ -35,7 +39,12 @@ msgstr ""
35
39
  msgid "Breadcrumbs"
36
40
  msgstr ""
37
41
 
38
- #: components/CLMSProfileView/CLMSProfileView
42
+ #: components/CLMSDownloadCartView/CLMSDownloadCartView
43
+ # defaultMessage: Cart
44
+ msgid "Cart"
45
+ msgstr ""
46
+
47
+ #: components/CLMSProfileView/CLMSUserProfileView
39
48
  # defaultMessage: Changes saved
40
49
  msgid "Changes saved"
41
50
  msgstr ""
@@ -65,12 +74,52 @@ msgstr ""
65
74
  msgid "Copernicus Site"
66
75
  msgstr ""
67
76
 
68
- #: components/CLMSProfileView/CLMSProfileView
77
+ #: components/CLMSProfileView/CLMSApiTokensView
78
+ # defaultMessage: Copy to clipboard
79
+ msgid "Copy created token button"
80
+ msgstr ""
81
+
82
+ #: components/CLMSProfileView/CLMSApiTokensView
83
+ # defaultMessage: Create
84
+ msgid "Create token"
85
+ msgstr ""
86
+
87
+ #: components/CLMSProfileView/CLMSApiTokensView
88
+ # defaultMessage: Use this form to create a new token and name it in a way that you can recognize it.
89
+ msgid "Create token description"
90
+ msgstr ""
91
+
92
+ #: components/CLMSProfileView/CLMSApiTokensView
93
+ # defaultMessage: Name
94
+ msgid "Create token name"
95
+ msgstr ""
96
+
97
+ #: components/CLMSProfileView/CLMSApiTokensView
98
+ # defaultMessage: This is your new token. Please note its value, because it will only be shown one. If you lose access to this token, you will need to delete it and create a new one
99
+ msgid "Created token description"
100
+ msgstr ""
101
+
102
+ #: components/CLMSProfileView/CLMSApiTokensView
103
+ # defaultMessage: Token
104
+ msgid "Created token name"
105
+ msgstr ""
106
+
107
+ #: components/CLMSProfileView/CLMSUserProfileView
69
108
  # defaultMessage: Default
70
109
  msgid "Default"
71
110
  msgstr ""
72
111
 
73
- #: components/CLMSProfileView/CLMSProfileView
112
+ #: components/CLMSProfileView/CLMSApiTokensView
113
+ # defaultMessage: Delete
114
+ msgid "Delete the token"
115
+ msgstr ""
116
+
117
+ #: components/CLMSMapViewerView/CLMSMapViewerView
118
+ # defaultMessage: Download by area
119
+ msgid "DownloadByArea"
120
+ msgstr ""
121
+
122
+ #: components/CLMSProfileView/CLMSUserProfileView
74
123
  # defaultMessage: E-mail
75
124
  msgid "E-mail"
76
125
  msgstr ""
@@ -96,7 +145,7 @@ msgstr ""
96
145
  msgid "Edit or remove image"
97
146
  msgstr ""
98
147
 
99
- #: components/CLMSProfileView/CLMSProfileView
148
+ #: components/CLMSProfileView/CLMSUserProfileView
100
149
  # defaultMessage: Enter full name, e.g. John Smith.
101
150
  msgid "Enter full name, e.g. John Smith."
102
151
  msgstr ""
@@ -106,11 +155,16 @@ msgstr ""
106
155
  msgid "File"
107
156
  msgstr ""
108
157
 
109
- #: components/CLMSProfileView/CLMSProfileView
158
+ #: components/CLMSProfileView/CLMSUserProfileView
110
159
  # defaultMessage: Full Name
111
160
  msgid "Full Name"
112
161
  msgstr ""
113
162
 
163
+ #: components/CLMSProfileView/CLMSApiTokensView
164
+ # defaultMessage: Go back to the token list
165
+ msgid "Go back button"
166
+ msgstr ""
167
+
114
168
  #: customizations/volto/components/theme/Breadcrumbs/Breadcrumbs
115
169
  # defaultMessage: Home
116
170
  msgid "Home"
@@ -126,11 +180,17 @@ msgstr ""
126
180
  msgid "Link"
127
181
  msgstr ""
128
182
 
129
- #: components/CLMSProfileView/CLMSProfileView
183
+ #: components/CLMSProfileView/CLMSUserProfileView
130
184
  # defaultMessage: Location
131
185
  msgid "Location"
132
186
  msgstr ""
133
187
 
188
+ #: components/CLMSDownloadCartView/CLMSDownloadCartView
189
+ # defaultMessage: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis luctus
190
+ mauris ante, a iaculis leo placerat quis.
191
+ msgid "Lorem"
192
+ msgstr ""
193
+
134
194
  #: customizations/volto/components/manage/Toolbar/Toolbar
135
195
  # defaultMessage: More
136
196
  msgid "More"
@@ -146,7 +206,6 @@ msgstr ""
146
206
  msgid "Page"
147
207
  msgstr ""
148
208
 
149
- #: components/CLMSProfileView/CLMSProfileView
150
209
  #: customizations/volto/components/manage/Toolbar/Toolbar
151
210
  # defaultMessage: Personal Information
152
211
  msgid "Personal Information"
@@ -162,11 +221,16 @@ msgstr ""
162
221
  msgid "Personal tools"
163
222
  msgstr ""
164
223
 
165
- #: components/CLMSProfileView/CLMSProfileView
224
+ #: components/CLMSProfileView/CLMSUserProfileView
166
225
  # defaultMessage: Portrait
167
226
  msgid "Portrait"
168
227
  msgstr ""
169
228
 
229
+ #: components/Blocks/CustomTemplates/VoltoListingBlock/CclListingWorkOpportunities
230
+ # defaultMessage: Procurement No:
231
+ msgid "ProcurementNo"
232
+ msgstr ""
233
+
170
234
  #: components/Blocks/CclHomeBgImageBlock/CclHomeImageEditor
171
235
  #: components/Blocks/CclHomeUsersBlock/CclHomeUsersBlockEdit
172
236
  # defaultMessage: Remove
@@ -199,12 +263,17 @@ msgstr ""
199
263
  msgid "Shrink toolbar"
200
264
  msgstr ""
201
265
 
202
- #: components/CLMSProfileView/CLMSProfileView
266
+ #: components/Blocks/CustomTemplates/VoltoListingBlock/CclListingWorkOpportunities
267
+ # defaultMessage: Submission deadline:
268
+ msgid "SubmissionDeadline"
269
+ msgstr ""
270
+
271
+ #: components/CLMSProfileView/CLMSUserProfileView
203
272
  # defaultMessage: Success
204
273
  msgid "Success"
205
274
  msgstr ""
206
275
 
207
- #: components/CLMSProfileView/CLMSProfileView
276
+ #: components/CLMSProfileView/CLMSUserProfileView
208
277
  # defaultMessage: The user portrait/avatar
209
278
  msgid "The user portrait/avatar"
210
279
  msgstr ""
@@ -226,17 +295,22 @@ msgstr ""
226
295
  msgid "Uploading file"
227
296
  msgstr ""
228
297
 
229
- #: components/CLMSProfileView/CLMSProfileView
298
+ #: components/CLMSProfileView/CLMSUserProfileView
230
299
  # defaultMessage: User Profile
231
300
  msgid "UserProfile"
232
301
  msgstr ""
233
302
 
234
- #: components/CLMSProfileView/CLMSProfileView
303
+ #: components/Blocks/CustomTemplates/VoltoTabsBlock/CclProductTabsView
304
+ # defaultMessage: View in the map viewer
305
+ msgid "View in the map viewer"
306
+ msgstr ""
307
+
308
+ #: components/CLMSProfileView/CLMSUserProfileView
235
309
  # defaultMessage: We will use this address if you need to recover your password
236
310
  msgid "We will use this address if you need to recover your password"
237
311
  msgstr ""
238
312
 
239
- #: components/CLMSProfileView/CLMSProfileView
313
+ #: components/CLMSProfileView/CLMSUserProfileView
240
314
  # defaultMessage: Your location - either city and country - or in a company setting, where your office is located.
241
315
  msgid "Your location - either city and country - or in a company setting, where your office is located."
242
316
  msgstr ""
@@ -251,6 +325,18 @@ msgstr ""
251
325
  msgid "agreePrivacyPolicyLinkText"
252
326
  msgstr ""
253
327
 
328
+ #: components/CLMSMeetingView/CLMSMeetingEmailsView
329
+ #: components/CLMSMeetingView/CLMSMeetingEmailView
330
+ # defaultMessage: All
331
+ msgid "all"
332
+ msgstr ""
333
+
334
+ #: components/CLMSMeetingView/CLMSMeetingEmailsView
335
+ #: components/CLMSMeetingView/CLMSMeetingEmailView
336
+ # defaultMessage: CC
337
+ msgid "cc"
338
+ msgstr ""
339
+
254
340
  #: customizations/volto/components/theme/Footer/Footer
255
341
  # defaultMessage: Copernicus Services
256
342
  msgid "copernicusServices"
@@ -262,13 +348,84 @@ msgstr ""
262
348
  msgid "countText"
263
349
  msgstr ""
264
350
 
351
+ #: components/CLMSProfileView/CLMSApiTokensView
352
+ # defaultMessage: CREATE NEW TOKEN
353
+ msgid "create title"
354
+ msgstr ""
355
+
356
+ #: components/CLMSProfileView/CLMSApiTokensView
357
+ # defaultMessage: NEW TOKEN CREATED
358
+ msgid "created title"
359
+ msgstr ""
360
+
361
+ #: components/CLMSProfileView/CLMSApiTokensView
362
+ # defaultMessage: API tokens are used for machine-to-machine communication with the CLMS portal API. You need to create a new API token for each application in wich you need to use the CLMS portal API. In this screen you can create a new API token, check the list of your tokens and also delete those tokens.
363
+ msgid "descripton"
364
+ msgstr ""
365
+
366
+ #: components/CLMSMeetingView/CLMSMeetingSubscribersView
367
+ #: components/CLMSMeetingView/CLMSMeetingSubscriberView
368
+ # defaultMessage: Email
369
+ msgid "email"
370
+ msgstr ""
371
+
372
+ #: components/CLMSMeetingView/CLMSMeetingView
373
+ # defaultMessage: All dates
374
+ msgid "event_alldates"
375
+ msgstr ""
376
+
377
+ #: components/CLMSMeetingView/CLMSMeetingView
378
+ # defaultMessage: Attendees
379
+ msgid "event_attendees"
380
+ msgstr ""
381
+
382
+ #: components/CLMSMeetingView/CLMSMeetingView
383
+ # defaultMessage: Contact Name
384
+ msgid "event_contactname"
385
+ msgstr ""
386
+
387
+ #: components/CLMSMeetingView/CLMSMeetingView
388
+ # defaultMessage: Contact Phone
389
+ msgid "event_contactphone"
390
+ msgstr ""
391
+
392
+ #: components/CLMSMeetingView/CLMSMeetingView
393
+ # defaultMessage: Website
394
+ msgid "event_website"
395
+ msgstr ""
396
+
397
+ #: components/CLMSMeetingView/CLMSMeetingView
398
+ # defaultMessage: What
399
+ msgid "event_what"
400
+ msgstr ""
401
+
402
+ #: components/CLMSMeetingView/CLMSMeetingView
403
+ # defaultMessage: When
404
+ msgid "event_when"
405
+ msgstr ""
406
+
407
+ #: components/CLMSMeetingView/CLMSMeetingView
408
+ # defaultMessage: Where
409
+ msgid "event_where"
410
+ msgstr ""
411
+
412
+ #: components/CLMSProfileView/CLMSApiTokensView
413
+ # defaultMessage: Existing tokens
414
+ msgid "existing tokens"
415
+ msgstr ""
416
+
417
+ #: components/CLMSProfileView/CLMSApiTokensView
418
+ # defaultMessage: These are your avaliable tokens
419
+ msgid "existing tokens description"
420
+ msgstr ""
421
+
265
422
  #: customizations/volto/components/theme/Footer/Footer
266
423
  # defaultMessage: Expert support provided by
267
424
  msgid "expertSupportProvidedBy"
268
425
  msgstr ""
269
426
 
270
427
  #: customizations/volto/components/theme/Footer/Footer
271
- # defaultMessage: Follow Us
428
+ # defaultMessage: Follow us
272
429
  msgid "followUs"
273
430
  msgstr ""
274
431
 
@@ -302,18 +459,29 @@ msgstr ""
302
459
  msgid "footerSecurity"
303
460
  msgstr ""
304
461
 
462
+ #: components/CLMSMeetingView/CLMSMeetingEmailsView
463
+ #: components/CLMSMeetingView/CLMSMeetingEmailView
464
+ # defaultMessage: From
465
+ msgid "from"
466
+ msgstr ""
467
+
305
468
  #: customizations/volto/components/theme/Header/Header
306
469
  # defaultMessage: Hello
307
470
  msgid "hello"
308
471
  msgstr ""
309
472
 
473
+ #: components/CLMSMeetingView/CLMSMeetingView
474
+ # defaultMessage: Hosting organisation
475
+ msgid "hosting_organisation"
476
+ msgstr ""
477
+
310
478
  #: customizations/volto/components/theme/Footer/Footer
311
479
  # defaultMessage: DG Joint Research Center
312
480
  msgid "jointResearchCenter"
313
481
  msgstr ""
314
482
 
315
483
  #: customizations/volto/components/theme/Header/Header
316
- # defaultMessage: Login/Register
484
+ # defaultMessage: Register/Login
317
485
  msgid "loginRegister"
318
486
  msgstr ""
319
487
 
@@ -322,13 +490,86 @@ msgstr ""
322
490
  msgid "logout"
323
491
  msgstr ""
324
492
 
493
+ #: components/CLMSMeetingView/CLMSMeetingView
494
+ # defaultMessage: Level
495
+ msgid "meetinglevel"
496
+ msgstr ""
497
+
498
+ #: components/CLMSMeetingView/CLMSMeetingView
499
+ # defaultMessage: Type
500
+ msgid "meetingtype"
501
+ msgstr ""
502
+
503
+ #: components/CLMSMeetingView/CLMSMeetingEmailsView
504
+ #: components/CLMSMeetingView/CLMSMeetingEmailView
505
+ # defaultMessage: Modified
506
+ msgid "modified"
507
+ msgstr ""
508
+
509
+ #: components/CLMSMeetingView/CLMSMeetingSubscribersView
510
+ #: components/CLMSMeetingView/CLMSMeetingSubscriberView
511
+ # defaultMessage: Name
512
+ msgid "name"
513
+ msgstr ""
514
+
515
+ #: components/CLMSMeetingView/CLMSMeetingSubscribersView
516
+ #: components/CLMSMeetingView/CLMSMeetingSubscriberView
517
+ # defaultMessage: Organisation
518
+ msgid "organisation"
519
+ msgstr ""
520
+
521
+ #: components/CLMSMeetingView/CLMSMeetingEmailsView
522
+ #: components/CLMSMeetingView/CLMSMeetingEmailView
523
+ # defaultMessage: Recipients
524
+ msgid "recipients"
525
+ msgstr ""
526
+
325
527
  #: components/Blocks/CclHomeSearchBlock/CclHomeSearchBlockEdit
326
528
  #: components/Blocks/CclHomeSearchBlock/CclHomeSearchBlockView
327
529
  # defaultMessage: Search datasets
328
530
  msgid "searchDatasetsPlaceholder"
329
531
  msgstr ""
330
532
 
533
+ #: components/CLMSMeetingView/CLMSMeetingSubscribersView
534
+ #: components/CLMSMeetingView/CLMSMeetingSubscriberView
535
+ # defaultMessage: State
536
+ msgid "state"
537
+ msgstr ""
538
+
539
+ #: components/CLMSMeetingView/CLMSMeetingEmailsView
540
+ #: components/CLMSMeetingView/CLMSMeetingEmailView
541
+ # defaultMessage: Subject
542
+ msgid "subject"
543
+ msgstr ""
544
+
331
545
  #: customizations/volto/components/theme/Footer/Footer
332
546
  # defaultMessage: Subscribe
333
547
  msgid "subscribe"
334
548
  msgstr ""
549
+
550
+ #: components/CLMSProfileView/CLMSApiTokensView
551
+ # defaultMessage: API Token management
552
+ msgid "title"
553
+ msgstr ""
554
+
555
+ #: components/CLMSProfileView/CLMSApiTokensView
556
+ # defaultMessage: Token title
557
+ msgid "tokenTitleLabel"
558
+ msgstr ""
559
+
560
+ #: components/CLMSMeetingView/CLMSMeetingEmailsView
561
+ #: components/CLMSMeetingView/CLMSMeetingEmailView
562
+ # defaultMessage: Type
563
+ msgid "type"
564
+ msgstr ""
565
+
566
+ #: components/CLMSMeetingView/CLMSMeetingSubscribersView
567
+ #: components/CLMSMeetingView/CLMSMeetingSubscriberView
568
+ # defaultMessage: User Name
569
+ msgid "user_name"
570
+ msgstr ""
571
+
572
+ #: components/CLMSMeetingView/CLMSMeetingView
573
+ # defaultMessage: Visit external website
574
+ msgid "visit_external_website"
575
+ msgstr ""
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-clms-theme",
3
- "version": "1.0.40",
3
+ "version": "1.0.41",
4
4
  "description": "volto-clms-theme: Volto theme for CLMS site",
5
5
  "main": "src/index.js",
6
6
  "author": "CodeSyntax for the European Environment Agency",
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+ import CclVerticalTabsView from './CclVerticalTabsView';
3
+ import { FormattedMessage } from 'react-intl';
4
+
5
+ const CclProductTabsView = (props) => {
6
+ const ExtraComponent = () => (
7
+ <div className="left-menu-detail">
8
+ <div className="menu-detail-image">
9
+ {props.metadata?.image ? (
10
+ <img
11
+ src={props.metadata?.image?.scales?.preview?.download}
12
+ alt={props.metadata?.title || 'Product map preview'}
13
+ />
14
+ ) : (
15
+ <img
16
+ src="https://eu-copernicus.github.io/copernicus-component-library/assets/images/image_placeholder.jpg"
17
+ alt="Product map preview"
18
+ style={{ opacity: 0.5 }}
19
+ />
20
+ )}
21
+ </div>
22
+ <div className="menu-detail-button">
23
+ <a href="/" className="ccl-button ccl-button--default">
24
+ <FormattedMessage
25
+ id="View in the map viewer"
26
+ defaultMessage="View in the map viewer"
27
+ />
28
+ </a>
29
+ </div>
30
+ </div>
31
+ );
32
+
33
+ return <CclVerticalTabsView {...props} ExtraComponent={ExtraComponent} />;
34
+ };
35
+
36
+ export default CclProductTabsView;
@@ -9,51 +9,7 @@ import cx from 'classnames';
9
9
  import { Route, NavLink } from 'react-router-dom';
10
10
 
11
11
  const CclVerticalTabsView = (props) => {
12
- const [hashlinkOnMount, setHashlinkOnMount] = React.useState(false);
13
- const {
14
- metadata = {},
15
- data = {},
16
- tabsList = [],
17
- activeTabIndex = 0,
18
- hashlink = {},
19
- setActiveTab = () => {},
20
- } = props;
21
-
22
- React.useEffect(() => {
23
- const urlHash = props.location.hash.substring(1) || '';
24
- if (
25
- hashlink.counter > 0 ||
26
- (hashlink.counter === 0 && urlHash && !hashlinkOnMount)
27
- ) {
28
- const id = hashlink.hash || urlHash || '';
29
- const index = tabsList.indexOf(id);
30
- const parentId = data.id || props.id;
31
- const parent = document.getElementById(parentId);
32
- const headerWrapper = document.querySelector('.header-wrapper');
33
- const offsetHeight = headerWrapper?.offsetHeight || 0;
34
- if (id !== parentId && index > -1 && parent) {
35
- if (activeTabIndex !== index) {
36
- setActiveTab(id);
37
- }
38
- props.scrollToTarget(parent, offsetHeight);
39
- } else if (id === parentId && parent) {
40
- props.scrollToTarget(parent, offsetHeight);
41
- }
42
- }
43
- if (!hashlinkOnMount) {
44
- setHashlinkOnMount(true);
45
- }
46
- }, [
47
- activeTabIndex,
48
- data.id,
49
- hashlink.counter,
50
- hashlink.hash,
51
- hashlinkOnMount,
52
- props,
53
- setActiveTab,
54
- tabsList,
55
- ]);
56
-
12
+ const { metadata = {}, tabsList = [], ExtraComponent = null } = props;
57
13
  const PanelsComponent = () => {
58
14
  const { activeTab = null, tabs = {} } = props;
59
15
  return (
@@ -82,6 +38,7 @@ const CclVerticalTabsView = (props) => {
82
38
  const TabsComponent = () => {
83
39
  return (
84
40
  <div className="left-content cont-w-25">
41
+ {ExtraComponent ? <ExtraComponent /> : ''}
85
42
  <nav className="left-menu">
86
43
  {tabsList.map((tab, index) => {
87
44
  const {
@@ -99,10 +56,9 @@ const CclVerticalTabsView = (props) => {
99
56
  className={cx('card', tab === activeTab && 'active')}
100
57
  >
101
58
  <NavLink
102
- to={'#' + title}
59
+ to={'#tab' + tabIndex}
103
60
  className="collapsed"
104
61
  onClick={(e) => {
105
- e.preventDefault();
106
62
  if (activeTab !== tab) {
107
63
  setActiveTab(tab);
108
64
  }
@@ -0,0 +1,63 @@
1
+ import React from 'react';
2
+
3
+ const RoutingHOC = (TabView) =>
4
+ function Component(props) {
5
+ const [hashlinkOnMount, setHashlinkOnMount] = React.useState(false);
6
+ const {
7
+ data = {},
8
+ tabsList = [],
9
+ activeTabIndex = 0,
10
+ hashlink = {},
11
+ setActiveTab = () => {},
12
+ } = props;
13
+ React.useEffect(() => {
14
+ const urlHash = window.location.hash.substring(1) || '';
15
+ if (
16
+ hashlink.counter > 0 ||
17
+ (hashlink.counter === 0 && urlHash && !hashlinkOnMount)
18
+ ) {
19
+ const id = hashlink.hash || urlHash || '';
20
+ const index = tabsList.indexOf(id);
21
+ const parentId = data.id || props.id;
22
+ const parent = document.getElementById(parentId);
23
+ const headerWrapper = document.querySelector('.header-wrapper');
24
+ const offsetHeight = headerWrapper?.offsetHeight || 0;
25
+ if (id !== parentId && index > -1 && parent) {
26
+ if (activeTabIndex !== index) {
27
+ setActiveTab(id);
28
+ }
29
+ props.scrollToTarget(parent, offsetHeight);
30
+ } else if (id === parentId && parent) {
31
+ props.scrollToTarget(parent, offsetHeight);
32
+ }
33
+ }
34
+ if (!hashlinkOnMount) {
35
+ setHashlinkOnMount(true);
36
+ }
37
+ if (
38
+ String(window.performance.getEntriesByType('navigation')[0].type) ===
39
+ 'navigate' ||
40
+ String(window.performance.getEntriesByType('navigation')[0].type) ===
41
+ 'reload'
42
+ ) {
43
+ if (window.location.hash.length === 0) {
44
+ setActiveTab(tabsList[0]);
45
+ } else {
46
+ setActiveTab(tabsList[window.location.hash.substring(4) - 1]);
47
+ }
48
+ }
49
+ }, [
50
+ activeTabIndex,
51
+ data.id,
52
+ hashlink.counter,
53
+ hashlink.hash,
54
+ hashlinkOnMount,
55
+ props,
56
+ setActiveTab,
57
+ tabsList,
58
+ ]);
59
+
60
+ return <TabView {...props} />;
61
+ };
62
+
63
+ export default RoutingHOC;
@@ -1,13 +1,15 @@
1
1
  import CclTabsView from './CclTabsView';
2
2
  import CclVerticalTabsView from './CclVerticalTabsView';
3
- import CclRouteTabsView from './VerticalRouteTabsView';
4
3
  import CclVerticalFaqTabsView from './CclVerticalFaqTabsView';
5
4
  import CclCarouselView from './CclCarouselView';
5
+ import RoutingHOC from './RoutingHOC';
6
+ import CclProductTabsView from './CclProductTabsView';
6
7
 
7
8
  export {
8
9
  CclTabsView,
9
10
  CclVerticalTabsView,
10
11
  CclVerticalFaqTabsView,
11
12
  CclCarouselView,
12
- CclRouteTabsView,
13
+ RoutingHOC,
14
+ CclProductTabsView,
13
15
  };
@@ -33,9 +33,10 @@ import { TABS_BLOCK } from '@eeacms/volto-tabs-block/constants';
33
33
  import {
34
34
  CclTabsView,
35
35
  CclVerticalTabsView,
36
- CclRouteTabsView,
37
36
  CclVerticalFaqTabsView,
38
37
  CclCarouselView,
38
+ RoutingHOC,
39
+ CclProductTabsView,
39
40
  } from '@eeacms/volto-clms-theme/components/Blocks/CustomTemplates/VoltoTabsBlock';
40
41
 
41
42
  import {
@@ -94,36 +95,35 @@ const customBlocks = (config) => ({
94
95
  ...config.blocks.blocksConfig[TABS_BLOCK],
95
96
  templates: {
96
97
  CCLTabs: {
97
- title: 'CCL Tabs (Copernicus Style Guide)',
98
+ title: 'Horizontal Tabs',
98
99
  edit: DefaultEdit,
99
100
  view: CclTabsView,
100
101
  schema: defaultSchema,
101
102
  },
102
103
  CCLVerticalTabs: {
103
- title: 'CCL Vertical Tabs',
104
+ title: 'Vertical Tabs',
104
105
  edit: DefaultEdit,
105
- view: CclVerticalTabsView,
106
+ view: RoutingHOC(CclVerticalTabsView),
106
107
  schema: defaultSchema,
107
108
  },
108
- CclRouteTabsView: {
109
- title: 'CCL Route Tabs',
109
+ CCLProductTabs: {
110
+ title: 'Vertical Product Tabs',
110
111
  edit: DefaultEdit,
111
- view: CclRouteTabsView,
112
+ view: CclProductTabsView,
112
113
  schema: defaultSchema,
113
114
  },
114
115
  CCLVerticalFaqTabs: {
115
- title: 'CCL Vertical FAQ Tabs',
116
+ title: 'Vertical FAQ Tabs',
116
117
  edit: DefaultEdit,
117
118
  view: CclVerticalFaqTabsView,
118
119
  schema: defaultSchema,
119
120
  },
120
121
  CCLCarousel: {
121
- title: 'CCL Carousel (Copernicus Style Guide)',
122
+ title: 'Carousel',
122
123
  edit: DefaultEdit,
123
124
  view: CclCarouselView,
124
125
  schema: defaultSchema,
125
126
  },
126
- ...(config.blocks.blocksConfig[TABS_BLOCK]?.templates || {}),
127
127
  },
128
128
  },
129
129
  listing: {