Skip to content
This repository has been archived by the owner on Oct 9, 2019. It is now read-only.

2.20 Release #255

Open
wants to merge 93 commits into
base: master
Choose a base branch
from
Open

2.20 Release #255

wants to merge 93 commits into from

Conversation

whitef0x0
Copy link
Member

@whitef0x0 whitef0x0 commented Nov 6, 2017

This is the PR for the 2.20 Release

Description

The 2.20 Release includes the following changes:

  • Bug affecting slow loading of forms due to high visitor counts is fixed
  • Field Statistics are Removed from Analytics View
  • Email Notifications for respondents and form owner added
  • Static URL mapping for each admin panel added
  • Coveralls.io support is added for Github PRs
  • Missing translations for German, Italian and French added
  • Welcome/Verification emails internationalized into German, Italian, French, English and Spanish
  • Template engine moved from swig to pug
  • Test coverage increased from 40% to 60% (mainly due to increase tests for user controller/model)
  • Broken tests on client and server-side updated and fixed
  • Submission data fetch delayed to increase form admin page rendering performance
  • API Route tests added

Motivation and Context

This is the next stable release for TellForm. It incorporates a few new features (most notably email notifications) and some performance enhancements for the web app.

How Has This Been Tested?

This has been tested with server-side, client-side and manual tests (see below for manual test plans).

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 421d3b5 on 2.20 into ** on master**.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 1f9a0ed on 2.20 into ** on master**.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 09d430a on 2.20 into ** on master**.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 15a508c on 2.20 into ** on master**.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 9d51608 on 2.20 into ** on master**.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 499f2c9 on 2.20 into ** on master**.

Fix incorrect responses count for form list view
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 49141e6 on 2.20 into ** on master**.

'private_form': ['__v'],
'public_user': ['passwordHash', 'password', 'provider', 'salt', 'lastModified', 'created', 'resetPasswordToken', 'resetPasswordExpires', 'token', 'apiKey', '__v'],
'private_user': ['passwordHash', 'password', 'provider', 'salt', 'resetPasswordToken', 'resetPasswordExpires', 'token', '__v']
};
Copy link
Member Author

Choose a reason for hiding this comment

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

These should be in defined as constants in constants.js`

'use strict';

module.exports = {
removeSensitiveModelData: function(type, object){
Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe model is a better name for object?

@@ -133,7 +134,7 @@ exports.signup = function(req, res) {

// new user created
if (newTempUser) {
const fn = pug.compileFile(__dirname + "/../../views/verification.email.view.pug");
const fn = pug.compileFile(__dirname + '/../../views/verification.email.view.pug');
Copy link
Member Author

Choose a reason for hiding this comment

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

Shouldn't need to define this twice in one function scope.

const fn = pug.compileFile(__dirname + "/../../views/templates/reset-password-email.server.view.pug");
res.locals['url'] = 'http://' + req.headers.host + '/auth/reset/' + token;
const fn = pug.compileFile(__dirname + '/../../views/templates/reset-password-email.server.view.pug');
res.locals.url = 'http://' + req.headers.host + '/auth/reset/' + token;
Copy link
Member Author

Choose a reason for hiding this comment

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

Should replace http:// with //

var domain = userEmail.split('@')[1];

var obfuscatedUser = user.substring(0, 1) + user.substring(1).replace(/./g, '*');
var obfuscatedUser = emailUsername.substring(0, 1) + emailUsername.substring(1).replace(/./g, '*');
Copy link
Member Author

Choose a reason for hiding this comment

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

Why is the regex in replace() required?

@@ -167,7 +166,7 @@ describe('Form Routes Unit tests', function() {
it(' > should not be able to create a Form if body is empty', function(done) {
loginSession.post('/forms')
.send({form: null})
.expect(400, {"message":"Invalid Input"})
.expect(400, {'message':'Invalid Input'})
Copy link
Member Author

Choose a reason for hiding this comment

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

This should be internationalized.

var currIndex = supportedLanguages.indexOf(preferredLanguages[i]);
var i, currIndex;
for (i = 0; i < preferredLanguages.length; i++) {
currIndex = supportedLanguages.indexOf(preferredLanguages[i]);
Copy link
Member Author

Choose a reason for hiding this comment

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

currIndex should be renamed to something more descriptive

if(currLanguage && currLanguage !== supportedLanguage || !currLanguage){
res.clearCookie('userLang');
res.cookie('userLang', supportedLanguage, { maxAge: 90000, httpOnly: true });
} else if(req.user && (!req.cookies.hasOwnProperty('userLang') || req.cookies.userLang !== req.user.language) ){
res.cookie('userLang', req.user.language, { maxAge: 90000, httpOnly: true });
Copy link
Member Author

Choose a reason for hiding this comment

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

userLang cookie settings should be stored in env/*.js

@@ -76,7 +75,7 @@ logger.getLogOptions = function getLogOptions() {
var _config = _.clone(config, true);
var configFileLogger = _config.log.fileLogger;

if (!_.has(_config, 'log.fileLogger.directoryPath') || !_.has(_config, 'log.fileLogger.fileName')) {
if (process.env.NODE_ENV !== 'test' && !_.has(_config, 'log.fileLogger.directoryPath') || !_.has(_config, 'log.fileLogger.fileName')) {
console.log('unable to find logging file configuration');
Copy link
Member Author

Choose a reason for hiding this comment

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

This should be fixed. The logger seems to never be able to find it's configuration.

}));

it('$scope.signin should sigin in user with valid credentials', inject(function(Auth) {

Copy link
Member Author

Choose a reason for hiding this comment

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

This test case should be removed.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 9ff247f on 2.20 into ** on master**.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling d8c5b00 on 2.20 into ** on master**.

@Sija
Copy link

Sija commented Oct 6, 2018

Hi, what's the status on this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
4 participants