mirror of
https://git.rwth-aachen.de/acs/public/villas/web/
synced 2025-03-09 00:00:01 +01:00
Fix for flux container converter #211
This commit is contained in:
parent
e0b1ba41aa
commit
31ef67356d
13 changed files with 42 additions and 33 deletions
|
@ -52,6 +52,8 @@ import SimulationModel from './simulationmodel/simulation-model';
|
|||
import Users from './user/users';
|
||||
import User from './user/user';
|
||||
|
||||
import FluxContainerConverter from "./common/FluxContainerConverter";
|
||||
|
||||
import './styles/app.css';
|
||||
|
||||
class App extends React.Component {
|
||||
|
@ -169,6 +171,5 @@ class App extends React.Component {
|
|||
//<Route exact path="/simulations" component={Simulations} />
|
||||
//<Route path="/simulations/:simulation" component={Simulation} />
|
||||
|
||||
let fluxContainerConverter = require('./common/FluxContainerConverter');
|
||||
export default Container.create(fluxContainerConverter.convert(App));
|
||||
export default Container.create(FluxContainerConverter.convert(App));
|
||||
//DragDropContext(HTML5Backend)(Container.create(App));
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/// FluxContainerConverter.js
|
||||
/// This is an ugly workaround found here https://github.com/facebook/flux/issues/351 to make Flux Containers work with ES6
|
||||
|
||||
module.exports = {
|
||||
export default {
|
||||
convert: function(containerClass) {
|
||||
const tmp = containerClass;
|
||||
containerClass = function(...args) {
|
||||
|
|
|
@ -42,6 +42,8 @@ import SimulationModelStore from '../simulationmodel/simulation-model-store';
|
|||
import FileStore from '../file/file-store';
|
||||
import AppDispatcher from '../common/app-dispatcher';
|
||||
|
||||
import FluxContainerConverter from "../common/FluxContainerConverter";
|
||||
|
||||
import 'react-contexify/dist/ReactContexify.min.css';
|
||||
|
||||
class Dashboard extends React.Component {
|
||||
|
@ -419,5 +421,4 @@ class Dashboard extends React.Component {
|
|||
}
|
||||
}
|
||||
|
||||
let fluxContainerConverter = require('../common/FluxContainerConverter');
|
||||
export default Fullscreenable()(Container.create(fluxContainerConverter.convert(Dashboard), { withProps: true }));
|
||||
export default Fullscreenable()(Container.create(FluxContainerConverter.convert(Dashboard), { withProps: true }));
|
||||
|
|
|
@ -28,6 +28,8 @@ import UserStore from '../user/user-store';
|
|||
|
||||
import AppDispatcher from '../common/app-dispatcher';
|
||||
|
||||
import FluxContainerConverter from "../common/FluxContainerConverter";
|
||||
|
||||
class SelectFile extends React.Component {
|
||||
static getStores() {
|
||||
return [ FileStore, UserStore ];
|
||||
|
@ -148,5 +150,4 @@ class SelectFile extends React.Component {
|
|||
}
|
||||
}
|
||||
|
||||
let fluxContainerConverter = require('../common/FluxContainerConverter');
|
||||
export default Container.create(fluxContainerConverter.convert(SelectFile));
|
||||
export default Container.create(FluxContainerConverter.convert(SelectFile));
|
||||
|
|
|
@ -39,6 +39,8 @@ import ImportSimulationModelDialog from '../simulationmodel/import-simulation-mo
|
|||
import SimulatorAction from '../simulator/simulator-action';
|
||||
import DeleteDialog from '../common/dialogs/delete-dialog';
|
||||
|
||||
import FluxContainerConverter from "../common/FluxContainerConverter";
|
||||
|
||||
class Scenario extends React.Component {
|
||||
static getStores() {
|
||||
return [ ScenarioStore, SimulatorStore, SimulationModelStore, UserStore ];
|
||||
|
@ -293,5 +295,4 @@ class Scenario extends React.Component {
|
|||
}
|
||||
}
|
||||
|
||||
let fluxContainerConverter = require('../common/FluxContainerConverter');
|
||||
export default Container.create(fluxContainerConverter.convert(Scenario), { withProps: true });
|
||||
export default Container.create(FluxContainerConverter.convert(Scenario), { withProps: true });
|
||||
|
|
|
@ -37,6 +37,8 @@ import ImportScenarioDialog from './import-scenario';
|
|||
|
||||
import DeleteDialog from '../common/dialogs/delete-dialog';
|
||||
|
||||
import FluxContainerConverter from "../common/FluxContainerConverter";
|
||||
|
||||
class Scenarios extends Component {
|
||||
static getStores() {
|
||||
return [ ScenarioStore, UserStore ];
|
||||
|
@ -208,5 +210,4 @@ class Scenarios extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
let fluxContainerConverter = require('../common/FluxContainerConverter');
|
||||
export default Container.create(fluxContainerConverter.convert(Scenarios));
|
||||
export default Container.create(FluxContainerConverter.convert(Scenarios));
|
||||
|
|
|
@ -33,6 +33,8 @@ import SignalMapping from './signal-mapping';
|
|||
import EditableHeader from '../common/editable-header';
|
||||
import ParametersEditor from '../common/parameters-editor';
|
||||
|
||||
import FluxContainerConverter from "../common/FluxContainerConverter";
|
||||
|
||||
class SimulationModel extends React.Component {
|
||||
static getStores() {
|
||||
return [ SimulationModelStore, UserStore ];
|
||||
|
@ -168,5 +170,4 @@ class SimulationModel extends React.Component {
|
|||
}
|
||||
}
|
||||
|
||||
let fluxContainerConverter = require('../common/FluxContainerConverter');
|
||||
export default Container.create(fluxContainerConverter.convert(SimulationModel), { withProps: true });
|
||||
export default Container.create(FluxContainerConverter.convert(SimulationModel), { withProps: true });
|
||||
|
|
|
@ -26,6 +26,8 @@ import _ from 'lodash';
|
|||
|
||||
import SimulatorStore from './simulator-store';
|
||||
|
||||
import FluxContainerConverter from "../common/FluxContainerConverter";
|
||||
|
||||
class SelectSimulator extends React.Component {
|
||||
static getStores() {
|
||||
return [ SimulatorStore ];
|
||||
|
@ -85,5 +87,4 @@ class SelectSimulator extends React.Component {
|
|||
}
|
||||
}
|
||||
|
||||
let fluxContainerConverter = require('../common/FluxContainerConverter');
|
||||
export default Container.create(fluxContainerConverter.convert(SelectSimulator));
|
||||
export default Container.create(FluxContainerConverter.convert(SelectSimulator));
|
||||
|
|
|
@ -39,6 +39,8 @@ import ImportSimulatorDialog from './import-simulator';
|
|||
import SimulatorAction from './simulator-action';
|
||||
import DeleteDialog from '../common/dialogs/delete-dialog';
|
||||
|
||||
import FluxContainerConverter from "../common/FluxContainerConverter";
|
||||
|
||||
class Simulators extends Component {
|
||||
static getStores() {
|
||||
return [ UserStore, SimulatorStore ];
|
||||
|
@ -330,5 +332,4 @@ class Simulators extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
let fluxContainerConverter = require('../common/FluxContainerConverter');
|
||||
export default Container.create(fluxContainerConverter.convert(Simulators));
|
||||
export default Container.create(FluxContainerConverter.convert(Simulators));
|
||||
|
|
|
@ -33,6 +33,8 @@ import NotificationsDataManager from '../common/data-managers/notifications-data
|
|||
import AppDispatcher from '../common/app-dispatcher';
|
||||
import UserStore from './user-store';
|
||||
|
||||
import FluxContainerConverter from "../common/FluxContainerConverter";
|
||||
|
||||
class Login extends Component {
|
||||
static getStores() {
|
||||
return [ UserStore ];
|
||||
|
@ -97,5 +99,4 @@ class Login extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
let fluxContainerConverter = require('../common/FluxContainerConverter');
|
||||
export default Container.create(fluxContainerConverter.convert(Login));
|
||||
export default Container.create(FluxContainerConverter.convert(Login));
|
||||
|
|
|
@ -31,6 +31,8 @@ import UsersStore from './users-store';
|
|||
import Icon from '../common/icon';
|
||||
import EditOwnUserDialog from './edit-own-user'
|
||||
|
||||
import FluxContainerConverter from "../common/FluxContainerConverter";
|
||||
|
||||
|
||||
class User extends Component {
|
||||
static getStores() {
|
||||
|
@ -42,7 +44,7 @@ class User extends Component {
|
|||
|
||||
let sessionToken = UserStore.getState().token;
|
||||
let user = UserStore.getState().currentUser;
|
||||
|
||||
|
||||
|
||||
if(user === null) {
|
||||
AppDispatcher.dispatch({
|
||||
|
@ -75,7 +77,7 @@ class User extends Component {
|
|||
|
||||
if (data) {
|
||||
if(data.password === data.confirmpassword){
|
||||
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
type: 'users/start-own-edit',
|
||||
data: data,
|
||||
|
@ -91,7 +93,7 @@ class User extends Component {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -125,7 +127,7 @@ class User extends Component {
|
|||
<Col xs={3}> {this.state.user.role} </Col>
|
||||
</Row>
|
||||
|
||||
|
||||
|
||||
<Button onClick={() => this.setState({ editModal: true })}><Icon icon='edit' /> Edit</Button>
|
||||
|
||||
<EditOwnUserDialog show={this.state.editModal} onClose={(data) => this.closeEditModal(data)} user={this.state.modalData} />
|
||||
|
@ -137,8 +139,4 @@ class User extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
let fluxContainerConverter = require('../common/FluxContainerConverter');
|
||||
export default Container.create(fluxContainerConverter.convert(User));
|
||||
export default Container.create(FluxContainerConverter.convert(User));
|
||||
|
|
|
@ -35,6 +35,8 @@ import EditUserDialog from './edit-user';
|
|||
|
||||
import DeleteDialog from '../common/dialogs/delete-dialog';
|
||||
|
||||
import FluxContainerConverter from "../common/FluxContainerConverter";
|
||||
|
||||
class Users extends Component {
|
||||
static getStores() {
|
||||
return [ UserStore, UsersStore ];
|
||||
|
@ -94,7 +96,7 @@ class Users extends Component {
|
|||
|
||||
if (data) {
|
||||
if(data.password === data.confirmpassword){
|
||||
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
type: 'users/start-edit',
|
||||
data: data,
|
||||
|
@ -152,5 +154,4 @@ class Users extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
let fluxContainerConverter = require('../common/FluxContainerConverter');
|
||||
export default Container.create(fluxContainerConverter.convert(Users));
|
||||
export default Container.create(FluxContainerConverter.convert(Users));
|
||||
|
|
|
@ -48,6 +48,8 @@ import WidgetBox from './widgets/box';
|
|||
import WidgetHTML from './widgets/html';
|
||||
import WidgetTopology from './widgets/topology';
|
||||
|
||||
import FluxContainerConverter from "../common/FluxContainerConverter";
|
||||
|
||||
import '../styles/widgets.css';
|
||||
|
||||
class Widget extends React.Component {
|
||||
|
@ -177,5 +179,4 @@ class Widget extends React.Component {
|
|||
}
|
||||
}
|
||||
|
||||
let fluxContainerConverter = require('../common/FluxContainerConverter');
|
||||
export default Container.create(fluxContainerConverter.convert(Widget), { withProps: true });
|
||||
export default Container.create(FluxContainerConverter.convert(Widget), { withProps: true });
|
||||
|
|
Loading…
Add table
Reference in a new issue