From 0bd8b298d758b7754abdef0323e014f6c803175b Mon Sep 17 00:00:00 2001 From: DimDz <70445835+DimDz@users.noreply.github.com> Date: Thu, 11 May 2023 12:48:11 +0300 Subject: [PATCH 1/3] Create Card from Calendar View --- client/components/boards/boardBody.js | 39 +++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/client/components/boards/boardBody.js b/client/components/boards/boardBody.js index 14a5f3ada..784316bb7 100644 --- a/client/components/boards/boardBody.js +++ b/client/components/boards/boardBody.js @@ -422,6 +422,45 @@ BlazeComponent.extendComponent({ revertFunc(); } }, + select: function(startDate) { + const currentBoard = Boards.findOne(Session.get('currentBoard')); + const currentUser = Meteor.user(); + const $modal = $(` + + `); + $modal.modal('show'); + $modal.find('#create-card-button').click(function() { + const myTitle = $modal.find('#card-title-input').val(); + if (myTitle) { + const firstList = currentBoard.draggableLists().fetch()[0]; + const firstSwimlane = currentBoard.swimlanes().fetch()[0]; + Meteor.call('createCardWithDueDate', currentBoard._id, firstList._id, myTitle, startDate.toDate(), firstSwimlane._id, function(error, result) { + if (error) { + console.log(error); + } else { + console.log("Card Created", result); + } + }); + $modal.modal('hide'); + } + }); + }, + }; }; }, isViewCalendar() { From 0867f728d1566f392275a55aa99e8d3eccf7ee21 Mon Sep 17 00:00:00 2001 From: DimDz <70445835+DimDz@users.noreply.github.com> Date: Thu, 11 May 2023 12:48:50 +0300 Subject: [PATCH 2/3] Calendar Modal --- client/components/boards/boardBody.css | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client/components/boards/boardBody.css b/client/components/boards/boardBody.css index b4db4765b..aa0e5740e 100644 --- a/client/components/boards/boardBody.css +++ b/client/components/boards/boardBody.css @@ -167,3 +167,11 @@ border-color: #2b004d; color: #fff !important; } +.modal-dialog { + display: flex; + justify-content: center; + align-items: center; +} +.modal-header { + text-align: center; +} From 4a5d05a19fd192c18bdb32dc41cbb49dd325dc04 Mon Sep 17 00:00:00 2001 From: DimDz <70445835+DimDz@users.noreply.github.com> Date: Thu, 11 May 2023 13:15:38 +0300 Subject: [PATCH 3/3] Fix typo --- client/components/boards/boardBody.js | 1 - 1 file changed, 1 deletion(-) diff --git a/client/components/boards/boardBody.js b/client/components/boards/boardBody.js index 784316bb7..92163fd58 100644 --- a/client/components/boards/boardBody.js +++ b/client/components/boards/boardBody.js @@ -461,7 +461,6 @@ BlazeComponent.extendComponent({ }); }, }; - }; }, isViewCalendar() { currentUser = Meteor.user();