diff --git a/js-frontend/gulpfile.babel.js b/js-frontend/gulpfile.babel.js index 05c98d1..15f1e53 100644 --- a/js-frontend/gulpfile.babel.js +++ b/js-frontend/gulpfile.babel.js @@ -20,7 +20,7 @@ gulp.task('dist', () => runSequence('dist:clean', 'dist:build', 'dist:index')); gulp.task('clean', ['dist:clean', 'serve:clean']); gulp.task('open', () => open('http://localhost:3000')); -gulp.task('export', () => runSequence('dist:clean', 'dist:build', 'dist:index', 'export:clean', 'export:copy')); +gulp.task('export', () => runSequence(/*'dist:clean', 'dist:build', 'dist:index',*/ 'export:clean', 'export:copy')); // Remove all built files gulp.task('serve:clean', cb => del('build', {dot: true}, cb)); @@ -78,11 +78,25 @@ gulp.task('dist:index', () => { gulp.task('serve:start', ['serve:static'], () => { const config = webpackConfig(true, 'build', PORT); + // https://webpack.github.io/docs/webpack-dev-server.html return new WebpackDevServer(webpack(config), { contentBase: 'build', publicPath: config.output.publicPath, watchDelay: 100, - historyApiFallback: true + historyApiFallback: true, + //proxy: { + // "*": "http://localhost:8080" + //} + + proxy: { + '/login' : { + target: 'http://localhost:8080' + }, + '/customers' : { + target: 'http://localhost:8080' + } + + } }) .listen(PORT, '0.0.0.0', (err) => { if (err) throw new $.util.PluginError('webpack-dev-server', err); diff --git a/js-frontend/package.json b/js-frontend/package.json index fe8a3b9..808451c 100644 --- a/js-frontend/package.json +++ b/js-frontend/package.json @@ -57,8 +57,10 @@ "react-loader": "^2.0.0", "react-pacomo": "^0.5.1", "react-redux": "^4.4.0", - "react-router": "^1.0.3", + "react-router": "^2.0.0-rc2", + "react-router-bootstrap": "^0.20.1", "react-router-redux": "^3.0.0", + "react-select": "^0.9.1", "redux": "^3.0.2", "redux-auth": "0.0.2", "redux-batched-subscribe": "^0.1.4", diff --git a/js-frontend/src/App.js b/js-frontend/src/App.js index d0e99c3..044c391 100644 --- a/js-frontend/src/App.js +++ b/js-frontend/src/App.js @@ -8,8 +8,8 @@ import { ReduxRouter} from "redux-router"; //import { Router, IndexRoute, Route, browserHistory } from 'react-router'; //import { syncHistory, routeReducer } from 'react-router-redux'; -import { Route, IndexRoute} from "react-router"; -import { configure, authStateReducer} from "redux-auth"; +import { Route, IndexRoute, Link, IndexLink} from "react-router"; +import { configure as reduxAuthConfigure, authStateReducer} from "redux-auth"; import { AuthGlobals } from "redux-auth/bootstrap-theme"; import { createStore, compose, applyMiddleware} from "redux"; @@ -25,8 +25,8 @@ import { pushState } from 'redux-router'; //import demoButtons from "./reducers/request-test-buttons"; //import demoUi from "./reducers/demo-ui"; -//import Container from "./views/partials/Container"; -//import Main from "./views/Main"; +import Container from "./components/partials/Container"; +import Main from "./views/Main"; import Account from "./views/Account"; import SignIn from "./views/SignIn"; import SignUp from "./views/SignUp"; @@ -34,11 +34,12 @@ import SignUp from "./views/SignUp"; // TODO: !!!! +// + class App extends React.Component { render() { return ( - {this.props.children} @@ -46,39 +47,6 @@ class App extends React.Component { } } -class Main extends React.Component { - render() { - return ( -
- Component: Main
- {this.props.children} -
- ); - } -} - -class GlobalComponents extends React.Component { - render() { - return ( -
- Component: GlobalComponents
- {this.props.children} -
- ); - } -} - -class Container extends React.Component { - render() { - return ( -
- Component: Container
- {this.props.children} -
- ); - } -} - export function initialize({cookies, isServer, currentLocation, userAgent} = {}) { const reducer = combineReducers({ @@ -179,7 +147,7 @@ export function initialize({cookies, isServer, currentLocation, userAgent} = {}) /** * The React Router 1.0 routes for both the server and the client. */ - return store.dispatch(configure([ + return store.dispatch(reduxAuthConfigure([ { default: { //apiUrl: __API_URL__ @@ -211,7 +179,7 @@ export function initialize({cookies, isServer, currentLocation, userAgent} = {}) cookies, isServer, currentLocation - })).then(({redirectPath, blank} = {}) => { + })).then(({ redirectPath, blank } = {}) => { // hack for material-ui server-side rendering. // see https://github.com/callemall/material-ui/pull/2007 if (userAgent) { @@ -224,6 +192,8 @@ export function initialize({cookies, isServer, currentLocation, userAgent} = {}) return