-
Notifications
You must be signed in to change notification settings - Fork 3
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
#158457036 Send invites to player and control number of players #12
Conversation
1972fee
to
132d454
Compare
132d454
to
84bf260
Compare
84bf260
to
0602483
Compare
0602483
to
3062b4c
Compare
3062b4c
to
43d6215
Compare
43d6215
to
cf3bee5
Compare
public/js/services/global.js
Outdated
console.log('userDonated success', results); | ||
}); | ||
.then(function (results) { | ||
console.log('userDonated success', results); |
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.
Unexpected console statement no-console
public/js/services/game.js
Outdated
|
||
socket.on('gameFilledUp', function (data) { |
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.
'data' is defined but never used no-unused-vars
public/js/services/game.js
Outdated
var notificationQueue = []; | ||
var timeout = false; | ||
var self = this; | ||
var joinOverrideTimeout = 0; |
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.
'joinOverrideTimeout' is assigned a value but never used no-unused-vars
public/js/services/game.js
Outdated
|
||
var notificationQueue = []; | ||
var timeout = false; | ||
var self = this; |
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.
'self' is assigned a value but never used no-unused-vars
public/js/directives.js
Outdated
return { | ||
restrict: 'EA', | ||
link: function(scope, elem, attr) { | ||
link(scope, elem, attr) { |
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.
'attr' is defined but never used no-unused-vars
public/js/controllers/game.js
Outdated
angular.module('mean.system') | ||
.controller('GameController', ['$scope', 'game', '$timeout', '$location', 'MakeAWishFactsService', '$dialog', function ($scope, game, $timeout, $location, MakeAWishFactsService, $dialog) { | ||
.controller('GameController', ['$scope', '$http', '$q', 'game', '$timeout', '$location', 'MakeAWishFactsService', '$dialog', '$rootScope', ($scope, $http, $q, game, $timeout, $location, MakeAWishFactsService, $rootScope) => { |
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.
'$rootScope' is defined but never used no-unused-vars
public/js/controllers/auth.js
Outdated
localStorage.setItem('#cfhetusertoken', response.token); | ||
$location.path('/app'); | ||
}, (error) => { | ||
console.log(error); |
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.
Unexpected console statement no-console
public/js/controllers/auth.js
Outdated
localStorage.setItem('#cfhetusertoken', response.token); | ||
$location.path('/app'); | ||
}, (error) => { | ||
console.log(error); |
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.
Unexpected console statement no-console
public/css/common.scss
Outdated
-webkit-box-shadow: 0px 0px 0px 0px transparent !important; | ||
-moz-box-shadow: 0px 0px 0px 0px transparent !important; | ||
box-shadow: 0px 0px 0px 0px transparent !important; | ||
-webkit-border-radius: 8px !important; |
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.
Line should be indented 2 spaces, but was indented 4 spaces
!important should not be used
Avoid vendor prefixes.
public/css/common.scss
Outdated
.crDonateWidget { | ||
-webkit-box-shadow: 0px 0px 0px 0px transparent !important; | ||
-moz-box-shadow: 0px 0px 0px 0px transparent !important; | ||
box-shadow: 0px 0px 0px 0px transparent !important; |
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.
Line should be indented 2 spaces, but was indented 4 spaces
!important should not be used0px
should be written without units as 0
cf3bee5
to
ee2637b
Compare
}); | ||
}); | ||
|
||
after((done) => { |
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.
'after' is not defined no-undef
|
||
after(function(done) { | ||
done(); | ||
it('should be able to show an error when try to save without name', (done) => { |
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.
'it' is not defined no-undef
}); | ||
}); | ||
describe('Method Save', () => { | ||
it('should be able to save without problems', done => user.save((err) => { |
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.
'it' is not defined no-undef
}); | ||
}); | ||
}); | ||
describe('Method Save', () => { |
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.
'describe' is not defined no-undef
// The tests | ||
describe('<Unit Test>', () => { | ||
describe('Model User:', () => { | ||
before((done) => { |
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.
'before' is not defined no-undef
backend-test/user/model.js
Outdated
app = require('../../server'), | ||
mongoose = require('mongoose'), | ||
User = mongoose.model('User'); | ||
const should = require('should'); |
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.
'require' is not defined no-undef
@@ -0,0 +1,78 @@ | |||
import 'babel-polyfill'; |
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.
Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
@@ -0,0 +1,70 @@ | |||
import 'babel-polyfill'; |
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.
Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
public/js/services/game.js
Outdated
@@ -66,6 +66,10 @@ angular.module('mean.system') | |||
game.timeLimits = data.timeLimits; | |||
}); | |||
|
|||
socket.on('gameFilledUp', function (data) { |
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.
'data' is defined but never used no-unused-vars
config/socket/socket.js
Outdated
socket.join(game.gameID); | ||
socket.gameID = game.gameID; | ||
console.log(socket.id,'has joined newly created game',game.gameID); |
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.
Unexpected console statement no-console
- Implements receipt of jwt token on signup - Implements correct controller on signup/login page - Implements caching of data in browser [Finishes #158457035]
-setup api endpoint for finding users -setup api endpoint for sending email to users -create a nodemailer function for sending email -create an email and url validator -write test cases for finding players and sending email -modify angular game controller -added validation to search field by creating a directive -styled text field and buttons -etc [#158457036]
-setup materialize -modal design for less that 3 players -modal design for more than 11 players [#158457036]
-remove multiple modals -use reusable modal -add questions and answers to db -change maximum player limit to 12 -link start button modal to game [#158457036]
-removed submit button from search form -added search on key press -modify karma config for test [#158457036]
-modify request header from controller -add middleware to routes -modify auth verification [#158457036]
-resolve package-lock.json errors -change play as guest href -move files into view folder [#158457036]
- Add new modal - Emit socket event when max player limit is reached - refactor fireGame function [#158457036]
ee2637b
to
7b11fff
Compare
Pull Request Test Coverage Report for Build 195
💛 - Coveralls |
@@ -40,9 +42,11 @@ module.exports = (config) => { | |||
colors: true, | |||
|
|||
// level of logging | |||
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG | |||
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || |
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
@@ -4,13 +4,17 @@ import * as answers from '../app/controllers/answers'; | |||
import questions from '../app/controllers/questions'; | |||
import avatars from '../app/controllers/avatars'; | |||
import index from '../app/controllers/index'; | |||
import middleware from '../app/middleware/auth'; |
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 file extension for "../app/middleware/auth" import/extensions
import request from 'supertest'; | ||
import { expect } from 'chai'; | ||
import app from '../../server'; | ||
import { Tokenizer } from '../../app/helpers/tokenizer'; |
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 file extension for "../../app/helpers/tokenizer" import/extensions
@@ -0,0 +1,77 @@ | |||
import request from 'supertest'; | |||
import { expect } from 'chai'; | |||
import app from '../../server'; |
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 file extension for "../../server" import/extensions
@@ -0,0 +1,77 @@ | |||
import request from 'supertest'; | |||
import { expect } from 'chai'; |
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 file extension for "chai" import/extensions
@@ -0,0 +1,29 @@ | |||
import { expect } from 'chai'; | |||
import sendInvitationEmail from '../../app/helpers/sendInvitationEmail'; |
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 file extension for "../../app/helpers/sendInvitationEmail" import/extensions
@@ -0,0 +1,29 @@ | |||
import { expect } from 'chai'; |
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 file extension for "chai" import/extensions
app/middleware/auth.js
Outdated
const auth = (req, res, next) => { | ||
let token = req.headers.authorization || req.headers['x-access-token']; | ||
token = token.replace('Bearer ', ''); | ||
|
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
@@ -0,0 +1,39 @@ | |||
import jwt from 'jsonwebtoken'; |
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 file extension for "jsonwebtoken" import/extensions
if (error) { | ||
return console.log(error); | ||
} | ||
console.log('Message sent: %s', info.messageId); |
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.
Unexpected console statement no-console
7b11fff
to
9ce92b7
Compare
// send mail with defined transport object | ||
transporter.sendMail(mailOptions, (error, info) => { | ||
if (error) { | ||
return console.log(error); |
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.
Unexpected console statement no-console
app/helpers/sendInvitationEmail.js
Outdated
@@ -0,0 +1,56 @@ | |||
/* eslint no-useless-escape: 0 */ | |||
import nodemailer from 'nodemailer'; | |||
import IsUrl from 'is-url'; |
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 file extension for "is-url" import/extensions
app/helpers/sendInvitationEmail.js
Outdated
@@ -0,0 +1,56 @@ | |||
/* eslint no-useless-escape: 0 */ | |||
import nodemailer from 'nodemailer'; |
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 file extension for "nodemailer" import/extensions
* @description Controller for handling requests to '/api/auth/login', | ||
* returns token in response as JSON. | ||
* @param {object} passport - passport with all the startegies registered | ||
* @description Controller for handling requests to '/api/auth/login', |
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
@@ -44,6 +48,12 @@ const signin = (req, res) => { | |||
* @param {object} res - response object provided by express | |||
* @param {function} next - next function for passing the request to next handler | |||
* @description Controller for handling requests to '/api/auth/login', returns token in response as JSON. | |||
* @param {object} passport - passport with all the startegies registered | |||
* @description Controller for handling requests to '/api/auth/login', |
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
@@ -6,30 +8,32 @@ import mongoose from 'mongoose'; | |||
import passport from 'passport'; | |||
import avatarsList from './avatars'; | |||
import { Tokenizer } from '../helpers/tokenizer'; | |||
import sendInvitationEmail from '../helpers/sendInvitationEmail'; |
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 file extension for "../helpers/sendInvitationEmail" import/extensions
- Mock http request for angular - write unit test cases for controller methods - modified controller methods to return promise [Finishes #158457036]
9ce92b7
to
e7b10bd
Compare
What does this PR do?
This PR allows users to search for other users and send an invitation to these users. It also prevents a game start when the number of connected users is less than 3 and notifies the 13th user trying to join a game that the game slot is full.
Description of Task to be completed?
How should this be manually tested?
This PR can be tested using the review app link below
What are the relevant pivotal tracker stories?
[158457036]
Any background context you want to add?
Screenshots