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

#137138341 Game group chat feature #32

Open
wants to merge 5 commits into
base: development
Choose a base branch
from

Conversation

chinazor-allen
Copy link
Contributor

What does this PR do?

Implementation of group chat feature

Description of Task to be completed?

Allow users in a game to chat with one another

How should this be manually tested?

N/A

Any background context you want to provide?

N/A

What are the relevant pivotal tracker stories?

Users should be able to chat with the group while they are in a game.
As a registered user in a game I want to be able to chat with the other players so that I can communicate with other players and have a more enjoyable experience using the app.

Screenshots (if appropriate)

image

Questions:

N/A

@@ -66,5 +66,7 @@ console.log(' Express app started on port ' + port);

// Initializing logger
logger.init(app, passport, mongoose);
// expose ap

//expose app

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected space or tab after '//' in comment spaced-comment

@@ -147,6 +152,12 @@ angular.module('mean.system')
return game.curQuestion.numAnswers > 1 && $scope.pickedCards[0] === card.id;
};

$scope.isPlayer = function($index) {
$window.sessionStorage.setItem('Username', game.players[game.playerIndex].username);
$window.sessionStorage.setItem('Avatar', game.players[game.playerIndex].avatar);

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

@@ -147,6 +152,12 @@ angular.module('mean.system')
return game.curQuestion.numAnswers > 1 && $scope.pickedCards[0] === card.id;
};

$scope.isPlayer = function($index) {
$window.sessionStorage.setItem('Username', game.players[game.playerIndex].username);

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

@@ -147,6 +152,12 @@ angular.module('mean.system')
return game.curQuestion.numAnswers > 1 && $scope.pickedCards[0] === card.id;
};

$scope.isPlayer = function($index) {

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 makeAWishFacts = MakeAWishFactsService.getMakeAWishFacts();
$scope.makeAWishFact = makeAWishFacts.pop();

$scope.pickCard = function (card) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected indentation of 2 spaces but found 4 indent

$scope.hasPickedCards = false;
$scope.winningCardPicked = false;
$scope.showTable = false;
$scope.modalShown = false;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected indentation of 2 spaces but found 4 indent

.controller('GameController', ['$scope', 'game', '$timeout', '$http', '$location', 'MakeAWishFactsService', '$dialog', '$window', function ($scope, game, $timeout, $http, $location, MakeAWishFactsService, $dialog, $window) {
$scope.hasPickedCards = false;
$scope.winningCardPicked = false;
$scope.showTable = false;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected indentation of 2 spaces but found 4 indent

} else if (game.curQuestion.numAnswers === 2 &&
.controller('GameController', ['$scope', 'game', '$timeout', '$http', '$location', 'MakeAWishFactsService', '$dialog', '$window', function ($scope, game, $timeout, $http, $location, MakeAWishFactsService, $dialog, $window) {
$scope.hasPickedCards = false;
$scope.winningCardPicked = false;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected indentation of 2 spaces but found 4 indent

$scope.hasPickedCards = true;
} else if (game.curQuestion.numAnswers === 2 &&
.controller('GameController', ['$scope', 'game', '$timeout', '$http', '$location', 'MakeAWishFactsService', '$dialog', '$window', function ($scope, game, $timeout, $http, $location, MakeAWishFactsService, $dialog, $window) {
$scope.hasPickedCards = false;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected indentation of 2 spaces but found 4 indent

$scope.sendPickedCards();
$scope.hasPickedCards = true;
} else if (game.curQuestion.numAnswers === 2 &&
.controller('GameController', ['$scope', 'game', '$timeout', '$http', '$location', 'MakeAWishFactsService', '$dialog', '$window', function ($scope, game, $timeout, $http, $location, MakeAWishFactsService, $dialog, $window) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 2 exceeds the maximum line length of 160 max-len
Strings must use doublequote quotes

var msgElement = document.createElement('div');

msgElement.className = 'msg';
$('#results').append(msgAvatarElement).append(msgUsernameElement).append(msgTextElement);

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


var msgElement = document.createElement('div');

msgElement.className = 'msg';

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

// msgTextElement.append(`${msgUsernameElement.text()}: `);
msgTextElement.append(msg.text);

var msgElement = document.createElement('div');

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

msgAvatarElement.attr('src', msg.avatar);
var msgUsernameElement = $('<b />');
msgUsernameElement.html(msg.username);
var msgTextElement = $('<p />');

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

var msg = snapshot.val();
var msgAvatarElement = $("<img />");
msgAvatarElement.attr('src', msg.avatar);
var msgUsernameElement = $('<b />');

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

var msgAvatar = avatarInput;
var msgText = textInput.value;
// replace myFirebase.set(...); with the next line
database.ref('msg').push({ avatar: msgAvatar, username: msgUser, text: msgText });

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

const gameID = sessionStorage.getItem('gameID');
const usernameInput = sessionStorage.getItem('Username');
const avatarInput = sessionStorage.getItem('Avatar');
const textInput = document.querySelector('#text');

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

const database = firebase.database();
const gameID = sessionStorage.getItem('gameID');
const usernameInput = sessionStorage.getItem('Username');
const avatarInput = sessionStorage.getItem('Avatar');

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

$('#post').on('click', function () {
const database = firebase.database();
const gameID = sessionStorage.getItem('gameID');
const usernameInput = sessionStorage.getItem('Username');

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

link: function(scope, elem, attr) {
$('#post').on('click', function () {
const database = firebase.database();
const gameID = sessionStorage.getItem('gameID');

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

@coveralls
Copy link

coveralls commented Feb 28, 2017

Coverage Status

Coverage remained the same at 56.708% when pulling 787043d on Feature/Chat-137138341 into eafddb6 on development.

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

3 participants