merged with master

This commit is contained in:
David Baldwynn 2017-11-11 20:05:06 -08:00
commit 4f2682554d
14 changed files with 64 additions and 59 deletions

5
.gitignore vendored
View file

@ -1,14 +1,10 @@
dist
.vagrant
npm-debug.*
docs/Oscar_Credentials.md
scripts/test_oscarhost.js
scripts/oscarhost/private/
coverage/
e2e_coverage/
uploads/
app/e2e_tests/screeshots/*
tmp
# iOS / Apple
# ===========
@ -25,6 +21,7 @@ Oscar_Credentials.*
npm-debug.log
node_modules/
public/lib/
public/dist
app/tests/coverage/
.bower-*/
.idea/

View file

@ -4,7 +4,7 @@ TellForm 2.1.0
[![Build Status](https://travis-ci.org/tellform/tellform.svg?branch=master)](https://travis-ci.org/tellform/tellform)
![Project Status](https://img.shields.io/badge/status-2.1.0-green.svg)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/3491e86eb7194308b8fc80711d736ede)](https://www.codacy.com/app/david-baldwin/tellform?utm_source=github.com&utm_medium=referral&utm_content=tellform/tellform&utm_campaign=Badge_Grade)
[![Gitter](https://badges.gitter.im/tellform/tellform.svg)](https://gitter.im/tellform/tellform?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![Gitter](https://badges.gitter.im/tellform/Lobby.svg)](https://gitter.im/tellform/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
> An *opensource alternative to TypeForm* that can create [stunning mobile-ready forms](https://tellform.com/examples) , surveys and questionnaires.
@ -119,14 +119,7 @@ Your application should run on port 3000 or the port you specified in your .env
To deploy with docker, first install docker [here](https://docs.docker.com/engine/installation/).
Then run these commands
```
$ docker run -p 27017:27017 -d --name some-mongo mongo
$ docker run -p 127.0.0.1:6379:6379 -d --name some-redis redis
$ docker run --rm -p 3000:3000 --link some-redis:redis-db --link some-mongo:db -e "SUBDOMAINS_DISABLED=TRUE" -e "DISABLE_CLUSTER_MODE=TRUE" -e "MAILER_EMAIL_ID=<YourEmailAPI_ID>" -e "MAILER_FROM=<noreply@yourdomain.com>" -e "MAILER_SERVICE_PROVIDER=<YourEmailAPIProvider>" -e "MAILER_PASSWORD=<YourAPIKey>" -e "BASE_URL=localhost" -p 80:80 tellform/development
```
Then see this page [here](https://tellform.com/install_docker) for commands on how to deploy your own local TellForm instance.
## Testing Your Application
You can run the full test suite included with TellForm with the test task:
@ -201,7 +194,7 @@ TellForm's configuration is done with environment variables. To set an option fo
## Where to get help
[Gitter Chat](https://gitter.im/tellform/tellform)
[Gitter Chat](https://gitter.im/tellform/Lobby)
[Official Twitter](https://twitter.com/tellform_real)

View file

@ -28,5 +28,10 @@
"description": "Which mail service/API you will be using (i.e. SparkPost, Mandrill, etc)",
"value": "SendGrid"
}
},
"buildpacks": [
{
"url": "https://github.com/heroku/heroku-buildpack-nodejs#v111"
}
]
}

View file

@ -10,20 +10,8 @@ var mongoose = require('mongoose'),
timeStampPlugin = require('../libs/timestamp.server.plugin'),
path = require('path'),
querystring = require('querystring'),
nodemailer = require('nodemailer'),
constants = require('../libs/constants');
var smtpTransport = nodemailer.createTransport(config.mailer.options);
// verify connection configuration on startup
smtpTransport.verify(function(error, success) {
if (error) {
console.log('Your mail configuration is incorrect', error);
} else {
console.log('Mail server is ready to take our messages');
}
});
/**
* User Schema
*/

View file

@ -51,7 +51,7 @@ html(lang='en', xmlns='http://www.w3.org/1999/xhtml')
block content
script window.ga=function(){ga.q.push(arguments)};ga.q=[];ga.l=+new Date;ga('create','{{google_analytics_id}}','auto');ga('send','pageview')
script window.ga=function(){ga.q.push(arguments)};ga.q=[];ga.l=+new Date;ga('create','#{google_analytics_id}','auto');ga('send','pageview')
script(src='https://www.google-analytics.com/analytics.js', async='', defer='')

View file

@ -28,9 +28,8 @@ module.exports = {
domain: process.env.BASE_URL || '.tellform.com'
},
assets: {
bower_js: 'public/dist/vendor.min.js',
css: 'public/dist/application.min.css',
js: 'public/dist/application.min.js',
form_js: 'public/dist/form-application.min.js'
css: ['public/dist/application.min.css'],
js: ['public/dist/application.min.js', 'public/dist/populate_template_cache.js'],
form_js: ['public/dist/form-application.min.js', 'public/dist/form_populate_template_cache.js', 'public/dist/form-vendor.min.js']
}
};

View file

@ -123,7 +123,7 @@ module.exports = function(grunt) {
compress: true
},
files: {
'public/dist/vendor.min.js': bowerArray
'public/dist/form-vendor.min.js': bowerArray
}
}
},

39
package-lock.json generated
View file

@ -3124,13 +3124,10 @@
}
},
"connect-mongo": {
"version": "0.8.2",
"resolved": "https://registry.npmjs.org/connect-mongo/-/connect-mongo-0.8.2.tgz",
"integrity": "sha1-ySh47sDFpaZiW3mgwhTzf4YfxuA=",
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/connect-mongo/-/connect-mongo-2.0.0.tgz",
"integrity": "sha512-2Nj5d4XO55AXSy1GOXDZteSEEUObGm/kvJaXyEQCa8cCHsCiZH+V/+sjk3b+khc4V8oyVi34rCtUxor4TfETLA==",
"requires": {
"debug": "3.1.0",
"depd": "1.1.1",
"lodash": "4.17.4",
"mongodb": "2.0.55"
}
},
@ -4060,6 +4057,36 @@
"resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz",
"integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY="
},
"envfile": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/envfile/-/envfile-2.1.1.tgz",
"integrity": "sha1-jlrmacHyRZ5YkJWdn4obHAXmj50=",
"requires": {
"ambi": "2.5.0",
"eachr": "3.2.0",
"editions": "1.3.3",
"typechecker": "4.4.1"
},
"dependencies": {
"eachr": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/eachr/-/eachr-3.2.0.tgz",
"integrity": "sha1-LDXkPqCGUW95l8+At6pk1VpKRIQ=",
"requires": {
"editions": "1.3.3",
"typechecker": "4.4.1"
}
},
"typechecker": {
"version": "4.4.1",
"resolved": "https://registry.npmjs.org/typechecker/-/typechecker-4.4.1.tgz",
"integrity": "sha1-+XuV9RsDhBchLWd9RaNz7nvO1+Y=",
"requires": {
"editions": "1.3.3"
}
}
}
},
"error-ex": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz",

