@eeacms/volto-tableau 7.0.3 → 7.0.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 +10 -0
- package/package.json +1 -1
- package/src/Blocks/EmbedTableauVisualization/View.jsx +13 -0
- package/src/Blocks/EmbedTableauVisualization/__snapshots__/Edit.test.jsx.snap +5 -1
- package/src/Blocks/EmbedTableauVisualization/__snapshots__/View.test.jsx.snap +5 -1
- package/src/Tableau/Tableau.jsx +2 -2
- package/src/Views/VisualizationView.jsx +14 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,16 @@ 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
|
+
### [7.0.5](https://github.com/eea/volto-tableau/compare/7.0.4...7.0.5) - 6 December 2023
|
|
8
|
+
|
|
9
|
+
#### :hammer_and_wrench: Others
|
|
10
|
+
|
|
11
|
+
- pass down static parameters in embed tableau as well [kreafox - [`11e46cc`](https://github.com/eea/volto-tableau/commit/11e46ccf07e83d9722790a8596375adb930b96c3)]
|
|
12
|
+
### [7.0.4](https://github.com/eea/volto-tableau/compare/7.0.3...7.0.4) - 5 December 2023
|
|
13
|
+
|
|
14
|
+
#### :hammer_and_wrench: Others
|
|
15
|
+
|
|
16
|
+
- fix tests [Miu Razvan - [`3a880ab`](https://github.com/eea/volto-tableau/commit/3a880aba0ff02bb568a1778e07b48b572472e44a)]
|
|
7
17
|
### [7.0.3](https://github.com/eea/volto-tableau/compare/7.0.2...7.0.3) - 29 November 2023
|
|
8
18
|
|
|
9
19
|
#### :hammer_and_wrench: Others
|
package/package.json
CHANGED
|
@@ -39,6 +39,18 @@ const View = (props) => {
|
|
|
39
39
|
|
|
40
40
|
const tableau_visualization = getTableauVisualization(props);
|
|
41
41
|
|
|
42
|
+
const { staticParameters = [] } = tableau_visualization;
|
|
43
|
+
|
|
44
|
+
const extraOptions = React.useMemo(() => {
|
|
45
|
+
const options = {};
|
|
46
|
+
staticParameters.forEach((parameter) => {
|
|
47
|
+
if (parameter.field && parameter.value) {
|
|
48
|
+
options[parameter.field] = parameter.value;
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
return options;
|
|
52
|
+
}, [staticParameters]);
|
|
53
|
+
|
|
42
54
|
useEffect(() => {
|
|
43
55
|
const tableauVisId = flattenToAppURL(tableau_visualization['@id'] || '');
|
|
44
56
|
if (
|
|
@@ -75,6 +87,7 @@ const View = (props) => {
|
|
|
75
87
|
with_enlarge,
|
|
76
88
|
tableau_vis_url,
|
|
77
89
|
}}
|
|
90
|
+
extraOptions={extraOptions}
|
|
78
91
|
/>
|
|
79
92
|
</PrivacyProtection>
|
|
80
93
|
</div>
|
package/src/Tableau/Tableau.jsx
CHANGED
|
@@ -34,7 +34,7 @@ function getHeight(height) {
|
|
|
34
34
|
if (asNumber) {
|
|
35
35
|
return `${height}px`;
|
|
36
36
|
}
|
|
37
|
-
return height;
|
|
37
|
+
return height || '700px';
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
const TableauDebug = ({ mode, data, vizState, url, version, clearData }) => {
|
|
@@ -438,7 +438,7 @@ const Tableau = forwardRef((props, ref) => {
|
|
|
438
438
|
clearData={clearData}
|
|
439
439
|
/>
|
|
440
440
|
<div
|
|
441
|
-
style={
|
|
441
|
+
style={{ height: getHeight(tableau_height) }}
|
|
442
442
|
className={cx('tableau', `tableau-${version}`, {
|
|
443
443
|
'tableau-autoscale': autoScale,
|
|
444
444
|
})}
|
|
@@ -9,6 +9,17 @@ import Tableau from '@eeacms/volto-tableau/Tableau/Tableau';
|
|
|
9
9
|
const VisualizationView = (props) => {
|
|
10
10
|
const { content = {} } = props;
|
|
11
11
|
const { tableau_visualization = {} } = content;
|
|
12
|
+
const { staticParameters = [] } = tableau_visualization;
|
|
13
|
+
|
|
14
|
+
const extraOptions = React.useMemo(() => {
|
|
15
|
+
const options = {};
|
|
16
|
+
staticParameters.forEach((parameter) => {
|
|
17
|
+
if (parameter.field && parameter.value) {
|
|
18
|
+
options[parameter.field] = parameter.value;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
return options;
|
|
22
|
+
}, [staticParameters]);
|
|
12
23
|
|
|
13
24
|
return (
|
|
14
25
|
<Container id="page-document">
|
|
@@ -22,10 +33,11 @@ const VisualizationView = (props) => {
|
|
|
22
33
|
with_notes: false,
|
|
23
34
|
with_sources: false,
|
|
24
35
|
with_more_info: false,
|
|
25
|
-
with_share:
|
|
26
|
-
with_enlarge:
|
|
36
|
+
with_share: true,
|
|
37
|
+
with_enlarge: true,
|
|
27
38
|
with_download: true,
|
|
28
39
|
}}
|
|
40
|
+
extraOptions={extraOptions}
|
|
29
41
|
breakpoints={
|
|
30
42
|
config.blocks.blocksConfig.embed_tableau_visualization.breakpoints
|
|
31
43
|
}
|