From bfab0be2d906243b29b3dc05dd47dcf8d26e85ef Mon Sep 17 00:00:00 2001 From: Laura Fuentes Grau Date: Tue, 5 Nov 2019 14:56:40 +0100 Subject: [PATCH 1/5] wip #210 added query parameter 'param' --- src/common/api/rest-api.js | 1 + src/common/data-managers/rest-data-manager.js | 114 +++++++++++++----- src/user/edit-user.js | 4 +- 3 files changed, 84 insertions(+), 35 deletions(-) diff --git a/src/common/api/rest-api.js b/src/common/api/rest-api.js index 4fb5395..d515079 100644 --- a/src/common/api/rest-api.js +++ b/src/common/api/rest-api.js @@ -73,6 +73,7 @@ class RestAPI { } post(url, body, token) { + console.log(url); return new Promise(function (resolve, reject) { var req = request.post(url).send(body).timeout({ response: 5000 }); // Simple response start timeout (3s) diff --git a/src/common/data-managers/rest-data-manager.js b/src/common/data-managers/rest-data-manager.js index b667ac0..65b904d 100644 --- a/src/common/data-managers/rest-data-manager.js +++ b/src/common/data-managers/rest-data-manager.js @@ -52,7 +52,7 @@ class RestDataManager { return object; } - load(id, token = null) { + load(id, token = null,param = null) { if (id != null) { // load single object RestAPI.get(this.makeURL(this.url + '/' + id), token).then(response => { @@ -96,54 +96,102 @@ class RestDataManager { } } - add(object, token = null) { + add(object, token = null, param = null) { var obj = {}; obj[this.type] = this.filterKeys(object); - RestAPI.post(this.makeURL(this.url), obj, token).then(response => { - AppDispatcher.dispatch({ - type: this.type + 's/added', - data: response[this.type] + if (param === null) { + RestAPI.post(this.makeURL(this.url), obj, token).then(response => { + AppDispatcher.dispatch({ + type: this.type + 's/added', + data: response[this.type] + }); + }).catch(error => { + AppDispatcher.dispatch({ + type: this.type + 's/add-error', + error: error + }); }); - }).catch(error => { - AppDispatcher.dispatch({ - type: this.type + 's/add-error', - error: error + } + else{ + console.log("else was called in add"); + RestAPI.post(this.makeURL(this.url) + "?" + param, obj, token).then(response => { + AppDispatcher.dispatch({ + type: this.type + 's/added', + data: response[this.type] + }); + }).catch(error => { + AppDispatcher.dispatch({ + type: this.type + 's/add-error', + error: error + }); }); - }); + } } - remove(object, token = null) { - RestAPI.delete(this.makeURL(this.url + '/' + object.id), token).then(response => { - AppDispatcher.dispatch({ - type: this.type + 's/removed', - data: response[this.type], - original: object + remove(object, token = null, param = null) { + if (param === null) { + RestAPI.delete(this.makeURL(this.url + '/' + object.id), token).then(response => { + AppDispatcher.dispatch({ + type: this.type + 's/removed', + data: response[this.type], + original: object + }); + }).catch(error => { + AppDispatcher.dispatch({ + type: this.type + 's/remove-error', + error: error + }); }); - }).catch(error => { - AppDispatcher.dispatch({ - type: this.type + 's/remove-error', - error: error + } + else{ + RestAPI.delete(this.makeURL(this.url + '/' + object.id + '?' + param), token).then(response => { + AppDispatcher.dispatch({ + type: this.type + 's/removed', + data: response[this.type], + original: object + }); + }).catch(error => { + AppDispatcher.dispatch({ + type: this.type + 's/remove-error', + error: error + }); }); - }); + } } - update(object, token = null) { + update(object, token = null, param = null) { var obj = {}; obj[this.type] = this.filterKeys(object); - RestAPI.put(this.makeURL(this.url + '/' + object.id), obj, token).then(response => { - AppDispatcher.dispatch({ - type: this.type + 's/edited', - data: response[this.type] + if(param === null) { + RestAPI.put(this.makeURL(this.url + '/' + object.id), obj, token).then(response => { + AppDispatcher.dispatch({ + type: this.type + 's/edited', + data: response[this.type] + }); + }).catch(error => { + AppDispatcher.dispatch({ + type: this.type + 's/edit-error', + error: error + }); }); - }).catch(error => { - AppDispatcher.dispatch({ - type: this.type + 's/edit-error', - error: error + } + else{ + RestAPI.put(this.makeURL(this.url + '/' + object.id + '?' + param), obj, token).then(response => { + AppDispatcher.dispatch({ + type: this.type + 's/edited', + data: response[this.type] + }); + }).catch(error => { + AppDispatcher.dispatch({ + type: this.type + 's/edit-error', + error: error + }); }); - }); - } + } + } + }; export default RestDataManager; diff --git a/src/user/edit-user.js b/src/user/edit-user.js index 3427452..d60015b 100644 --- a/src/user/edit-user.js +++ b/src/user/edit-user.js @@ -121,8 +121,8 @@ class EditUserDialog extends React.Component { this.handleChange(e)} /> - Old Password - this.handleChange(e)} /> + Admin Password + this.handleChange(e)} /> Password From a7124c3a24890d1f4178b594c7d2d5ca580ef0a0 Mon Sep 17 00:00:00 2001 From: Laura Fuentes Grau Date: Sun, 10 Nov 2019 18:59:24 +0100 Subject: [PATCH 2/5] wip #210 frontend can now send url with query parameters to backend --- src/common/array-store.js | 17 ++++-- src/common/data-managers/rest-data-manager.js | 58 +++++++++++++++++-- 2 files changed, 64 insertions(+), 11 deletions(-) diff --git a/src/common/array-store.js b/src/common/array-store.js index 1d76845..bb00c3c 100644 --- a/src/common/array-store.js +++ b/src/common/array-store.js @@ -71,10 +71,10 @@ class ArrayStore extends ReduceStore { if (Array.isArray(action.data)) { action.data.forEach((id) => { - this.dataManager.load(id, action.token); + this.dataManager.load(id, action.token,action.param); }); } else { - this.dataManager.load(action.data, action.token); + this.dataManager.load(action.data, action.token,action.param); } return state; @@ -99,7 +99,7 @@ class ArrayStore extends ReduceStore { return super.reduce(state, action); case this.type + '/start-add': - this.dataManager.add(action.data, action.token); + this.dataManager.add(action.data, action.token,action.param); return state; case this.type + '/added': @@ -111,7 +111,7 @@ class ArrayStore extends ReduceStore { case this.type + '/start-remove': - this.dataManager.remove(action.data, action.token); + this.dataManager.remove(action.data, action.token,action.param); return state; case this.type + '/removed': @@ -133,11 +133,11 @@ class ArrayStore extends ReduceStore { return super.reduce(state, action); case this.type + '/start-edit': - this.dataManager.update(action.data, action.token); + this.dataManager.update(action.data, action.token,action.param); return state; case this.type + '/start-own-edit': - this.dataManager.update(action.data, action.token); + this.dataManager.update(action.data, action.token,action.param); return state; case this.type + '/edited': @@ -155,6 +155,11 @@ class ArrayStore extends ReduceStore { case this.type + '/edit-error': return state; + case 'exdashboard/querytest' : + console.log("querytest wurde aufgerufen"); + this.dataManager.update(action.data, action.token,action.param); + return state; + default: return state; } diff --git a/src/common/data-managers/rest-data-manager.js b/src/common/data-managers/rest-data-manager.js index 65b904d..33f2de6 100644 --- a/src/common/data-managers/rest-data-manager.js +++ b/src/common/data-managers/rest-data-manager.js @@ -53,9 +53,53 @@ class RestDataManager { } load(id, token = null,param = null) { + if (param === null) { + if (id != null) { + // load single object + RestAPI.get(this.makeURL(this.url + '/' + id), token).then(response => { + const data = this.filterKeys(response[this.type]); + + AppDispatcher.dispatch({ + type: this.type + 's/loaded', + data: data + }); + + if (this.onLoad != null) { + this.onLoad(data); + } + }).catch(error => { + AppDispatcher.dispatch({ + type: this.type + 's/load-error', + error: error + }); + }); + } else { + // load all objects + RestAPI.get(this.makeURL(this.url), token).then(response => { + const data = response[this.type + 's'].map(element => { + return this.filterKeys(element); + }); + + AppDispatcher.dispatch({ + type: this.type + 's/loaded', + data: data + }); + + if (this.onLoad != null) { + this.onLoad(data); + } + }).catch(error => { + AppDispatcher.dispatch({ + type: this.type + 's/load-error', + error: error + }); + }); + } + } + else{ if (id != null) { // load single object - RestAPI.get(this.makeURL(this.url + '/' + id), token).then(response => { + RestAPI.get(this.makeURL(this.url + '/' + id + '/' + param), token).then(response => { const data = this.filterKeys(response[this.type]); AppDispatcher.dispatch({ @@ -74,7 +118,7 @@ class RestDataManager { }); } else { // load all objects - RestAPI.get(this.makeURL(this.url), token).then(response => { + RestAPI.get(this.makeURL(this.url) + '/' + param, token).then(response => { const data = response[this.type + 's'].map(element => { return this.filterKeys(element); }); @@ -94,6 +138,8 @@ class RestDataManager { }); }); } + + } } add(object, token = null, param = null) { @@ -115,7 +161,7 @@ class RestDataManager { } else{ console.log("else was called in add"); - RestAPI.post(this.makeURL(this.url) + "?" + param, obj, token).then(response => { + RestAPI.post(this.makeURL(this.url) + "/" + param, obj, token).then(response => { AppDispatcher.dispatch({ type: this.type + 's/added', data: response[this.type] @@ -145,7 +191,7 @@ class RestDataManager { }); } else{ - RestAPI.delete(this.makeURL(this.url + '/' + object.id + '?' + param), token).then(response => { + RestAPI.delete(this.makeURL(this.url + '/' + object.id + '/' + param), token).then(response => { AppDispatcher.dispatch({ type: this.type + 's/removed', data: response[this.type], @@ -163,6 +209,7 @@ class RestDataManager { update(object, token = null, param = null) { var obj = {}; obj[this.type] = this.filterKeys(object); + console.log("wir haben den rdm erreicht!"); if(param === null) { RestAPI.put(this.makeURL(this.url + '/' + object.id), obj, token).then(response => { @@ -178,7 +225,8 @@ class RestDataManager { }); } else{ - RestAPI.put(this.makeURL(this.url + '/' + object.id + '?' + param), obj, token).then(response => { + console.log("here we have: " + this.url); + RestAPI.put(this.makeURL(this.url + '/' + object.id + '/' + param), obj, token).then(response => { AppDispatcher.dispatch({ type: this.type + 's/edited', data: response[this.type] From 700c64fc1fde42c722bbad4cb0a375ffd51c53a3 Mon Sep 17 00:00:00 2001 From: Laura Fuentes Grau Date: Tue, 12 Nov 2019 15:17:40 +0100 Subject: [PATCH 3/5] wip #210 fixed query parameters, added an example dashboard file for testing --- src/app.js | 2 + src/common/array-store.js | 5 - src/common/data-managers/rest-data-manager.js | 157 +++++++----------- src/common/menu-sidebar.js | 1 + src/dashboard/exdashboard.js | 66 ++++++++ 5 files changed, 125 insertions(+), 106 deletions(-) create mode 100644 src/dashboard/exdashboard.js diff --git a/src/app.js b/src/app.js index 92bb42c..a13b632 100644 --- a/src/app.js +++ b/src/app.js @@ -51,6 +51,7 @@ import Scenario from './scenario/scenario'; import SimulationModel from './simulationmodel/simulation-model'; import Users from './user/users'; import User from './user/user'; +import ExDashboard from './dashboard/exdashboard'; import './styles/app.css'; @@ -152,6 +153,7 @@ class App extends React.Component { + diff --git a/src/common/array-store.js b/src/common/array-store.js index bb00c3c..710ff94 100644 --- a/src/common/array-store.js +++ b/src/common/array-store.js @@ -155,11 +155,6 @@ class ArrayStore extends ReduceStore { case this.type + '/edit-error': return state; - case 'exdashboard/querytest' : - console.log("querytest wurde aufgerufen"); - this.dataManager.update(action.data, action.token,action.param); - return state; - default: return state; } diff --git a/src/common/data-managers/rest-data-manager.js b/src/common/data-managers/rest-data-manager.js index 33f2de6..e2418ac 100644 --- a/src/common/data-managers/rest-data-manager.js +++ b/src/common/data-managers/rest-data-manager.js @@ -52,11 +52,57 @@ class RestDataManager { return object; } + sendRequest(form, id, token, param, object = null, obj = null) { + switch (form) { + case 'load': + if (param === null) { + if (id != null) { + // load single object + return RestAPI.get(this.makeURL(this.url + '/' + id), token); + } else { + // load all objects + return RestAPI.get(this.makeURL(this.url), token); + } + } + else { + if (id != null) { + // load single object + return RestAPI.get(this.makeURL(this.url + '/' + id + '?' + param), token) + } else { + // load all objects + return RestAPI.get(this.makeURL(this.url) + '?' + param, token) + } + } + case 'add': + if (param === null) { + return RestAPI.post(this.makeURL(this.url), obj, token); + } else { + return RestAPI.post(this.makeURL(this.url) + "?" + param, obj, token); + } + case 'remove': + if (param === null) { + return RestAPI.delete(this.makeURL(this.url + '/' + object.id), token) + } + else { + return RestAPI.delete(this.makeURL(this.url + '/' + object.id + '?' + param)) + } + case 'update': + if (param === null) { + return RestAPI.put(this.makeURL(this.url + '/' + object.id), obj, token); + } + else { + return RestAPI.put(this.makeURL(this.url + '/' + object.id + '?' + param), obj, token); + } + default: + console.log("something went wrong"); + break; + } + } + load(id, token = null,param = null) { - if (param === null) { if (id != null) { // load single object - RestAPI.get(this.makeURL(this.url + '/' + id), token).then(response => { + this.sendRequest('load',id,token,param).then(response => { const data = this.filterKeys(response[this.type]); AppDispatcher.dispatch({ @@ -75,7 +121,7 @@ class RestDataManager { }); } else { // load all objects - RestAPI.get(this.makeURL(this.url), token).then(response => { + this.sendRequest('load',id,token,param).then(response => { const data = response[this.type + 's'].map(element => { return this.filterKeys(element); }); @@ -96,58 +142,13 @@ class RestDataManager { }); } } - else{ - if (id != null) { - // load single object - RestAPI.get(this.makeURL(this.url + '/' + id + '/' + param), token).then(response => { - const data = this.filterKeys(response[this.type]); - - AppDispatcher.dispatch({ - type: this.type + 's/loaded', - data: data - }); - - if (this.onLoad != null) { - this.onLoad(data); - } - }).catch(error => { - AppDispatcher.dispatch({ - type: this.type + 's/load-error', - error: error - }); - }); - } else { - // load all objects - RestAPI.get(this.makeURL(this.url) + '/' + param, token).then(response => { - const data = response[this.type + 's'].map(element => { - return this.filterKeys(element); - }); - - AppDispatcher.dispatch({ - type: this.type + 's/loaded', - data: data - }); - - if (this.onLoad != null) { - this.onLoad(data); - } - }).catch(error => { - AppDispatcher.dispatch({ - type: this.type + 's/load-error', - error: error - }); - }); - } - - } - } + add(object, token = null, param = null) { var obj = {}; obj[this.type] = this.filterKeys(object); - if (param === null) { - RestAPI.post(this.makeURL(this.url), obj, token).then(response => { + this.sendRequest('add',null,token,param,null,obj).then(response => { AppDispatcher.dispatch({ type: this.type + 's/added', data: response[this.type] @@ -158,26 +159,10 @@ class RestDataManager { error: error }); }); - } - else{ - console.log("else was called in add"); - RestAPI.post(this.makeURL(this.url) + "/" + param, obj, token).then(response => { - AppDispatcher.dispatch({ - type: this.type + 's/added', - data: response[this.type] - }); - }).catch(error => { - AppDispatcher.dispatch({ - type: this.type + 's/add-error', - error: error - }); - }); - } } remove(object, token = null, param = null) { - if (param === null) { - RestAPI.delete(this.makeURL(this.url + '/' + object.id), token).then(response => { + this.sendRequest('remove',null,token,param,object).then(response => { AppDispatcher.dispatch({ type: this.type + 's/removed', data: response[this.type], @@ -190,29 +175,12 @@ class RestDataManager { }); }); } - else{ - RestAPI.delete(this.makeURL(this.url + '/' + object.id + '/' + param), token).then(response => { - AppDispatcher.dispatch({ - type: this.type + 's/removed', - data: response[this.type], - original: object - }); - }).catch(error => { - AppDispatcher.dispatch({ - type: this.type + 's/remove-error', - error: error - }); - }); - } - } - + update(object, token = null, param = null) { var obj = {}; obj[this.type] = this.filterKeys(object); - console.log("wir haben den rdm erreicht!"); - if(param === null) { - RestAPI.put(this.makeURL(this.url + '/' + object.id), obj, token).then(response => { + this.sendRequest('update',null,token,param,object,obj).then(response => { AppDispatcher.dispatch({ type: this.type + 's/edited', data: response[this.type] @@ -224,21 +192,8 @@ class RestDataManager { }); }); } - else{ - console.log("here we have: " + this.url); - RestAPI.put(this.makeURL(this.url + '/' + object.id + '/' + param), obj, token).then(response => { - AppDispatcher.dispatch({ - type: this.type + 's/edited', - data: response[this.type] - }); - }).catch(error => { - AppDispatcher.dispatch({ - type: this.type + 's/edit-error', - error: error - }); - }); - } - } + + }; diff --git a/src/common/menu-sidebar.js b/src/common/menu-sidebar.js index 5f43425..be42a68 100644 --- a/src/common/menu-sidebar.js +++ b/src/common/menu-sidebar.js @@ -35,6 +35,7 @@ class SidebarMenu extends React.Component {
  • Home
  • Scenarios
  • Simulators
  • +
  • Example Dashboard
  • { this.props.currentRole === 'Admin' ?
  • User Management
  • : '' } diff --git a/src/dashboard/exdashboard.js b/src/dashboard/exdashboard.js new file mode 100644 index 0000000..54ab039 --- /dev/null +++ b/src/dashboard/exdashboard.js @@ -0,0 +1,66 @@ +import React, { Component } from 'react'; +import { Container } from 'flux/utils'; +import DashboardStore from './dashboard-store'; +import AppDispatcher from '../common/app-dispatcher'; +import Table from '../common/table'; +import TableColumn from '../common/table-column'; +import UserStore from '../user/user-store' + + + + + + + +class ExDashboard extends Component { + static getStores() { + return [ DashboardStore ]; + } + + static calculateState(prevState, props) { + prevState = prevState || {}; + + console.log("calculateState has been called"); + const dashboards = DashboardStore.getState(); + let tokenState = UserStore.getState().token; + console.log(dashboards); + + return{ + dashboards, + tokenState + } + + } + + componentDidMount() { + AppDispatcher.dispatch({ + type: 'dashboards/start-load', + token: this.state.tokenState, + param: 'scenarioID=1' + }); + } + + + + + render() { + + return ( +
    +

    Dashboards

    + + + + + +
    +
    + ); + } +} + + + + +let fluxContainerConverter = require('../common/FluxContainerConverter'); +export default Container.create(fluxContainerConverter.convert(ExDashboard)); From 36b97bc058c2a2eea722058649f22fde174db090 Mon Sep 17 00:00:00 2001 From: Laura Fuentes Grau Date: Mon, 18 Nov 2019 14:51:41 +0100 Subject: [PATCH 4/5] wip #210 added requestURL function to RestDataManager --- src/common/data-managers/rest-data-manager.js | 71 ++++++++----------- 1 file changed, 28 insertions(+), 43 deletions(-) diff --git a/src/common/data-managers/rest-data-manager.js b/src/common/data-managers/rest-data-manager.js index e2418ac..7fc3c98 100644 --- a/src/common/data-managers/rest-data-manager.js +++ b/src/common/data-managers/rest-data-manager.js @@ -52,57 +52,42 @@ class RestDataManager { return object; } - sendRequest(form, id, token, param, object = null, obj = null) { - switch (form) { - case 'load': - if (param === null) { - if (id != null) { - // load single object - return RestAPI.get(this.makeURL(this.url + '/' + id), token); - } else { - // load all objects - return RestAPI.get(this.makeURL(this.url), token); + requestURL(form, id, param, object = null){ + switch(form){ + case 'load/add': + if (param === null){ + if(id != null){ + return this.url + '/' + id; + } + else { + return this.makeURL(this.url); } } - else { - if (id != null) { - // load single object - return RestAPI.get(this.makeURL(this.url + '/' + id + '?' + param), token) - } else { - // load all objects - return RestAPI.get(this.makeURL(this.url) + '?' + param, token) + else{ + if(id != null){ + return this.url + '/' + id + '?' + param; + } + else { + return this.makeURL(this.url) + '?' + param } - } - case 'add': - if (param === null) { - return RestAPI.post(this.makeURL(this.url), obj, token); - } else { - return RestAPI.post(this.makeURL(this.url) + "?" + param, obj, token); } - case 'remove': - if (param === null) { - return RestAPI.delete(this.makeURL(this.url + '/' + object.id), token) + case 'remove/update': + if(param === null){ + return this.makeURL(this.url + '/' + object.id); } - else { - return RestAPI.delete(this.makeURL(this.url + '/' + object.id + '?' + param)) + else{ + return this.makeURL(this.url + '/' + object.id + '?' + param); } - case 'update': - if (param === null) { - return RestAPI.put(this.makeURL(this.url + '/' + object.id), obj, token); - } - else { - return RestAPI.put(this.makeURL(this.url + '/' + object.id + '?' + param), obj, token); - } - default: - console.log("something went wrong"); - break; + default: + console.log("something went wrong"); + break; } } load(id, token = null,param = null) { if (id != null) { // load single object - this.sendRequest('load',id,token,param).then(response => { + RestAPI.get(this.requestURL('load/add',id,param), token).then(response => { const data = this.filterKeys(response[this.type]); AppDispatcher.dispatch({ @@ -121,7 +106,7 @@ class RestDataManager { }); } else { // load all objects - this.sendRequest('load',id,token,param).then(response => { + RestAPI.get(this.requestURL('load/add',id,param), token).then(response => { const data = response[this.type + 's'].map(element => { return this.filterKeys(element); }); @@ -148,7 +133,7 @@ class RestDataManager { var obj = {}; obj[this.type] = this.filterKeys(object); - this.sendRequest('add',null,token,param,null,obj).then(response => { + RestAPI.post(this.requestURL('load/add',null,param), obj, token).then(response => { AppDispatcher.dispatch({ type: this.type + 's/added', data: response[this.type] @@ -162,7 +147,7 @@ class RestDataManager { } remove(object, token = null, param = null) { - this.sendRequest('remove',null,token,param,object).then(response => { + RestAPI.delete(this.requestURL('remove/update',null,param,object), token).then(response => { AppDispatcher.dispatch({ type: this.type + 's/removed', data: response[this.type], @@ -180,7 +165,7 @@ class RestDataManager { var obj = {}; obj[this.type] = this.filterKeys(object); - this.sendRequest('update',null,token,param,object,obj).then(response => { + RestAPI.put(this.requestURL('remove/update',null,param,object), obj, token).then(response => { AppDispatcher.dispatch({ type: this.type + 's/edited', data: response[this.type] From f379137ff2f66413f328164cfe8246ffb6050684 Mon Sep 17 00:00:00 2001 From: Laura Fuentes Grau Date: Tue, 19 Nov 2019 09:53:47 +0100 Subject: [PATCH 5/5] final state #210 query parameters added to RestDataManager --- src/app.js | 3 +- src/common/api/rest-api.js | 1 - src/common/menu-sidebar.js | 1 - src/dashboard/exdashboard.js | 66 ------------------------------------ src/user/user.js | 1 - 5 files changed, 1 insertion(+), 71 deletions(-) delete mode 100644 src/dashboard/exdashboard.js diff --git a/src/app.js b/src/app.js index a13b632..d4da58f 100644 --- a/src/app.js +++ b/src/app.js @@ -51,7 +51,7 @@ import Scenario from './scenario/scenario'; import SimulationModel from './simulationmodel/simulation-model'; import Users from './user/users'; import User from './user/user'; -import ExDashboard from './dashboard/exdashboard'; + import './styles/app.css'; @@ -153,7 +153,6 @@ class App extends React.Component { - diff --git a/src/common/api/rest-api.js b/src/common/api/rest-api.js index d515079..4fb5395 100644 --- a/src/common/api/rest-api.js +++ b/src/common/api/rest-api.js @@ -73,7 +73,6 @@ class RestAPI { } post(url, body, token) { - console.log(url); return new Promise(function (resolve, reject) { var req = request.post(url).send(body).timeout({ response: 5000 }); // Simple response start timeout (3s) diff --git a/src/common/menu-sidebar.js b/src/common/menu-sidebar.js index be42a68..5f43425 100644 --- a/src/common/menu-sidebar.js +++ b/src/common/menu-sidebar.js @@ -35,7 +35,6 @@ class SidebarMenu extends React.Component {
  • Home
  • Scenarios
  • Simulators
  • -
  • Example Dashboard
  • { this.props.currentRole === 'Admin' ?
  • User Management
  • : '' } diff --git a/src/dashboard/exdashboard.js b/src/dashboard/exdashboard.js deleted file mode 100644 index 54ab039..0000000 --- a/src/dashboard/exdashboard.js +++ /dev/null @@ -1,66 +0,0 @@ -import React, { Component } from 'react'; -import { Container } from 'flux/utils'; -import DashboardStore from './dashboard-store'; -import AppDispatcher from '../common/app-dispatcher'; -import Table from '../common/table'; -import TableColumn from '../common/table-column'; -import UserStore from '../user/user-store' - - - - - - - -class ExDashboard extends Component { - static getStores() { - return [ DashboardStore ]; - } - - static calculateState(prevState, props) { - prevState = prevState || {}; - - console.log("calculateState has been called"); - const dashboards = DashboardStore.getState(); - let tokenState = UserStore.getState().token; - console.log(dashboards); - - return{ - dashboards, - tokenState - } - - } - - componentDidMount() { - AppDispatcher.dispatch({ - type: 'dashboards/start-load', - token: this.state.tokenState, - param: 'scenarioID=1' - }); - } - - - - - render() { - - return ( -
    -

    Dashboards

    - - - - - -
    -
    - ); - } -} - - - - -let fluxContainerConverter = require('../common/FluxContainerConverter'); -export default Container.create(fluxContainerConverter.convert(ExDashboard)); diff --git a/src/user/user.js b/src/user/user.js index 74ac1a8..e35a148 100644 --- a/src/user/user.js +++ b/src/user/user.js @@ -71,7 +71,6 @@ class User extends Component { closeEditModal(data) { this.setState({ editModal: false }); - console.log(data); if (data) { if(data.password === data.confirmpassword){