@eeacms/volto-tableau 9.0.2 → 9.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,17 @@ 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
+ ### [9.0.4](https://github.com/eea/volto-tableau/compare/9.0.3...9.0.4) - 14 June 2026
8
+
9
+ #### :bug: Bug Fixes
10
+
11
+ - fix(tableau): preserve falsy values [Miu Razvan - [`c061428`](https://github.com/eea/volto-tableau/commit/c061428a10da0b8c73df789d7698eb83dd938b52)]
12
+
13
+ #### :hammer_and_wrench: Others
14
+
15
+ - Fix Tableau embed tests router context [Miu Razvan - [`49e677d`](https://github.com/eea/volto-tableau/commit/49e677d9fc0531556d3b092adedb28783fcb91fc)]
16
+ ### [9.0.3](https://github.com/eea/volto-tableau/compare/9.0.2...9.0.3) - 4 June 2026
17
+
7
18
  ### [9.0.2](https://github.com/eea/volto-tableau/compare/9.0.1...9.0.2) - 20 May 2026
8
19
 
9
20
  #### :hammer_and_wrench: Others
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-tableau",
3
- "version": "9.0.2",
3
+ "version": "9.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",
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { render } from '@testing-library/react';
3
3
  import { Provider } from 'react-intl-redux';
4
+ import { MemoryRouter } from 'react-router-dom';
4
5
  import config from '@plone/volto/registry';
5
6
  import '@testing-library/jest-dom';
6
7
 
@@ -29,22 +30,24 @@ describe('Edit', () => {
29
30
 
30
31
  const { container } = render(
31
32
  <Provider store={global.store}>
32
- <Edit
33
- id="my-tableau"
34
- data={data}
35
- pathname="/news"
36
- selected={true}
37
- block="1234"
38
- index={1}
39
- onChangeBlock={() => {}}
40
- onSelectBlock={() => {}}
41
- onDeleteBlock={() => {}}
42
- onFocusPreviousBlock={() => {}}
43
- onFocusNextBlock={() => {}}
44
- handleKeyDown={() => {}}
45
- content={{}}
46
- useVisibilitySensor={false}
47
- />
33
+ <MemoryRouter initialEntries={['/news']}>
34
+ <Edit
35
+ id="my-tableau"
36
+ data={data}
37
+ pathname="/news"
38
+ selected={true}
39
+ block="1234"
40
+ index={1}
41
+ onChangeBlock={() => {}}
42
+ onSelectBlock={() => {}}
43
+ onDeleteBlock={() => {}}
44
+ onFocusPreviousBlock={() => {}}
45
+ onFocusNextBlock={() => {}}
46
+ handleKeyDown={() => {}}
47
+ content={{}}
48
+ useVisibilitySensor={false}
49
+ />
50
+ </MemoryRouter>
48
51
  </Provider>,
49
52
  );
50
53
 
@@ -188,7 +188,7 @@ export default compose(
188
188
  connect(
189
189
  (state, props) => {
190
190
  const tableau_vis_url = flattenToAppURL(props.data.tableau_vis_url || '');
191
- const pathname = flattenToAppURL(state.content.data['@id']);
191
+ const pathname = flattenToAppURL(state.content.data?.['@id'] || '');
192
192
  return {
193
193
  tableauContent: state.content?.subrequests?.[props.id]?.data,
194
194
  discodata_query: state.discodata_query,
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { render } from '@testing-library/react';
3
3
  import { Provider } from 'react-intl-redux';
4
+ import { MemoryRouter } from 'react-router-dom';
4
5
  import '@testing-library/jest-dom';
5
6
 
6
7
  import View from './View';
@@ -21,7 +22,9 @@ describe('View', () => {
21
22
  it('should render the component', () => {
22
23
  const { container } = render(
23
24
  <Provider store={global.store}>
24
- <View data={data} useVisibilitySensor={false} />
25
+ <MemoryRouter initialEntries={['/news']}>
26
+ <View data={data} useVisibilitySensor={false} />
27
+ </MemoryRouter>
25
28
  </Provider>,
26
29
  );
27
30
 
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import isUndefined from 'lodash/isUndefined';
2
3
  import { connect } from 'react-redux';
3
4
  import Tableau from '@eeacms/volto-tableau/Tableau/Tableau';
4
5
  import qs from 'query-string';
@@ -29,7 +30,7 @@ const View = React.forwardRef((props, ref) => {
29
30
  const extraOptions = React.useMemo(() => {
30
31
  const options = {};
31
32
  staticParameters.forEach((parameter) => {
32
- if (parameter.field && parameter.value) {
33
+ if (parameter.field && !isUndefined(parameter.value)) {
33
34
  options[parameter.field] = parameter.value;
34
35
  }
35
36
  });
@@ -39,9 +40,9 @@ const View = React.forwardRef((props, ref) => {
39
40
  React.useEffect(() => {
40
41
  const newFilters = { ...extraFilters };
41
42
  urlParameters.forEach((element) => {
42
- if (element.field && typeof query[element.urlParam] !== 'undefined') {
43
+ if (element.field && !isUndefined(query[element.urlParam])) {
43
44
  newFilters[element.field] = query[element.urlParam];
44
- } else if (newFilters[element.field]) {
45
+ } else if (element.field in newFilters) {
45
46
  delete newFilters[element.field];
46
47
  }
47
48
  });
@@ -63,7 +63,7 @@ export function getParameters({ tableauVisualization, query, data }) {
63
63
  ...reduce(
64
64
  staticParameters,
65
65
  (acc, { field, value }) => {
66
- if (field && value) {
66
+ if (field && !isUndefined(value)) {
67
67
  return {
68
68
  ...acc,
69
69
  [field]: value,
@@ -76,7 +76,7 @@ export function getParameters({ tableauVisualization, query, data }) {
76
76
  ...reduce(
77
77
  urlParameters,
78
78
  (acc, { field, urlParam }) => {
79
- if (field && query[urlParam]) {
79
+ if (field && !isUndefined(query[urlParam])) {
80
80
  return {
81
81
  ...acc,
82
82
  [field]: isString(query[urlParam])
@@ -102,7 +102,7 @@ export function getFilters({ tableauVisualization, query, data }) {
102
102
  ...reduce(
103
103
  staticFilters,
104
104
  (acc, { field, value }) => {
105
- if (field && value) {
105
+ if (field && !isUndefined(value)) {
106
106
  return {
107
107
  ...acc,
108
108
  [field]: value,
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import isObject from 'lodash/isObject';
3
3
  import isArray from 'lodash/isArray';
4
+ import isNumber from 'lodash/isNumber';
4
5
  import isString from 'lodash/isString';
5
6
  import isBoolean from 'lodash/isBoolean';
6
7
  import isNull from 'lodash/isNull';
@@ -27,7 +28,8 @@ const JsonCodeSnippet = ({ obj, depth = 1 }) => {
27
28
  )}
28
29
  {isArray(value) && JSON.stringify(value)}
29
30
  {isString(value) && <>"{value}"</>}
30
- {isBoolean(value) && <>{value}</>}
31
+ {isNumber(value) && <>{value}</>}
32
+ {isBoolean(value) && <>{value.toString()}</>}
31
33
  {isNull(value) && <>null</>}
32
34
  {isUndefined(value) && <>undefined</>}
33
35
  </span>