Skip to content
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

Merged

Conversation

andela-fopara
Copy link
Contributor

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

andela-fopara and others added 30 commits January 26, 2017 00:57
…u-cfh into feature/Users-should-be-able-to-create/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
@@ -26,6 +26,10 @@ angular.module('mean.system')
.then(function (response) {
return response[0].data;
});
},
isAuthenticated: function () {

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!');

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!');

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!');

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) {

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();
}

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

}
});
};

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();
}
});

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();
}

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) {

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

.error((err) => {
var location = $location.path();
if (location === '/game-log') {
$scope.message = 'An unexpected error occurred!';

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') {

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';

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') {

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');

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) {

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
})

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

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) {

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;

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

@coveralls
Copy link

coveralls commented Feb 28, 2017

Coverage Status

Coverage decreased (-1.2%) to 56.708% when pulling cfbd482 on feature-leader-board-game-history-donation/137138345 into ad05dbc on development.

@andela-oadebayo andela-oadebayo merged commit eafddb6 into development Feb 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants