Commit c7937486 authored by Sonja Happ's avatar Sonja Happ

remove logging, ? indicating start of parameter has to be contained in param

parent 33cc47c1
......@@ -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 {
});
});
}
};
......
......@@ -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 {
<WidgetContextMenu key={widgetKey} index={parseInt(widgetKey,10)} widget={widgets[widgetKey]} onEdit={this.editWidget} onDelete={this.deleteWidget} onChange={this.widgetChange} />
))}
</div>
</div>;
}
......@@ -493,4 +493,4 @@ class Dashboard extends React.Component {
let fluxContainerConverter = require('../common/FluxContainerConverter');
export default Fullscreenable()(Container.create(fluxContainerConverter.convert(Dashboard), { withProps: true }));
//<EditWidget sessionToken={this.state.sessionToken} show={this.state.editModal} onClose={this.closeEdit} widget={this.state.modalData} simulationModels={this.state.simulationModels} files={this.state.files} />
//onEdit={this.startEditing}
\ No newline at end of file
//onEdit={this.startEditing}
......@@ -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 (
<div className='section'>
<h1>Dashboards</h1>
<Table data={this.state.dashboards}>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment