Basic support for Mosaico templates.

TODO:
- Allow choosing a mosaico template in a mosaico-based template
- Integrate the custom mosaico templates with templates (endpoint for retrieving a mosaico template, replacement of URL_BASE and PLACEHOLDER tags
- Implement support for MJML-based Mosaico templates
- Implement support for MJML-based templates
- Implement support for GrapeJS-based templates
This commit is contained in:
Tomas Bures 2018-04-02 19:05:22 +02:00
parent 7b5642e911
commit 6706d93bc1
21 changed files with 2192 additions and 26 deletions

View file

@ -36,7 +36,7 @@ async function listDTAjax(context, params) {
);
}
async function _validateAndPreprocess(tx, entity, isCreate) {
async function _validateAndPreprocess(tx, entity) {
entity.data = JSON.stringify(entity.data);
}
@ -44,7 +44,7 @@ async function create(context, entity) {
return await knex.transaction(async tx => {
await shares.enforceEntityPermissionTx(tx, context, 'namespace', entity.namespace, 'createTemplate');
await _validateAndPreprocess(tx, entity, true);
await _validateAndPreprocess(tx, entity);
await namespaceHelpers.validateEntity(tx, entity);
@ -73,7 +73,7 @@ async function updateWithConsistencyCheck(context, entity) {
throw new interoperableErrors.ChangedError();
}
await _validateAndPreprocess(tx, entity, false);
await _validateAndPreprocess(tx, entity);
await namespaceHelpers.validateEntity(tx, entity);
await namespaceHelpers.validateMove(context, entity, existing, 'template', 'createTemplate', 'delete');