diff --git a/package.json b/package.json index a6fb16c45..152b5e015 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "@dhis2/d2-ui-rich-text": "^5.3.10", "@dhis2/d2-ui-sharing-dialog": "^5.3.10", "@dhis2/d2-ui-translation-dialog": "^5.3.10", - "@dhis2/data-visualizer-plugin": "^32.0.3", + "@dhis2/data-visualizer-plugin": "^33.0.2", "@dhis2/ui": "1.0.0-beta.15", "@dhis2/ui-core": "^1.1.3", "@material-ui/core": "^3.9.2", diff --git a/src/components/Item/VisualizationItem/Item.js b/src/components/Item/VisualizationItem/Item.js index c5b2cb2da..ed9940bb6 100644 --- a/src/components/Item/VisualizationItem/Item.js +++ b/src/components/Item/VisualizationItem/Item.js @@ -97,6 +97,8 @@ export class Item extends Component { super(props); this.d2 = context.d2; + + this.contentRef = React.createRef(); } async componentDidMount() { @@ -268,7 +270,7 @@ export class Item extends Component { ? { height: item.originalHeight - HEADER_HEIGHT - PADDING_BOTTOM, } - : { height: '100%' }; + : { height: this.contentRef.offsetHeight }; }; render() { @@ -285,6 +287,7 @@ export class Item extends Component {
(this.contentRef = ref)} > {this.state.configLoaded && this.getPluginComponent()}
diff --git a/src/components/Item/VisualizationItem/__tests__/__snapshots__/Item.spec.js.snap b/src/components/Item/VisualizationItem/__tests__/__snapshots__/Item.spec.js.snap index 68061e12a..66e9a0c1e 100644 --- a/src/components/Item/VisualizationItem/__tests__/__snapshots__/Item.spec.js.snap +++ b/src/components/Item/VisualizationItem/__tests__/__snapshots__/Item.spec.js.snap @@ -167,7 +167,7 @@ ShallowWrapper { "children": false, "className": "dashboard-item-content", }, - "ref": null, + "ref": [Function], "rendered": false, "type": "div", }, @@ -296,7 +296,7 @@ ShallowWrapper { "children": false, "className": "dashboard-item-content", }, - "ref": null, + "ref": [Function], "rendered": false, "type": "div", }, diff --git a/yarn.lock b/yarn.lock index 9b8e0c5bc..baba79383 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1096,13 +1096,13 @@ recompose "^0.26.0" rxjs "^5.5.7" -"@dhis2/data-visualizer-plugin@^32.0.3": - version "32.0.3" - resolved "https://registry.yarnpkg.com/@dhis2/data-visualizer-plugin/-/data-visualizer-plugin-32.0.3.tgz#70552cb7b4f3240d4eebb14f685788b49dd5d145" - integrity sha512-1aFTOz7KiCcEmyZNGJDjpdbIW2kUrQTXPTCGjHXFF8EorTXBPf4Avw+rEKajGuhlJ9f1+gCGr21BP6rQOgZOUA== +"@dhis2/data-visualizer-plugin@^33.0.2": + version "33.0.2" + resolved "https://registry.yarnpkg.com/@dhis2/data-visualizer-plugin/-/data-visualizer-plugin-33.0.2.tgz#d1387bf5d8c4f773e55ea8bfce5e5c52cb981f33" + integrity sha512-CnoI3H5tGIthFO7gAWt/GVWY/s4ziVg2AhRjue4vFKX6yC4UkvDq83wLm7xbKhaufTopL5/O95KRleXHLUGGBw== dependencies: "@material-ui/core" "^3.1.2" - d2-charts-api "32.0.1" + d2-charts-api "32.0.6" lodash-es "^4.17.11" react "^16.6.0" react-dom "^16.6.0" @@ -3601,10 +3601,10 @@ cyclist@~0.2.2: resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-0.2.2.tgz#1b33792e11e914a2fd6d6ed6447464444e5fa640" integrity sha1-GzN5LhHpFKL9bW7WRHRkRE5fpkA= -d2-charts-api@32.0.1: - version "32.0.1" - resolved "https://registry.yarnpkg.com/d2-charts-api/-/d2-charts-api-32.0.1.tgz#f402a5352a08fe3281a437652afc2dc8fd7fd22e" - integrity sha512-s6VlDLCkcjNluOXwUp1csa/6ZaNDBtbu9RWmaa8kb5gPpc1BDovwx0lE34FPrEUIefF5JNpisl3fwlrLrH592Q== +d2-charts-api@32.0.6: + version "32.0.6" + resolved "https://registry.yarnpkg.com/d2-charts-api/-/d2-charts-api-32.0.6.tgz#e733a5417a78186a0c4a9cce72bc616aa9dfbf79" + integrity sha512-pV+f+6oajrRcFn38Zo0m7arIcKUcMeQaGqkFLeg71YuGJC/iojEUQjhixPoTl+arHz+PTtok3o0nN73hKISU3Q== dependencies: d2-utilizr "0.2.13" d3-color "1.0.1"