diff options
author | Lauri Ojansivu <x@xet7.org> | 2017-07-25 16:52:58 +0300 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2017-07-25 16:52:58 +0300 |
commit | 96c79f78ccdf1508dc8d4233adfb13b6324de8d1 (patch) | |
tree | 986bf40a8191895ebc5ab11b0935e8161e3d0c70 | |
parent | 7b4970a8d980f3918fcf7fbb584d7a67aae9cc13 (diff) | |
parent | 82d553721ceeec0813955345c50556dcd21ec545 (diff) | |
download | wekan-96c79f78ccdf1508dc8d4233adfb13b6324de8d1.tar.gz wekan-96c79f78ccdf1508dc8d4233adfb13b6324de8d1.tar.bz2 wekan-96c79f78ccdf1508dc8d4233adfb13b6324de8d1.zip |
Merge branch 'GhassenRjab-export-import-sandstorm' into devel
Export and import boards in Sandstorm.
Thanks to GhassenRjab ! Related #1144 and #799
45 files changed, 127 insertions, 8 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 7be93bf9..e769764c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,14 @@ This release adds the following new features: -* [More screenshots at Features page](https://github.com/wekan/wekan/wiki/Features). +* [More screenshots at Features page](https://github.com/wekan/wekan/wiki/Features); +* [Export and import boards in Sandstorm](https://github.com/wekan/wekan/pull/1144). -Thanks to GitHub user xet7 for contributions. +and fixes the following bugs: + +* [Double shashes on ROOT_URL](https://github.com/wekan/wekan/issues/962). + +Thanks to GitHub users GhassenRjab, nztqa and xet7 for contributions. # v0.29 2017-07-21 Wekan release diff --git a/client/components/boards/boardArchive.js b/client/components/boards/boardArchive.js index aab1e2c6..acb53149 100644 --- a/client/components/boards/boardArchive.js +++ b/client/components/boards/boardArchive.js @@ -18,6 +18,13 @@ BlazeComponent.extendComponent({ events() { return [{ 'click .js-restore-board'() { + // TODO : Make isSandstorm variable global + const isSandstorm = Meteor.settings && Meteor.settings.public && + Meteor.settings.public.sandstorm; + if (isSandstorm && Session.get('currentBoard')) { + const currentBoard = Boards.findOne(Session.get('currentBoard')); + currentBoard.archive(); + } const board = this.currentData(); board.restore(); Utils.goBoardId(board._id); diff --git a/client/components/boards/boardHeader.jade b/client/components/boards/boardHeader.jade index d33ee11b..3d98322d 100644 --- a/client/components/boards/boardHeader.jade +++ b/client/components/boards/boardHeader.jade @@ -71,6 +71,12 @@ template(name="boardHeaderBar") title="{{_ 'log-in'}}") i.fa.fa-sign-in span {{_ 'log-in'}} + + if isSandstorm + if currentUser + a.board-header-btn.js-open-archived-board + i.fa.fa-archive + span {{_ 'archives'}} a.board-header-btn.js-open-filter-view( title="{{#if Filter.isActive}}{{_ 'filter-on-desc'}}{{else}}{{_ 'filter'}}{{/if}}" @@ -113,6 +119,11 @@ template(name="boardMenuPopup") li: a(href="{{exportUrl}}", download="{{exportFilename}}") {{_ 'export-board'}} li: a.js-archive-board {{_ 'archive-board'}} li: a.js-outgoing-webhooks {{_ 'outgoing-webhooks'}} + if isSandstorm + hr + ul.pop-over-list + li: a(href="{{exportUrl}}", download="{{exportFilename}}") {{_ 'export-board'}} + li: a.js-import-board {{_ 'import-board-c'}} template(name="boardVisibilityList") ul.pop-over-list @@ -197,9 +208,9 @@ template(name="createBoard") template(name="chooseBoardSource") ul.pop-over-list li - a(href="{{pathFor 'import/trello'}}") {{_ 'from-trello'}} + a(href="{{pathFor '/import/trello'}}") {{_ 'from-trello'}} li - a(href="{{pathFor 'import/wekan'}}") {{_ 'from-wekan'}} + a(href="{{pathFor '/import/wekan'}}") {{_ 'from-wekan'}} template(name="boardChangeTitlePopup") form diff --git a/client/components/boards/boardHeader.js b/client/components/boards/boardHeader.js index dafbfd30..2ee21905 100644 --- a/client/components/boards/boardHeader.js +++ b/client/components/boards/boardHeader.js @@ -14,6 +14,7 @@ Template.boardMenuPopup.events({ FlowRouter.go('home'); }), 'click .js-outgoing-webhooks': Popup.open('outgoingWebhooks'), + 'click .js-import-board': Popup.open('chooseBoardSource'), }); Template.boardMenuPopup.helpers({ @@ -76,6 +77,9 @@ BlazeComponent.extendComponent({ 'click .js-open-board-menu': Popup.open('boardMenu'), 'click .js-change-visibility': Popup.open('boardChangeVisibility'), 'click .js-watch-board': Popup.open('boardChangeWatch'), + 'click .js-open-archived-board'() { + Modal.open('archivedBoards'); + }, 'click .js-open-filter-view'() { Sidebar.setView('filter'); }, diff --git a/client/components/import/import.jade b/client/components/import/import.jade index d1b3489a..5e737cc6 100644 --- a/client/components/import/import.jade +++ b/client/components/import/import.jade @@ -15,6 +15,8 @@ template(name="importTextarea") p: label(for='import-textarea') {{_ instruction}} textarea.js-import-json(placeholder="{{_ 'import-json-placeholder'}}" autofocus) | {{jsonText}} + if isSandstorm + p.warning {{_ 'import-sandstorm-warning'}} input.primary.wide(type="submit" value="{{_ 'import'}}") template(name="importMapMembers") diff --git a/client/components/import/import.js b/client/components/import/import.js index d72a02dd..64170c1d 100644 --- a/client/components/import/import.js +++ b/client/components/import/import.js @@ -68,10 +68,12 @@ BlazeComponent.extendComponent({ this.importedData.get(), additionalData, this.importSource, + Session.get('fromBoard'), (err, res) => { if (err) { this.setError(err.error); } else { + Session.set('fromBoard', null); Utils.goBoardId(res); } } diff --git a/config/router.js b/config/router.js index d4d13be5..ea85c7e6 100644 --- a/config/router.js +++ b/config/router.js @@ -84,6 +84,9 @@ FlowRouter.route('/import/:source', { name: 'import', triggersEnter: [AccountsTemplates.ensureSignedIn], action(params) { + if (Session.get('currentBoard')) { + Session.set('fromBoard', Session.get('currentBoard')); + } Session.set('currentBoard', null); Session.set('currentCard', null); Session.set('importSource', params.source); diff --git a/i18n/ar.i18n.json b/i18n/ar.i18n.json index 08cbd579..80ca93d8 100644 --- a/i18n/ar.i18n.json +++ b/i18n/ar.i18n.json @@ -206,8 +206,10 @@ "home": "الرئيسية", "import": "Import", "import-board": "استيراد لوحة", + "import-board-c": "استيراد لوحة", "import-board-title-trello": "Import board from Trello", "import-board-title-wekan": "استيراد لوحة من ويكان", + "import-sandstorm-warning": "Imported board will delete all existing data on board and replace it with imported board.", "from-trello": "من تريلو", "from-wekan": "من ويكان", "import-board-instruction-trello": "In your Trello board, go to 'Menu', then 'More', 'Print and Export', 'Export JSON', and copy the resulting text", diff --git a/i18n/br.i18n.json b/i18n/br.i18n.json index f7f83c98..01d3ace2 100644 --- a/i18n/br.i18n.json +++ b/i18n/br.i18n.json @@ -206,8 +206,10 @@ "home": "Home", "import": "Import", "import-board": "import board", + "import-board-c": "Import board", "import-board-title-trello": "Import board from Trello", "import-board-title-wekan": "Import board from Wekan", + "import-sandstorm-warning": "Imported board will delete all existing data on board and replace it with imported board.", "from-trello": "From Trello", "from-wekan": "From Wekan", "import-board-instruction-trello": "In your Trello board, go to 'Menu', then 'More', 'Print and Export', 'Export JSON', and copy the resulting text", diff --git a/i18n/ca.i18n.json b/i18n/ca.i18n.json index 72f23947..b2e54670 100644 --- a/i18n/ca.i18n.json +++ b/i18n/ca.i18n.json @@ -206,8 +206,10 @@ "home": "Inici", "import": "importa", "import-board": "import board", + "import-board-c": "Import board", "import-board-title-trello": "Importa tauler des de Trello", "import-board-title-wekan": "Import board from Wekan", + "import-sandstorm-warning": "Imported board will delete all existing data on board and replace it with imported board.", "from-trello": "From Trello", "from-wekan": "From Wekan", "import-board-instruction-trello": "En el teu tauler Trello, ves a 'Menú', 'Més'.' Imprimir i Exportar', 'Exportar JSON', i copia el text resultant.", diff --git a/i18n/cs.i18n.json b/i18n/cs.i18n.json index 3c8cadb6..728e81b2 100644 --- a/i18n/cs.i18n.json +++ b/i18n/cs.i18n.json @@ -206,8 +206,10 @@ "home": "Domů", "import": "Import", "import-board": "import board", + "import-board-c": "Import board", "import-board-title-trello": "Import board from Trello", "import-board-title-wekan": "Import board from Wekan", + "import-sandstorm-warning": "Imported board will delete all existing data on board and replace it with imported board.", "from-trello": "From Trello", "from-wekan": "From Wekan", "import-board-instruction-trello": "Na svém Trello tablu, otevři 'Menu', pak 'More', 'Print and Export', 'Export JSON', a zkopíruj výsledný text", diff --git a/i18n/de.i18n.json b/i18n/de.i18n.json index 83efdabc..a971abe0 100644 --- a/i18n/de.i18n.json +++ b/i18n/de.i18n.json @@ -206,8 +206,10 @@ "home": "Home", "import": "Importieren", "import-board": "import board", + "import-board-c": "Import board", "import-board-title-trello": "Board von Trello importieren", "import-board-title-wekan": "Import board from Wekan", + "import-sandstorm-warning": "Imported board will delete all existing data on board and replace it with imported board.", "from-trello": "From Trello", "from-wekan": "From Wekan", "import-board-instruction-trello": "Gehen Sie in ihrem Trello-Board auf 'Menü', dann 'Mehr', 'Drucken und Exportieren', 'JSON-Export' und kopieren Sie den dort angezeigten Text", diff --git a/i18n/en-GB.i18n.json b/i18n/en-GB.i18n.json index e27671cb..513d49bf 100644 --- a/i18n/en-GB.i18n.json +++ b/i18n/en-GB.i18n.json @@ -206,8 +206,10 @@ "home": "Home", "import": "Import", "import-board": "import board", + "import-board-c": "Import board", "import-board-title-trello": "Import board from Trello", "import-board-title-wekan": "Import board from Wekan", + "import-sandstorm-warning": "Imported board will delete all existing data on board and replace it with imported board.", "from-trello": "From Trello", "from-wekan": "From Wekan", "import-board-instruction-trello": "In your Trello board, go to 'Menu', then 'More', 'Print and Export', 'Export JSON', and copy the resulting text.", diff --git a/i18n/en.i18n.json b/i18n/en.i18n.json index 05d86ff6..da47e1c6 100644 --- a/i18n/en.i18n.json +++ b/i18n/en.i18n.json @@ -206,8 +206,10 @@ "home": "Home", "import": "Import", "import-board": "import board", + "import-board-c": "Import board", "import-board-title-trello": "Import board from Trello", "import-board-title-wekan": "Import board from Wekan", + "import-sandstorm-warning": "Imported board will delete all existing data on board and replace it with imported board.", "from-trello": "From Trello", "from-wekan": "From Wekan", "import-board-instruction-trello": "In your Trello board, go to 'Menu', then 'More', 'Print and Export', 'Export JSON', and copy the resulting text.", diff --git a/i18n/eo.i18n.json b/i18n/eo.i18n.json index 58ff0f03..f4d4fb43 100644 --- a/i18n/eo.i18n.json +++ b/i18n/eo.i18n.json @@ -206,8 +206,10 @@ "home": "Hejmo", "import": "Importi", "import-board": "import board", + "import-board-c": "Import board", "import-board-title-trello": "Import board from Trello", "import-board-title-wekan": "Import board from Wekan", + "import-sandstorm-warning": "Imported board will delete all existing data on board and replace it with imported board.", "from-trello": "From Trello", "from-wekan": "From Wekan", "import-board-instruction-trello": "In your Trello board, go to 'Menu', then 'More', 'Print and Export', 'Export JSON', and copy the resulting text.", diff --git a/i18n/es.i18n.json b/i18n/es.i18n.json index 64d2c5a7..104b40d5 100644 --- a/i18n/es.i18n.json +++ b/i18n/es.i18n.json @@ -206,8 +206,10 @@ "home": "Inicio", "import": "Importar", "import-board": "import board", + "import-board-c": "Importar tablero", "import-board-title-trello": "Importar tablero desde Trello", "import-board-title-wekan": "Import board from Wekan", + "import-sandstorm-warning": "Imported board will delete all existing data on board and replace it with imported board.", "from-trello": "Desde Trello", "from-wekan": "Desde Wekan", "import-board-instruction-trello": "In your Trello board, go to 'Menu', then 'More', 'Print and Export', 'Export JSON', and copy the resulting text", diff --git a/i18n/eu.i18n.json b/i18n/eu.i18n.json index 2f9342d4..b4619d66 100644 --- a/i18n/eu.i18n.json +++ b/i18n/eu.i18n.json @@ -206,8 +206,10 @@ "home": "Hasiera", "import": "Inportatu", "import-board": "inportatu arbela", + "import-board-c": "Inportatu arbela", "import-board-title-trello": "Inportatu arbela Trellotik", "import-board-title-wekan": "Inportatu arbela Wekanetik", + "import-sandstorm-warning": "Imported board will delete all existing data on board and replace it with imported board.", "from-trello": "Trellotik", "from-wekan": "Wekanetik", "import-board-instruction-trello": "Zure Trello arbelean, aukeratu 'Menu\", 'More', 'Print and Export', 'Export JSON', eta kopiatu jasotako testua hemen.", diff --git a/i18n/fa.i18n.json b/i18n/fa.i18n.json index 2a892f07..468f144b 100644 --- a/i18n/fa.i18n.json +++ b/i18n/fa.i18n.json @@ -206,8 +206,10 @@ "home": "خانه", "import": "وارد کردن", "import-board": "import board", + "import-board-c": "Import board", "import-board-title-trello": "وارد کردن تخته ها از Trello", "import-board-title-wekan": "Import board from Wekan", + "import-sandstorm-warning": "Imported board will delete all existing data on board and replace it with imported board.", "from-trello": "From Trello", "from-wekan": "From Wekan", "import-board-instruction-trello": "در Trello-ی خود به 'Menu'، 'More'، 'Print'، 'Export to JSON رفته و متن نهایی را دراینجا وارد نمایید.", diff --git a/i18n/fi.i18n.json b/i18n/fi.i18n.json index ea8cd374..bec9b0a9 100644 --- a/i18n/fi.i18n.json +++ b/i18n/fi.i18n.json @@ -206,8 +206,10 @@ "home": "Koti", "import": "Tuo", "import-board": "tuo taulu", + "import-board-c": "Tuo taulu", "import-board-title-trello": "Tuo taulu Trellosta", "import-board-title-wekan": "Tuo taulu Wekanista", + "import-sandstorm-warning": "Tuotu taulu poistaa kaikki olemassaolevan taulun tiedot ja korvaa ne tuodulla taululla.", "from-trello": "Trellosta", "from-wekan": "Wekanista", "import-board-instruction-trello": "Trello taulullasi, mene 'Menu', sitten 'More', 'Print and Export', 'Export JSON', ja kopioi tuloksena saamasi teksti", diff --git a/i18n/fr.i18n.json b/i18n/fr.i18n.json index dc323c8b..82fa9fe4 100644 --- a/i18n/fr.i18n.json +++ b/i18n/fr.i18n.json @@ -206,8 +206,10 @@ "home": "Accueil", "import": "Importer", "import-board": "importer un tableau", + "import-board-c": "Importer un tableau", "import-board-title-trello": "Importer le tableau depuis Trello", "import-board-title-wekan": "Importer un tableau depuis Wekan", + "import-sandstorm-warning": "Imported board will delete all existing data on board and replace it with imported board.", "from-trello": "Depuis Trello", "from-wekan": "Depuis Wekan", "import-board-instruction-trello": "Dans votre tableau Trello, allez sur 'Menu', puis sur 'Plus', 'Imprimer et exporter', 'Exporter en JSON' et copiez le texte du résultat", diff --git a/i18n/gl.i18n.json b/i18n/gl.i18n.json index 924aec1d..76956dec 100644 --- a/i18n/gl.i18n.json +++ b/i18n/gl.i18n.json @@ -206,8 +206,10 @@ "home": "Inicio", "import": "Importar", "import-board": "importar taboleiro", + "import-board-c": "Importar taboleiro", "import-board-title-trello": "Importar taboleiro de Trello", "import-board-title-wekan": "Importar taboleiro de Wekan", + "import-sandstorm-warning": "Imported board will delete all existing data on board and replace it with imported board.", "from-trello": "De Trello", "from-wekan": "De Wekan", "import-board-instruction-trello": "In your Trello board, go to 'Menu', then 'More', 'Print and Export', 'Export JSON', and copy the resulting text.", diff --git a/i18n/he.i18n.json b/i18n/he.i18n.json index 8893f26d..72c3ff90 100644 --- a/i18n/he.i18n.json +++ b/i18n/he.i18n.json @@ -206,8 +206,10 @@ "home": "בית", "import": "יבוא", "import-board": "יבוא לוח", + "import-board-c": "יבוא לוח", "import-board-title-trello": "ייבוא לוח מטרלו", "import-board-title-wekan": "יבוא לוח מ־Wekan", + "import-sandstorm-warning": "Imported board will delete all existing data on board and replace it with imported board.", "from-trello": "מ־Trello", "from-wekan": "מ־Wekan", "import-board-instruction-trello": "בלוח הטרלו שלך, עליך ללחוץ על ‚תפריט‘, ואז על ‚עוד‘, ‚הדפסה וייצוא‘, ‚יצוא JSON‘ ולהעתיק את הטקסט שנוצר.", diff --git a/i18n/hu.i18n.json b/i18n/hu.i18n.json index 9b2114a8..cab9bd0b 100644 --- a/i18n/hu.i18n.json +++ b/i18n/hu.i18n.json @@ -206,8 +206,10 @@ "home": "Kezdőlap", "import": "Importálás", "import-board": "import board", + "import-board-c": "Import board", "import-board-title-trello": "Tábla importálása a Trello-ról", "import-board-title-wekan": "Import board from Wekan", + "import-sandstorm-warning": "Imported board will delete all existing data on board and replace it with imported board.", "from-trello": "From Trello", "from-wekan": "From Wekan", "import-board-instruction-trello": "In your Trello board, go to 'Menu', then 'More', 'Print and Export', 'Export JSON', and copy the resulting text.", diff --git a/i18n/id.i18n.json b/i18n/id.i18n.json index 10f50359..e25ea7d4 100644 --- a/i18n/id.i18n.json +++ b/i18n/id.i18n.json @@ -206,8 +206,10 @@ "home": "Beranda", "import": "Impor", "import-board": "import board", + "import-board-c": "Import board", "import-board-title-trello": "Impor panel dari Trello", "import-board-title-wekan": "Import board from Wekan", + "import-sandstorm-warning": "Imported board will delete all existing data on board and replace it with imported board.", "from-trello": "From Trello", "from-wekan": "From Wekan", "import-board-instruction-trello": "Di panel Trello anda, ke 'Menu', terus 'More', 'Print and Export','Export JSON', dan salin hasilnya", diff --git a/i18n/it.i18n.json b/i18n/it.i18n.json index 35acbdd7..66a81f83 100644 --- a/i18n/it.i18n.json +++ b/i18n/it.i18n.json @@ -206,8 +206,10 @@ "home": "Home", "import": "Importa", "import-board": "Importa bacheca", + "import-board-c": "Importa bacheca", "import-board-title-trello": "Importa una bacheca da Trello", "import-board-title-wekan": "Importa bacheca da Wekan", + "import-sandstorm-warning": "Imported board will delete all existing data on board and replace it with imported board.", "from-trello": "Da Trello", "from-wekan": "Da Wekan", "import-board-instruction-trello": "Nella tua bacheca Trello vai a 'Menu', poi 'Altro', 'Stampa ed esporta', 'Esporta JSON', e copia il testo che compare.", diff --git a/i18n/ja.i18n.json b/i18n/ja.i18n.json index b30b9e7f..8a92045a 100644 --- a/i18n/ja.i18n.json +++ b/i18n/ja.i18n.json @@ -206,8 +206,10 @@ "home": "ホーム", "import": "インポート", "import-board": "import board", + "import-board-c": "Import board", "import-board-title-trello": "Trelloからボードをインポート", "import-board-title-wekan": "Import board from Wekan", + "import-sandstorm-warning": "Imported board will delete all existing data on board and replace it with imported board.", "from-trello": "From Trello", "from-wekan": "From Wekan", "import-board-instruction-trello": "In your Trello board, go to 'Menu', then 'More', 'Print and Export', 'Export JSON', and copy the resulting text", diff --git a/i18n/ko.i18n.json b/i18n/ko.i18n.json index 25c43277..b7a4296b 100644 --- a/i18n/ko.i18n.json +++ b/i18n/ko.i18n.json @@ -206,8 +206,10 @@ "home": "홈", "import": "가져오기", "import-board": "import board", + "import-board-c": "Import board", "import-board-title-trello": "Trello에서 보드 가져오기", "import-board-title-wekan": "Import board from Wekan", + "import-sandstorm-warning": "Imported board will delete all existing data on board and replace it with imported board.", "from-trello": "From Trello", "from-wekan": "From Wekan", "import-board-instruction-trello": "Trello 게시판에서 'Menu' -> 'More' -> 'Print and Export', 'Export JSON' 선택하여 텍스트 결과값 복사", diff --git a/i18n/nb.i18n.json b/i18n/nb.i18n.json index 3cfda1e0..d37d7ad6 100644 --- a/i18n/nb.i18n.json +++ b/i18n/nb.i18n.json @@ -206,8 +206,10 @@ "home": "Home", "import": "Import", "import-board": "import board", + "import-board-c": "Import board", "import-board-title-trello": "Import board from Trello", "import-board-title-wekan": "Import board from Wekan", + "import-sandstorm-warning": "Imported board will delete all existing data on board and replace it with imported board.", "from-trello": "From Trello", "from-wekan": "From Wekan", "import-board-instruction-trello": "In your Trello board, go to 'Menu', then 'More', 'Print and Export', 'Export JSON', and copy the resulting text.", diff --git a/i18n/nl.i18n.json b/i18n/nl.i18n.json index dea41210..d8ee535c 100644 --- a/i18n/nl.i18n.json +++ b/i18n/nl.i18n.json @@ -206,8 +206,10 @@ "home": "Home", "import": "Import", "import-board": "import board", + "import-board-c": "Import board", "import-board-title-trello": "Import board from Trello", "import-board-title-wekan": "Import board from Wekan", + "import-sandstorm-warning": "Imported board will delete all existing data on board and replace it with imported board.", "from-trello": "From Trello", "from-wekan": "From Wekan", "import-board-instruction-trello": "In your Trello board, go to 'Menu', then 'More', 'Print and Export', 'Export JSON', and copy the resulting text.", diff --git a/i18n/pl.i18n.json b/i18n/pl.i18n.json index b698418a..c1a99ff4 100644 --- a/i18n/pl.i18n.json +++ b/i18n/pl.i18n.json @@ -206,8 +206,10 @@ "home": "Strona główna", "import": "Importu", "import-board": "import board", + "import-board-c": "Import board", "import-board-title-trello": "Import board from Trello", "import-board-title-wekan": "Import board from Wekan", + "import-sandstorm-warning": "Imported board will delete all existing data on board and replace it with imported board.", "from-trello": "From Trello", "from-wekan": "From Wekan", "import-board-instruction-trello": "W twojej tablicy na Trello, idź do 'Menu', następnie 'More', 'Print and Export', 'Export JSON' i skopiuj wynik", diff --git a/i18n/pt-BR.i18n.json b/i18n/pt-BR.i18n.json index b16b512d..bb1008eb 100644 --- a/i18n/pt-BR.i18n.json +++ b/i18n/pt-BR.i18n.json @@ -206,8 +206,10 @@ "home": "Início", "import": "Importar", "import-board": "importar quadro", + "import-board-c": "Importar quadro", "import-board-title-trello": "Importar board do Trello", "import-board-title-wekan": "Importar quadro do Wekan", + "import-sandstorm-warning": "Imported board will delete all existing data on board and replace it with imported board.", "from-trello": "Do Trello", "from-wekan": "Do Wekan", "import-board-instruction-trello": "No seu quadro do Trello, vá em 'Menu', depois em 'Mais', 'Imprimir e Exportar', 'Exportar JSON', então copie o texto emitido", diff --git a/i18n/ro.i18n.json b/i18n/ro.i18n.json index effbed5e..c021ec2d 100644 --- a/i18n/ro.i18n.json +++ b/i18n/ro.i18n.json @@ -206,8 +206,10 @@ "home": "Home", "import": "Import", "import-board": "import board", + "import-board-c": "Import board", "import-board-title-trello": "Import board from Trello", "import-board-title-wekan": "Import board from Wekan", + "import-sandstorm-warning": "Imported board will delete all existing data on board and replace it with imported board.", "from-trello": "From Trello", "from-wekan": "From Wekan", "import-board-instruction-trello": "In your Trello board, go to 'Menu', then 'More', 'Print and Export', 'Export JSON', and copy the resulting text", diff --git a/i18n/ru.i18n.json b/i18n/ru.i18n.json index 260f0dcc..07950b07 100644 --- a/i18n/ru.i18n.json +++ b/i18n/ru.i18n.json @@ -206,8 +206,10 @@ "home": "Главная", "import": "Импорт", "import-board": "импортировать доску", + "import-board-c": "Импортировать доску", "import-board-title-trello": "Импортировать доску из Trello", "import-board-title-wekan": "Импортировать доску с Wekan", + "import-sandstorm-warning": "Imported board will delete all existing data on board and replace it with imported board.", "from-trello": "Из Trello", "from-wekan": "Их Wekan", "import-board-instruction-trello": "На вашей Trello доске нажмите “Menu” - “More” - “Print and export - “Export JSON” и скопируйте полученный текст", diff --git a/i18n/sr.i18n.json b/i18n/sr.i18n.json index 00174ab7..24e78500 100644 --- a/i18n/sr.i18n.json +++ b/i18n/sr.i18n.json @@ -206,8 +206,10 @@ "home": "Home", "import": "Import", "import-board": "import board", + "import-board-c": "Import board", "import-board-title-trello": "Uvezi tablu iz Trella", "import-board-title-wekan": "Import board from Wekan", + "import-sandstorm-warning": "Imported board will delete all existing data on board and replace it with imported board.", "from-trello": "From Trello", "from-wekan": "From Wekan", "import-board-instruction-trello": "In your Trello board, go to 'Menu', then 'More', 'Print and Export', 'Export JSON', and copy the resulting text", diff --git a/i18n/sv.i18n.json b/i18n/sv.i18n.json index 6f1d8bd0..90a47138 100644 --- a/i18n/sv.i18n.json +++ b/i18n/sv.i18n.json @@ -206,8 +206,10 @@ "home": "Hem", "import": "Importera", "import-board": "import board", + "import-board-c": "Import board", "import-board-title-trello": "Importera anslagstavla från Trello", "import-board-title-wekan": "Import board from Wekan", + "import-sandstorm-warning": "Imported board will delete all existing data on board and replace it with imported board.", "from-trello": "From Trello", "from-wekan": "From Wekan", "import-board-instruction-trello": "I din Trello-anslagstavla, gå till 'Meny', sedan 'Mera', 'Skriv ut och exportera', 'Exportera JSON' och kopiera den resulterande text.", diff --git a/i18n/ta.i18n.json b/i18n/ta.i18n.json index 851b554b..fc5f032e 100644 --- a/i18n/ta.i18n.json +++ b/i18n/ta.i18n.json @@ -206,8 +206,10 @@ "home": "Home", "import": "Import", "import-board": "import board", + "import-board-c": "Import board", "import-board-title-trello": "Import board from Trello", "import-board-title-wekan": "Import board from Wekan", + "import-sandstorm-warning": "Imported board will delete all existing data on board and replace it with imported board.", "from-trello": "From Trello", "from-wekan": "From Wekan", "import-board-instruction-trello": "In your Trello board, go to 'Menu', then 'More', 'Print and Export', 'Export JSON', and copy the resulting text.", diff --git a/i18n/th.i18n.json b/i18n/th.i18n.json index 5722c522..85735140 100644 --- a/i18n/th.i18n.json +++ b/i18n/th.i18n.json @@ -206,8 +206,10 @@ "home": "หน้าหลัก", "import": "นำเข้า", "import-board": "import board", + "import-board-c": "Import board", "import-board-title-trello": "นำเข้าบอร์ดจาก Trello", "import-board-title-wekan": "Import board from Wekan", + "import-sandstorm-warning": "Imported board will delete all existing data on board and replace it with imported board.", "from-trello": "From Trello", "from-wekan": "From Wekan", "import-board-instruction-trello": "ใน Trello ของคุณให้ไปที่ 'Menu' และไปที่ More -> Print and Export -> Export JSON และคัดลอกข้อความจากนั้น", diff --git a/i18n/tr.i18n.json b/i18n/tr.i18n.json index f678a4d0..328c0cbe 100644 --- a/i18n/tr.i18n.json +++ b/i18n/tr.i18n.json @@ -206,8 +206,10 @@ "home": "Ana Sayfa", "import": "İçeri aktar", "import-board": "import board", + "import-board-c": "Panoyu içe aktar", "import-board-title-trello": "Trello'dan panoyu içeri aktar", "import-board-title-wekan": "Wekan'dan panoyu içe aktar", + "import-sandstorm-warning": "Imported board will delete all existing data on board and replace it with imported board.", "from-trello": "Trello'dan", "from-wekan": "Wekan'dan", "import-board-instruction-trello": "Trello panonuzda, 'Menü'ye gidip, ardıdan, 'daha fazlası' na tıklayın, 'Yazdır ve Çıktı al' sayfasından 'JSON biçiminde çıktı al' diyip, çıkan metni buraya kopyalayın.", diff --git a/i18n/uk.i18n.json b/i18n/uk.i18n.json index 52e7d606..604afb31 100644 --- a/i18n/uk.i18n.json +++ b/i18n/uk.i18n.json @@ -206,8 +206,10 @@ "home": "Home", "import": "Import", "import-board": "import board", + "import-board-c": "Import board", "import-board-title-trello": "Import board from Trello", "import-board-title-wekan": "Import board from Wekan", + "import-sandstorm-warning": "Imported board will delete all existing data on board and replace it with imported board.", "from-trello": "From Trello", "from-wekan": "From Wekan", "import-board-instruction-trello": "In your Trello board, go to 'Menu', then 'More', 'Print and Export', 'Export JSON', and copy the resulting text.", diff --git a/i18n/vi.i18n.json b/i18n/vi.i18n.json index 858f25d7..edd193cb 100644 --- a/i18n/vi.i18n.json +++ b/i18n/vi.i18n.json @@ -206,8 +206,10 @@ "home": "Home", "import": "Import", "import-board": "import board", + "import-board-c": "Import board", "import-board-title-trello": "Import board from Trello", "import-board-title-wekan": "Import board from Wekan", + "import-sandstorm-warning": "Imported board will delete all existing data on board and replace it with imported board.", "from-trello": "From Trello", "from-wekan": "From Wekan", "import-board-instruction-trello": "In your Trello board, go to 'Menu', then 'More', 'Print and Export', 'Export JSON', and copy the resulting text.", diff --git a/i18n/zh-CN.i18n.json b/i18n/zh-CN.i18n.json index e2a66b4c..88f26768 100644 --- a/i18n/zh-CN.i18n.json +++ b/i18n/zh-CN.i18n.json @@ -206,8 +206,10 @@ "home": "首页", "import": "导入", "import-board": "import board", + "import-board-c": "Import board", "import-board-title-trello": "从Trello导入看板", "import-board-title-wekan": "Import board from Wekan", + "import-sandstorm-warning": "Imported board will delete all existing data on board and replace it with imported board.", "from-trello": "From Trello", "from-wekan": "From Wekan", "import-board-instruction-trello": "在你的Trello看板中,点击“菜单”,然后选择“更多”,“打印与导出”,“导出为 JSON” 并拷贝结果文本", diff --git a/i18n/zh-TW.i18n.json b/i18n/zh-TW.i18n.json index 35e839dc..ea13528d 100644 --- a/i18n/zh-TW.i18n.json +++ b/i18n/zh-TW.i18n.json @@ -206,8 +206,10 @@ "home": "首頁", "import": "匯入", "import-board": "import board", + "import-board-c": "Import board", "import-board-title-trello": "匯入在 Trello 的看板", "import-board-title-wekan": "Import board from Wekan", + "import-sandstorm-warning": "Imported board will delete all existing data on board and replace it with imported board.", "from-trello": "From Trello", "from-wekan": "From Wekan", "import-board-instruction-trello": "在你的Trello看板中,點選“功能表”,然後選擇“更多”,“列印與匯出”,“匯出為 JSON” 並拷貝結果文本", diff --git a/models/import.js b/models/import.js index 2e58c90f..09769794 100644 --- a/models/import.js +++ b/models/import.js @@ -2,10 +2,11 @@ import { TrelloCreator } from './trelloCreator'; import { WekanCreator } from './wekanCreator'; Meteor.methods({ - importBoard(board, data, importSource) { + importBoard(board, data, importSource, currentBoard) { check(board, Object); check(data, Object); check(importSource, String); + check(currentBoard, Match.Maybe(String)); let creator; switch (importSource) { case 'trello': @@ -23,6 +24,6 @@ Meteor.methods({ // authorized) nothing to check, everyone can import boards in their account // 3. create all elements - return creator.create(board); + return creator.create(board, currentBoard); }, }); diff --git a/models/trelloCreator.js b/models/trelloCreator.js index fbc4a878..aa86a5c8 100644 --- a/models/trelloCreator.js +++ b/models/trelloCreator.js @@ -488,7 +488,14 @@ export class TrelloCreator { } } - create(board) { + create(board, currentBoardId) { + // TODO : Make isSandstorm variable global + const isSandstorm = Meteor.settings && Meteor.settings.public && + Meteor.settings.public.sandstorm; + if (isSandstorm && currentBoardId) { + const currentBoard = Boards.findOne(currentBoardId); + currentBoard.archive(); + } this.parseActions(board.actions); const boardId = this.createBoardAndLabels(board); this.createLists(board.lists, boardId); diff --git a/models/wekanCreator.js b/models/wekanCreator.js index 6dd56fb1..b5f9b0ff 100644 --- a/models/wekanCreator.js +++ b/models/wekanCreator.js @@ -478,7 +478,14 @@ export class WekanCreator { } } - create(board) { + create(board, currentBoardId) { + // TODO : Make isSandstorm variable global + const isSandstorm = Meteor.settings && Meteor.settings.public && + Meteor.settings.public.sandstorm; + if (isSandstorm && currentBoardId) { + const currentBoard = Boards.findOne(currentBoardId); + currentBoard.archive(); + } this.parseActivities(board); const boardId = this.createBoardAndLabels(board); this.createLists(board.lists, boardId); |