@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 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-tableau",
3
- "version": "7.0.3",
3
+ "version": "7.0.5",
4
4
  "description": "@eeacms/volto-tableau: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -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>
@@ -21,7 +21,11 @@ Array [
21
21
  >
22
22
  <div
23
23
  className="tableau tableau-2.8.0"
24
- style={Object {}}
24
+ style={
25
+ Object {
26
+ "height": "700px",
27
+ }
28
+ }
25
29
  />
26
30
  </div>
27
31
  </div>
@@ -20,7 +20,11 @@ exports[`View should render the component 1`] = `
20
20
  >
21
21
  <div
22
22
  className="tableau tableau-2.8.0"
23
- style={Object {}}
23
+ style={
24
+ Object {
25
+ "height": "700px",
26
+ }
27
+ }
24
28
  />
25
29
  </div>
26
30
  </div>
@@ -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={tableau_height ? { height: getHeight(tableau_height) } : {}}
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: false,
26
- with_enlarge: false,
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
  }