Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

Commit

Permalink
Added Log out button, all login sessions cached (#16)
Browse files Browse the repository at this point in the history
* minor fixes

* idea for tomorrow

* rewrite authentication logic

* working error handling and display

* cached login session

* logout button complete

* set map maxZoom and default location (#14)

* fixed outdated tests

* update release script

Co-authored-by: Syed Murtaza Naqvi <[email protected]>
  • Loading branch information
JZ6 and smnaqvi authored Feb 28, 2020
1 parent 21738c6 commit 754622d
Show file tree
Hide file tree
Showing 12 changed files with 177 additions and 187 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules/
dist/
# .vscode/
coverage/
*key.json
*key.json
*.zip
release/
2 changes: 1 addition & 1 deletion configuration.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Real Time Map",
"supportEmail": "[email protected], [email protected]",
"version": "2.3.0",
"version": "v2.3.1",
"items": [
{
"icon": "dist/img/icon.png",
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{
"name": "real-time-map",
"version": "2.3.0",
"version": "v2.3.1",
"description": "The Real Time Dashboard project is an open source foundation for real time GPS, exception, and status tracking that will allow an organization to track their fleet data in real time or playback historical data on the map.",
"main": "server.js",
"scripts": {
"test": "jest --config=jest.config.json --coverage",
"test": "jest --config=jest.config.json --coverage",
"devStart": "sh dev.sh",
"devServer": "nodemon ./server.js",
"devBuild": "webpack --config webpack.dev.js --watch",
"build": "echo Building Version 2.3.0 && webpack --config webpack.prod.js && echo Version 2.3.0 built in dist folder.",
"start": "node ./server.js"
"build": "echo 'Building Version v2.3.1...' && webpack --config webpack.prod.js && echo 'Version v2.3.1 built into the dist folder.'",
"start": "node ./server.js",
"release":"npm i && npm run build && mkdir release && cp -avr -t release dist README.md configuration.json"
},
"repository": {
"type": "git",
Expand Down
3 changes: 1 addition & 2 deletions src/app-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ import { initView } from "./index";
import {
apiConfig,
userInfo
}
from "./dataStore/api-config";
} from "./dataStore/api-config";
import {
resetAnimationOnFocus,
resetTransitionAnimation
Expand Down
6 changes: 5 additions & 1 deletion src/components/map/map-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ export const mapModel = {
storage.map.closePopup();
});
storage.map.on("zoom", resetTransitionAnimation);

// set to default location if user does not allow locating.
const defautLocation = [43.515391, -79.684085];
storage.map.setView(defautLocation, 12);
},

addMapBoxTileLayer: map => {
Expand All @@ -55,7 +59,7 @@ export const mapModel = {
},

locateUserAndSetView() {
storage.map.locate({ setView: true });
storage.map.locate({ setView: true, maxZoom: 12 });
},

setMapToCompanyAddress() {
Expand Down
5 changes: 5 additions & 0 deletions src/components/map/map-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import { mapModel } from "./map-model";
import { progressBar } from "../progress-bar";
import { ProgressIndicatorComponent } from "../progress-bar/progress-indicator-component";
import { SnackBar } from "../snackbar/snackbar-component";
import {
apiConfig
} from "../../dataStore/api-config";
import storage from "../../dataStore";

export class MapView extends React.Component {
componentDidMount() {
Expand All @@ -13,6 +17,7 @@ export class MapView extends React.Component {
render() {
return (
<div id="RTM-Map-Container">
{storage.isStandAlone ? <button id="RTM-LogoutButton" onClick={() => { apiConfig.api.forget(); }}>Logout</button> : null}
<div id="RTM-Map">
<ProgressIndicatorComponent />
<button
Expand Down
Loading

0 comments on commit 754622d

Please sign in to comment.