Skip to content

Commit

Permalink
fix: pass static parameters to tableau in widget view
Browse files Browse the repository at this point in the history
  • Loading branch information
kreafox committed Nov 28, 2023
1 parent 685d0c4 commit 88a1911
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Widgets/VisualizationViewWidget.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
import React from 'react';
import { connect } from 'react-redux';
import config from '@plone/volto/registry';
import { pickMetadata } from '@eeacms/volto-embed/helpers';
import Tableau from '@eeacms/volto-tableau/Tableau/Tableau';

function VisualizationViewWidget(props) {
const { staticParameters = [] } = props.value;

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

return (
<Tableau
data={{
Expand All @@ -16,6 +29,7 @@ function VisualizationViewWidget(props) {
with_enlarge: true,
with_download: true,
}}
extraOptions={extraOptions}
breakpoints={
config.blocks.blocksConfig?.embed_tableau_visualization?.breakpoints
}
Expand Down

0 comments on commit 88a1911

Please sign in to comment.