summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2020-07-23 13:36:39 +0300
committerLauri Ojansivu <x@xet7.org>2020-07-23 13:36:39 +0300
commit1624fc82f7c319e84a78f29445c7867f7da15c32 (patch)
treeeafcd18b6c76407358ee7a8f5d465acd575d39d5 /models
parent42d8773e3674ce67ae710db2dffdc46f9669d7a9 (diff)
downloadwekan-1624fc82f7c319e84a78f29445c7867f7da15c32.tar.gz
wekan-1624fc82f7c319e84a78f29445c7867f7da15c32.tar.bz2
wekan-1624fc82f7c319e84a78f29445c7867f7da15c32.zip
Exports now work at #3173 at least for small boards. TODO: Fix EdgeHTML to work, before I can release this.
Thanks to xet7 !
Diffstat (limited to 'models')
-rw-r--r--models/export.js30
-rw-r--r--models/exporter.js54
2 files changed, 38 insertions, 46 deletions
diff --git a/models/export.js b/models/export.js
index 7a59fbec..17b08dad 100644
--- a/models/export.js
+++ b/models/export.js
@@ -80,21 +80,19 @@ if (Meteor.isServer) {
});
}
const exporter = new Exporter(boardId);
- if (exporter.canExport(user)) {
- body = params.query.delimiter
- ? exporter.buildCsv(params.query.delimiter)
- : exporter.buildCsv();
- res.writeHead(200, {
- // Checking length does not work https://github.com/wekan/wekan/issues/3173
- // so not using it here
- //'Content-Length': body.length,
- 'Content-Type': params.query.delimiter ? 'text/csv' : 'text/tsv',
- });
- res.write(body);
- res.end();
- } else {
- res.writeHead(403);
- res.end('Permission Error');
- }
+ //if (exporter.canExport(user)) {
+ body = params.query.delimiter
+ ? exporter.buildCsv(params.query.delimiter)
+ : exporter.buildCsv();
+ //'Content-Length': body.length,
+ res.writeHead(200, {
+ 'Content-Type': params.query.delimiter ? 'text/csv' : 'text/tsv',
+ });
+ res.write(body);
+ res.end();
+ //} else {
+ // res.writeHead(403);
+ // res.end('Permission Error');
+ //}
});
}
diff --git a/models/exporter.js b/models/exporter.js
index 3b3589f6..b6188ece 100644
--- a/models/exporter.js
+++ b/models/exporter.js
@@ -1,8 +1,7 @@
-// const stringify = require('csv-stringify');
+const stringify = require('csv-stringify');
// exporter maybe is broken since Gridfs introduced, add fs and path
export class Exporter {
- /*
constructor(boardId) {
this._boardId = boardId;
}
@@ -241,29 +240,29 @@ export class Exporter {
}
i++;
});
-
- // TODO: Try to get translations working.
- // These currently only bring English translations.
- // TAPi18n.__('title'),
- // TAPi18n.__('description'),
- // TAPi18n.__('status'),
- // TAPi18n.__('swimlane'),
- // TAPi18n.__('owner'),
- // TAPi18n.__('requested-by'),
- // TAPi18n.__('assigned-by'),
- // TAPi18n.__('members'),
- // TAPi18n.__('assignee'),
- // TAPi18n.__('labels'),
- // TAPi18n.__('card-start'),
- // TAPi18n.__('card-due'),
- // TAPi18n.__('card-end'),
- // TAPi18n.__('overtime-hours'),
- // TAPi18n.__('spent-time-hours'),
- // TAPi18n.__('createdAt'),
- // TAPi18n.__('last-modified-at'),
- // TAPi18n.__('last-activity'),
- // TAPi18n.__('voting'),
- // TAPi18n.__('archived'),
+ /* TODO: Try to get translations working.
+ These currently only bring English translations.
+ TAPi18n.__('title'),
+ TAPi18n.__('description'),
+ TAPi18n.__('status'),
+ TAPi18n.__('swimlane'),
+ TAPi18n.__('owner'),
+ TAPi18n.__('requested-by'),
+ TAPi18n.__('assigned-by'),
+ TAPi18n.__('members'),
+ TAPi18n.__('assignee'),
+ TAPi18n.__('labels'),
+ TAPi18n.__('card-start'),
+ TAPi18n.__('card-due'),
+ TAPi18n.__('card-end'),
+ TAPi18n.__('overtime-hours'),
+ TAPi18n.__('spent-time-hours'),
+ TAPi18n.__('createdAt'),
+ TAPi18n.__('last-modified-at'),
+ TAPi18n.__('last-activity'),
+ TAPi18n.__('voting'),
+ TAPi18n.__('archived'),
+ */
const stringifier = stringify({
header: true,
@@ -396,9 +395,4 @@ export class Exporter {
const board = Boards.findOne(this._boardId);
return board && board.isVisibleBy(user);
}
-*/
-
- canExport(user) {
- return false;
- }
}