-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#Registered users should be able to view a "game log" of past games/137138345 #34
#Registered users should be able to view a "game log" of past games/137138345 #34
Conversation
…u-cfh into feature/Users-should-be-able-to-create/start-a-new-game/137138327
…e/start-a-new-game/137138327
…/137138327' of https://github.com/andela/project-jiayou-cfh into feature/Users-should-be-able-to-create/start-a-new-game/137138327
…aram made t rue 137138327
@@ -26,6 +26,10 @@ angular.module('mean.system') | |||
.then(function (response) { | |||
return response[0].data; | |||
}); | |||
}, | |||
isAuthenticated: function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected method shorthand object-shorthand
} else { | ||
addToNotificationQueue('The czar is contemplating...'); | ||
addToNotificationQueue('Select TWO answers!'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strings must use doublequote quotes
addToNotificationQueue("Everyone's done. Choose the winner!"); | ||
addToNotificationQueue('You\'re the Card Czar! Please wait!'); | ||
} else if (game.curQuestion.numAnswers === 1) { | ||
addToNotificationQueue('Select an answer!'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strings must use doublequote quotes
@@ -154,54 +155,39 @@ angular.module('mean.system') | |||
} | |||
} else if (data.state === 'waiting for czar to decide') { | |||
if (game.czar === game.playerIndex) { | |||
addToNotificationQueue("Everyone's done. Choose the winner!"); | |||
addToNotificationQueue('You\'re the Card Czar! Please wait!'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strings must use doublequote quotes
if (newState || game.curQuestion !== data.curQuestion) { | ||
game.state = data.state; | ||
} | ||
if (newState || game.curQuestion !== data.curQuestion) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected indentation of 6 spaces but found 4 indent
if ($scope.links.length !== 4) { | ||
showDashboard(); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing spaces not allowed no-trailing-spaces
} | ||
}); | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing spaces not allowed no-trailing-spaces
else { | ||
removeDashBoard(); | ||
} | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected indentation of 9 spaces but found 8 indent
Trailing spaces not allowed no-trailing-spaces
.success(function (res) { | ||
if(res === true) { | ||
addDashBoard(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closing curly brace does not appear on the same line as the subsequent block brace-style
var showDashboard = function () { | ||
authService.isAuthenticated() | ||
.success(function (res) { | ||
if(res === true) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected space(s) after "if" keyword-spacing
…https://github.com/andela/project-jiayou-cfh into feature-leader-board-game-history-donation/137138345
.error((err) => { | ||
var location = $location.path(); | ||
if (location === '/game-log') { | ||
$scope.message = 'An unexpected error occurred!'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strings must use doublequote quotes
}) | ||
.error((err) => { | ||
var location = $location.path(); | ||
if (location === '/game-log') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strings must use doublequote quotes
} else { | ||
var location = $location.path(); | ||
if (location === '/game-log') { | ||
$scope.message = 'No games played yet'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strings must use doublequote quotes
$scope.histories = res; | ||
} else { | ||
var location = $location.path(); | ||
if (location === '/game-log') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strings must use doublequote quotes
* @returns{void} | ||
*/ | ||
$scope.gameLog = () => { | ||
var userEmail = localStorage.getItem('Email'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strings must use doublequote quotes
$http.post("/api/games", { | ||
JWT: jwt | ||
}) | ||
.success(function(res) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space before function parentheses space-before-function-paren
var games; | ||
$http.post("/api/games", { | ||
JWT: jwt | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected indentation of 6 spaces but found 8 indent
var jwt = localStorage.getItem("JWT"); | ||
var games; | ||
$http.post("/api/games", { | ||
JWT: jwt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected indentation of 8 spaces but found 10 indent
* contain all leaderboard data | ||
* @returns{void} | ||
*/ | ||
var getAllGames = function(output) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected a function declaration func-style
Missing space before function parentheses space-before-function-paren
} | ||
} | ||
} | ||
output["userNames"] = winnerObj; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
["userNames"] is better written in dot notation dot-notation
What does this PR do?
This PR creates the game log, leaderboard and donation log for the system. The donation log is yet to be linked with the backend, it's still just a static page.
How should this be manually tested?
This can be manually by running the app using npm start, signup and then sign in and checkout the dashboard menu.
Any background information context you want to provide?
The dependencies needed are added using their cdn links.
What are the relevant pivotal tracker stories?
Registered users should be able to view a a "game log" of past games - #137138345