Commit f468b445 authored by Sonja Happ's avatar Sonja Happ
Browse files

Refactoring of js code base:

- Grouping js files based on the elements of the data model instead of parent js class
- All js files providing functionality for one element of the data model are now in one folder; this makes is easier to implement changes for one element in all affected files/ classes
- js files which are common to multiple elements are in the common folder
- The new structure is more in alignment with the new Go backend code base structure
- This commit does not contain any changes in functionality of the frontend
parent 982e5661
......@@ -19,9 +19,9 @@
* along with VILLASweb. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
import RestDataManager from './rest-data-manager';
import RestAPI from '../api/rest-api';
import AppDispatcher from '../app-dispatcher';
import RestDataManager from '../common/data-managers/rest-data-manager';
import RestAPI from '../common/api/rest-api';
import AppDispatcher from '../common/app-dispatcher';
class UsersDataManager extends RestDataManager {
constructor() {
......@@ -57,7 +57,7 @@ class UsersDataManager extends RestDataManager {
});
});
}
}
export default new UsersDataManager();
......@@ -19,9 +19,9 @@
* along with VILLASweb. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
import ArrayStore from './array-store';
import UsersDataManager from '../data-managers/users-data-manager';
import NotificationsDataManager from '../data-managers/notifications-data-manager';
import ArrayStore from '../common/array-store';
import UsersDataManager from './users-data-manager';
import NotificationsDataManager from '../common/data-managers/notifications-data-manager';
class UsersStore extends ArrayStore {
constructor() {
......
......@@ -23,17 +23,17 @@ import React, { Component } from 'react';
import { Container } from 'flux/utils';
import { Button } from 'react-bootstrap';
import AppDispatcher from '../app-dispatcher';
import UserStore from '../stores/user-store';
import UsersStore from '../stores/users-store';
import AppDispatcher from '../common/app-dispatcher';
import UserStore from './user-store';
import UsersStore from './users-store';
import Icon from '../components/icon';
import Table from '../components/table';
import TableColumn from '../components/table-column';
import NewUserDialog from '../components/dialogs/new-user';
import EditUserDialog from '../components/dialogs/edit-user';
import Icon from '../common/icon';
import Table from '../common/table';
import TableColumn from '../common/table-column';
import NewUserDialog from './new-user';
import EditUserDialog from './edit-user';
import DeleteDialog from '../components/dialogs/delete-dialog';
import DeleteDialog from '../common/dialogs/delete-dialog';
class Users extends Component {
static getStores() {
......@@ -140,5 +140,5 @@ class Users extends Component {
}
}
let fluxContainerConverter = require('./FluxContainerConverter');
let fluxContainerConverter = require('../common/FluxContainerConverter');
export default Container.create(fluxContainerConverter.convert(Users));
......@@ -22,7 +22,7 @@
import React from 'react';
import { FormGroup, FormControl, FormLabel } from 'react-bootstrap';
import Dialog from './dialog';
import Dialog from '../common/dialogs/dialog';
class EditVisualizationDialog extends React.Component {
valid: false;
......
......@@ -22,7 +22,7 @@
import React from 'react';
import { FormGroup, FormControl, FormLabel } from 'react-bootstrap';
import Dialog from './dialog';
import Dialog from '../common/dialogs/dialog';
class ImportVisualizationDialog extends React.Component {
valid = false;
......
......@@ -22,7 +22,7 @@
import React from 'react';
import { FormGroup, FormControl, FormLabel } from 'react-bootstrap';
import Dialog from './dialog';
import Dialog from '../common/dialogs/dialog';
class NewVisualzationDialog extends React.Component {
valid: false;
......
......@@ -22,7 +22,7 @@
import React from 'react';
import { DragSource } from 'react-dnd';
import classNames from 'classnames';
import Icon from './icon';
import Icon from '../common/icon';
const toolboxItemSource = {
beginDrag(props) {
......
......@@ -19,7 +19,7 @@
* along with VILLASweb. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
import ArrayStore from './array-store';
import VisualizationsDataManager from '../data-managers/visualizations-data-manager';
import ArrayStore from '../common/array-store';
import VisualizationsDataManager from './visualizations-data-manager';
export default new ArrayStore('visualizations', VisualizationsDataManager);
......@@ -27,23 +27,23 @@ import Fullscreenable from 'react-fullscreenable';
import Slider from 'rc-slider';
import classNames from 'classnames';
import Icon from '../components/icon';
import WidgetFactory from '../components/widget-factory';
import ToolboxItem from '../components/toolbox-item';
import Dropzone from '../components/dropzone';
import Widget from './widget';
import EditWidget from '../components/dialogs/edit-widget';
import Grid from '../components/grid';
import UserStore from '../stores/user-store';
import VisualizationStore from '../stores/visualization-store';
import ProjectStore from '../stores/project-store';
import SimulationStore from '../stores/simulation-store';
import SimulationModelStore from '../stores/simulation-model-store';
import FileStore from '../stores/file-store';
import AppDispatcher from '../app-dispatcher';
import NotificationsDataManager from '../data-managers/notifications-data-manager';
import NotificationsFactory from '../data-managers/notifications-factory';
import Icon from '../common/icon';
import WidgetFactory from '../widget/widget-factory';
import ToolboxItem from './toolbox-item';
import Dropzone from './dropzone';
import Widget from '../widget/widget';
import EditWidget from '../widget/edit-widget';
import Grid from './grid';
import UserStore from '../user/user-store';
import VisualizationStore from './visualization-store';
import ProjectStore from '../project/project-store';
import SimulationStore from '../simulation/simulation-store';
import SimulationModelStore from '../simulationmodel/simulation-model-store';
import FileStore from '../file/file-store';
import AppDispatcher from '../common/app-dispatcher';
import NotificationsDataManager from '../common/data-managers/notifications-data-manager';
import NotificationsFactory from '../common/data-managers/notifications-factory';
import 'react-contexify/dist/ReactContexify.min.css';
......@@ -547,5 +547,5 @@ class Visualization extends React.Component {
}
}
let fluxContainerConverter = require('./FluxContainerConverter');
let fluxContainerConverter = require('../common/FluxContainerConverter');
export default Fullscreenable()(Container.create(fluxContainerConverter.convert(Visualization), { withProps: true }));
......@@ -19,6 +19,6 @@
* along with VILLASweb. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
import RestDataManager from './rest-data-manager';
import RestDataManager from '../common/data-managers/rest-data-manager';
export default new RestDataManager('visualization', '/visualizations');
......@@ -23,9 +23,9 @@ import React from 'react';
import { FormGroup, FormLabel, Button } from 'react-bootstrap';
import Icon from '../icon';
import Table from '../table';
import TableColumn from '../table-column';
import Icon from '../common/icon';
import Table from '../common/table';
import TableColumn from '../common/table-column';
class EditWidgetColorZonesControl extends React.Component {
constructor(props) {
......
......@@ -22,7 +22,7 @@
import React from 'react';
import { FormGroup, FormControl, FormLabel, Button, ProgressBar } from 'react-bootstrap';
import AppDispatcher from '../../app-dispatcher';
import AppDispatcher from '../common/app-dispatcher';
class EditImageWidgetControl extends React.Component {
constructor(props) {
......@@ -50,7 +50,7 @@ class EditImageWidgetControl extends React.Component {
formData.append(key, this.state.fileList[key]);
}
}
// upload files
AppDispatcher.dispatch({
type: 'files/start-upload',
......
Supports Markdown
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