Skip to content

Commit

Permalink
Merge pull request #57 from eea/develop
Browse files Browse the repository at this point in the history
fix default height
  • Loading branch information
avoinea authored Dec 5, 2023
2 parents 012f7f7 + c6a5bcc commit 64686f3
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ 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).

### [7.0.4](https://github.com/eea/volto-tableau/compare/7.0.3...7.0.4) - 5 December 2023

#### :hammer_and_wrench: Others

- fix tests [Miu Razvan - [`3a880ab`](https://github.com/eea/volto-tableau/commit/3a880aba0ff02bb568a1778e07b48b572472e44a)]
- fix default height [Miu Razvan - [`0eb7ebb`](https://github.com/eea/volto-tableau/commit/0eb7ebb7c5f702ffb3f0ae679b90f27ad7cbb080)]
### [7.0.3](https://github.com/eea/volto-tableau/compare/7.0.2...7.0.3) - 29 November 2023

#### :hammer_and_wrench: Others
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": "7.0.3",
"version": "7.0.4",
"description": "@eeacms/volto-tableau: Volto add-on",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ Array [
>
<div
className="tableau tableau-2.8.0"
style={Object {}}
style={
Object {
"height": "700px",
}
}
/>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ exports[`View should render the component 1`] = `
>
<div
className="tableau tableau-2.8.0"
style={Object {}}
style={
Object {
"height": "700px",
}
}
/>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/Tableau/Tableau.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function getHeight(height) {
if (asNumber) {
return `${height}px`;
}
return height;
return height || '700px';
}

const TableauDebug = ({ mode, data, vizState, url, version, clearData }) => {
Expand Down Expand Up @@ -438,7 +438,7 @@ const Tableau = forwardRef((props, ref) => {
clearData={clearData}
/>
<div
style={tableau_height ? { height: getHeight(tableau_height) } : {}}
style={{ height: getHeight(tableau_height) }}
className={cx('tableau', `tableau-${version}`, {
'tableau-autoscale': autoScale,
})}
Expand Down
16 changes: 14 additions & 2 deletions src/Views/VisualizationView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ import Tableau from '@eeacms/volto-tableau/Tableau/Tableau';
const VisualizationView = (props) => {
const { content = {} } = props;
const { tableau_visualization = {} } = content;
const { staticParameters = [] } = tableau_visualization;

const extraOptions = React.useMemo(() => {
const options = {};
staticParameters.forEach((parameter) => {
if (parameter.field && parameter.value) {
options[parameter.field] = parameter.value;
}
});
return options;
}, [staticParameters]);

return (
<Container id="page-document">
Expand All @@ -22,10 +33,11 @@ const VisualizationView = (props) => {
with_notes: false,
with_sources: false,
with_more_info: false,
with_share: false,
with_enlarge: false,
with_share: true,
with_enlarge: true,
with_download: true,
}}
extraOptions={extraOptions}
breakpoints={
config.blocks.blocksConfig.embed_tableau_visualization.breakpoints
}
Expand Down

0 comments on commit 64686f3

Please sign in to comment.