瀏覽代碼

Merge branch 'GhassenRjab-export-import-sandstorm' into devel

Export and import boards in Sandstorm.
Thanks to GhassenRjab ! Related #1144 and #799
Lauri Ojansivu 8 年之前
父節點
當前提交
96c79f78cc

+ 7 - 2
CHANGELOG.md

@@ -2,9 +2,14 @@
 
 
 This release adds the following new features:
 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
 # v0.29 2017-07-21 Wekan release
 
 

+ 7 - 0
client/components/boards/boardArchive.js

@@ -18,6 +18,13 @@ BlazeComponent.extendComponent({
   events() {
   events() {
     return [{
     return [{
       'click .js-restore-board'() {
       '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();
         const board = this.currentData();
         board.restore();
         board.restore();
         Utils.goBoardId(board._id);
         Utils.goBoardId(board._id);

+ 13 - 2
client/components/boards/boardHeader.jade

@@ -71,6 +71,12 @@ template(name="boardHeaderBar")
               title="{{_ 'log-in'}}")
               title="{{_ 'log-in'}}")
               i.fa.fa-sign-in
               i.fa.fa-sign-in
               span {{_ 'log-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(
       a.board-header-btn.js-open-filter-view(
           title="{{#if Filter.isActive}}{{_ 'filter-on-desc'}}{{else}}{{_ 'filter'}}{{/if}}"
           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(href="{{exportUrl}}", download="{{exportFilename}}") {{_ 'export-board'}}
         li: a.js-archive-board {{_ 'archive-board'}}
         li: a.js-archive-board {{_ 'archive-board'}}
         li: a.js-outgoing-webhooks {{_ 'outgoing-webhooks'}}
         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")
 template(name="boardVisibilityList")
   ul.pop-over-list
   ul.pop-over-list
@@ -197,9 +208,9 @@ template(name="createBoard")
 template(name="chooseBoardSource")
 template(name="chooseBoardSource")
   ul.pop-over-list
   ul.pop-over-list
     li
     li
-      a(href="{{pathFor 'import/trello'}}") {{_ 'from-trello'}}
+      a(href="{{pathFor '/import/trello'}}") {{_ 'from-trello'}}
     li
     li
-      a(href="{{pathFor 'import/wekan'}}") {{_ 'from-wekan'}}
+      a(href="{{pathFor '/import/wekan'}}") {{_ 'from-wekan'}}
 
 
 template(name="boardChangeTitlePopup")
 template(name="boardChangeTitlePopup")
   form
   form

+ 4 - 0
client/components/boards/boardHeader.js

@@ -14,6 +14,7 @@ Template.boardMenuPopup.events({
     FlowRouter.go('home');
     FlowRouter.go('home');
   }),
   }),
   'click .js-outgoing-webhooks': Popup.open('outgoingWebhooks'),
   'click .js-outgoing-webhooks': Popup.open('outgoingWebhooks'),
+  'click .js-import-board': Popup.open('chooseBoardSource'),
 });
 });
 
 
 Template.boardMenuPopup.helpers({
 Template.boardMenuPopup.helpers({
@@ -76,6 +77,9 @@ BlazeComponent.extendComponent({
       'click .js-open-board-menu': Popup.open('boardMenu'),
       'click .js-open-board-menu': Popup.open('boardMenu'),
       'click .js-change-visibility': Popup.open('boardChangeVisibility'),
       'click .js-change-visibility': Popup.open('boardChangeVisibility'),
       'click .js-watch-board': Popup.open('boardChangeWatch'),
       'click .js-watch-board': Popup.open('boardChangeWatch'),
+      'click .js-open-archived-board'() {
+        Modal.open('archivedBoards');
+      },
       'click .js-open-filter-view'() {
       'click .js-open-filter-view'() {
         Sidebar.setView('filter');
         Sidebar.setView('filter');
       },
       },

+ 2 - 0
client/components/import/import.jade

@@ -15,6 +15,8 @@ template(name="importTextarea")
     p: label(for='import-textarea') {{_ instruction}}
     p: label(for='import-textarea') {{_ instruction}}
     textarea.js-import-json(placeholder="{{_ 'import-json-placeholder'}}" autofocus)
     textarea.js-import-json(placeholder="{{_ 'import-json-placeholder'}}" autofocus)
       | {{jsonText}}
       | {{jsonText}}
+    if isSandstorm
+      p.warning {{_ 'import-sandstorm-warning'}}
     input.primary.wide(type="submit" value="{{_ 'import'}}")
     input.primary.wide(type="submit" value="{{_ 'import'}}")
 
 
 template(name="importMapMembers")
 template(name="importMapMembers")

+ 2 - 0
client/components/import/import.js

@@ -68,10 +68,12 @@ BlazeComponent.extendComponent({
       this.importedData.get(),
       this.importedData.get(),
       additionalData,
       additionalData,
       this.importSource,
       this.importSource,
+      Session.get('fromBoard'),
       (err, res) => {
       (err, res) => {
         if (err) {
         if (err) {
           this.setError(err.error);
           this.setError(err.error);
         } else {
         } else {
+          Session.set('fromBoard', null);
           Utils.goBoardId(res);
           Utils.goBoardId(res);
         }
         }
       }
       }

+ 3 - 0
config/router.js

@@ -84,6 +84,9 @@ FlowRouter.route('/import/:source', {
   name: 'import',
   name: 'import',
   triggersEnter: [AccountsTemplates.ensureSignedIn],
   triggersEnter: [AccountsTemplates.ensureSignedIn],
   action(params) {
   action(params) {
+    if (Session.get('currentBoard')) {
+      Session.set('fromBoard', Session.get('currentBoard'));
+    }
     Session.set('currentBoard', null);
     Session.set('currentBoard', null);
     Session.set('currentCard', null);
     Session.set('currentCard', null);
     Session.set('importSource', params.source);
     Session.set('importSource', params.source);

+ 2 - 0
i18n/ar.i18n.json

@@ -206,8 +206,10 @@
     "home": "الرئيسية",
     "home": "الرئيسية",
     "import": "Import",
     "import": "Import",
     "import-board": "استيراد لوحة",
     "import-board": "استيراد لوحة",
+    "import-board-c": "استيراد لوحة",
     "import-board-title-trello": "Import board from Trello",
     "import-board-title-trello": "Import board from Trello",
     "import-board-title-wekan": "استيراد لوحة من ويكان",
     "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-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",
     "import-board-instruction-trello": "In your Trello board, go to 'Menu', then 'More', 'Print and Export', 'Export JSON', and copy the resulting text",

+ 2 - 0
i18n/br.i18n.json

@@ -206,8 +206,10 @@
     "home": "Home",
     "home": "Home",
     "import": "Import",
     "import": "Import",
     "import-board": "import board",
     "import-board": "import board",
+    "import-board-c": "Import board",
     "import-board-title-trello": "Import board from Trello",
     "import-board-title-trello": "Import board from Trello",
     "import-board-title-wekan": "Import board from Wekan",
     "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-trello": "From Trello",
     "from-wekan": "From Wekan",
     "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",
     "import-board-instruction-trello": "In your Trello board, go to 'Menu', then 'More', 'Print and Export', 'Export JSON', and copy the resulting text",

+ 2 - 0
i18n/ca.i18n.json

@@ -206,8 +206,10 @@
     "home": "Inici",
     "home": "Inici",
     "import": "importa",
     "import": "importa",
     "import-board": "import board",
     "import-board": "import board",
+    "import-board-c": "Import board",
     "import-board-title-trello": "Importa tauler des de Trello",
     "import-board-title-trello": "Importa tauler des de Trello",
     "import-board-title-wekan": "Import board from Wekan",
     "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-trello": "From Trello",
     "from-wekan": "From Wekan",
     "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.",
     "import-board-instruction-trello": "En el teu tauler Trello, ves a 'Menú', 'Més'.' Imprimir i Exportar', 'Exportar JSON', i copia el text resultant.",

+ 2 - 0
i18n/cs.i18n.json

@@ -206,8 +206,10 @@
     "home": "Domů",
     "home": "Domů",
     "import": "Import",
     "import": "Import",
     "import-board": "import board",
     "import-board": "import board",
+    "import-board-c": "Import board",
     "import-board-title-trello": "Import board from Trello",
     "import-board-title-trello": "Import board from Trello",
     "import-board-title-wekan": "Import board from Wekan",
     "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-trello": "From Trello",
     "from-wekan": "From Wekan",
     "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",
     "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",

+ 2 - 0
i18n/de.i18n.json

@@ -206,8 +206,10 @@
     "home": "Home",
     "home": "Home",
     "import": "Importieren",
     "import": "Importieren",
     "import-board": "import board",
     "import-board": "import board",
+    "import-board-c": "Import board",
     "import-board-title-trello": "Board von Trello importieren",
     "import-board-title-trello": "Board von Trello importieren",
     "import-board-title-wekan": "Import board from Wekan",
     "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-trello": "From Trello",
     "from-wekan": "From Wekan",
     "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",
     "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",

+ 2 - 0
i18n/en-GB.i18n.json

@@ -206,8 +206,10 @@
     "home": "Home",
     "home": "Home",
     "import": "Import",
     "import": "Import",
     "import-board": "import board",
     "import-board": "import board",
+    "import-board-c": "Import board",
     "import-board-title-trello": "Import board from Trello",
     "import-board-title-trello": "Import board from Trello",
     "import-board-title-wekan": "Import board from Wekan",
     "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-trello": "From Trello",
     "from-wekan": "From Wekan",
     "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.",
     "import-board-instruction-trello": "In your Trello board, go to 'Menu', then 'More', 'Print and Export', 'Export JSON', and copy the resulting text.",

+ 2 - 0
i18n/en.i18n.json

@@ -206,8 +206,10 @@
     "home": "Home",
     "home": "Home",
     "import": "Import",
     "import": "Import",
     "import-board": "import board",
     "import-board": "import board",
+    "import-board-c": "Import board",
     "import-board-title-trello": "Import board from Trello",
     "import-board-title-trello": "Import board from Trello",
     "import-board-title-wekan": "Import board from Wekan",
     "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-trello": "From Trello",
     "from-wekan": "From Wekan",
     "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.",
     "import-board-instruction-trello": "In your Trello board, go to 'Menu', then 'More', 'Print and Export', 'Export JSON', and copy the resulting text.",

+ 2 - 0
i18n/eo.i18n.json

@@ -206,8 +206,10 @@
     "home": "Hejmo",
     "home": "Hejmo",
     "import": "Importi",
     "import": "Importi",
     "import-board": "import board",
     "import-board": "import board",
+    "import-board-c": "Import board",
     "import-board-title-trello": "Import board from Trello",
     "import-board-title-trello": "Import board from Trello",
     "import-board-title-wekan": "Import board from Wekan",
     "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-trello": "From Trello",
     "from-wekan": "From Wekan",
     "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.",
     "import-board-instruction-trello": "In your Trello board, go to 'Menu', then 'More', 'Print and Export', 'Export JSON', and copy the resulting text.",

+ 2 - 0
i18n/es.i18n.json

@@ -206,8 +206,10 @@
     "home": "Inicio",
     "home": "Inicio",
     "import": "Importar",
     "import": "Importar",
     "import-board": "import board",
     "import-board": "import board",
+    "import-board-c": "Importar tablero",
     "import-board-title-trello": "Importar tablero desde Trello",
     "import-board-title-trello": "Importar tablero desde Trello",
     "import-board-title-wekan": "Import board from Wekan",
     "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-trello": "Desde Trello",
     "from-wekan": "Desde Wekan",
     "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",
     "import-board-instruction-trello": "In your Trello board, go to 'Menu', then 'More', 'Print and Export', 'Export JSON', and copy the resulting text",

+ 2 - 0
i18n/eu.i18n.json

@@ -206,8 +206,10 @@
     "home": "Hasiera",
     "home": "Hasiera",
     "import": "Inportatu",
     "import": "Inportatu",
     "import-board": "inportatu arbela",
     "import-board": "inportatu arbela",
+    "import-board-c": "Inportatu arbela",
     "import-board-title-trello": "Inportatu arbela Trellotik",
     "import-board-title-trello": "Inportatu arbela Trellotik",
     "import-board-title-wekan": "Inportatu arbela Wekanetik",
     "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-trello": "Trellotik",
     "from-wekan": "Wekanetik",
     "from-wekan": "Wekanetik",
     "import-board-instruction-trello": "Zure Trello arbelean, aukeratu 'Menu\", 'More', 'Print and Export', 'Export JSON', eta kopiatu jasotako testua hemen.",
     "import-board-instruction-trello": "Zure Trello arbelean, aukeratu 'Menu\", 'More', 'Print and Export', 'Export JSON', eta kopiatu jasotako testua hemen.",

+ 2 - 0
i18n/fa.i18n.json

@@ -206,8 +206,10 @@
     "home": "خانه",
     "home": "خانه",
     "import": "وارد کردن",
     "import": "وارد کردن",
     "import-board": "import board",
     "import-board": "import board",
+    "import-board-c": "Import board",
     "import-board-title-trello": "وارد کردن تخته ها از Trello",
     "import-board-title-trello": "وارد کردن تخته ها از Trello",
     "import-board-title-wekan": "Import board from Wekan",
     "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-trello": "From Trello",
     "from-wekan": "From Wekan",
     "from-wekan": "From Wekan",
     "import-board-instruction-trello": "در Trello-ی خود  به 'Menu'، 'More'، 'Print'، 'Export to JSON رفته و متن نهایی را دراینجا وارد نمایید.",
     "import-board-instruction-trello": "در Trello-ی خود  به 'Menu'، 'More'، 'Print'، 'Export to JSON رفته و متن نهایی را دراینجا وارد نمایید.",

+ 2 - 0
i18n/fi.i18n.json

@@ -206,8 +206,10 @@
     "home": "Koti",
     "home": "Koti",
     "import": "Tuo",
     "import": "Tuo",
     "import-board": "tuo taulu",
     "import-board": "tuo taulu",
+    "import-board-c": "Tuo taulu",
     "import-board-title-trello": "Tuo taulu Trellosta",
     "import-board-title-trello": "Tuo taulu Trellosta",
     "import-board-title-wekan": "Tuo taulu Wekanista",
     "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-trello": "Trellosta",
     "from-wekan": "Wekanista",
     "from-wekan": "Wekanista",
     "import-board-instruction-trello": "Trello taulullasi, mene 'Menu', sitten 'More', 'Print and Export', 'Export JSON', ja kopioi tuloksena saamasi teksti",
     "import-board-instruction-trello": "Trello taulullasi, mene 'Menu', sitten 'More', 'Print and Export', 'Export JSON', ja kopioi tuloksena saamasi teksti",

+ 2 - 0
i18n/fr.i18n.json

@@ -206,8 +206,10 @@
     "home": "Accueil",
     "home": "Accueil",
     "import": "Importer",
     "import": "Importer",
     "import-board": "importer un tableau",
     "import-board": "importer un tableau",
+    "import-board-c": "Importer un tableau",
     "import-board-title-trello": "Importer le tableau depuis Trello",
     "import-board-title-trello": "Importer le tableau depuis Trello",
     "import-board-title-wekan": "Importer un tableau depuis Wekan",
     "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-trello": "Depuis Trello",
     "from-wekan": "Depuis Wekan",
     "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",
     "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",

+ 2 - 0
i18n/gl.i18n.json

@@ -206,8 +206,10 @@
     "home": "Inicio",
     "home": "Inicio",
     "import": "Importar",
     "import": "Importar",
     "import-board": "importar taboleiro",
     "import-board": "importar taboleiro",
+    "import-board-c": "Importar taboleiro",
     "import-board-title-trello": "Importar taboleiro de Trello",
     "import-board-title-trello": "Importar taboleiro de Trello",
     "import-board-title-wekan": "Importar taboleiro de Wekan",
     "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-trello": "De Trello",
     "from-wekan": "De Wekan",
     "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.",
     "import-board-instruction-trello": "In your Trello board, go to 'Menu', then 'More', 'Print and Export', 'Export JSON', and copy the resulting text.",

+ 2 - 0
i18n/he.i18n.json

@@ -206,8 +206,10 @@
     "home": "בית",
     "home": "בית",
     "import": "יבוא",
     "import": "יבוא",
     "import-board": "יבוא לוח",
     "import-board": "יבוא לוח",
+    "import-board-c": "יבוא לוח",
     "import-board-title-trello": "ייבוא לוח מטרלו",
     "import-board-title-trello": "ייבוא לוח מטרלו",
     "import-board-title-wekan": "יבוא לוח מ־Wekan",
     "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-trello": "מ־Trello",
     "from-wekan": "מ־Wekan",
     "from-wekan": "מ־Wekan",
     "import-board-instruction-trello": "בלוח הטרלו שלך, עליך ללחוץ על ‚תפריט‘, ואז על ‚עוד‘, ‚הדפסה וייצוא‘, ‚יצוא JSON‘ ולהעתיק את הטקסט שנוצר.",
     "import-board-instruction-trello": "בלוח הטרלו שלך, עליך ללחוץ על ‚תפריט‘, ואז על ‚עוד‘, ‚הדפסה וייצוא‘, ‚יצוא JSON‘ ולהעתיק את הטקסט שנוצר.",

+ 2 - 0
i18n/hu.i18n.json

@@ -206,8 +206,10 @@
     "home": "Kezdőlap",
     "home": "Kezdőlap",
     "import": "Importálás",
     "import": "Importálás",
     "import-board": "import board",
     "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-trello": "Tábla importálása a Trello-ról",
     "import-board-title-wekan": "Import board from Wekan",
     "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-trello": "From Trello",
     "from-wekan": "From Wekan",
     "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.",
     "import-board-instruction-trello": "In your Trello board, go to 'Menu', then 'More', 'Print and Export', 'Export JSON', and copy the resulting text.",

+ 2 - 0
i18n/id.i18n.json

@@ -206,8 +206,10 @@
     "home": "Beranda",
     "home": "Beranda",
     "import": "Impor",
     "import": "Impor",
     "import-board": "import board",
     "import-board": "import board",
+    "import-board-c": "Import board",
     "import-board-title-trello": "Impor panel dari Trello",
     "import-board-title-trello": "Impor panel dari Trello",
     "import-board-title-wekan": "Import board from Wekan",
     "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-trello": "From Trello",
     "from-wekan": "From Wekan",
     "from-wekan": "From Wekan",
     "import-board-instruction-trello": "Di panel Trello anda, ke 'Menu', terus 'More', 'Print and Export','Export JSON', dan salin hasilnya",
     "import-board-instruction-trello": "Di panel Trello anda, ke 'Menu', terus 'More', 'Print and Export','Export JSON', dan salin hasilnya",

+ 2 - 0
i18n/it.i18n.json

@@ -206,8 +206,10 @@
     "home": "Home",
     "home": "Home",
     "import": "Importa",
     "import": "Importa",
     "import-board": "Importa bacheca",
     "import-board": "Importa bacheca",
+    "import-board-c": "Importa bacheca",
     "import-board-title-trello": "Importa una bacheca da Trello",
     "import-board-title-trello": "Importa una bacheca da Trello",
     "import-board-title-wekan": "Importa bacheca da Wekan",
     "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-trello": "Da Trello",
     "from-wekan": "Da Wekan",
     "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.",
     "import-board-instruction-trello": "Nella tua bacheca Trello vai a 'Menu', poi 'Altro', 'Stampa ed esporta', 'Esporta JSON', e copia il testo che compare.",

+ 2 - 0
i18n/ja.i18n.json

@@ -206,8 +206,10 @@
     "home": "ホーム",
     "home": "ホーム",
     "import": "インポート",
     "import": "インポート",
     "import-board": "import board",
     "import-board": "import board",
+    "import-board-c": "Import board",
     "import-board-title-trello": "Trelloからボードをインポート",
     "import-board-title-trello": "Trelloからボードをインポート",
     "import-board-title-wekan": "Import board from Wekan",
     "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-trello": "From Trello",
     "from-wekan": "From Wekan",
     "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",
     "import-board-instruction-trello": "In your Trello board, go to 'Menu', then 'More', 'Print and Export', 'Export JSON', and copy the resulting text",

+ 2 - 0
i18n/ko.i18n.json

@@ -206,8 +206,10 @@
     "home": "홈",
     "home": "홈",
     "import": "가져오기",
     "import": "가져오기",
     "import-board": "import board",
     "import-board": "import board",
+    "import-board-c": "Import board",
     "import-board-title-trello": "Trello에서 보드 가져오기",
     "import-board-title-trello": "Trello에서 보드 가져오기",
     "import-board-title-wekan": "Import board from Wekan",
     "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-trello": "From Trello",
     "from-wekan": "From Wekan",
     "from-wekan": "From Wekan",
     "import-board-instruction-trello": "Trello 게시판에서 'Menu' -> 'More' -> 'Print and Export', 'Export JSON' 선택하여 텍스트 결과값 복사",
     "import-board-instruction-trello": "Trello 게시판에서 'Menu' -> 'More' -> 'Print and Export', 'Export JSON' 선택하여 텍스트 결과값 복사",

+ 2 - 0
i18n/nb.i18n.json

@@ -206,8 +206,10 @@
     "home": "Home",
     "home": "Home",
     "import": "Import",
     "import": "Import",
     "import-board": "import board",
     "import-board": "import board",
+    "import-board-c": "Import board",
     "import-board-title-trello": "Import board from Trello",
     "import-board-title-trello": "Import board from Trello",
     "import-board-title-wekan": "Import board from Wekan",
     "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-trello": "From Trello",
     "from-wekan": "From Wekan",
     "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.",
     "import-board-instruction-trello": "In your Trello board, go to 'Menu', then 'More', 'Print and Export', 'Export JSON', and copy the resulting text.",

+ 2 - 0
i18n/nl.i18n.json

@@ -206,8 +206,10 @@
     "home": "Home",
     "home": "Home",
     "import": "Import",
     "import": "Import",
     "import-board": "import board",
     "import-board": "import board",
+    "import-board-c": "Import board",
     "import-board-title-trello": "Import board from Trello",
     "import-board-title-trello": "Import board from Trello",
     "import-board-title-wekan": "Import board from Wekan",
     "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-trello": "From Trello",
     "from-wekan": "From Wekan",
     "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.",
     "import-board-instruction-trello": "In your Trello board, go to 'Menu', then 'More', 'Print and Export', 'Export JSON', and copy the resulting text.",

+ 2 - 0
i18n/pl.i18n.json

@@ -206,8 +206,10 @@
     "home": "Strona główna",
     "home": "Strona główna",
     "import": "Importu",
     "import": "Importu",
     "import-board": "import board",
     "import-board": "import board",
+    "import-board-c": "Import board",
     "import-board-title-trello": "Import board from Trello",
     "import-board-title-trello": "Import board from Trello",
     "import-board-title-wekan": "Import board from Wekan",
     "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-trello": "From Trello",
     "from-wekan": "From Wekan",
     "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",
     "import-board-instruction-trello": "W twojej tablicy na Trello, idź do 'Menu', następnie 'More', 'Print and Export', 'Export JSON' i skopiuj wynik",

+ 2 - 0
i18n/pt-BR.i18n.json

@@ -206,8 +206,10 @@
     "home": "Início",
     "home": "Início",
     "import": "Importar",
     "import": "Importar",
     "import-board": "importar quadro",
     "import-board": "importar quadro",
+    "import-board-c": "Importar quadro",
     "import-board-title-trello": "Importar board do Trello",
     "import-board-title-trello": "Importar board do Trello",
     "import-board-title-wekan": "Importar quadro do Wekan",
     "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-trello": "Do Trello",
     "from-wekan": "Do Wekan",
     "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",
     "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",

+ 2 - 0
i18n/ro.i18n.json

@@ -206,8 +206,10 @@
     "home": "Home",
     "home": "Home",
     "import": "Import",
     "import": "Import",
     "import-board": "import board",
     "import-board": "import board",
+    "import-board-c": "Import board",
     "import-board-title-trello": "Import board from Trello",
     "import-board-title-trello": "Import board from Trello",
     "import-board-title-wekan": "Import board from Wekan",
     "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-trello": "From Trello",
     "from-wekan": "From Wekan",
     "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",
     "import-board-instruction-trello": "In your Trello board, go to 'Menu', then 'More', 'Print and Export', 'Export JSON', and copy the resulting text",

+ 2 - 0
i18n/ru.i18n.json

@@ -206,8 +206,10 @@
     "home": "Главная",
     "home": "Главная",
     "import": "Импорт",
     "import": "Импорт",
     "import-board": "импортировать доску",
     "import-board": "импортировать доску",
+    "import-board-c": "Импортировать доску",
     "import-board-title-trello": "Импортировать доску из Trello",
     "import-board-title-trello": "Импортировать доску из Trello",
     "import-board-title-wekan": "Импортировать доску с Wekan",
     "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-trello": "Из Trello",
     "from-wekan": "Их Wekan",
     "from-wekan": "Их Wekan",
     "import-board-instruction-trello": "На вашей Trello доске нажмите “Menu” - “More” - “Print and export - “Export JSON” и скопируйте полученный текст",
     "import-board-instruction-trello": "На вашей Trello доске нажмите “Menu” - “More” - “Print and export - “Export JSON” и скопируйте полученный текст",

+ 2 - 0
i18n/sr.i18n.json

@@ -206,8 +206,10 @@
     "home": "Home",
     "home": "Home",
     "import": "Import",
     "import": "Import",
     "import-board": "import board",
     "import-board": "import board",
+    "import-board-c": "Import board",
     "import-board-title-trello": "Uvezi tablu iz Trella",
     "import-board-title-trello": "Uvezi tablu iz Trella",
     "import-board-title-wekan": "Import board from Wekan",
     "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-trello": "From Trello",
     "from-wekan": "From Wekan",
     "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",
     "import-board-instruction-trello": "In your Trello board, go to 'Menu', then 'More', 'Print and Export', 'Export JSON', and copy the resulting text",

+ 2 - 0
i18n/sv.i18n.json

@@ -206,8 +206,10 @@
     "home": "Hem",
     "home": "Hem",
     "import": "Importera",
     "import": "Importera",
     "import-board": "import board",
     "import-board": "import board",
+    "import-board-c": "Import board",
     "import-board-title-trello": "Importera anslagstavla från Trello",
     "import-board-title-trello": "Importera anslagstavla från Trello",
     "import-board-title-wekan": "Import board from Wekan",
     "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-trello": "From Trello",
     "from-wekan": "From Wekan",
     "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.",
     "import-board-instruction-trello": "I din Trello-anslagstavla, gå till 'Meny', sedan 'Mera', 'Skriv ut och exportera', 'Exportera JSON' och kopiera den resulterande text.",

+ 2 - 0
i18n/ta.i18n.json

@@ -206,8 +206,10 @@
     "home": "Home",
     "home": "Home",
     "import": "Import",
     "import": "Import",
     "import-board": "import board",
     "import-board": "import board",
+    "import-board-c": "Import board",
     "import-board-title-trello": "Import board from Trello",
     "import-board-title-trello": "Import board from Trello",
     "import-board-title-wekan": "Import board from Wekan",
     "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-trello": "From Trello",
     "from-wekan": "From Wekan",
     "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.",
     "import-board-instruction-trello": "In your Trello board, go to 'Menu', then 'More', 'Print and Export', 'Export JSON', and copy the resulting text.",

+ 2 - 0
i18n/th.i18n.json

@@ -206,8 +206,10 @@
     "home": "หน้าหลัก",
     "home": "หน้าหลัก",
     "import": "นำเข้า",
     "import": "นำเข้า",
     "import-board": "import board",
     "import-board": "import board",
+    "import-board-c": "Import board",
     "import-board-title-trello": "นำเข้าบอร์ดจาก Trello",
     "import-board-title-trello": "นำเข้าบอร์ดจาก Trello",
     "import-board-title-wekan": "Import board from Wekan",
     "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-trello": "From Trello",
     "from-wekan": "From Wekan",
     "from-wekan": "From Wekan",
     "import-board-instruction-trello": "ใน Trello ของคุณให้ไปที่ 'Menu' และไปที่ More -> Print and Export -> Export JSON และคัดลอกข้อความจากนั้น",
     "import-board-instruction-trello": "ใน Trello ของคุณให้ไปที่ 'Menu' และไปที่ More -> Print and Export -> Export JSON และคัดลอกข้อความจากนั้น",

+ 2 - 0
i18n/tr.i18n.json

@@ -206,8 +206,10 @@
     "home": "Ana Sayfa",
     "home": "Ana Sayfa",
     "import": "İçeri aktar",
     "import": "İçeri aktar",
     "import-board": "import board",
     "import-board": "import board",
+    "import-board-c": "Panoyu içe aktar",
     "import-board-title-trello": "Trello'dan panoyu içeri aktar",
     "import-board-title-trello": "Trello'dan panoyu içeri aktar",
     "import-board-title-wekan": "Wekan'dan panoyu içe 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-trello": "Trello'dan",
     "from-wekan": "Wekan'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.",
     "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.",

+ 2 - 0
i18n/uk.i18n.json

@@ -206,8 +206,10 @@
     "home": "Home",
     "home": "Home",
     "import": "Import",
     "import": "Import",
     "import-board": "import board",
     "import-board": "import board",
+    "import-board-c": "Import board",
     "import-board-title-trello": "Import board from Trello",
     "import-board-title-trello": "Import board from Trello",
     "import-board-title-wekan": "Import board from Wekan",
     "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-trello": "From Trello",
     "from-wekan": "From Wekan",
     "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.",
     "import-board-instruction-trello": "In your Trello board, go to 'Menu', then 'More', 'Print and Export', 'Export JSON', and copy the resulting text.",

+ 2 - 0
i18n/vi.i18n.json

@@ -206,8 +206,10 @@
     "home": "Home",
     "home": "Home",
     "import": "Import",
     "import": "Import",
     "import-board": "import board",
     "import-board": "import board",
+    "import-board-c": "Import board",
     "import-board-title-trello": "Import board from Trello",
     "import-board-title-trello": "Import board from Trello",
     "import-board-title-wekan": "Import board from Wekan",
     "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-trello": "From Trello",
     "from-wekan": "From Wekan",
     "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.",
     "import-board-instruction-trello": "In your Trello board, go to 'Menu', then 'More', 'Print and Export', 'Export JSON', and copy the resulting text.",

+ 2 - 0
i18n/zh-CN.i18n.json

@@ -206,8 +206,10 @@
     "home": "首页",
     "home": "首页",
     "import": "导入",
     "import": "导入",
     "import-board": "import board",
     "import-board": "import board",
+    "import-board-c": "Import board",
     "import-board-title-trello": "从Trello导入看板",
     "import-board-title-trello": "从Trello导入看板",
     "import-board-title-wekan": "Import board from Wekan",
     "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-trello": "From Trello",
     "from-wekan": "From Wekan",
     "from-wekan": "From Wekan",
     "import-board-instruction-trello": "在你的Trello看板中,点击“菜单”,然后选择“更多”,“打印与导出”,“导出为 JSON” 并拷贝结果文本",
     "import-board-instruction-trello": "在你的Trello看板中,点击“菜单”,然后选择“更多”,“打印与导出”,“导出为 JSON” 并拷贝结果文本",

+ 2 - 0
i18n/zh-TW.i18n.json

@@ -206,8 +206,10 @@
     "home": "首頁",
     "home": "首頁",
     "import": "匯入",
     "import": "匯入",
     "import-board": "import board",
     "import-board": "import board",
+    "import-board-c": "Import board",
     "import-board-title-trello": "匯入在 Trello 的看板",
     "import-board-title-trello": "匯入在 Trello 的看板",
     "import-board-title-wekan": "Import board from Wekan",
     "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-trello": "From Trello",
     "from-wekan": "From Wekan",
     "from-wekan": "From Wekan",
     "import-board-instruction-trello": "在你的Trello看板中,點選“功能表”,然後選擇“更多”,“列印與匯出”,“匯出為 JSON” 並拷貝結果文本",
     "import-board-instruction-trello": "在你的Trello看板中,點選“功能表”,然後選擇“更多”,“列印與匯出”,“匯出為 JSON” 並拷貝結果文本",

+ 3 - 2
models/import.js

@@ -2,10 +2,11 @@ import { TrelloCreator } from './trelloCreator';
 import { WekanCreator } from './wekanCreator';
 import { WekanCreator } from './wekanCreator';
 
 
 Meteor.methods({
 Meteor.methods({
-  importBoard(board, data, importSource) {
+  importBoard(board, data, importSource, currentBoard) {
     check(board, Object);
     check(board, Object);
     check(data, Object);
     check(data, Object);
     check(importSource, String);
     check(importSource, String);
+    check(currentBoard, Match.Maybe(String));
     let creator;
     let creator;
     switch (importSource) {
     switch (importSource) {
     case 'trello':
     case 'trello':
@@ -23,6 +24,6 @@ Meteor.methods({
     // authorized) nothing to check, everyone can import boards in their account
     // authorized) nothing to check, everyone can import boards in their account
 
 
     // 3. create all elements
     // 3. create all elements
-    return creator.create(board);
+    return creator.create(board, currentBoard);
   },
   },
 });
 });

+ 8 - 1
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);
     this.parseActions(board.actions);
     const boardId = this.createBoardAndLabels(board);
     const boardId = this.createBoardAndLabels(board);
     this.createLists(board.lists, boardId);
     this.createLists(board.lists, boardId);

+ 8 - 1
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);
     this.parseActivities(board);
     const boardId = this.createBoardAndLabels(board);
     const boardId = this.createBoardAndLabels(board);
     this.createLists(board.lists, boardId);
     this.createLists(board.lists, boardId);