@eeacms/volto-tableau 7.0.3 → 7.0.4

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,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
+ ### [7.0.4](https://github.com/eea/volto-tableau/compare/7.0.3...7.0.4) - 5 December 2023
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - fix tests [Miu Razvan - [`3a880ab`](https://github.com/eea/volto-tableau/commit/3a880aba0ff02bb568a1778e07b48b572472e44a)]
12
+ - fix default height [Miu Razvan - [`0eb7ebb`](https://github.com/eea/volto-tableau/commit/0eb7ebb7c5f702ffb3f0ae679b90f27ad7cbb080)]
7
13
  ### [7.0.3](https://github.com/eea/volto-tableau/compare/7.0.2...7.0.3) - 29 November 2023
8
14
 
9
15
  #### :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.4",
4
4
  "description": "@eeacms/volto-tableau: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -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
  }