From e4e9fce2df3bd74447fd99695c649f42977c51ba Mon Sep 17 00:00:00 2001 From: Sonja Happ Date: Wed, 13 May 2020 15:53:20 +0200 Subject: [PATCH] add TODOs in topology widget #214 --- src/widget/widgets/topology.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/widget/widgets/topology.js b/src/widget/widgets/topology.js index d9e5d82..65ccfbb 100644 --- a/src/widget/widgets/topology.js +++ b/src/widget/widgets/topology.js @@ -102,17 +102,21 @@ class WidgetTopology extends React.Component { } componentDidUpdate(prevProps: Readonly

, prevState: Readonly, snapshot: SS): void { - const file = this.props.files.find(file => file._id === this.props.widget.customProperties.file); + const file = this.props.files.find(file => file.id === this.props.widget.customProperties.file); + + // TODO the following code requires revision! + // TODO The model file is no longer stored on the local disc (config.publicPathBase and file.path are not available!). + // TODO It is part of the file store and needs to be taken from there. // Ensure model is requested only once or a different was selected if (prevProps.widget.customProperties.file !== this.props.widget.customProperties.file || (prevState.dashboardState === 'initial' && file)) { - this.setState({'dashboardState': 'loading' }); + this.setState({dashboardState: 'loading' }); if (file) { fetch(new Request('/' + config.publicPathBase + file.path)) .then( response => { if (response.status === 200) { - this.setState({'dashboardState': 'ready' }); + this.setState({dashboardState: 'ready' }); return response.text().then( contents => { if (this.svgElem) { let cimsvgInstance = new cimsvg(this.svgElem.current); @@ -152,7 +156,7 @@ class WidgetTopology extends React.Component { const miniatureProps = { miniaturePosition: "none", } - + const toolbarProps = { toolbarPosition: "none" }