@eeacms/volto-clms-theme 1.0.159 → 1.0.161
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 +18 -4
- package/README.md +11 -0
- package/package.json +1 -1
- package/src/components/Blocks/CustomTemplates/VoltoSearchBlock/rewriteOptions.js +2 -0
- package/src/components/CLMSDatasetDetailView/CLMSDatasetDetailView.jsx +7 -5
- package/src/components/CLMSDatasetDetailView/DownloadDataSetContent.jsx +12 -0
- package/src/components/CLMSProfileView/CLMSApiTokensView.jsx +43 -17
- package/src/components/CLMSProfileView/CLMSDeleteProfileView.jsx +3 -3
- package/src/components/CLMSUseCasesView/CLMSUseCasesView.jsx +2 -2
- package/src/components/CLMSUseCasesView/usecases.less +4 -0
- package/src/components/CclDownloadTable/CclDownloadTable.jsx +48 -14
- package/src/components/CclDownloadTable/download-table.less +4 -0
- package/src/customizations/volto-slate/editor/ui/InlineToolbar.jsx +73 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,24 @@ All notable changes to this project will be documented in this file. Dates are d
|
|
|
4
4
|
|
|
5
5
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
6
6
|
|
|
7
|
+
### [1.0.161](https://github.com/eea/volto-clms-theme/compare/1.0.160...1.0.161) - 11 January 2023
|
|
8
|
+
|
|
9
|
+
#### :rocket: New Features
|
|
10
|
+
|
|
11
|
+
- feat: add Download full dataset text to Dataset View [ionlizarazu - [`9f2e55b`](https://github.com/eea/volto-clms-theme/commit/9f2e55b12aa553c47ee770f727947004e65540e4)]
|
|
12
|
+
- feat: add FAQ to filters [ionlizarazu - [`934b771`](https://github.com/eea/volto-clms-theme/commit/934b771c7beb197b142407c72a582464e75faf2c)]
|
|
13
|
+
|
|
14
|
+
#### :bug: Bug Fixes
|
|
15
|
+
|
|
16
|
+
- fix:slugify profile tabs ids [ionlizarazu - [`6a736a1`](https://github.com/eea/volto-clms-theme/commit/6a736a1972e74ddc0d4ef2a814b9b2a4f8adbad0)]
|
|
17
|
+
|
|
18
|
+
#### :hammer_and_wrench: Others
|
|
19
|
+
|
|
20
|
+
- CLMS-1624 picture for prepackages files [Unai - [`302c527`](https://github.com/eea/volto-clms-theme/commit/302c527afebb3a53305f1b30e923b693bc50a1f8)]
|
|
21
|
+
- use cases bug fix [Unai - [`73ba75b`](https://github.com/eea/volto-clms-theme/commit/73ba75bb5d225dde1c3e1982d35efeac0a4c3ff5)]
|
|
22
|
+
- Update README.md [UnaiEtxaburu - [`07a2c59`](https://github.com/eea/volto-clms-theme/commit/07a2c59dcc438b82462b1ca0b3c3a025a0f76842)]
|
|
23
|
+
### [1.0.160](https://github.com/eea/volto-clms-theme/compare/1.0.159...1.0.160) - 23 December 2022
|
|
24
|
+
|
|
7
25
|
### [1.0.159](https://github.com/eea/volto-clms-theme/compare/1.0.158...1.0.159) - 22 December 2022
|
|
8
26
|
|
|
9
27
|
#### :hammer_and_wrench: Others
|
|
@@ -629,7 +647,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
629
647
|
#### :hammer_and_wrench: Others
|
|
630
648
|
|
|
631
649
|
- related products and datasets added to news and meeting views and login-plone route created [Unai - [`5704a1a`](https://github.com/eea/volto-clms-theme/commit/5704a1a766148746162b60efaf232ea90dc20cf4)]
|
|
632
|
-
- Revert "[JENKINS] Use eeacms/plone-backend and Volto alpha version- Refs #151967" [Mikel Larreategi - [`46eb694`](https://github.com/eea/volto-clms-theme/commit/46eb69415280a3c982405299135027ae4221426a)]
|
|
633
650
|
- sort items according to the lowercased label and put those with special meaning at the end [Mikel Larreategi - [`6410abe`](https://github.com/eea/volto-clms-theme/commit/6410abe096f60dcad54dced2026c9df9b7946d68)]
|
|
634
651
|
- lint fix [Unai - [`1264a7a`](https://github.com/eea/volto-clms-theme/commit/1264a7adfe8d679fea1bd821ad087add20f4271d)]
|
|
635
652
|
- footer newsletter subscription change, global search maxLength change from 8000 to 200 and /login design change [Unai - [`a09d24a`](https://github.com/eea/volto-clms-theme/commit/a09d24adbb6fa053fb2a2cc0071506b906593b42)]
|
|
@@ -780,7 +797,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
780
797
|
- search block new features [ionlizarazu - [`8e814cb`](https://github.com/eea/volto-clms-theme/commit/8e814cbd359782540c21fe37b37ef146d331f0d6)]
|
|
781
798
|
- language selector cookie management [ionlizarazu - [`1385ac9`](https://github.com/eea/volto-clms-theme/commit/1385ac95795702206d3623ba6e780faa43a89e0a)]
|
|
782
799
|
- toolbar cookie management [ionlizarazu - [`5c23200`](https://github.com/eea/volto-clms-theme/commit/5c23200790b20e1d4f1bc966463c37bf4c808f47)]
|
|
783
|
-
- Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`0316a0d`](https://github.com/eea/volto-clms-theme/commit/0316a0d8b6fb0fa14af13002415f3c95d9f8ede3)]
|
|
784
800
|
### [1.0.84](https://github.com/eea/volto-clms-theme/compare/1.0.83...1.0.84) - 18 March 2022
|
|
785
801
|
|
|
786
802
|
#### :hammer_and_wrench: Others
|
|
@@ -1685,13 +1701,11 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
1685
1701
|
#### :hammer_and_wrench: Others
|
|
1686
1702
|
|
|
1687
1703
|
- replace @collective/volto-dropdownmenu with volto-dropdownmenu [ionlizarazu - [`07f004f`](https://github.com/eea/volto-clms-theme/commit/07f004fe0219e403fb51bc045c83d34f3b981f76)]
|
|
1688
|
-
- yarn.lock [ionlizarazu - [`fe1ca04`](https://github.com/eea/volto-clms-theme/commit/fe1ca04889d29fe7b653db4c69af2751b84b8a1a)]
|
|
1689
1704
|
- add NODE_ENV parameter [ionlizarazu - [`101f27c`](https://github.com/eea/volto-clms-theme/commit/101f27c25b8fbd192e1b11865e95cf5ffee08c1b)]
|
|
1690
1705
|
- upgrade volto-dropdownmenu version [ionlizarazu - [`2081855`](https://github.com/eea/volto-clms-theme/commit/2081855301f4c708776e0dbab39db143cee00dbc)]
|
|
1691
1706
|
- HomeSearch block missing url behaviour [ionlizarazu - [`d20a378`](https://github.com/eea/volto-clms-theme/commit/d20a378ce3f254b8343692348f314bf281974542)]
|
|
1692
1707
|
- babel configuration [ionlizarazu - [`203ea2d`](https://github.com/eea/volto-clms-theme/commit/203ea2de07f99ca3403e4ca220ca74d7ce69b61d)]
|
|
1693
1708
|
- prettier [ionlizarazu - [`e79e26b`](https://github.com/eea/volto-clms-theme/commit/e79e26bf2fa40ba7b4eb53a24dabd87928221c28)]
|
|
1694
|
-
- add yarn lock [ionlizarazu - [`e1ab28b`](https://github.com/eea/volto-clms-theme/commit/e1ab28b060d5a74431c368b0de82a68dabce1eab)]
|
|
1695
1709
|
- Jenkinsfile cypress test [ionlizarazu - [`b385d65`](https://github.com/eea/volto-clms-theme/commit/b385d65986f717c60f8c434a08fc11b829d08eb4)]
|
|
1696
1710
|
- cypress [ionlizarazu - [`a243cf0`](https://github.com/eea/volto-clms-theme/commit/a243cf0182fa3dd113c16ff495c71e310252d83b)]
|
|
1697
1711
|
- some fixes [ionlizarazu - [`046279b`](https://github.com/eea/volto-clms-theme/commit/046279b9d05bea8a64eca03eed493e02621534c9)]
|
package/README.md
CHANGED
|
@@ -53,6 +53,17 @@
|
|
|
53
53
|
|
|
54
54
|
1. Happy editing!
|
|
55
55
|
|
|
56
|
+
## Things to keep in mind before migrating to Volto 16
|
|
57
|
+
1. Remove the volto-slate override. This override is a patch to clean up duplicate SlateContextToolbar buttons. This is not necessary in Volto 16.
|
|
58
|
+
|
|
59
|
+
````bash
|
|
60
|
+
rm -rf src/customizations/volto-slate
|
|
61
|
+
````
|
|
62
|
+
2. Remove ArrayWidget override. https://github.com/eea/volto-clms-theme/commit/7cf72aba7b1d69cf1b310a89410aa3a3753f01f3
|
|
63
|
+
|
|
64
|
+
````bash
|
|
65
|
+
rm -rf src/customizations/volto/components/manage/Widgets/ArrayWidget.jsx
|
|
66
|
+
````
|
|
56
67
|
## Release
|
|
57
68
|
|
|
58
69
|
### Automatic release using Jenkins
|
package/package.json
CHANGED
|
@@ -8,6 +8,7 @@ export const portal_types_labels = {
|
|
|
8
8
|
Tender: 'Tender',
|
|
9
9
|
TechnicalLibrary: 'Product documentation',
|
|
10
10
|
Document: 'Other content',
|
|
11
|
+
FAQ: 'FAQ',
|
|
11
12
|
};
|
|
12
13
|
|
|
13
14
|
export const category_labels = {
|
|
@@ -50,6 +51,7 @@ const rewriteOptions = (name, choices) => {
|
|
|
50
51
|
'Tender',
|
|
51
52
|
'WorkOpportunity',
|
|
52
53
|
'Document',
|
|
54
|
+
'FAQ',
|
|
53
55
|
];
|
|
54
56
|
|
|
55
57
|
const dataset_geographical_classification = [
|
|
@@ -64,11 +64,13 @@ const CLMSDatasetDetailView = ({ content, token }) => {
|
|
|
64
64
|
const [open, setOpen] = React.useState({});
|
|
65
65
|
const locale = useSelector((state) => state.intl.locale);
|
|
66
66
|
|
|
67
|
-
const isAuxiliary = content
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
67
|
+
const isAuxiliary = content?.mapviewer_viewservice
|
|
68
|
+
? content?.mapviewer_viewservice
|
|
69
|
+
.toLowerCase()
|
|
70
|
+
.startsWith(
|
|
71
|
+
'https://trial.discomap.eea.europa.eu/arcgis/services/clms/worldcountries/mapserver/wmsserver',
|
|
72
|
+
)
|
|
73
|
+
: false;
|
|
72
74
|
|
|
73
75
|
return (
|
|
74
76
|
<div className="ccl-container ">
|
|
@@ -6,6 +6,7 @@ import { useLocation } from 'react-router-dom';
|
|
|
6
6
|
import CclButton from '@eeacms/volto-clms-theme/components/CclButton/CclButton';
|
|
7
7
|
import CclDownloadTable from '@eeacms/volto-clms-theme/components/CclDownloadTable/CclDownloadTable';
|
|
8
8
|
import CclLoginModal from '@eeacms/volto-clms-theme/components/CclLoginModal/CclLoginModal';
|
|
9
|
+
import { UniversalLink } from '@plone/volto/components';
|
|
9
10
|
|
|
10
11
|
const DownloadDataSetContent = (data, token) => {
|
|
11
12
|
const location = useLocation();
|
|
@@ -53,6 +54,17 @@ const DownloadDataSetContent = (data, token) => {
|
|
|
53
54
|
)}
|
|
54
55
|
/>
|
|
55
56
|
)}
|
|
57
|
+
<br />
|
|
58
|
+
<br />
|
|
59
|
+
<br />
|
|
60
|
+
<h2>Download full dataset</h2>
|
|
61
|
+
<p>
|
|
62
|
+
If you want to download the full dataset, click{' '}
|
|
63
|
+
<UniversalLink href="/en/how-to-guides/how-to-download-spatial-data/how-to-download-m2m">
|
|
64
|
+
here
|
|
65
|
+
</UniversalLink>{' '}
|
|
66
|
+
to learn more
|
|
67
|
+
</p>
|
|
56
68
|
{/* {data.token === '' ? (
|
|
57
69
|
<CclButton
|
|
58
70
|
url={location.pathname + '/download-by-area'}
|
|
@@ -2,24 +2,33 @@
|
|
|
2
2
|
* CLMSProfileView container.
|
|
3
3
|
* @module components/CLMSProfileView/CLMSProfileView
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
5
|
import React, { Component } from 'react';
|
|
7
|
-
import
|
|
6
|
+
import { defineMessages, injectIntl } from 'react-intl';
|
|
8
7
|
import { connect } from 'react-redux';
|
|
9
|
-
import qs from 'query-string';
|
|
10
8
|
import { compose } from 'redux';
|
|
11
|
-
import {
|
|
12
|
-
|
|
9
|
+
import { Container } from 'semantic-ui-react';
|
|
10
|
+
|
|
13
11
|
import { getUser, updateUser } from '@plone/volto/actions';
|
|
14
12
|
import { getBaseUrl } from '@plone/volto/helpers';
|
|
15
13
|
import CclButton from '@eeacms/volto-clms-theme/components/CclButton/CclButton';
|
|
16
|
-
import { Container } from 'semantic-ui-react';
|
|
17
14
|
import CclModal from '@eeacms/volto-clms-theme/components/CclModal/CclModal';
|
|
15
|
+
|
|
18
16
|
import {
|
|
19
17
|
getTokens,
|
|
20
18
|
createTokens,
|
|
21
19
|
deleteTokens,
|
|
22
20
|
} from '../../actions/tokens/tokens';
|
|
21
|
+
import { slugify } from '../Blocks/utils';
|
|
22
|
+
|
|
23
|
+
import jwtDecode from 'jwt-decode';
|
|
24
|
+
import PropTypes from 'prop-types';
|
|
25
|
+
import qs from 'query-string';
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* CLMSProfileView class.
|
|
29
|
+
* @class CLMSProfileView
|
|
30
|
+
* @extends Component
|
|
31
|
+
*/
|
|
23
32
|
|
|
24
33
|
const messages = defineMessages({
|
|
25
34
|
ApiTokens: {
|
|
@@ -91,11 +100,6 @@ const messages = defineMessages({
|
|
|
91
100
|
},
|
|
92
101
|
});
|
|
93
102
|
|
|
94
|
-
/**
|
|
95
|
-
* CLMSProfileView class.
|
|
96
|
-
* @class CLMSProfileView
|
|
97
|
-
* @extends Component
|
|
98
|
-
*/
|
|
99
103
|
class CLMSApiTokensView extends Component {
|
|
100
104
|
/**
|
|
101
105
|
* Property types.
|
|
@@ -271,7 +275,12 @@ class CLMSApiTokensView extends Component {
|
|
|
271
275
|
<CclModal
|
|
272
276
|
onClick={() => this.onClose}
|
|
273
277
|
trigger={
|
|
274
|
-
<CclButton
|
|
278
|
+
<CclButton
|
|
279
|
+
mode={'filled'}
|
|
280
|
+
to={`profile#${slugify(
|
|
281
|
+
this.props.intl.formatMessage(messages.ApiTokens),
|
|
282
|
+
)}`}
|
|
283
|
+
>
|
|
275
284
|
{this.props.intl.formatMessage(messages.deleteButton)}
|
|
276
285
|
</CclButton>
|
|
277
286
|
}
|
|
@@ -284,7 +293,9 @@ class CLMSApiTokensView extends Component {
|
|
|
284
293
|
</p>
|
|
285
294
|
<CclButton
|
|
286
295
|
mode={'filled'}
|
|
287
|
-
to=
|
|
296
|
+
to={`profile#${slugify(
|
|
297
|
+
this.props.intl.formatMessage(messages.ApiTokens),
|
|
298
|
+
)}`}
|
|
288
299
|
onClick={() => {
|
|
289
300
|
this.deleteToken(item.key_id);
|
|
290
301
|
}}
|
|
@@ -301,7 +312,9 @@ class CLMSApiTokensView extends Component {
|
|
|
301
312
|
<CclButton
|
|
302
313
|
mode={'filled'}
|
|
303
314
|
onClick={this.handleClick}
|
|
304
|
-
to=
|
|
315
|
+
to={`profile#${slugify(
|
|
316
|
+
this.props.intl.formatMessage(messages.ApiTokens),
|
|
317
|
+
)}`}
|
|
305
318
|
>
|
|
306
319
|
{this.props.intl.formatMessage(messages.createTitle)}
|
|
307
320
|
</CclButton>
|
|
@@ -310,7 +323,12 @@ class CLMSApiTokensView extends Component {
|
|
|
310
323
|
<CclModal
|
|
311
324
|
onClick={() => this.onClose}
|
|
312
325
|
trigger={
|
|
313
|
-
<CclButton
|
|
326
|
+
<CclButton
|
|
327
|
+
mode={'filled'}
|
|
328
|
+
to={`profile#${slugify(
|
|
329
|
+
this.props.intl.formatMessage(messages.ApiTokens),
|
|
330
|
+
)}`}
|
|
331
|
+
>
|
|
314
332
|
{this.props.intl.formatMessage(messages.createTitle)}
|
|
315
333
|
</CclButton>
|
|
316
334
|
}
|
|
@@ -402,7 +420,11 @@ class CLMSApiTokensView extends Component {
|
|
|
402
420
|
<br />
|
|
403
421
|
<CclButton
|
|
404
422
|
mode={'filled'}
|
|
405
|
-
to=
|
|
423
|
+
to={`profile#${slugify(
|
|
424
|
+
this.props.intl.formatMessage(
|
|
425
|
+
messages.ApiTokens,
|
|
426
|
+
),
|
|
427
|
+
)}`}
|
|
406
428
|
onClick={() => {
|
|
407
429
|
navigator.clipboard.writeText(
|
|
408
430
|
JSON.stringify(item),
|
|
@@ -423,7 +445,11 @@ class CLMSApiTokensView extends Component {
|
|
|
423
445
|
<CclButton
|
|
424
446
|
mode={'filled'}
|
|
425
447
|
onClick={this.onClose}
|
|
426
|
-
to=
|
|
448
|
+
to={`profile#${slugify(
|
|
449
|
+
this.props.intl.formatMessage(
|
|
450
|
+
messages.ApiTokens,
|
|
451
|
+
),
|
|
452
|
+
)}`}
|
|
427
453
|
>
|
|
428
454
|
{this.props.intl.formatMessage(
|
|
429
455
|
messages.goBackButton,
|
|
@@ -56,7 +56,7 @@ export const CLMSDeleteProfileView = (props) => {
|
|
|
56
56
|
}}
|
|
57
57
|
open={open['delete-profile']}
|
|
58
58
|
trigger={
|
|
59
|
-
<CclButton mode={'filled'} to="profile#
|
|
59
|
+
<CclButton mode={'filled'} to="profile#delete_profile">
|
|
60
60
|
<FormattedMessage
|
|
61
61
|
id="Delete my account"
|
|
62
62
|
defaultMessage="Delete my account"
|
|
@@ -100,7 +100,7 @@ export const CLMSDeleteProfileView = (props) => {
|
|
|
100
100
|
setOpen({ ...open, 'delete-profile': false });
|
|
101
101
|
}}
|
|
102
102
|
mode="filled"
|
|
103
|
-
to="profile#
|
|
103
|
+
to="profile#delete_profile"
|
|
104
104
|
>
|
|
105
105
|
<FormattedMessage
|
|
106
106
|
id="Yes, I want to delete my account"
|
|
@@ -112,7 +112,7 @@ export const CLMSDeleteProfileView = (props) => {
|
|
|
112
112
|
setOpen({ ...open, 'delete-profile': false });
|
|
113
113
|
}}
|
|
114
114
|
mode="filled"
|
|
115
|
-
to="profile#
|
|
115
|
+
to="profile#delete_profile"
|
|
116
116
|
>
|
|
117
117
|
<FormattedMessage
|
|
118
118
|
id="No, I want to keep my account"
|
|
@@ -74,7 +74,7 @@ const CLMSUseCaseView = (props) => {
|
|
|
74
74
|
))}
|
|
75
75
|
</List>
|
|
76
76
|
)}
|
|
77
|
-
<
|
|
77
|
+
<div className="usecase-list">
|
|
78
78
|
<List celled horizontal className="usecase-other-values-list">
|
|
79
79
|
<List.Item>
|
|
80
80
|
{content?.submittingProducionYear && (
|
|
@@ -100,7 +100,7 @@ const CLMSUseCaseView = (props) => {
|
|
|
100
100
|
)}
|
|
101
101
|
</List.Item>
|
|
102
102
|
</List>
|
|
103
|
-
</
|
|
103
|
+
</div>
|
|
104
104
|
<div className="usecase-body-text">
|
|
105
105
|
{content?.text && <StringToHTML string={content?.text?.data} />}
|
|
106
106
|
</div>
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import '
|
|
2
|
-
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { defineMessages, useIntl } from 'react-intl';
|
|
3
|
+
import { useSelector } from 'react-redux';
|
|
4
|
+
import { toast } from 'react-toastify';
|
|
3
5
|
import {
|
|
4
6
|
Button,
|
|
5
7
|
Checkbox,
|
|
@@ -7,19 +9,26 @@ import {
|
|
|
7
9
|
Pagination,
|
|
8
10
|
Segment,
|
|
9
11
|
} from 'semantic-ui-react';
|
|
10
|
-
import React, { useState } from 'react';
|
|
11
12
|
|
|
12
|
-
import CclButton from '@eeacms/volto-clms-theme/components/CclButton/CclButton';
|
|
13
13
|
import { Icon, Toast } from '@plone/volto/components';
|
|
14
|
-
import PropTypes from 'prop-types';
|
|
15
14
|
import clearSVG from '@plone/volto/icons/clear.svg';
|
|
16
15
|
import paginationLeftSVG from '@plone/volto/icons/left-key.svg';
|
|
17
16
|
import paginationRightSVG from '@plone/volto/icons/right-key.svg';
|
|
18
|
-
import
|
|
19
|
-
import
|
|
17
|
+
import CclButton from '@eeacms/volto-clms-theme/components/CclButton/CclButton';
|
|
18
|
+
import CclModal from '@eeacms/volto-clms-theme/components/CclModal/CclModal';
|
|
20
19
|
import { StringToHTML } from '@eeacms/volto-clms-theme/components/CclUtils';
|
|
21
|
-
import
|
|
22
|
-
import
|
|
20
|
+
import useCartState from '@eeacms/volto-clms-utils/cart/useCartState';
|
|
21
|
+
import PlaceHolder from '@eeacms/volto-clms-theme/../theme/clms/img/ccl-thumbnail-placeholder.jpg';
|
|
22
|
+
|
|
23
|
+
import './download-table.less';
|
|
24
|
+
|
|
25
|
+
import PropTypes from 'prop-types';
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Property types.
|
|
29
|
+
* @property {Object} propTypes Property types.
|
|
30
|
+
* @static
|
|
31
|
+
*/
|
|
23
32
|
|
|
24
33
|
function CclDownloadTable(props) {
|
|
25
34
|
const locale = useSelector((state) => state.intl?.locale);
|
|
@@ -47,6 +56,10 @@ function CclDownloadTable(props) {
|
|
|
47
56
|
},
|
|
48
57
|
);
|
|
49
58
|
|
|
59
|
+
const prepackage_grid = props.dataset['@id'].split('products');
|
|
60
|
+
const prepackage_grid_image =
|
|
61
|
+
prepackage_grid[0] + 'products/prepackages-grid.png/@@images/image';
|
|
62
|
+
|
|
50
63
|
const messages = defineMessages({
|
|
51
64
|
added_to_cart: {
|
|
52
65
|
id: 'Added to cart',
|
|
@@ -56,6 +69,10 @@ function CclDownloadTable(props) {
|
|
|
56
69
|
id: 'Success',
|
|
57
70
|
defaultMessage: 'Success',
|
|
58
71
|
},
|
|
72
|
+
prePackages_location_map: {
|
|
73
|
+
id: 'Click to open pre-packages location map',
|
|
74
|
+
defaultMessage: 'Click to open pre-packages location map',
|
|
75
|
+
},
|
|
59
76
|
});
|
|
60
77
|
|
|
61
78
|
React.useEffect(() => {
|
|
@@ -227,6 +244,7 @@ function CclDownloadTable(props) {
|
|
|
227
244
|
hasSome('size'),
|
|
228
245
|
];
|
|
229
246
|
const validcolums = columns.some((column) => !!column);
|
|
247
|
+
|
|
230
248
|
return (
|
|
231
249
|
prePackagedCollection.length > 0 &&
|
|
232
250
|
validcolums &&
|
|
@@ -271,6 +289,27 @@ function CclDownloadTable(props) {
|
|
|
271
289
|
</Button>
|
|
272
290
|
</>
|
|
273
291
|
)}
|
|
292
|
+
{props.dataset.show_legend_on_prepackages && (
|
|
293
|
+
<CclModal
|
|
294
|
+
trigger={
|
|
295
|
+
<CclButton to="#download">
|
|
296
|
+
{intl.formatMessage(messages.prePackages_location_map)}
|
|
297
|
+
</CclButton>
|
|
298
|
+
}
|
|
299
|
+
size={'medium'}
|
|
300
|
+
>
|
|
301
|
+
<div className="image-modal">
|
|
302
|
+
<img
|
|
303
|
+
src={
|
|
304
|
+
prepackage_grid_image
|
|
305
|
+
? prepackage_grid_image
|
|
306
|
+
: PlaceHolder
|
|
307
|
+
}
|
|
308
|
+
alt={'Placeholder'}
|
|
309
|
+
/>
|
|
310
|
+
</div>
|
|
311
|
+
</CclModal>
|
|
312
|
+
)}
|
|
274
313
|
{cartSelection.length !== prePackagedCollection.length && (
|
|
275
314
|
<>
|
|
276
315
|
<br />
|
|
@@ -407,11 +446,6 @@ function CclDownloadTable(props) {
|
|
|
407
446
|
);
|
|
408
447
|
}
|
|
409
448
|
|
|
410
|
-
/**
|
|
411
|
-
* Property types.
|
|
412
|
-
* @property {Object} propTypes Property types.
|
|
413
|
-
* @static
|
|
414
|
-
*/
|
|
415
449
|
CclDownloadTable.propTypes = {
|
|
416
450
|
type: PropTypes.string,
|
|
417
451
|
dataset: PropTypes.shape({
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React from 'react'; // , useState
|
|
2
|
+
import SlateToolbar from 'volto-slate/editor/ui/SlateToolbar';
|
|
3
|
+
import SlateContextToolbar from 'volto-slate/editor/ui/SlateContextToolbar';
|
|
4
|
+
import config from '@plone/volto/registry';
|
|
5
|
+
import { hasRangeSelection } from 'volto-slate/utils';
|
|
6
|
+
import { ReactEditor } from 'slate-react';
|
|
7
|
+
import cx from 'classnames';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The main Slate toolbar. All the others are just wrappers, UI or used here
|
|
11
|
+
* This override is a patch to clean up duplicate SlateContextToolbar buttons. This is not necessary in Volto 16.
|
|
12
|
+
*/
|
|
13
|
+
const InlineToolbar = (props) => {
|
|
14
|
+
const {
|
|
15
|
+
editor,
|
|
16
|
+
className,
|
|
17
|
+
showExpandedToolbar,
|
|
18
|
+
setShowExpandedToolbar,
|
|
19
|
+
} = props;
|
|
20
|
+
|
|
21
|
+
const { slate } = config.settings;
|
|
22
|
+
const [showMainToolbar, setShowMainToolbar] = React.useState(
|
|
23
|
+
!!(editor.selection && hasRangeSelection(editor)),
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
React.useEffect(() => {
|
|
27
|
+
let el;
|
|
28
|
+
try {
|
|
29
|
+
el = ReactEditor.toDOMNode(editor, editor);
|
|
30
|
+
} catch {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const toggleToolbar = () => {
|
|
34
|
+
const selection = window.getSelection();
|
|
35
|
+
const { activeElement } = window.document;
|
|
36
|
+
if (activeElement !== el) return;
|
|
37
|
+
if (!selection.isCollapsed && !showMainToolbar) {
|
|
38
|
+
setShowMainToolbar(true);
|
|
39
|
+
} else if (selection.isCollapsed && showMainToolbar) {
|
|
40
|
+
setShowMainToolbar(false);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
window.document.addEventListener('selectionchange', toggleToolbar);
|
|
44
|
+
return () => document.removeEventListener('selectionchange', toggleToolbar);
|
|
45
|
+
}, [editor, showMainToolbar]);
|
|
46
|
+
|
|
47
|
+
const showContextToolbar =
|
|
48
|
+
slate.contextToolbarButtons.map((plug) => plug(editor)).filter((c) => !!c)
|
|
49
|
+
.length > 0;
|
|
50
|
+
return (
|
|
51
|
+
<>
|
|
52
|
+
<SlateToolbar
|
|
53
|
+
className={cx(className, {
|
|
54
|
+
upper: showContextToolbar,
|
|
55
|
+
})}
|
|
56
|
+
selected={true}
|
|
57
|
+
enableExpando={slate.enableExpandedToolbar}
|
|
58
|
+
showExpandedToolbar={showExpandedToolbar}
|
|
59
|
+
setShowExpandedToolbar={setShowExpandedToolbar}
|
|
60
|
+
show={showMainToolbar}
|
|
61
|
+
/>
|
|
62
|
+
<SlateContextToolbar
|
|
63
|
+
editor={editor}
|
|
64
|
+
plugins={slate.contextToolbarButtons.filter((obj, pos, arr) => {
|
|
65
|
+
return arr.map((mapObj) => mapObj.name).indexOf(obj.name) === pos;
|
|
66
|
+
})}
|
|
67
|
+
show={showContextToolbar}
|
|
68
|
+
/>
|
|
69
|
+
</>
|
|
70
|
+
);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export default InlineToolbar;
|