Browse Source

Confirm Archive Card.

Thanks to xet7 !
Lauri Ojansivu 3 years ago
parent
commit
6c3fcdcc4c

+ 6 - 0
client/components/cards/cardDetails.jade

@@ -826,6 +826,12 @@ template(name="cardDeletePopup")
     p {{_ "card-delete-suggest-archive"}}
     p {{_ "card-delete-suggest-archive"}}
   button.js-confirm.negate.full(type="submit") {{_ 'delete'}}
   button.js-confirm.negate.full(type="submit") {{_ 'delete'}}
 
 
+template(name="cardArchivePopup")
+  p {{_ "card-archive-pop"}}
+  unless archived
+    p {{_ "card-archive-suggest-cancel"}}
+  button.js-confirm.negate.full(type="submit") {{_ 'archive'}}
+
 template(name="deleteVotePopup")
 template(name="deleteVotePopup")
   p {{_ "vote-delete-pop"}}
   p {{_ "vote-delete-pop"}}
   button.js-confirm.negate.full(type="submit") {{_ 'delete'}}
   button.js-confirm.negate.full(type="submit") {{_ 'delete'}}

+ 4 - 4
client/components/cards/cardDetails.js

@@ -663,11 +663,11 @@ Template.cardDetailsActionsPopup.events({
     );
     );
     this.move(this.boardId, this.swimlaneId, this.listId, maxOrder + 1);
     this.move(this.boardId, this.swimlaneId, this.listId, maxOrder + 1);
   },
   },
-  'click .js-archive'(event) {
-    event.preventDefault();
-    this.archive();
+  'click .js-archive': Popup.afterConfirm('cardArchive', function () {
     Popup.close();
     Popup.close();
-  },
+    this.archive();
+    Utils.goBoardId(this.boardId);
+  }),
   'click .js-more': Popup.open('cardMore'),
   'click .js-more': Popup.open('cardMore'),
   'click .js-toggle-watch-card'() {
   'click .js-toggle-watch-card'() {
     const currentCard = this;
     const currentCard = this;

+ 3 - 0
i18n/en.i18n.json

@@ -159,6 +159,8 @@
   "card-delete-notice": "Deleting is permanent. You will lose all actions associated with this card.",
   "card-delete-notice": "Deleting is permanent. You will lose all actions associated with this card.",
   "card-delete-pop": "All actions will be removed from the activity feed and you won't be able to re-open the card. There is no undo.",
   "card-delete-pop": "All actions will be removed from the activity feed and you won't be able to re-open the card. There is no undo.",
   "card-delete-suggest-archive": "You can move a card to Archive to remove it from the board and preserve the activity.",
   "card-delete-suggest-archive": "You can move a card to Archive to remove it from the board and preserve the activity.",
+  "card-archive-pop": "Card will not be visible at this list after archiving card.",
+  "card-archive-suggest-cancel": "You can later restore card from Archive.",
   "card-due": "Due",
   "card-due": "Due",
   "card-due-on": "Due on",
   "card-due-on": "Due on",
   "card-spent": "Spent Time",
   "card-spent": "Spent Time",
@@ -207,6 +209,7 @@
   "deletePokerPopup-title": "Delete planning poker?",
   "deletePokerPopup-title": "Delete planning poker?",
   "poker-delete-pop": "Deleting is permanent. You will lose all actions associated with this planning poker.",
   "poker-delete-pop": "Deleting is permanent. You will lose all actions associated with this planning poker.",
   "cardDeletePopup-title": "Delete Card?",
   "cardDeletePopup-title": "Delete Card?",
+  "cardArchivePopup-title": "Archive Card?",
   "cardDetailsActionsPopup-title": "Card Actions",
   "cardDetailsActionsPopup-title": "Card Actions",
   "cardLabelsPopup-title": "Labels",
   "cardLabelsPopup-title": "Labels",
   "cardMembersPopup-title": "Members",
   "cardMembersPopup-title": "Members",

+ 1 - 1
server/rulesHelper.js

@@ -48,7 +48,7 @@ RulesHelper = {
         }
         }
       }
       }
       let matchesList = [value, '*'];
       let matchesList = [value, '*'];
-      if (field === 'cardTitle') {
+      if ((field === 'cardTitle') && (value !== undefined)) {
         matchesList = value.split(/\W/).concat(matchesList);
         matchesList = value.split(/\W/).concat(matchesList);
       }
       }
       matchingMap[field] = {
       matchingMap[field] = {