View file

@ -32,12 +32,13 @@
"chalk": "^1.1.3",
"compression": "~1.6.0",
"connect": "^3.4.1",
"connect-mongo": "~0.8.2",
"connect-mongo": "^2.0.0",
"consolidate": "~0.14.5",
"cookie-parser": "~1.4.0",
"deep-diff": "^0.3.4",
"dotenv": "^2.0.0",
"email-verification": "github:tellform/node-email-verification",
"envfile": "^2.1.1",
"express": "~4.13.3",
"express-session": "~1.12.1",
"glob": "^7.0.3",

View file

@ -2,7 +2,7 @@
// Setting up route
angular.module('core').config(['$stateProvider', '$urlRouterProvider',
function($stateProvider, $urlRouterProvider, Authorization) {
function($stateProvider, $urlRouterProvider) {
// Redirect to home view when route not found
$urlRouterProvider.otherwise('/forms');
}
@ -21,13 +21,8 @@ angular.module(ApplicationConfiguration.applicationModuleName).run(['$rootScope'
params: fromParams
}
<<<<<<< HEAD
var statesToIgnore = ['home', 'signin', 'resendVerifyEmail', 'verify', 'signup', 'signup-success', 'forgot', 'reset-invalid', 'reset', 'reset-success'];
=======
var statesToIgnore = ['', 'home', 'signin', 'resendVerifyEmail', 'verify', 'signup', 'signup-success', 'forgot', 'reset-invalid', 'reset', 'reset-success'];
>>>>>>> 2.20
//Redirect to listForms if user is authenticated
if(statesToIgnore.indexOf(toState.name) > 0){
if(Auth.isAuthenticated()){

View file

@ -1,18 +1,11 @@
'use strict';
//TODO: DAVID: URGENT: Make this a $resource that fetches valid field types from server
<<<<<<< HEAD
angular.module('forms').service('FormFields', [ '$rootScope', '$translate', '$window',
function($rootScope, $translate, $window) {
console.log($window.user);
$translate.use($window.user.language);
=======
angular.module('forms').service('FormFields', [ '$rootScope', '$translate', 'Auth',
function($rootScope, $translate, Auth) {
var language = Auth.ensureHasCurrentUser().language;
$translate.use(language);
>>>>>>> 2.20
this.types = [
{

View file

@ -3,10 +3,6 @@
// Use Application configuration module to register a new module
ApplicationConfiguration.registerModule('forms', [
'ngFileUpload', 'ui.date', 'ui.sortable',
<<<<<<< HEAD
'angular-input-stars', 'users', 'ngclipboard', 'textAngular',
'frapontillo.bootstrap-switch'
=======
'angular-input-stars', 'users', 'ngclipboard'
>>>>>>> 2.20
]);//, 'colorpicker.module' @TODO reactivate this module

View file

@ -17,7 +17,8 @@ require('events').EventEmitter.prototype._maxListeners = 0;
var config = require('./config/config'),
mongoose = require('mongoose'),
chalk = require('chalk');
chalk = require('chalk'),
nodemailer = require('nodemailer');
/**
* Main application entry file.
@ -36,6 +37,16 @@ mongoose.connection.on('error', function (err) {
process.exit(-1);
});
const smtpTransport = nodemailer.createTransport(config.mailer.options);
// verify connection configuration on startup
smtpTransport.verify(function(error, success) {
if (error) {
console.error(chalk.red('Your mail configuration is incorrect: ' + error));
process.exit(-1);
}
});
// Init the express application
var app = require('./config/express')(db);