From c7937486b2c186c9b9c516e1cfb441d9b7b4a6c7 Mon Sep 17 00:00:00 2001 From: Sonja Happ Date: Tue, 26 Nov 2019 14:26:42 +0100 Subject: [PATCH] remove logging, ? indicating start of parameter has to be contained in param --- src/common/data-managers/rest-data-manager.js | 18 ++++----- src/dashboard/dashboard.js | 40 +++++++++---------- src/dashboard/exdashboard.js | 16 ++++---- 3 files changed, 36 insertions(+), 38 deletions(-) diff --git a/src/common/data-managers/rest-data-manager.js b/src/common/data-managers/rest-data-manager.js index e928804..559d404 100644 --- a/src/common/data-managers/rest-data-manager.js +++ b/src/common/data-managers/rest-data-manager.js @@ -57,7 +57,6 @@ class RestDataManager { case 'load/add': if (param === null){ if(id != null){ - console.log("id != 0"); return this.makeURL(this.url + '/' + id); } else { @@ -66,10 +65,10 @@ class RestDataManager { } else{ if(id != null){ - return this.makeURL(this.url + '/' + id + '?' + param); + return this.makeURL(this.url + '/' + id + param); } else { - return this.makeURL(this.url + '?' + param) + return this.makeURL(this.url + param) } } case 'remove/update': @@ -77,7 +76,7 @@ class RestDataManager { return this.makeURL(this.url + '/' + object.id); } else{ - return this.makeURL(this.url + '/' + object.id + '?' + param); + return this.makeURL(this.url + '/' + object.id + param); } default: console.log("something went wrong"); @@ -87,11 +86,10 @@ class RestDataManager { load(id, token = null,param = null) { if (id != null) { - console.log("rdm load was called"); // load single object RestAPI.get(this.requestURL('load/add',id,param), token).then(response => { const data = this.filterKeys(response[this.type]); - + AppDispatcher.dispatch({ type: this.type + 's/loaded', data: data @@ -129,7 +127,7 @@ class RestDataManager { }); } } - + add(object, token = null, param = null) { var obj = {}; @@ -162,7 +160,7 @@ class RestDataManager { }); }); } - + update(object, token = null, param = null) { var obj = {}; obj[this.type] = this.filterKeys(object); @@ -179,8 +177,8 @@ class RestDataManager { }); }); } - - + + }; diff --git a/src/dashboard/dashboard.js b/src/dashboard/dashboard.js index 499d620..9ce23a8 100644 --- a/src/dashboard/dashboard.js +++ b/src/dashboard/dashboard.js @@ -61,35 +61,35 @@ class Dashboard extends React.Component { console.log("dashboard calculate state was called: " + props.match.params.dashboard); let dashboards = DashboardStore.getState() let rawDashboard = dashboards[props.match.params.dashboard - 1]; - - + + let str = JSON.stringify(rawDashboard, null, 4); console.log(str); if (rawDashboard != null) { dashboard = Map(rawDashboard); console.log("dashboard: " + dashboard); - // convert widgets list to a dictionary to be able to reference widgets + // convert widgets list to a dictionary to be able to reference widgets //let widgets = {}; let rawWidgets = WidgetStore.getState(); - + if(rawWidgets.length === 0){ AppDispatcher.dispatch({ type: 'widgets/start-load', token: sessionToken, - param: 'dashboardID=1' + param: '?dashboardID=1' }); } - + console.log("here are the widgets: "); console.log(rawWidgets); - + dashboard = dashboard.set('widgets', rawWidgets); console.log("") - + /* for(let widget of dashboard.get('widgets')){ console.log("load files got called") console.log(widget); @@ -100,9 +100,9 @@ class Dashboard extends React.Component { }); } */ - - - + + + //ist das überhaupt nötiG?? /* if (this.state.dashboard.has('id') === false) { AppDispatcher.dispatch({ @@ -112,14 +112,14 @@ class Dashboard extends React.Component { }); } */ - - + + /*if(Object.keys(widgets).length !== 0 ){ this.computeHeightWithWidgets(widgets); } - let selectedDashboards = dashboard; + let selectedDashboards = dashboard; /* this.setState({ dashboard: selectedDashboards, project: null }); @@ -141,10 +141,10 @@ class Dashboard extends React.Component { console.log("!! the widget key: "+ widgetKey); let thisWidget = widgets[widgetKey]; let thisWidgetHeight = thisWidget.y + thisWidget.height; - + return thisWidgetHeight > maxHeightSoFar? thisWidgetHeight : maxHeightSoFar; }, 0); - + console.log("now the object keys: "); console.log(Object.keys(widgets)); let simulationModels = []; @@ -198,7 +198,7 @@ class Dashboard extends React.Component { } } - + componentWillUnmount() { //document.removeEventListener('keydown', this.handleKeydown.bind(this)); @@ -251,7 +251,7 @@ class Dashboard extends React.Component { default: } } - + } /* * Adapt the area's height with the position of the new widget. @@ -484,7 +484,7 @@ class Dashboard extends React.Component { ))} - + ; } @@ -493,4 +493,4 @@ class Dashboard extends React.Component { let fluxContainerConverter = require('../common/FluxContainerConverter'); export default Fullscreenable()(Container.create(fluxContainerConverter.convert(Dashboard), { withProps: true })); // -//onEdit={this.startEditing} \ No newline at end of file +//onEdit={this.startEditing} diff --git a/src/dashboard/exdashboard.js b/src/dashboard/exdashboard.js index ee7a014..21c5615 100644 --- a/src/dashboard/exdashboard.js +++ b/src/dashboard/exdashboard.js @@ -18,7 +18,7 @@ class ExDashboard extends Component { static getStores() { return [ DashboardStore ]; } - + static calculateState(prevState, props) { prevState = prevState || {}; @@ -31,23 +31,23 @@ class ExDashboard extends Component { dashboards, tokenState } - + } - + componentDidMount() { AppDispatcher.dispatch({ type: 'dashboards/start-load', token: this.state.tokenState, - param: 'scenarioID=1' + param: '?scenarioID=1' }); } - + loadDash(){ console.log('bis hierhin gekommen'); AppDispatcher.dispatch({ type: 'dashboards/start-load', token: this.state.tokenState, - param: 'scenarioID=1' + param: '?scenarioID=1' }); } @@ -59,9 +59,9 @@ class ExDashboard extends Component { }; return ( - +
- +

Dashboards