diff options
author | Xavier Priour <xavier.priour@bubblyware.com> | 2015-12-13 20:02:34 +0100 |
---|---|---|
committer | Xavier Priour <xavier.priour@bubblyware.com> | 2015-12-13 20:02:34 +0100 |
commit | 18697d45f652a119ba21b0cef42fbf732902bfa9 (patch) | |
tree | 2ca8bc680acb8c148478660158a2f82ae4f61e7d /client | |
parent | 7cfc72da995a247b77d24dca215e59af2f5ed5f0 (diff) | |
download | wekan-18697d45f652a119ba21b0cef42fbf732902bfa9.tar.gz wekan-18697d45f652a119ba21b0cef42fbf732902bfa9.tar.bz2 wekan-18697d45f652a119ba21b0cef42fbf732902bfa9.zip |
board export now checks authentication
Diffstat (limited to 'client')
-rw-r--r-- | client/components/boards/boardHeader.jade | 2 | ||||
-rw-r--r-- | client/components/boards/boardHeader.js | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/client/components/boards/boardHeader.jade b/client/components/boards/boardHeader.jade index 3e608d4a..f264a6d9 100644 --- a/client/components/boards/boardHeader.jade +++ b/client/components/boards/boardHeader.jade @@ -56,7 +56,7 @@ template(name="boardMenuPopup") if currentUser.isBoardAdmin hr ul.pop-over-list - li: a.js-export-board(href="{{urlExport}}", download) {{_ 'export-board'}} + li: a.js-export-board {{_ 'export-board'}} li: a.js-archive-board {{_ 'archive-board'}} template(name="boardVisibilityList") diff --git a/client/components/boards/boardHeader.js b/client/components/boards/boardHeader.js index 3503cbfb..34204a46 100644 --- a/client/components/boards/boardHeader.js +++ b/client/components/boards/boardHeader.js @@ -13,6 +13,20 @@ Template.boardMenuPopup.events({ // confirm that the board was successfully archived. FlowRouter.go('home'); }), + 'click .js-export-board'() { + const boardId = Session.get('currentBoard'); + Meteor.call('exportBoard', boardId, (error, response) => { + if(error) { + // the only error we can anticipate is accessing a non-authorized board + // and this should have been caugh by UI before. + // So no treatment here for the time being. + } else { + const dataToSave = new Blob([JSON.stringify(response)], {type: 'application/json;charset=utf-8'}); + const filename = `wekan-export-board-${boardId}.json`; + saveAs(dataToSave, filename); + } + }); + } }); Template.boardMenuPopup.helpers({ |