Skip to content

Commit b89a59e

Browse files
committed
DDD
1 parent f4559eb commit b89a59e

File tree

9 files changed

+1007
-22
lines changed

9 files changed

+1007
-22
lines changed

EventBus.js

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,26 @@ eb.send = function (address, message, headers, callback) {
3131

3232
if (eb.state != EventBus.OPEN) {
3333

34-
console.log("EVENT_BUS_RECONNECTING");
35-
36-
eb = new EventBus('http://' + location.host + '/eventbus');
37-
38-
eb.onopen = () => {
39-
console.log("EVENT_BUS_RECONNECTED");
40-
send.call(eb, address, message, headers, callback);
41-
};
42-
43-
eb.onerror = () => {
44-
console.log("EVENT_BUS_RECONNECT_FAILED");
45-
window.alert("Disconnected from server. Please login again.");
46-
location.href = Uris.toAbsoluteUri(Uris.LOGIN_URI);
47-
callback(new Error("Invalid state error."), null);
48-
};
34+
//console.log("EVENT_BUS_RECONNECTING");
35+
//
36+
//eb = new EventBus('http://' + location.host + '/eventbus');
37+
//
38+
//eb.onopen = () => {
39+
// console.log("EVENT_BUS_RECONNECTED");
40+
// send.call(eb, address, message, headers, callback);
41+
//};
42+
//
43+
//eb.onerror = () => {
44+
// console.log("EVENT_BUS_RECONNECT_FAILED");
45+
// window.alert("Disconnected from server. Please login again.");
46+
// location.href = Uris.toAbsoluteUri(Uris.LOGIN_URI);
47+
// callback(new Error("Invalid state error."), null);
48+
//};
49+
50+
console.log("EVENT_BUS_RECONNECT_FAILED");
51+
window.alert("Disconnected from server. Please login again.");
52+
location.href = Uris.toAbsoluteUri(Uris.LOGIN_URI);
53+
callback(new Error("Invalid state error."), null);
4954

5055
return;
5156
}

Menu.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ class Menu extends React.Component {
4444
<IndexLink to={Uris.UNIT.BASE} activeClassName="active"
4545
className="list-group-item">View Units</IndexLink>
4646

47+
48+
<IndexLink to={Uris.SELL_INVENTORY_TRACK.CREATE} activeClassName="active"
49+
className="list-group-item">Sell Inventory Relation</IndexLink>
50+
4751
</div>
4852

4953
);

Uris.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ var Uris;
77
module.exports = Uris = {
88
BASE_URI: "/",
99
LOGIN_URI: '/login',
10+
SELL_INVENTORY_TRACK: {
11+
CREATE: '/sell-inventory-track/create',
12+
UPDATE: '/sell-inventory-track/update'
13+
},
1014
USER: {
1115
CREATE: '/user/create',
1216
VIEW: '/user/view/:id',

main.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ var LoginPage = require('./pages/Login');
4040

4141
var DashboardPage = require('./DashboardPage');
4242

43+
var TrackPage = require('./sell/SellTrackingSettings');
44+
4345
var Uris = require('./Uris');
4446

4547
//Create and initialize app when eventbus initialization complete.
@@ -48,7 +50,7 @@ document.addEventListener("EVENT_BUS_CONNECTED", function () {
4850

4951
ReactDom.render(
5052
<Router history={hashHistory}>
51-
53+
5254
<Route path={Uris.LOGIN_URI} component={LoginPage}/>
5355

5456
<Route path={Uris.BASE_URI} component={App}>
@@ -86,6 +88,8 @@ document.addEventListener("EVENT_BUS_CONNECTED", function () {
8688
<Route path={Uris.INVENTORY.ADD_REMOVE_EDIT_PRODUCTS} component={AddRemoveEditProducts}/>
8789
</Route>
8890

91+
<Route path={Uris.SELL_INVENTORY_TRACK.CREATE} component={TrackPage}/>
92+
8993
</Route>
9094
</Router>, document.getElementById('app'));
9195
});

0 commit comments

Comments
 (0)