@eeacms/volto-clms-theme 1.1.219 → 1.1.220
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 +6 -0
- package/package.json +1 -1
- package/src/components/Blocks/CclProductLinksBlock/CclProductLinksEdit.jsx +114 -0
- package/src/components/Blocks/CclProductLinksBlock/CclProductLinksView.jsx +59 -0
- package/src/components/Blocks/CclProductLinksBlock/ProductLink.jsx +64 -0
- package/src/components/Blocks/CclProductLinksBlock/schema.js +46 -0
- package/src/components/Blocks/CustomTemplates/VoltoColumnsBlock/CclProductCardColumnEdit.jsx +633 -0
- package/src/components/Blocks/CustomTemplates/VoltoColumnsBlock/CclProductCardColumnView.jsx +96 -0
- package/src/components/Blocks/CustomTemplates/VoltoColumnsBlock/ColumnVariations.jsx +31 -0
- package/src/components/Blocks/CustomTemplates/VoltoColumnsBlock/EditBlockWrapper.jsx +185 -0
- package/src/components/Blocks/CustomTemplates/VoltoColumnsBlock/columnSchema.js +41 -0
- package/src/components/Blocks/CustomTemplates/VoltoColumnsBlock/index.js +4 -0
- package/src/components/Blocks/CustomTemplates/VoltoColumnsBlock/schema.js +95 -0
- package/src/components/Blocks/CustomTemplates/VoltoColumnsBlock/utils.js +49 -0
- package/src/components/Blocks/CustomTemplates/VoltoListingBlock/CclListingCards.jsx +3 -1
- package/src/components/Blocks/CustomTemplates/VoltoTableBlock/Cell.jsx +87 -0
- package/src/components/Blocks/CustomTemplates/VoltoTableBlock/TableBlockEdit.jsx +688 -0
- package/src/components/Blocks/CustomTemplates/VoltoTableBlock/TableBlockView.jsx +147 -0
- package/src/components/Blocks/CustomTemplates/VoltoTableBlock/index.js +4 -0
- package/src/components/Blocks/CustomTemplates/VoltoTableBlock/schema.js +122 -0
- package/src/components/Blocks/CustomTemplates/VoltoTabsBlock/CclProductToggleView.jsx +132 -0
- package/src/components/Blocks/CustomTemplates/VoltoTabsBlock/CclVerticalTabsProductOverviewView.jsx +184 -0
- package/src/components/Blocks/CustomTemplates/VoltoTabsBlock/index.js +6 -0
- package/src/components/Blocks/CustomTemplates/VoltoTabsBlock/tabsSchemaWithIcon.js +136 -0
- package/src/components/Blocks/customBlocks.js +79 -0
- package/src/components/CclCard/CclCard.jsx +21 -0
- package/theme/clms/img/i_biogeophysical_green_bg.svg +15 -0
- package/theme/clms/img/i_groundmotion_green_bg.svg +14 -0
- package/theme/clms/img/i_landcover_green_bg.svg +13 -0
- package/theme/clms/img/i_priorityarea_green_bg.svg +13 -0
- package/theme/clms/img/i_referenceandvalidation_green_bg.svg +17 -0
- package/theme/clms/img/i_satellite_green_bg.svg +11 -0
- package/theme/site/extras/cards.less +53 -0
- package/theme/site/extras/ccl-tabs.less +57 -1
- package/theme/site/extras/clms-table.less +54 -0
- package/theme/site/extras/column-product-card.less +54 -0
- package/theme/site/extras/custom.overrides +4 -1
- package/theme/site/extras/product-tab-toggle.less +50 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,12 @@ 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.1.220](https://github.com/eea/volto-clms-theme/compare/1.1.219...1.1.220) - 13 March 2025
|
|
8
|
+
|
|
9
|
+
#### :rocket: New Features
|
|
10
|
+
|
|
11
|
+
- feat: Product portfolio - Implement the improvements established for the section -refs #282695 [ana-oprea - [`6383c1d`](https://github.com/eea/volto-clms-theme/commit/6383c1da4716ce2646a90cafea76fbda0f96472f)]
|
|
12
|
+
|
|
7
13
|
### [1.1.219](https://github.com/eea/volto-clms-theme/compare/1.1.218...1.1.219) - 10 March 2025
|
|
8
14
|
|
|
9
15
|
#### :hammer_and_wrench: Others
|
package/package.json
CHANGED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { injectIntl } from 'react-intl';
|
|
3
|
+
import { compose } from 'redux';
|
|
4
|
+
|
|
5
|
+
import { SidebarPortal, BlockDataForm } from '@plone/volto/components'; // BlocksForm, Icon,
|
|
6
|
+
import withObjectBrowser from '@plone/volto/components/manage/Sidebar/ObjectBrowser';
|
|
7
|
+
|
|
8
|
+
import { emptyCard, getPanels } from '../utils';
|
|
9
|
+
import { CardBlockSchema, CardContainerSchema } from './schema';
|
|
10
|
+
|
|
11
|
+
import { isEmpty } from 'lodash';
|
|
12
|
+
import ProductLink from './ProductLink.jsx';
|
|
13
|
+
|
|
14
|
+
const CclProductLinksEdit = ({
|
|
15
|
+
block,
|
|
16
|
+
data,
|
|
17
|
+
onChangeBlock,
|
|
18
|
+
selected,
|
|
19
|
+
setSidebarTab,
|
|
20
|
+
}) => {
|
|
21
|
+
const properties = isEmpty(data?.customCards?.blocks)
|
|
22
|
+
? emptyCard(2)
|
|
23
|
+
: data.customCards;
|
|
24
|
+
|
|
25
|
+
const panelData = properties;
|
|
26
|
+
const panels = getPanels(panelData);
|
|
27
|
+
React.useEffect(() => {
|
|
28
|
+
if (isEmpty(data?.customCards)) {
|
|
29
|
+
onChangeBlock(block, {
|
|
30
|
+
...data,
|
|
31
|
+
customCards: {
|
|
32
|
+
...properties,
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
/* eslint-disable-next-line */
|
|
37
|
+
}, []);
|
|
38
|
+
|
|
39
|
+
const [selectedCardBlock, setSelectedCardBlock] = useState(-1);
|
|
40
|
+
|
|
41
|
+
let schema = CardContainerSchema();
|
|
42
|
+
let cardSchema = CardBlockSchema();
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<>
|
|
46
|
+
<div
|
|
47
|
+
className="cardContainer-header"
|
|
48
|
+
onClick={() => {
|
|
49
|
+
setSidebarTab(1);
|
|
50
|
+
setSelectedCardBlock(-1);
|
|
51
|
+
}}
|
|
52
|
+
aria-hidden="true"
|
|
53
|
+
>
|
|
54
|
+
{data.title || 'Product links container'}
|
|
55
|
+
</div>
|
|
56
|
+
<div className={'product-column-links'}>
|
|
57
|
+
<>
|
|
58
|
+
{panels.map(([uid, panel], index) => (
|
|
59
|
+
<ProductLink
|
|
60
|
+
key={index}
|
|
61
|
+
card={panel}
|
|
62
|
+
onClickImage={() => {
|
|
63
|
+
setSelectedCardBlock(uid);
|
|
64
|
+
}}
|
|
65
|
+
isCustomCard={true}
|
|
66
|
+
isEditMode
|
|
67
|
+
/>
|
|
68
|
+
))}
|
|
69
|
+
</>
|
|
70
|
+
</div>
|
|
71
|
+
<SidebarPortal selected={selected && selectedCardBlock === -1}>
|
|
72
|
+
<BlockDataForm
|
|
73
|
+
schema={schema}
|
|
74
|
+
title="Product Link container block"
|
|
75
|
+
onChangeField={(id, value) => {
|
|
76
|
+
onChangeBlock(block, {
|
|
77
|
+
...data,
|
|
78
|
+
[id]: value,
|
|
79
|
+
});
|
|
80
|
+
}}
|
|
81
|
+
formData={data}
|
|
82
|
+
/>
|
|
83
|
+
</SidebarPortal>
|
|
84
|
+
<SidebarPortal
|
|
85
|
+
selected={
|
|
86
|
+
selected && selectedCardBlock !== -1 && data.customCards?.blocks
|
|
87
|
+
}
|
|
88
|
+
>
|
|
89
|
+
<BlockDataForm
|
|
90
|
+
schema={cardSchema}
|
|
91
|
+
title="Card block"
|
|
92
|
+
onChangeField={(id, value) => {
|
|
93
|
+
onChangeBlock(block, {
|
|
94
|
+
...data,
|
|
95
|
+
customCards: {
|
|
96
|
+
...data.customCards,
|
|
97
|
+
blocks: {
|
|
98
|
+
...data.customCards.blocks,
|
|
99
|
+
[selectedCardBlock]: {
|
|
100
|
+
...data.customCards.blocks[selectedCardBlock],
|
|
101
|
+
[id]: value,
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
}}
|
|
107
|
+
formData={data.customCards?.blocks[selectedCardBlock]}
|
|
108
|
+
/>
|
|
109
|
+
</SidebarPortal>
|
|
110
|
+
</>
|
|
111
|
+
);
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
export default compose(withObjectBrowser, injectIntl)(CclProductLinksEdit);
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { isEmpty } from 'lodash';
|
|
3
|
+
import { getPanels } from '../utils';
|
|
4
|
+
import ProductLink from './ProductLink';
|
|
5
|
+
|
|
6
|
+
const CclProductLinksView = (props) => {
|
|
7
|
+
const {
|
|
8
|
+
block,
|
|
9
|
+
data,
|
|
10
|
+
onChangeBlock,
|
|
11
|
+
setSidebarTab,
|
|
12
|
+
setSelectedCardBlock,
|
|
13
|
+
} = props;
|
|
14
|
+
|
|
15
|
+
const properties = data?.customCards;
|
|
16
|
+
|
|
17
|
+
const panelData = properties;
|
|
18
|
+
const panels = getPanels(panelData);
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (isEmpty(data?.customCards)) {
|
|
21
|
+
onChangeBlock(block, {
|
|
22
|
+
...data,
|
|
23
|
+
customCards: {
|
|
24
|
+
...properties,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
/* eslint-disable-next-line */
|
|
29
|
+
}, []);
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<>
|
|
33
|
+
<div
|
|
34
|
+
className="cardContainer-header"
|
|
35
|
+
onClick={() => {
|
|
36
|
+
setSidebarTab(1);
|
|
37
|
+
setSelectedCardBlock(-1);
|
|
38
|
+
}}
|
|
39
|
+
aria-hidden="true"
|
|
40
|
+
>
|
|
41
|
+
{data?.title && data.title}
|
|
42
|
+
</div>
|
|
43
|
+
<div className={'product-column-links'}>
|
|
44
|
+
<>
|
|
45
|
+
{panels.map(([uid, panel], index) => (
|
|
46
|
+
<ProductLink
|
|
47
|
+
key={index}
|
|
48
|
+
card={panel}
|
|
49
|
+
isCustomCard={true}
|
|
50
|
+
isEditMode={false}
|
|
51
|
+
/>
|
|
52
|
+
))}
|
|
53
|
+
</>
|
|
54
|
+
</div>
|
|
55
|
+
</>
|
|
56
|
+
);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export default CclProductLinksView;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
import { Link } from 'react-router-dom';
|
|
3
|
+
import { flattenToAppURL, isInternalURL } from '@plone/volto/helpers';
|
|
4
|
+
|
|
5
|
+
const ProductLink = (props) => {
|
|
6
|
+
const {
|
|
7
|
+
card,
|
|
8
|
+
onClickImage = () => {
|
|
9
|
+
return '';
|
|
10
|
+
},
|
|
11
|
+
isEditMode,
|
|
12
|
+
} = props;
|
|
13
|
+
|
|
14
|
+
const [hasLink, setHasLink] = useState(false);
|
|
15
|
+
const href = card.url?.[0]?.['@id'] || card.url;
|
|
16
|
+
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
if (isEditMode) {
|
|
19
|
+
setHasLink(false);
|
|
20
|
+
} else {
|
|
21
|
+
if (card.url) {
|
|
22
|
+
if (card.url && card.url.length > 0) {
|
|
23
|
+
setHasLink(true);
|
|
24
|
+
}
|
|
25
|
+
if (card.url.length === 0) {
|
|
26
|
+
setHasLink(false);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}, [isEditMode, card.url]);
|
|
31
|
+
|
|
32
|
+
const url = hasLink && isInternalURL(href) ? flattenToAppURL(href) : href;
|
|
33
|
+
const As = hasLink && isInternalURL(url) ? Link : 'a';
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<As
|
|
37
|
+
href={hasLink ? url : null}
|
|
38
|
+
to={hasLink ? url : null}
|
|
39
|
+
onClick={() => {
|
|
40
|
+
onClickImage();
|
|
41
|
+
if (isEditMode === false)
|
|
42
|
+
window.scrollTo({
|
|
43
|
+
top: 0,
|
|
44
|
+
left: 0,
|
|
45
|
+
behavior: 'smooth',
|
|
46
|
+
});
|
|
47
|
+
}}
|
|
48
|
+
onKeyDown={() => {
|
|
49
|
+
onClickImage();
|
|
50
|
+
if (isEditMode === false)
|
|
51
|
+
window.scrollTo({
|
|
52
|
+
top: 0,
|
|
53
|
+
left: 0,
|
|
54
|
+
behavior: 'smooth',
|
|
55
|
+
});
|
|
56
|
+
}}
|
|
57
|
+
className={hasLink ? 'card-with-link' : ''}
|
|
58
|
+
>
|
|
59
|
+
{card?.title || 'New link title'}
|
|
60
|
+
</As>
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export default ProductLink;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export const CardContainerSchema = () => ({
|
|
2
|
+
title: 'Card container',
|
|
3
|
+
fieldsets: [
|
|
4
|
+
{
|
|
5
|
+
id: 'default',
|
|
6
|
+
title: 'Default',
|
|
7
|
+
fields: ['customCards'],
|
|
8
|
+
},
|
|
9
|
+
],
|
|
10
|
+
properties: {
|
|
11
|
+
customCards: {
|
|
12
|
+
title: 'Custom cards',
|
|
13
|
+
type: 'panels',
|
|
14
|
+
schema: CardBlockSchema,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
required: ['cardOrigin'],
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export const CardBlockSchema = () => {
|
|
21
|
+
return {
|
|
22
|
+
title: 'Card block',
|
|
23
|
+
fieldsets: [
|
|
24
|
+
{
|
|
25
|
+
id: 'default',
|
|
26
|
+
title: 'Default',
|
|
27
|
+
fields: ['title', 'url'],
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
properties: {
|
|
31
|
+
title: {
|
|
32
|
+
title: 'Title',
|
|
33
|
+
description: 'Card title',
|
|
34
|
+
type: 'string',
|
|
35
|
+
placeholder: 'Card title here',
|
|
36
|
+
},
|
|
37
|
+
url: {
|
|
38
|
+
title: 'URL',
|
|
39
|
+
widget: 'object_browser',
|
|
40
|
+
mode: 'link',
|
|
41
|
+
allowExternals: true,
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
required: [],
|
|
45
|
+
};
|
|
46
|
+
};
|