Skip to content

Commit

Permalink
Merge pull request #32 from eea/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
avoinea authored Jun 13, 2023
2 parents 6e1bca2 + 7198922 commit 7865d2a
Show file tree
Hide file tree
Showing 44 changed files with 1,028 additions and 1,630 deletions.
21 changes: 14 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,25 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

### [4.0.0](https://github.com/eea/volto-tableau/compare/3.0.8...4.0.0) - 13 June 2023

#### :house: Internal changes


#### :hammer_and_wrench: Others

- update [Miu Razvan - [`02db357`](https://github.com/eea/volto-tableau/commit/02db357750d3c8d2db29b61af9e09c6880599089)]
- update [Miu Razvan - [`543312b`](https://github.com/eea/volto-tableau/commit/543312bcf7a7a8c385087f6c38717ba4effa938e)]
- prettier [Miu Razvan - [`f318c80`](https://github.com/eea/volto-tableau/commit/f318c800e6051b06053490a99c4f4923aa04c72d)]
- Prepeare 4.0.0 release -> require eea.api.dataconnector@4.7 [Miu Razvan - [`0a26f69`](https://github.com/eea/volto-tableau/commit/0a26f6980d3c35b7d2ac2c404a94abb0e9b89619)]
- refact: improve tableau + cleanup [Miu Razvan - [`6729fa0`](https://github.com/eea/volto-tableau/commit/6729fa0ebded7419d588bc87dc64bc2b47a9f572)]
- test: jest should look for addons in node_modules Refs #253277 [valentinab25 - [`0c63253`](https://github.com/eea/volto-tableau/commit/0c632532d6d1bd79fbc553af003f949788ca6303)]
- test: Fix test config, coverage Refs #253277 [valentinab25 - [`04f79a3`](https://github.com/eea/volto-tableau/commit/04f79a32af3463818768e6ce614245583faf2731)]
### [3.0.8](https://github.com/eea/volto-tableau/compare/3.0.7...3.0.8) - 18 May 2023

#### :bug: Bug Fixes

- fix: resolution for countup #252559 [Andrei Grigore - [`9851b63`](https://github.com/eea/volto-tableau/commit/9851b6335e710022d9402f659b2e3ec333130e2c)]
- fix: load screenshot of tableau in privacy protection #252559 [Andrei Grigore - [`fdc2f1b`](https://github.com/eea/volto-tableau/commit/fdc2f1b0cf0c212e5e14eefa721585686dff338d)]

#### :hammer_and_wrench: Others

Expand All @@ -26,7 +39,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### :hammer_and_wrench: Others

- Add Sonarqube tag using industry-frontend addons list [EEA Jenkins - [`f5deccd`](https://github.com/eea/volto-tableau/commit/f5deccd84372752908b300c5cfd78134818e5ce4)]
### [3.0.6](https://github.com/eea/volto-tableau/compare/3.0.5...3.0.6) - 30 January 2023

### [3.0.5](https://github.com/eea/volto-tableau/compare/3.0.4...3.0.5) - 26 January 2023
Expand Down Expand Up @@ -98,7 +110,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- Update commands.js [Nilesh - [`7c48437`](https://github.com/eea/volto-tableau/commit/7c4843780efb9b85a4728de73c00d831c1d8fdcf)]
- Update e2e.js [Nilesh - [`f67b45c`](https://github.com/eea/volto-tableau/commit/f67b45c170f58f8d0301192994226f173e4cb00a)]
- latest volto compatibility refs #154757 [nileshgulia1 - [`881ba48`](https://github.com/eea/volto-tableau/commit/881ba482dc9b82e7fdac16549d41e80a6d26b3de)]
- Add Sonarqube tag using marine-frontend addons list [EEA Jenkins - [`58e25df`](https://github.com/eea/volto-tableau/commit/58e25df2291add09670143bee54cde103ee835b9)]
### [1.3.0](https://github.com/eea/volto-tableau/compare/1.2.5...1.3.0) - 28 September 2022

#### :hammer_and_wrench: Others
Expand All @@ -112,15 +123,11 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- Use volto 16 alpha 14 [Miu Razvan - [`93641be`](https://github.com/eea/volto-tableau/commit/93641be4c2393f49008aff789400cf7c947949fd)]
- Revert volto-tableau group to common [Andrei Grigore - [`9d24c6d`](https://github.com/eea/volto-tableau/commit/9d24c6d2767fed6a840cddaee55dbd5cecb544b5)]
- Tableaugroup typo fix [Andrei Grigore - [`b0b5378`](https://github.com/eea/volto-tableau/commit/b0b5378a437043120a96c9e5e8802584145daa22)]
- Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`3234347`](https://github.com/eea/volto-tableau/commit/3234347e524cc0ed4918242f503fe9e7dba266b2)]
- Refs #142010 - Optimize Volto-addons gitflow pipelines [valentinab25 - [`d237e1c`](https://github.com/eea/volto-tableau/commit/d237e1c72817d7e68a3eb698563674d1514db24f)]
### [1.2.4](https://github.com/eea/volto-tableau/compare/1.2.3...1.2.4) - 25 October 2021

#### :hammer_and_wrench: Others

- Add Sonarqube tag using frontend addons list [EEA Jenkins - [`2b19679`](https://github.com/eea/volto-tableau/commit/2b19679e2c7bcdc83082d1c73a595eea8b86d14f)]
- Add Sonarqube tag using frontend addons list [EEA Jenkins - [`384ccae`](https://github.com/eea/volto-tableau/commit/384ccaebed8c414a5c90eb96c6ce0a2b091f249c)]
- Add Sonarqube tag using frontend addons list [EEA Jenkins - [`589258e`](https://github.com/eea/volto-tableau/commit/589258e9b3cbba9cee37c57bb85ca5b707bc65d7)]
### [1.2.3](https://github.com/eea/volto-tableau/compare/1.2.2...1.2.3) - 14 June 2021

#### :hammer_and_wrench: Others
Expand Down
2 changes: 2 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pipeline {
NAMESPACE = "@eeacms"
SONARQUBE_TAGS = "volto.eea.europa.eu,climate-energy.eea.europa.eu,forest.eea.europa.eu,biodiversity.europa.eu,water.europa.eu-freshwater,water.europa.eu-marine,industry.eea.europa.eu"
DEPENDENCIES = ""
VOLTO = ""
}

stages {
Expand Down Expand Up @@ -187,6 +188,7 @@ pipeline {
def nodeJS = tool 'NodeJS';
withSonarQubeEnv('Sonarqube') {
sh '''sed -i "s#/opt/frontend/my-volto-project/src/addons/${GIT_NAME}/##g" xunit-reports/coverage/lcov.info'''
sh '''sed -i "s#src/addons/${GIT_NAME}/##g" xunit-reports/coverage/lcov.info'''
sh "export PATH=${scannerHome}/bin:${nodeJS}/bin:$PATH; sonar-scanner -Dsonar.javascript.lcov.reportPaths=./xunit-reports/coverage/lcov.info,./cypress-coverage/coverage/lcov.info -Dsonar.sources=./src -Dsonar.projectKey=$GIT_NAME-$BRANCH_NAME -Dsonar.projectVersion=$BRANCH_NAME-$BUILD_NUMBER"
sh '''try=2; while [ \$try -gt 0 ]; do curl -s -XPOST -u "${SONAR_AUTH_TOKEN}:" "${SONAR_HOST_URL}api/project_tags/set?project=${GIT_NAME}-${BRANCH_NAME}&tags=${SONARQUBE_TAGS},${BRANCH_NAME}" > set_tags_result; if [ \$(grep -ic error set_tags_result ) -eq 0 ]; then try=0; else cat set_tags_result; echo "... Will retry"; sleep 60; try=\$(( \$try - 1 )); fi; done'''
}
Expand Down
4 changes: 2 additions & 2 deletions jest-addon.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ module.exports = {
'!src/**/*.d.ts',
],
moduleNameMapper: {
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
'@plone/volto/cypress': '<rootDir>/node_modules/@plone/volto/cypress',
'@plone/volto/babel': '<rootDir>/node_modules/@plone/volto/babel',
'@plone/volto/(.*)$': '<rootDir>/node_modules/@plone/volto/src/$1',
'@package/(.*)$': '<rootDir>/src/$1',
'@plone/volto-quanta/(.*)$': '<rootDir>/src/addons/volto-quanta/src/$1',
'@eeacms/(.*?)/(.*)$': '<rootDir>/src/addons/$1/src/$2',
'@eeacms/(.*?)/(.*)$': '<rootDir>/node_modules/@eeacms/$1/src/$2',
'@plone/volto-slate':
'<rootDir>/node_modules/@plone/volto/packages/volto-slate/src',
'~/(.*)$': '<rootDir>/src/$1',
'load-volto-addons':
'<rootDir>/node_modules/@plone/volto/jest-addons-loader.js',
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
},
transform: {
'^.+\\.js(x)?$': 'babel-jest',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eeacms/volto-tableau",
"version": "3.0.8",
"version": "4.0.0",
"description": "@eeacms/volto-tableau: Volto add-on",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
Expand Down
56 changes: 0 additions & 56 deletions src/Blocks/EmbedEEATableauBlock/Edit.jsx

This file was deleted.

74 changes: 0 additions & 74 deletions src/Blocks/EmbedEEATableauBlock/View.jsx

This file was deleted.

31 changes: 31 additions & 0 deletions src/Blocks/EmbedTableauVisualization/Edit.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React from 'react';
import BlockDataForm from '@plone/volto/components/manage/Form/BlockDataForm';
import { SidebarPortal } from '@plone/volto/components';
import View from './View';
import getSchema from './schema';

const Edit = (props) => {
const schema = React.useMemo(() => getSchema(props), [props]);

return (
<React.Fragment>
<View {...props} mode="edit" />
<SidebarPortal selected={props.selected}>
<BlockDataForm
block={props.block}
schema={schema}
title={schema.title}
onChangeField={(id, value) => {
props.onChangeBlock(props.block, {
...props.data,
[id]: value,
});
}}
formData={props.data}
/>
</SidebarPortal>
</React.Fragment>
);
};

export default Edit;
63 changes: 63 additions & 0 deletions src/Blocks/EmbedTableauVisualization/View.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import React from 'react';
import { PrivacyProtection } from '@eeacms/volto-embed';
import Tableau from '@eeacms/volto-tableau/Tableau/Tableau';

import { flattenToAppURL } from '@plone/volto/helpers';
import { getContent } from '@plone/volto/actions';

import { connect } from 'react-redux';
import { compose } from 'redux';

const View = (props) => {
const data = props.data;
const { data_provenance, tableau_visualization } =
props.tableau_visualization_data || {};
const tableau_vis_url = flattenToAppURL(data.tableau_vis_url || '');

React.useEffect(() => {
if (tableau_vis_url) {
props.getContent(tableau_vis_url, null, props.id);
}
// eslint-disable-next-line
}, [tableau_vis_url]);

return (
<div className="embed-container">
<PrivacyProtection
{...props}
data={{ ...data, url: tableau_visualization?.url }}
>
{!tableau_vis_url && (
<div>Please select a visualization from block editor.</div>
)}
{!!tableau_vis_url && (
<>
{!tableau_visualization?.url && props.mode === 'edit' && (
<div>Url is not set in the visualization</div>
)}
{!!tableau_visualization?.url && (
<Tableau
data={tableau_visualization}
with_sources={true}
with_download={true}
with_share={true}
sources={data_provenance.data || []}
/>
)}
</>
)}
</PrivacyProtection>
</div>
);
};

export default compose(
connect(
(state, props) => ({
tableau_visualization_data: state.content.subrequests?.[props.id]?.data,
}),
{
getContent,
},
),
)(React.memo(View));
30 changes: 30 additions & 0 deletions src/Blocks/EmbedTableauVisualization/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import EmbedTableauVisualizatonEdit from './Edit';
import EmbedTableauVisualizatonView from './View';

import sliderSVG from '@plone/volto/icons/slider.svg';

export default (config) => {
config.blocks.blocksConfig.embed_tableau_visualization = {
id: 'embed_tableau_visualization',
title: 'Embed EEA Tableau visualization',
icon: sliderSVG,
group: 'common',
edit: EmbedTableauVisualizatonEdit,
view: EmbedTableauVisualizatonView,
restricted: false,
mostUsed: false,
sidebarTab: 1,
blocks: {},
security: {
addPermission: [],
view: [],
},
breakpoints: {
desktop: [Infinity, 982],
tablet: [981, 768],
mobile: [767, 0],
},
};

return config;
};
Loading

0 comments on commit 7865d2a

Please sign in to comment.