Explorar o código

Merge pull request #4923 from DimDz/master

Fix for the Create Card at Calendar
Lauri Ojansivu %!s(int64=2) %!d(string=hai) anos
pai
achega
2d683ea198
Modificáronse 2 ficheiros con 22 adicións e 0 borrados
  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',
       id: 'calendar-view',
       defaultView: 'agendaDay',
       defaultView: 'agendaDay',
       editable: true,
       editable: true,
+      selecatble: true,
       timezone: 'local',
       timezone: 'local',
       weekNumbers: true,
       weekNumbers: true,
       header: {
       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) {
 function cardRemover(userId, doc) {
   ChecklistItems.remove({
   ChecklistItems.remove({
     cardId: doc._id,
     cardId: doc._id,