successfully split form and admin panel template cache

This commit is contained in:
David Baldwynn 2017-03-27 15:00:22 -07:00
parent 709303d43c
commit 8d27010d0a
No known key found for this signature in database
GPG key ID: 15D1C13202224A9B
11 changed files with 107 additions and 20 deletions

View file

@ -71,7 +71,7 @@
<script type="text/javascript">
var signupDisabled = {{signupDisabled | safe}};
var socketPort = {{socketPort | safe}};
var socketUrl = {{socketUrl | safe}} || null;
var socketUrl = {{socketUrl | safe}};
</script>
<!--Socket.io Client Dependency-->

4
config/env/all.js vendored
View file

@ -21,7 +21,6 @@ module.exports = {
},
port: process.env.PORT || 3000,
socketPort: process.env.SOCKET_PORT || 20523,
templateEngine: 'swig',
@ -110,7 +109,8 @@ module.exports = {
'public/form_modules/forms/*.js',
'public/form_modules/forms/*/*/*/*.js',
'public/form_modules/forms/*/*.js',
'public/form_modules/forms/*/*/*.js'
'public/form_modules/forms/*/*/*.js',
'public/form_modules/forms/**.js'
],
views: [
'public/modules/**/*.html',

View file

@ -9,6 +9,8 @@ module.exports = {
pass: ''
}
},
socketPort: process.env.SOCKET_PORT || 20523,
log: {
// Can specify one of 'combined', 'common', 'dev', 'short', 'tiny'
format: 'dev',

View file

@ -57,9 +57,16 @@ module.exports = function(db) {
app.locals.description = config.app.description;
app.locals.keywords = config.app.keywords;
app.locals.socketPort = config.socketPort;
if(config.socketPort){
app.locals.socketPort = config.socketPort;
} else {
app.locals.socketPort = false;
}
if(config.socketUrl){
app.locals.socketUrl = config.socketUrl;
} else {
app.locals.socketUrl = false;
}
app.locals.bowerJSFiles = config.getBowerJSAssets();
app.locals.bowerCssFiles = config.getBowerCSSAssets();

View file

@ -64,7 +64,7 @@ module.exports = function(grunt) {
},
mochaTests: {
files: watchFiles.serverTests,
tasks: ['test:server'],
tasks: ['test:server']
}
},
jshint: {
@ -254,7 +254,7 @@ module.exports = function(grunt) {
},
forms: {
options: {
module: 'TellForm.form_templates'
module: 'TellForm-Form.form_templates'
},
src: ['public/form_modules/**/views/**.html', 'public/form_modules/**/views/**/*.html'],
dest: 'public/dist/form_populate_template_cache.js'
@ -273,7 +273,7 @@ module.exports = function(grunt) {
}
}
});
grunt.event.on('coverage', function(lcov, done){
var coveralls = require('coveralls');
coveralls.handleInput(lcov, function(err){
@ -306,21 +306,21 @@ module.exports = function(grunt) {
grunt.registerTask('coverage:server', ['env:test', 'mocha_istanbul:coverageServer']);
// Default task(s).
grunt.registerTask('default', ['lint', 'html2js:main', 'env', 'concurrent:default']);
grunt.registerTask('dev', ['lint', 'html2js:main', 'env:dev', 'concurrent:default']);
grunt.registerTask('default', ['lint', 'html2js:main', 'html2js:forms', 'env', 'concurrent:default']);
grunt.registerTask('dev', ['lint', 'html2js:main', 'html2js:forms', 'env:dev', 'concurrent:default']);
// Debug task.
grunt.registerTask('debug', ['lint', 'html2js:main', 'concurrent:debug']);
grunt.registerTask('debug', ['lint', 'html2js:main', 'html2js:forms', 'concurrent:debug']);
// Secure task(s).
grunt.registerTask('secure', ['env:secure', 'lint', 'html2js:main', 'concurrent:default']);
grunt.registerTask('secure', ['env:secure', 'lint', 'html2js:main', 'html2js:forms', 'concurrent:default']);
// Lint task(s).
grunt.registerTask('lint', ['jshint', 'csslint']);
grunt.registerTask('lint:tests', ['jshint:allTests']);
// Build task(s).
grunt.registerTask('build', ['lint', 'loadConfig', 'cssmin', 'ngAnnotate', 'uglify', 'html2js:main']);
grunt.registerTask('build', ['lint', 'loadConfig', 'cssmin', 'ngAnnotate', 'uglify', 'html2js:main', 'html2js:forms']);
//Setup task(s).
grunt.registerTask('setup', ['execute']);
@ -328,5 +328,5 @@ module.exports = function(grunt) {
// Test task(s).
grunt.registerTask('test', ['lint:tests', 'test:server', 'test:client']);
grunt.registerTask('test:server', ['lint:tests', 'env:test', 'mochaTest']);
grunt.registerTask('test:client', ['lint:tests', 'html2js:main', 'env:test', 'karma:unit']);
grunt.registerTask('test:client', ['lint:tests', 'html2js:main', 'html2js:forms', 'env:test', 'karma:unit']);
};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -3,8 +3,8 @@
// Init the application configuration module for AngularJS application
var ApplicationConfiguration = (function() {
// Init module configuration options
var applicationModuleName = 'TellForm';
var applicationModuleVendorDependencies = ['duScroll', 'ui.select', 'ngSanitize', 'vButton', 'ngResource', 'TellForm.form_templates', 'ui.router', 'ui.bootstrap', 'ui.utils', 'pascalprecht.translate'];
var applicationModuleName = 'TellForm-Form';
var applicationModuleVendorDependencies = ['duScroll', 'ui.select', 'ngSanitize', 'vButton', 'ngResource', 'TellForm-Form.form_templates', 'ui.router', 'ui.bootstrap', 'ui.utils', 'pascalprecht.translate'];
// Add a new vertical module
var registerModule = function(moduleName, dependencies) {

View file

@ -30,7 +30,7 @@ angular.module('view-form').directive('fieldDirective', ['$http', '$compile', '$
'natural'
];
var templateUrl = 'modules/forms/base/views/directiveViews/field/';
var templateUrl = 'form_modules/forms/base/views/directiveViews/field/';
if (__indexOf.call(supportedFields, type) >= 0) {
templateUrl = templateUrl+type+'.html';
@ -49,7 +49,7 @@ angular.module('view-form').directive('fieldDirective', ['$http', '$compile', '$
forms: '='
},
link: function(scope, element) {
$rootScope.chooseDefaultOption = scope.chooseDefaultOption = function(type) {
if(type === 'yes_no'){
scope.field.fieldValue = 'true';

View file

@ -39,7 +39,7 @@ function hashFnv32a(str, asString, seed) {
angular.module('view-form').directive('submitFormDirective', ['$http', 'TimeCounter', '$filter', '$rootScope', 'SendVisitorData',
function ($http, TimeCounter, $filter, $rootScope, SendVisitorData) {
return {
templateUrl: 'modules/forms/base/views/directiveViews/form/submit-form.client.view.html',
templateUrl: 'form_modules/forms/base/views/directiveViews/form/submit-form.client.view.html',
restrict: 'E',
scope: {
myform:'='