@eeacms/volto-tableau 7.1.0 → 7.2.0

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,20 @@ 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.2.0](https://github.com/eea/volto-tableau/compare/7.1.0...7.2.0) - 17 January 2024
8
+
9
+ #### :rocket: New Features
10
+
11
+ - feat: show embed error + always show sources [Razvan - [`c1df7a2`](https://github.com/eea/volto-tableau/commit/c1df7a221c427705e29bcd45d621666973e12edb)]
12
+
13
+ #### :bug: Bug Fixes
14
+
15
+ - fix: infinit requests patch [Razvan - [`9a9afa2`](https://github.com/eea/volto-tableau/commit/9a9afa2d73821c61d66044d5c44806ab060d3bd3)]
16
+
17
+ #### :hammer_and_wrench: Others
18
+
19
+ - Release 7.2.0 [Alin Voinea - [`7c0af33`](https://github.com/eea/volto-tableau/commit/7c0af336f63abfe5e25058a1ff1b07000a9a8c87)]
20
+ - fix tests [Razvan - [`48f255a`](https://github.com/eea/volto-tableau/commit/48f255a7a437a909e018604fe81db8987b6bfe87)]
7
21
  ### [7.1.0](https://github.com/eea/volto-tableau/compare/7.0.5...7.1.0) - 13 December 2023
8
22
 
9
23
  #### :rocket: New Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-tableau",
3
- "version": "7.1.0",
3
+ "version": "7.2.0",
4
4
  "description": "@eeacms/volto-tableau: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -41,7 +41,6 @@ const View = (props) => {
41
41
  } = props;
42
42
  const {
43
43
  with_notes = true,
44
- with_sources = true,
45
44
  with_more_info = true,
46
45
  with_download = true,
47
46
  with_share = true,
@@ -135,7 +134,13 @@ const View = (props) => {
135
134
  * tableau visualization
136
135
  */
137
136
  const tableauVisId = flattenToAppURL(tableauVisualization['@id'] || '');
138
- if (isBlock && tableau_vis_url && tableau_vis_url !== tableauVisId) {
137
+ if (
138
+ mode === 'edit' &&
139
+ !tableauVisualization.error &&
140
+ isBlock &&
141
+ tableau_vis_url &&
142
+ tableau_vis_url !== tableauVisId
143
+ ) {
139
144
  getContent(tableau_vis_url, null, id);
140
145
  }
141
146
  }, [id, isBlock, getContent, mode, tableau_vis_url, tableauVisualization]);
@@ -144,6 +149,12 @@ const View = (props) => {
144
149
  return <Message>Please select a tableau from block editor.</Message>;
145
150
  }
146
151
 
152
+ if (tableauVisualization?.error) {
153
+ return (
154
+ <p dangerouslySetInnerHTML={{ __html: tableauVisualization.error }} />
155
+ );
156
+ }
157
+
147
158
  return (
148
159
  <div className="embed-tableau">
149
160
  <PrivacyProtection
@@ -157,7 +168,7 @@ const View = (props) => {
157
168
  tableau_height:
158
169
  tableau_height || tableauVisualization.tableau_height,
159
170
  with_notes,
160
- with_sources,
171
+ with_sources: true,
161
172
  with_more_info,
162
173
  with_download,
163
174
  with_share,
@@ -154,14 +154,6 @@ Array [
154
154
  -
155
155
  No description
156
156
  </div>
157
- <div
158
- className="mocked-boolean-widget"
159
- id="mocked-field-with_sources"
160
- >
161
- Show sources
162
- -
163
- Will show sources set in this page Data provenance
164
- </div>
165
157
  <div
166
158
  className="mocked-boolean-widget"
167
159
  id="mocked-field-with_more_info"
@@ -83,7 +83,6 @@ export default (props) => {
83
83
  title: 'Toolbar',
84
84
  fields: [
85
85
  'with_notes',
86
- 'with_sources',
87
86
  'with_more_info',
88
87
  'with_download',
89
88
  'with_share',
@@ -118,6 +118,7 @@ const Tableau = forwardRef((props, ref) => {
118
118
  setVizState,
119
119
  onChangeBlock,
120
120
  } = props;
121
+
121
122
  const {
122
123
  data_provenance = {},
123
124
  figure_note = [],
@@ -31,16 +31,21 @@ export function getTableauVisualization({
31
31
  tableauContent,
32
32
  content,
33
33
  }) {
34
- const mergedContent = (isBlock ? tableauContent : content) || {};
35
- const tableau_visualization =
34
+ const mergedContent =
36
35
  (isBlock
37
- ? tableauContent?.tableau_visualization
38
- : content?.tableau_visualization) ||
39
- data?.tableau_visualization ||
40
- {};
36
+ ? tableauContent
37
+ : {
38
+ ...content,
39
+ tableau_visualization: {
40
+ ...(content?.tableau_visualization || {}),
41
+ ...pickMetadata(content),
42
+ },
43
+ }) || {};
44
+ const tableau_visualization =
45
+ mergedContent?.tableau_visualization || data?.tableau_visualization || {};
41
46
  return {
42
- ...pickMetadata(mergedContent),
43
47
  ...tableau_visualization,
48
+ ...(isBlock ? pickMetadata(mergedContent) : {}),
44
49
  };
45
50
  }
46
51