Report templates ported to ReactJS and Knex.

Does not run yet because reports have dependencies on the old report templates.
This commit is contained in:
Tomas Bures 2017-07-09 15:41:53 +02:00
parent be7da791db
commit d4cea46f07
29 changed files with 807 additions and 688 deletions

View file

@ -3,11 +3,13 @@
const passport = require('./passport');
const config = require('config');
function _getConfig() {
function _getConfig(context) {
return {
authMethod: passport.authMethod,
isAuthMethodLocal: passport.isAuthMethodLocal,
externalPasswordResetLink: config.ldap.passwordresetlink
externalPasswordResetLink: config.ldap.passwordresetlink,
language: config.language || 'en',
userId: context.user ? context.user.id : undefined
}
}
@ -17,7 +19,7 @@ function registerRootRoute(router, title, entryPoint) {
title,
reactEntryPoint: entryPoint,
reactCsrfToken: req.csrfToken(),
mailtrainConfig: JSON.stringify(_getConfig())
mailtrainConfig: JSON.stringify(_getConfig(req.context))
});
});
}