diff --git a/src/index.html b/src/index.html index 8c52c63..68ceb1e 100644 --- a/src/index.html +++ b/src/index.html @@ -3,6 +3,7 @@ Logistics Wizard + diff --git a/src/modules/demos.js b/src/modules/demos.js index 62a1ee9..dcc4003 100644 --- a/src/modules/demos.js +++ b/src/modules/demos.js @@ -13,6 +13,7 @@ export const END_DEMO_SESSION = 'demos/END_DEMO_SESSION'; export const GET_DEMO_SUCCESS = 'demos/GET_DEMO_SUCCESS'; export const LOGIN = 'demos/LOGIN'; export const LOGIN_SUCCESS = 'demos/LOGIN_SUCCESS'; +export const LOGOUT_SUCCESS = 'demos/LOGOUT_SUCCESS'; export const demoSelector = state => state.demoSession; @@ -60,10 +61,15 @@ export const loginSuccess = ({ token, userid }) => ({ userid, }); +export const logoutSuccess = () => ({ + type: LOGOUT_SUCCESS, +}); + export const actions = { createDemoFailure, getDemoSuccess, loginSuccess, + logoutSuccess, }; // ------------------------------------ @@ -108,6 +114,8 @@ const ACTION_HANDLERS = { loggedIn: user.id === userid, })), }), + [LOGOUT_SUCCESS]: () => ({ + }), }; // ------------------------------------ @@ -177,6 +185,7 @@ export function *watchEndDemoSession() { const demoState = yield select(demoSelector); try { yield call(api.endDemo, demoState.guid); + yield put(logoutSuccess()); } catch (error) { console.log('Error during logout', error); diff --git a/src/modules/demos.test.js b/src/modules/demos.test.js index e438947..81edfd8 100644 --- a/src/modules/demos.test.js +++ b/src/modules/demos.test.js @@ -9,6 +9,7 @@ import { GET_DEMO_SUCCESS, LOGIN_SUCCESS, LOGIN, + LOGOUT_SUCCESS, getDemoSession, getDemoSuccess, login, @@ -17,6 +18,7 @@ import { demoSelector, watchGetDemoSession, watchLogin, + logoutSuccess, } from './demos'; @@ -40,6 +42,10 @@ test('(Constant) LOGIN_SUCCESS === "demos/LOGIN_SUCCESS"', t => { t.is(LOGIN_SUCCESS, 'demos/LOGIN_SUCCESS'); }); +test('(Constant) LOGOUT_SUCCESS === "demos/LOGOUT_SUCCESS"', t => { + t.is(LOGOUT_SUCCESS, 'demos/LOGOUT_SUCCESS'); +}); + test('(Action) getDemoSession', actionTest( getDemoSession, @@ -68,6 +74,13 @@ test('(Action) loginSuccess', { type: LOGIN_SUCCESS, token: { token: 'token' }, userid: 'userid' }) ); +test('(Action) logoutSuccess', + actionTest( + logoutSuccess, + { token: { token: 'token' }, userid: 'userid' }, + { type: LOGOUT_SUCCESS }) + ); + test('(Reducer) initializes with empty state', t => { t.deepEqual(demosReducer(undefined, {}), {}); }); diff --git a/src/routes/Dashboard/components/ForecastTile/ForecastTile.jsx b/src/routes/Dashboard/components/ForecastTile/ForecastTile.jsx index 4d88dba..0738ddf 100644 --- a/src/routes/Dashboard/components/ForecastTile/ForecastTile.jsx +++ b/src/routes/Dashboard/components/ForecastTile/ForecastTile.jsx @@ -9,6 +9,7 @@ import { TableRowColumn, } from 'material-ui/Table'; import LoadingSpinner from 'components/LoadingSpinner'; +import classes from './ForecastTile.scss'; const styles = { wrapper: { @@ -39,7 +40,14 @@ const ForecastTile = ({ weather }) => { {forecast.dow} + {forecast.day {forecast.day ? forecast.day.phrase_22char : forecast.night.phrase_22char} + )} diff --git a/src/routes/Dashboard/components/ForecastTile/ForecastTile.scss b/src/routes/Dashboard/components/ForecastTile/ForecastTile.scss index c8ee24a..7d46341 100644 --- a/src/routes/Dashboard/components/ForecastTile/ForecastTile.scss +++ b/src/routes/Dashboard/components/ForecastTile/ForecastTile.scss @@ -18,3 +18,8 @@ justify-content: center; align-items: center; } + +.weatherIcon { + width: 32px; + margin-right: 15px; +} diff --git a/src/routes/Dashboard/components/Map/MapMarker/MapMarker.scss b/src/routes/Dashboard/components/Map/MapMarker/MapMarker.scss index b212f79..cdbb1e7 100644 --- a/src/routes/Dashboard/components/Map/MapMarker/MapMarker.scss +++ b/src/routes/Dashboard/components/Map/MapMarker/MapMarker.scss @@ -1,3 +1,5 @@ +@import '~styles/base/colors'; + .distributionCenter, .retailer, .shipment { text-align: center; display: inline-block; @@ -12,8 +14,6 @@ width: 30px; height: 30px; margin: 1px; - border: 1px solid rgba(0,0,0,0); - border-radius: 15px; } &.selected div { @@ -26,7 +26,7 @@ // -------------------------------------------- .distributionCenter { color: #cc780f; - font-size: 16px; + font-size: 18px; & div i { padding-top: 6px; @@ -41,29 +41,34 @@ // -------------------------------------------- // Shipment // -------------------------------------------- + .shipment { - color: #749f67; - font-size: 16px; + color: $map3Primary; + font-size: 25px; + & div i { padding-top: 4px; } &:hover, &.selected { - background-color: #749f67; + background-color: $map3Primary; color: white; + width: 36px; + height: 35px; } } + // -------------------------------------------- // Retailer // -------------------------------------------- .retailer { - color: #ad3e9c; + color: $map2Primary; font-size: 24px; &:hover, &.selected { - background-color: #ad3e9c; + background-color: $map2Primary; color: white; } } diff --git a/src/routes/Dashboard/components/Map/PopUpCard/DCCard/DCCard.jsx b/src/routes/Dashboard/components/Map/PopUpCard/DCCard/DCCard.jsx index 1cfa322..69377e3 100644 --- a/src/routes/Dashboard/components/Map/PopUpCard/DCCard/DCCard.jsx +++ b/src/routes/Dashboard/components/Map/PopUpCard/DCCard/DCCard.jsx @@ -43,8 +43,11 @@ const DCCard = ({ address, contact, shipments, idToNameResolver }) => ( {shipments.map(shipment => ( - - {idToNameResolver.resolve('retailer', shipment.toId)} + + +   + {idToNameResolver.resolve('retailer', shipment.toId)} + {shipment.status} ))} diff --git a/src/routes/Dashboard/components/Map/PopUpCard/RetailerCard/RetailerCard.jsx b/src/routes/Dashboard/components/Map/PopUpCard/RetailerCard/RetailerCard.jsx index 273d64a..afc3bdb 100644 --- a/src/routes/Dashboard/components/Map/PopUpCard/RetailerCard/RetailerCard.jsx +++ b/src/routes/Dashboard/components/Map/PopUpCard/RetailerCard/RetailerCard.jsx @@ -74,8 +74,11 @@ export class RetailerCard extends React.PureComponent {
{shipments.map(shipment => ( - - {this.props.idToNameResolver.resolve('distributionCenter', shipment.fromId)} + + +   + {this.props.idToNameResolver.resolve('distributionCenter', shipment.fromId)} + {shipment.status} ))} diff --git a/src/routes/Dashboard/components/Map/PopUpCard/ShipmentCard/ShipmentCard.jsx b/src/routes/Dashboard/components/Map/PopUpCard/ShipmentCard/ShipmentCard.jsx index c391101..2cd32b1 100644 --- a/src/routes/Dashboard/components/Map/PopUpCard/ShipmentCard/ShipmentCard.jsx +++ b/src/routes/Dashboard/components/Map/PopUpCard/ShipmentCard/ShipmentCard.jsx @@ -34,9 +34,11 @@ export class ShipmentCard extends React.PureComponent { status, currentLocation, estimatedTimeOfArrival, - updatedAt, fromId, toId, + averageSpeed, + shipmentHumidity, + shipmentTemp, } = this.props.shipment; return ( @@ -67,9 +69,20 @@ export class ShipmentCard extends React.PureComponent { }
- Last Updated + Shipment Data +
+
+