diff --git a/app/models/user.server.model.js b/app/models/user.server.model.js index 898f995a..f016826c 100755 --- a/app/models/user.server.model.js +++ b/app/models/user.server.model.js @@ -128,7 +128,7 @@ UserSchema.plugin(mUtilities.timestamp, { //Create folder for user's pdfs UserSchema.pre('save', function (next) { this.username = this.email; - if(process.env.NODE_ENV === 'development'){ + if(process.env.NODE_ENV === 'local-development'){ var newDestination = path.join(config.pdfUploadPath, this.username.replace(/ /g,'')), stat = null; diff --git a/config/env/development.js b/config/env/development.js index ad6ba9b7..9e44c4eb 100755 --- a/config/env/development.js +++ b/config/env/development.js @@ -1,7 +1,7 @@ 'use strict'; module.exports = { - baseUrl: 'http://localhost:3000', + baseUrl: process.env.BASE_URL || 'http://localhost:3000', db: { uri: 'mongodb://localhost/mean-dev', options: { diff --git a/config/env/production-dev.js b/config/env/production-dev.js index f94ce80c..d59a05b5 100644 --- a/config/env/production-dev.js +++ b/config/env/production-dev.js @@ -1,7 +1,7 @@ 'use strict'; module.exports = { - baseUrl: 'dev.tellform.com', + baseUrl: process.env.BASE_URL || 'dev.tellform.com', db: { uri: process.env.MONGOHQ_URL || process.env.MONGOLAB_URI || 'mongodb://' + (process.env.DB_1_PORT_27017_TCP_ADDR || 'localhost') + '/mean', options: { @@ -19,7 +19,7 @@ module.exports = { } }, sessionCookie: { - domain: 'dev.tellform.com' + domain: process.env.BASE_URL || 'dev.tellform.com' }, assets: { css: 'public/dist/application.min.css', diff --git a/config/init.js b/config/init.js index 893989fe..13e78275 100755 --- a/config/init.js +++ b/config/init.js @@ -15,6 +15,8 @@ module.exports = function() { * We'll Look for a valid NODE_ENV variable and if one cannot be found load the development NODE_ENV */ var environmentFiles = glob.sync('./config/env/' + process.env.NODE_ENV + '.js'); + console.log('process.env.MAILER_EMAIL_ID: '+process.env.MAILER_EMAIL_ID ); + if (!environmentFiles.length) { if (process.env.NODE_ENV) { console.error(chalk.red('No configuration file found for "' + process.env.NODE_ENV + '" environment using development instead')); diff --git a/gruntfile.js b/gruntfile.js index 4753dee4..d7283f36 100755 --- a/gruntfile.js +++ b/gruntfile.js @@ -2,6 +2,8 @@ module.exports = function(grunt) { require('jit-grunt')(grunt); + + grunt.loadNpmTasks('grunt-env'); // Unified Watch Object var watchFiles = { @@ -147,8 +149,8 @@ module.exports = function(grunt) { secure: { NODE_ENV: 'secure' }, - options: { - src: 'ENV.json' + default: { + src: '.env' } }, mochaTest: { @@ -280,7 +282,7 @@ module.exports = function(grunt) { grunt.registerTask('coverage:server', ['env:test', 'mocha_istanbul:coverageServer']); // Default task(s). - grunt.registerTask('default', ['lint', 'html2js:main', 'concurrent:default']); + grunt.registerTask('default', ['lint', 'html2js:main', 'env:default', 'concurrent:default']); // Debug task. grunt.registerTask('debug', ['lint', 'html2js:main', 'concurrent:debug']); diff --git a/public/modules/forms/config/forms.client.routes.js b/public/modules/forms/config/forms.client.routes.js index ba825be8..4a1c72ec 100644 --- a/public/modules/forms/config/forms.client.routes.js +++ b/public/modules/forms/config/forms.client.routes.js @@ -8,10 +8,7 @@ angular.module('forms').config(['$stateProvider', $stateProvider. state('listForms', { url: '/forms', - templateUrl: 'modules/forms/views/list-forms.client.view.html', - data: { - permissions: [ 'editForm' ] - } + templateUrl: 'modules/forms/views/list-forms.client.view.html' }). state('submitForm', { url: '/forms/:formId', @@ -53,4 +50,4 @@ angular.module('forms').config(['$stateProvider', templateUrl: 'modules/forms/views/adminTabs/create.html' }); } -]); \ No newline at end of file +]); diff --git a/public/populate_template_cache.js b/public/populate_template_cache.js index 1233ea82..ebb5a344 100644 --- a/public/populate_template_cache.js +++ b/public/populate_template_cache.js @@ -294,7 +294,7 @@ angular.module('NodeForm.templates', []).run(['$templateCache', function($templa $templateCache.put("../public/modules/forms/views/directiveViews/form/edit-submissions-form.client.view.html", "
#{{value.title}}OscarEMR User ProfilePercentage CompleteTime ElapsedDeviceLocationIP AddressDate Submitted (UTC)Generated PDF
{{$index+1}}{{field.fieldValue}}User Profile #{{row.oscarDemoNum}}{{row.percentageComplete}}%{{row.timeElapsed}}{{row.device.name}}, {{row.device.type}}{{row.geoLocation.city}}, {{row.geoLocation.country}}{{row.ipAddr}}{{row.created | date:'yyyy-MM-dd HH:mm:ss'}}Generated PDF
"); $templateCache.put("../public/modules/forms/views/directiveViews/form/submit-form.client.view.html", - "

{{myform.startPage.introTitle}}

{{myform.startPage.introParagraph}}

{{ myform.title }} (private preview)



{{myform | formValidity}} out of {{myform.visible_form_fields.length}} answered

Form entry successfully submitted!

"); + "

{{myform.startPage.introTitle}}

{{myform.startPage.introParagraph}}


{{myform | formValidity}} out of {{myform.visible_form_fields.length}} answered

Form entry successfully submitted!

"); $templateCache.put("../public/modules/users/views/authentication/access-denied.client.view.html", "

You need to be logged in to access this page

Login
"); $templateCache.put("../public/modules/users/views/authentication/signin.client.view.html",