Files can be added to templates and managed in a dedicated "Files" view.
Mosaico integration in progress. The files seem to be working for Mosaico.
This commit is contained in:
parent
c85f2d4440
commit
b5cdf57f72
23 changed files with 506 additions and 164 deletions
|
@ -4,7 +4,7 @@ const passport = require('../../lib/passport');
|
|||
const _ = require('../../lib/translate')._;
|
||||
const reports = require('../../models/reports');
|
||||
const reportProcessor = require('../../lib/report-processor');
|
||||
const fileHelpers = require('../../lib/file-helpers');
|
||||
const reportHelpers = require('../../lib/report-helpers');
|
||||
const shares = require('../../models/shares');
|
||||
const contextHelpers = require('../../lib/context-helpers');
|
||||
|
||||
|
@ -62,14 +62,14 @@ router.getAsync('/report-content/:id', async (req, res) => {
|
|||
await shares.enforceEntityPermission(req.context, 'report', req.params.id, 'viewContent');
|
||||
|
||||
const report = await reports.getByIdWithTemplate(contextHelpers.getAdminContext(), req.params.id);
|
||||
res.sendFile(fileHelpers.getReportContentFile(report));
|
||||
res.sendFile(reportHelpers.getReportContentFile(report));
|
||||
});
|
||||
|
||||
router.getAsync('/report-output/:id', async (req, res) => {
|
||||
await shares.enforceEntityPermission(req.context, 'report', req.params.id, 'viewOutput');
|
||||
|
||||
const report = await reports.getByIdWithTemplate(contextHelpers.getAdminContext(), req.params.id);
|
||||
res.sendFile(fileHelpers.getReportOutputFile(report));
|
||||
res.sendFile(reportHelpers.getReportOutputFile(report));
|
||||
});
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue