@eeacms/volto-tableau 9.0.3 → 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 +7 -2
- package/package.json +1 -1
- package/src/Blocks/EmbedTableauVisualization/Edit.test.jsx +19 -16
- package/src/Blocks/EmbedTableauVisualization/View.test.jsx +4 -1
- package/src/Blocks/TableauBlock/View.jsx +4 -3
- package/src/Tableau/helpers.js +3 -3
- package/src/Utils/JsonCodeSnippet.jsx +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,11 +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
|
-
### [9.0.
|
|
7
|
+
### [9.0.4](https://github.com/eea/volto-tableau/compare/9.0.3...9.0.4) - 14 June 2026
|
|
8
8
|
|
|
9
9
|
#### :bug: Bug Fixes
|
|
10
10
|
|
|
11
|
-
- fix:
|
|
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
|
|
12
17
|
|
|
13
18
|
### [9.0.2](https://github.com/eea/volto-tableau/compare/9.0.1...9.0.2) - 20 May 2026
|
|
14
19
|
|
package/package.json
CHANGED
|
@@ -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
|
-
<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
|
|
@@ -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
|
-
<
|
|
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 &&
|
|
43
|
+
if (element.field && !isUndefined(query[element.urlParam])) {
|
|
43
44
|
newFilters[element.field] = query[element.urlParam];
|
|
44
|
-
} else if (
|
|
45
|
+
} else if (element.field in newFilters) {
|
|
45
46
|
delete newFilters[element.field];
|
|
46
47
|
}
|
|
47
48
|
});
|
package/src/Tableau/helpers.js
CHANGED
|
@@ -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
|
-
{
|
|
31
|
+
{isNumber(value) && <>{value}</>}
|
|
32
|
+
{isBoolean(value) && <>{value.toString()}</>}
|
|
31
33
|
{isNull(value) && <>null</>}
|
|
32
34
|
{isUndefined(value) && <>undefined</>}
|
|
33
35
|
</span>
|