@eeacms/volto-tableau 7.0.0 → 7.0.1

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,7 +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.0](https://github.com/eea/volto-tableau/compare/6.0.6...7.0.0) - 23 November 2023
7
+ ### [7.0.1](https://github.com/eea/volto-tableau/compare/7.0.0...7.0.1) - 24 November 2023
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - fix [Miu Razvan - [`4036e40`](https://github.com/eea/volto-tableau/commit/4036e4018bc0faf86aba7a330b52f0a975343be0)]
12
+ - update [Miu Razvan - [`e274b41`](https://github.com/eea/volto-tableau/commit/e274b416f65b446f0e2453e9f0ed6f4cdd27a3f6)]
13
+ - fix [Miu Razvan - [`da14168`](https://github.com/eea/volto-tableau/commit/da14168f40d161264488810e7b08facb265a2c00)]
14
+ - fix [Miu Razvan - [`faba267`](https://github.com/eea/volto-tableau/commit/faba267e7fde6a5b906fdcff010ed9d46ecea741)]
15
+ - fix [Miu Razvan - [`a772a85`](https://github.com/eea/volto-tableau/commit/a772a85e19b80a7202f23ad45e3aff6fa3ae9c3c)]
16
+ ## [7.0.0](https://github.com/eea/volto-tableau/compare/6.0.6...7.0.0) - 23 November 2023
8
17
 
9
18
  #### :bug: Bug Fixes
10
19
 
@@ -25,12 +34,14 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
25
34
  - test [Dobricean Ioan Dorian - [`48505ca`](https://github.com/eea/volto-tableau/commit/48505caef84d12091035fdd79cf64067e7f819e2)]
26
35
  - split the view and edit [Dobricean Ioan Dorian - [`7227bb1`](https://github.com/eea/volto-tableau/commit/7227bb1fb70e5d895f15872ed6533e089be99836)]
27
36
  - update embed tableau so it can work with serialized data [Dobricean Ioan Dorian - [`59d958c`](https://github.com/eea/volto-tableau/commit/59d958c7a1a5055ea62e04abcbf34ee93f52e23a)]
37
+ - test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`c452d70`](https://github.com/eea/volto-tableau/commit/c452d704819fb485e3cd3b39c2501361d20e8559)]
28
38
  ### [6.0.6](https://github.com/eea/volto-tableau/compare/6.0.5...6.0.6) - 17 November 2023
29
39
 
30
40
  #### :hammer_and_wrench: Others
31
41
 
32
42
  - tests: add cypress for tableau [nileshgulia1 - [`6eca683`](https://github.com/eea/volto-tableau/commit/6eca6834b85cdab4ed82367fee32fdbbb35b0f5e)]
33
43
  - tests: update unit tests [nileshgulia1 - [`96cae09`](https://github.com/eea/volto-tableau/commit/96cae09eab2e737f032c97eb401a3efa88e68ec6)]
44
+ - test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`c7e81cb`](https://github.com/eea/volto-tableau/commit/c7e81cb0768f755dd4107a4998253d9bccc33809)]
34
45
  - comment test [Miu Razvan - [`a459525`](https://github.com/eea/volto-tableau/commit/a459525fdccf8ee61651d4cb2e04eb253e841c61)]
35
46
  ### [6.0.5](https://github.com/eea/volto-tableau/compare/6.0.4...6.0.5) - 15 November 2023
36
47
 
@@ -57,6 +68,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
57
68
 
58
69
  #### :house: Internal changes
59
70
 
71
+ - chore: [JENKINS] Refactor automated testing [valentinab25 - [`903b90a`](https://github.com/eea/volto-tableau/commit/903b90a2df0abc183aa68d99a89bb688de3a0c73)]
60
72
 
61
73
  #### :hammer_and_wrench: Others
62
74
 
@@ -66,6 +78,9 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
66
78
  - tests: increase coverage [kreafox - [`ecb9262`](https://github.com/eea/volto-tableau/commit/ecb92625a44365faf4c39f0ff3f02ccc4ca21656)]
67
79
  - Fix tableau height [kreafox - [`6194c24`](https://github.com/eea/volto-tableau/commit/6194c2405e2bd93aba9865caed76292cd55193d3)]
68
80
  - Show share & download button on widget view [kreafox - [`a66e253`](https://github.com/eea/volto-tableau/commit/a66e2537d08dc7129e249c28e1daa27246c88815)]
81
+ - test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`9d2189d`](https://github.com/eea/volto-tableau/commit/9d2189d4edb13dd449d75cd6dd9052bbed67304d)]
82
+ - test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`f2fa3f9`](https://github.com/eea/volto-tableau/commit/f2fa3f9ccabab918586179ac16ead44e2eba8498)]
83
+ - test: [JENKINS] Improve cypress time [valentinab25 - [`5748183`](https://github.com/eea/volto-tableau/commit/5748183c27dae18a4ebbc067d659cbc24cad8f71)]
69
84
  - use toolbar from volto-embed [Miu Razvan - [`1a232a1`](https://github.com/eea/volto-tableau/commit/1a232a15f2bbe05da75307800590d0a0a1c4996b)]
70
85
  ## [6.0.0](https://github.com/eea/volto-tableau/compare/5.0.2...6.0.0) - 30 October 2023
71
86
 
@@ -123,6 +138,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
123
138
  - test: change volto version in Jenkinsfile [ana-oprea - [`347aceb`](https://github.com/eea/volto-tableau/commit/347aceb07d152fddeebbf3a7e7a6ac9c55dc21ba)]
124
139
  - test: increase cypress timeout [ana-oprea - [`bdf4408`](https://github.com/eea/volto-tableau/commit/bdf44083cd84c96b4914d3f8a3bb17c5187f191c)]
125
140
  - test: EN locales, pre-commit fix, feature PRs checks Refs #257193 [valentinab25 - [`caff974`](https://github.com/eea/volto-tableau/commit/caff9742a703b224133a8dd2a969629e70c9fd33)]
141
+ - test: Fix eslint and yarn i18n [Alin Voinea - [`b8be7fb`](https://github.com/eea/volto-tableau/commit/b8be7fb9ab10faed0a1be8ce7e3d4e7c78ebe020)]
126
142
  - i18n: Add en [Alin Voinea - [`c5e20dd`](https://github.com/eea/volto-tableau/commit/c5e20ddea25c830ac80665ee9a71e557e8cd117d)]
127
143
  - test: Update Makefile and docker-compose to align it with Jenkinsfile [valentinab25 - [`2116ff9`](https://github.com/eea/volto-tableau/commit/2116ff95c6454e813bdca44e6c3aa81fa0a916b8)]
128
144
  ## [5.0.0](https://github.com/eea/volto-tableau/compare/4.1.1...5.0.0) - 25 July 2023
@@ -134,17 +150,21 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
134
150
  #### :hammer_and_wrench: Others
135
151
 
136
152
  - Release 5.0.0 [Alin Voinea - [`97c98e9`](https://github.com/eea/volto-tableau/commit/97c98e98b1295a4ad45756326dc20cd59517515f)]
153
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`2acb3a5`](https://github.com/eea/volto-tableau/commit/2acb3a5490f62ce0a95ebbd03c32874ac3a42603)]
137
154
  ### [4.1.1](https://github.com/eea/volto-tableau/compare/4.1.0...4.1.1) - 21 July 2023
138
155
 
139
156
  #### :hammer_and_wrench: Others
140
157
 
141
158
  - Add VisualizationViewWidget [Tiberiu Ichim - [`fa881cb`](https://github.com/eea/volto-tableau/commit/fa881cbc3643a46697fb16d1c86ada1d4121a46a)]
159
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`cbcbad2`](https://github.com/eea/volto-tableau/commit/cbcbad26f7aa3683122199c8d5cbd142903df93b)]
160
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`51abe6d`](https://github.com/eea/volto-tableau/commit/51abe6d4db80825fe2e396e04c7003c6ad79b480)]
142
161
  ### [4.1.0](https://github.com/eea/volto-tableau/compare/4.0.0...4.1.0) - 15 June 2023
143
162
 
144
163
  ## [4.0.0](https://github.com/eea/volto-tableau/compare/3.0.8...4.0.0) - 13 June 2023
145
164
 
146
165
  #### :house: Internal changes
147
166
 
167
+ - chore: [JENKINS] Remove alpha testing version [valentinab25 - [`e33bb21`](https://github.com/eea/volto-tableau/commit/e33bb21eb429c33e3a15d771487a1c9af8ccb0d5)]
148
168
 
149
169
  #### :hammer_and_wrench: Others
150
170
 
@@ -176,6 +196,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
176
196
 
177
197
  #### :hammer_and_wrench: Others
178
198
 
199
+ - Add Sonarqube tag using industry-frontend addons list [EEA Jenkins - [`f5deccd`](https://github.com/eea/volto-tableau/commit/f5deccd84372752908b300c5cfd78134818e5ce4)]
179
200
  ### [3.0.6](https://github.com/eea/volto-tableau/compare/3.0.5...3.0.6) - 30 January 2023
180
201
 
181
202
  ### [3.0.5](https://github.com/eea/volto-tableau/compare/3.0.4...3.0.5) - 26 January 2023
@@ -247,6 +268,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
247
268
  - Update commands.js [Nilesh - [`7c48437`](https://github.com/eea/volto-tableau/commit/7c4843780efb9b85a4728de73c00d831c1d8fdcf)]
248
269
  - Update e2e.js [Nilesh - [`f67b45c`](https://github.com/eea/volto-tableau/commit/f67b45c170f58f8d0301192994226f173e4cb00a)]
249
270
  - latest volto compatibility refs #154757 [nileshgulia1 - [`881ba48`](https://github.com/eea/volto-tableau/commit/881ba482dc9b82e7fdac16549d41e80a6d26b3de)]
271
+ - Add Sonarqube tag using marine-frontend addons list [EEA Jenkins - [`58e25df`](https://github.com/eea/volto-tableau/commit/58e25df2291add09670143bee54cde103ee835b9)]
250
272
  ### [1.3.0](https://github.com/eea/volto-tableau/compare/1.2.5...1.3.0) - 28 September 2022
251
273
 
252
274
  #### :hammer_and_wrench: Others
@@ -260,11 +282,15 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
260
282
  - Use volto 16 alpha 14 [Miu Razvan - [`93641be`](https://github.com/eea/volto-tableau/commit/93641be4c2393f49008aff789400cf7c947949fd)]
261
283
  - Revert volto-tableau group to common [Andrei Grigore - [`9d24c6d`](https://github.com/eea/volto-tableau/commit/9d24c6d2767fed6a840cddaee55dbd5cecb544b5)]
262
284
  - Tableaugroup typo fix [Andrei Grigore - [`b0b5378`](https://github.com/eea/volto-tableau/commit/b0b5378a437043120a96c9e5e8802584145daa22)]
285
+ - Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`3234347`](https://github.com/eea/volto-tableau/commit/3234347e524cc0ed4918242f503fe9e7dba266b2)]
263
286
  - Refs #142010 - Optimize Volto-addons gitflow pipelines [valentinab25 - [`d237e1c`](https://github.com/eea/volto-tableau/commit/d237e1c72817d7e68a3eb698563674d1514db24f)]
264
287
  ### [1.2.4](https://github.com/eea/volto-tableau/compare/1.2.3...1.2.4) - 25 October 2021
265
288
 
266
289
  #### :hammer_and_wrench: Others
267
290
 
291
+ - Add Sonarqube tag using frontend addons list [EEA Jenkins - [`2b19679`](https://github.com/eea/volto-tableau/commit/2b19679e2c7bcdc83082d1c73a595eea8b86d14f)]
292
+ - Add Sonarqube tag using frontend addons list [EEA Jenkins - [`384ccae`](https://github.com/eea/volto-tableau/commit/384ccaebed8c414a5c90eb96c6ce0a2b091f249c)]
293
+ - Add Sonarqube tag using frontend addons list [EEA Jenkins - [`589258e`](https://github.com/eea/volto-tableau/commit/589258e9b3cbba9cee37c57bb85ca5b707bc65d7)]
268
294
  ### [1.2.3](https://github.com/eea/volto-tableau/compare/1.2.2...1.2.3) - 14 June 2021
269
295
 
270
296
  #### :hammer_and_wrench: Others
package/Jenkinsfile CHANGED
@@ -248,33 +248,33 @@ pipeline {
248
248
  }
249
249
  }
250
250
 
251
- stage('SonarQube compare to master') {
252
- when {
253
- anyOf {
254
- allOf {
255
- not { environment name: 'CHANGE_ID', value: '' }
256
- environment name: 'CHANGE_TARGET', value: 'develop'
257
- }
258
- allOf {
259
- environment name: 'CHANGE_ID', value: ''
260
- branch 'develop'
261
- not { changelog '.*^Automated release [0-9\\.]+$' }
262
- }
263
- }
264
- }
265
- steps {
266
- script {
267
- sh '''echo "Error" > checkresult.txt'''
268
- catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
269
- sh '''set -o pipefail; docker run -i --rm --pull always --name="$IMAGE_NAME-gitflow-sn" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_NAME="$GIT_NAME" eeacms/gitflow /checkSonarqubemaster.sh | grep -v "Found script" | tee checkresult.txt'''
270
- }
251
+ // stage('SonarQube compare to master') {
252
+ // when {
253
+ // anyOf {
254
+ // allOf {
255
+ // not { environment name: 'CHANGE_ID', value: '' }
256
+ // environment name: 'CHANGE_TARGET', value: 'develop'
257
+ // }
258
+ // allOf {
259
+ // environment name: 'CHANGE_ID', value: ''
260
+ // branch 'develop'
261
+ // not { changelog '.*^Automated release [0-9\\.]+$' }
262
+ // }
263
+ // }
264
+ // }
265
+ // steps {
266
+ // script {
267
+ // sh '''echo "Error" > checkresult.txt'''
268
+ // catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
269
+ // sh '''set -o pipefail; docker run -i --rm --pull always --name="$IMAGE_NAME-gitflow-sn" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_NAME="$GIT_NAME" eeacms/gitflow /checkSonarqubemaster.sh | grep -v "Found script" | tee checkresult.txt'''
270
+ // }
271
271
 
272
- publishChecks name: 'SonarQube', title: 'Sonarqube Code Quality Check', summary: 'Quality check on the SonarQube metrics from branch develop, comparing it with the ones from master branch. No bugs are allowed',
273
- text: readFile(file: 'checkresult.txt'), conclusion: "${currentBuild.currentResult}",
274
- detailsURL: "${env.BUILD_URL}display/redirect"
275
- }
276
- }
277
- }
272
+ // publishChecks name: 'SonarQube', title: 'Sonarqube Code Quality Check', summary: 'Quality check on the SonarQube metrics from branch develop, comparing it with the ones from master branch. No bugs are allowed',
273
+ // text: readFile(file: 'checkresult.txt'), conclusion: "${currentBuild.currentResult}",
274
+ // detailsURL: "${env.BUILD_URL}display/redirect"
275
+ // }
276
+ // }
277
+ // }
278
278
 
279
279
  stage('Pull Request') {
280
280
  when {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-tableau",
3
- "version": "7.0.0",
3
+ "version": "7.0.1",
4
4
  "description": "@eeacms/volto-tableau: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -75,4 +75,4 @@
75
75
  "cypress:open": "make cypress-open",
76
76
  "prepare": "husky install"
77
77
  }
78
- }
78
+ }
@@ -51,8 +51,6 @@ const View = (props) => {
51
51
  }
52
52
  }, [id, isBlock, getContent, mode, tableau_vis_url, tableau_visualization]);
53
53
 
54
- const { figure_note = [], data_provenance = {} } = tableau_visualization;
55
-
56
54
  if (props.mode === 'edit' && !tableau_vis_url) {
57
55
  return <Message>Please select a tableau from block editor.</Message>;
58
56
  }
@@ -75,8 +73,6 @@ const View = (props) => {
75
73
  tableau_height,
76
74
  tableau_vis_url,
77
75
  }}
78
- figure_note={figure_note}
79
- sources={data_provenance?.data || []}
80
76
  />
81
77
  </PrivacyProtection>
82
78
  </div>
@@ -6,7 +6,7 @@ import sliderSVG from '@plone/volto/icons/slider.svg';
6
6
  export default (config) => {
7
7
  config.blocks.blocksConfig.embed_tableau_visualization = {
8
8
  id: 'embed_tableau_visualization',
9
- title: 'Embed EEA Tableau visualization',
9
+ title: 'Embed Dashboard (Tableau)',
10
10
  icon: sliderSVG,
11
11
  group: 'common',
12
12
  edit: EmbedTableauVisualizatonEdit,
@@ -89,20 +89,19 @@ const Tableau = forwardRef((props, ref) => {
89
89
  extraOptions = {},
90
90
  mode = 'view',
91
91
  screen = {},
92
- figure_note = [],
93
- sources,
94
92
  version = '2.8.0',
95
93
  setVizState,
96
94
  onChangeBlock,
97
95
  } = props;
98
96
  const {
97
+ data_provenance = {},
98
+ figure_note = [],
99
99
  autoScale = false,
100
100
  hideTabs = false,
101
101
  hideToolbar = false,
102
102
  sheetname = '',
103
103
  toolbarPosition = 'Top',
104
104
  breakpointUrls = [],
105
- tableau_vis_url,
106
105
  with_notes = true,
107
106
  with_sources = true,
108
107
  with_more_info = true,
@@ -317,14 +316,14 @@ const Tableau = forwardRef((props, ref) => {
317
316
  };
318
317
 
319
318
  const updateScale = () => {
320
- const tableauEl = vizEl.current.querySelector('iframe');
319
+ const iframe = vizEl.current.querySelector('iframe');
321
320
  const { sheetSize = {} } = viz.current.getVizSize() || {};
322
321
  const vizWidth = sheetSize?.minSize?.width || 1;
323
322
  const scale = Math.min(vizEl.current.clientWidth / vizWidth, 1);
324
- tableauEl.style.transform = `scale(${scale})`;
323
+ iframe.style.transform = `scale(${scale})`;
325
324
  window.requestAnimationFrame(() => {
326
325
  if (vizEl.current) {
327
- vizEl.current.style.height = `${scale * tableauEl.clientHeight}px`;
326
+ vizEl.current.style.height = `${scale * iframe.clientHeight}px`;
328
327
  }
329
328
  });
330
329
  };
@@ -441,9 +440,9 @@ const Tableau = forwardRef((props, ref) => {
441
440
  {loaded && (
442
441
  <div className={cx('visualization-toolbar', { mobile })}>
443
442
  <div className="left-col">
444
- {with_notes && <FigureNote note={figure_note || []} />}
445
- {with_sources && <Sources sources={sources} />}
446
- {with_more_info && <MoreInfo href={tableau_vis_url || data.url} />}
443
+ {with_notes && <FigureNote notes={figure_note || []} />}
444
+ {with_sources && <Sources sources={data_provenance?.data || []} />}
445
+ {with_more_info && <MoreInfo href={data['@id']} />}
447
446
  </div>
448
447
  <div className="right-col">
449
448
  {with_enlarge && loaded && (
@@ -463,9 +462,7 @@ const Tableau = forwardRef((props, ref) => {
463
462
  </Enlarge>
464
463
  )}
465
464
  {with_download && loaded && <Download viz={viz.current} />}
466
- {with_share && loaded && (
467
- <Share href={tableau_vis_url || data.url} />
468
- )}
465
+ {with_share && loaded && <Share href={data['@id']} />}
469
466
  </div>
470
467
  </div>
471
468
  )}
@@ -3,6 +3,7 @@ import { hasBlocksData } from '@plone/volto/helpers';
3
3
  import { Container } from 'semantic-ui-react';
4
4
  import config from '@plone/volto/registry';
5
5
  import RenderBlocks from '@plone/volto/components/theme/View/RenderBlocks';
6
+ import { pickMetadata } from '@eeacms/volto-embed/helpers';
6
7
  import Tableau from '@eeacms/volto-tableau/Tableau/Tableau';
7
8
 
8
9
  const VisualizationView = (props) => {
@@ -17,6 +18,7 @@ const VisualizationView = (props) => {
17
18
  <Tableau
18
19
  data={{
19
20
  ...tableau_visualization,
21
+ ...pickMetadata(content),
20
22
  with_notes: false,
21
23
  with_sources: false,
22
24
  with_more_info: false,
@@ -1,13 +1,14 @@
1
- import Tableau from '@eeacms/volto-tableau/Tableau/Tableau';
1
+ import { connect } from 'react-redux';
2
2
  import config from '@plone/volto/registry';
3
+ import { pickMetadata } from '@eeacms/volto-embed/helpers';
4
+ import Tableau from '@eeacms/volto-tableau/Tableau/Tableau';
3
5
 
4
- export default function VisualizationViewWidget(props) {
5
- const { value = {} } = props;
6
-
6
+ function VisualizationViewWidget(props) {
7
7
  return (
8
8
  <Tableau
9
9
  data={{
10
- ...value,
10
+ ...(props.value || {}),
11
+ ...pickMetadata(props.content),
11
12
  with_notes: false,
12
13
  with_sources: false,
13
14
  with_more_info: false,
@@ -21,3 +22,7 @@ export default function VisualizationViewWidget(props) {
21
22
  />
22
23
  );
23
24
  }
25
+
26
+ export default connect((state) => ({ content: state.content.data }))(
27
+ VisualizationViewWidget,
28
+ );
@@ -6,13 +6,19 @@ import configureStore from 'redux-mock-store';
6
6
  import VisualizationViewWidget from './VisualizationViewWidget';
7
7
 
8
8
  const mockStore = configureStore([]);
9
- const store = mockStore({});
9
+ const store = mockStore({
10
+ content: { data: {} },
11
+ });
10
12
 
11
13
  jest.mock('@plone/volto/components', () => ({
12
14
  Icon: ({ children }) => <img alt="incon">{children}</img>,
13
15
  Toast: ({ children }) => <p>{children}</p>,
14
16
  }));
15
17
 
18
+ jest.mock('@eeacms/volto-embed/helpers', () => ({
19
+ pickMetadata: (data) => data,
20
+ }));
21
+
16
22
  describe('VisualizationViewWidget', () => {
17
23
  it('should render the component', () => {
18
24
  const data = {