Browse Source

Merge pull request #4923 from DimDz/master

Fix for the Create Card at Calendar
Lauri Ojansivu 2 years ago
parent
commit
2d683ea198
2 changed files with 22 additions and 0 deletions
  1. 1 0
      client/components/boards/boardBody.js
  2. 21 0
      models/cards.js

+ 1 - 0
client/components/boards/boardBody.js

@@ -328,6 +328,7 @@ BlazeComponent.extendComponent({
       id: 'calendar-view',
       defaultView: 'agendaDay',
       editable: true,
+      selecatble: true,
       timezone: 'local',
       weekNumbers: true,
       header: {

+ 21 - 0
models/cards.js

@@ -2943,6 +2943,27 @@ function cardCreation(userId, doc) {
   });
 }
 
+Meteor.methods({
+  createCardWithDueDate: function(boardId, listId, title, dueDate, swimlaneId) {
+    check(boardId, String);
+    check(listId, String);
+    check(title, String);
+    check(dueDate, Date);
+    check(swimlaneId, String);
+    const card = {
+      title,
+      listId,
+      boardId,
+      swimlaneId,
+      createdAt: new Date(),
+      dueAt: dueDate,
+      sort: 0,
+    };
+    const cardId = Cards.insert(card);
+    return cardId;
+  },
+});
+
 function cardRemover(userId, doc) {
   ChecklistItems.remove({
     cardId: doc._id,