From e5193870fc8a889fb73860e1164fa460f198a7c6 Mon Sep 17 00:00:00 2001 From: "DPLV\\dpoz" Date: Mon, 8 Jan 2018 08:35:30 +0800 Subject: working fix for wekan/wekan#476 in lists working fix for wekan/wekan#476 in lists --- client/components/lists/list.styl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'client/components/lists') diff --git a/client/components/lists/list.styl b/client/components/lists/list.styl index d5800140..21d267ca 100644 --- a/client/components/lists/list.styl +++ b/client/components/lists/list.styl @@ -88,12 +88,14 @@ .list-body flex: 1 + flex-direction: column display: flex overflow-y: auto padding: 5px 11px .minicards - flex: 1 + flex-grow: 1 + flex-shrink: 0 form margin-bottom: 9px -- cgit v1.2.3-1-g7c22 From 690a5b970319ceabc0be965152187d7098022621 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Manelli?= Date: Fri, 19 Jan 2018 12:22:03 -0300 Subject: First swimlane draft, no functionality --- client/components/lists/list.js | 2 +- client/components/lists/listBody.jade | 2 +- client/components/lists/listBody.js | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) (limited to 'client/components/lists') diff --git a/client/components/lists/list.js b/client/components/lists/list.js index a65ccc56..1d38f8f6 100644 --- a/client/components/lists/list.js +++ b/client/components/lists/list.js @@ -18,7 +18,7 @@ BlazeComponent.extendComponent({ // callback, we basically solve all issues related to reactive updates. A // comment below provides further details. onRendered() { - const boardComponent = this.parentComponent(); + const boardComponent = this.parentComponent().parentComponent(); const itemsSelector = '.js-minicard:not(.placeholder, .js-card-composer)'; const $cards = this.$('.js-minicards'); $cards.sortable({ diff --git a/client/components/lists/listBody.jade b/client/components/lists/listBody.jade index 840fd801..abe0298b 100644 --- a/client/components/lists/listBody.jade +++ b/client/components/lists/listBody.jade @@ -4,7 +4,7 @@ template(name="listBody") if cards.count +inlinedForm(autoclose=false position="top") +addCardForm(listId=_id position="top") - each cards + each cards ../../_id a.minicard-wrapper.js-minicard(href=absoluteUrl class="{{#if cardIsSelected}}is-selected{{/if}}" class="{{#if MultiSelection.isSelected _id}}is-checked{{/if}}") diff --git a/client/components/lists/listBody.js b/client/components/lists/listBody.js index fe2f1630..7a63eab6 100644 --- a/client/components/lists/listBody.js +++ b/client/components/lists/listBody.js @@ -36,6 +36,7 @@ BlazeComponent.extendComponent({ const members = formComponent.members.get(); const labelIds = formComponent.labels.get(); + const swimlaneId = this.parentComponent().parentComponent().data()._id; if (title) { const _id = Cards.insert({ title, @@ -44,6 +45,7 @@ BlazeComponent.extendComponent({ listId: this.data()._id, boardId: this.data().board()._id, sort: sortIndex, + swimlaneId: swimlaneId, }); // In case the filter is active we need to add the newly inserted card in // the list of exceptions -- cards that are not filtered. Otherwise the -- cgit v1.2.3-1-g7c22 From ee2a43dd5b4b5296f61f68b46fd85521224f571d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Manelli?= Date: Fri, 19 Jan 2018 16:00:02 -0300 Subject: Add siwmlane button. Allow card drop between swimlanes --- client/components/lists/list.js | 5 +++-- client/components/lists/list.styl | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'client/components/lists') diff --git a/client/components/lists/list.js b/client/components/lists/list.js index 1d38f8f6..e922a3fd 100644 --- a/client/components/lists/list.js +++ b/client/components/lists/list.js @@ -55,6 +55,7 @@ BlazeComponent.extendComponent({ const nCards = MultiSelection.isActive() ? MultiSelection.count() : 1; const sortIndex = calculateIndex(prevCardDom, nextCardDom, nCards); const listId = Blaze.getData(ui.item.parents('.list').get(0))._id; + const swimlaneId = Blaze.getData(ui.item.parents('.swimlane').get(0))._id; // Normally the jquery-ui sortable library moves the dragged DOM element // to its new position, which disrupts Blaze reactive updates mechanism @@ -67,12 +68,12 @@ BlazeComponent.extendComponent({ if (MultiSelection.isActive()) { Cards.find(MultiSelection.getMongoSelector()).forEach((card, i) => { - card.move(listId, sortIndex.base + i * sortIndex.increment); + card.move(swimlaneId, listId, sortIndex.base + i * sortIndex.increment); }); } else { const cardDomElement = ui.item.get(0); const card = Blaze.getData(cardDomElement); - card.move(listId, sortIndex.base); + card.move(swimlaneId, listId, sortIndex.base); } boardComponent.setIsDragging(false); }, diff --git a/client/components/lists/list.styl b/client/components/lists/list.styl index 21d267ca..c3753360 100644 --- a/client/components/lists/list.styl +++ b/client/components/lists/list.styl @@ -9,7 +9,6 @@ // Even if this background color is the same as the body we can't leave it // transparent, because that won't work during a list drag. background: darken(white, 13%) - height: 100% border-left: 1px solid darken(white, 20%) padding: 0 float: left -- cgit v1.2.3-1-g7c22 From 2d7d9b5d9ffed0349b2cf65acc61561c21d05aaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Manelli?= Date: Mon, 22 Jan 2018 15:31:33 -0300 Subject: Fix lint errors --- client/components/lists/listBody.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'client/components/lists') diff --git a/client/components/lists/listBody.js b/client/components/lists/listBody.js index 7a63eab6..0911f828 100644 --- a/client/components/lists/listBody.js +++ b/client/components/lists/listBody.js @@ -45,7 +45,7 @@ BlazeComponent.extendComponent({ listId: this.data()._id, boardId: this.data().board()._id, sort: sortIndex, - swimlaneId: swimlaneId, + swimlaneId, }); // In case the filter is active we need to add the newly inserted card in // the list of exceptions -- cards that are not filtered. Otherwise the -- cgit v1.2.3-1-g7c22 From 7b04f14e3c33db0b1c3ecff003262e7689383a15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Manelli?= Date: Mon, 22 Jan 2018 23:35:23 -0300 Subject: Allow toogle of lists and swimlanes views --- client/components/lists/listBody.jade | 2 +- client/components/lists/listBody.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'client/components/lists') diff --git a/client/components/lists/listBody.jade b/client/components/lists/listBody.jade index abe0298b..32c6b278 100644 --- a/client/components/lists/listBody.jade +++ b/client/components/lists/listBody.jade @@ -4,7 +4,7 @@ template(name="listBody") if cards.count +inlinedForm(autoclose=false position="top") +addCardForm(listId=_id position="top") - each cards ../../_id + each (cards (idOrNull ../../_id)) a.minicard-wrapper.js-minicard(href=absoluteUrl class="{{#if cardIsSelected}}is-selected{{/if}}" class="{{#if MultiSelection.isSelected _id}}is-checked{{/if}}") diff --git a/client/components/lists/listBody.js b/client/components/lists/listBody.js index 0911f828..2ca654b2 100644 --- a/client/components/lists/listBody.js +++ b/client/components/lists/listBody.js @@ -98,6 +98,13 @@ BlazeComponent.extendComponent({ MultiSelection.toggle(this.currentData()._id); }, + idOrNull(swimlaneId) { + const board = Boards.findOne(Session.get('currentBoard')); + if (board.view === 'board-view-swimlanes') + return swimlaneId; + return undefined; + }, + canSeeAddCard() { return !this.reachedWipLimit() && Meteor.user() && Meteor.user().isBoardMember() && !Meteor.user().isCommentOnly(); }, -- cgit v1.2.3-1-g7c22 From af119ff7c096e6cb077ba40e1eb0df8d3cc09821 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Manelli?= Date: Mon, 22 Jan 2018 23:43:47 -0300 Subject: Add card on first swimlane found --- client/components/lists/listBody.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'client/components/lists') diff --git a/client/components/lists/listBody.js b/client/components/lists/listBody.js index 2ca654b2..6cc94371 100644 --- a/client/components/lists/listBody.js +++ b/client/components/lists/listBody.js @@ -36,7 +36,14 @@ BlazeComponent.extendComponent({ const members = formComponent.members.get(); const labelIds = formComponent.labels.get(); - const swimlaneId = this.parentComponent().parentComponent().data()._id; + const boardId = this.data().board()._id; + const board = Boards.findOne(boardId); + let swimlaneId = ''; + if (board.view === 'board-view-swimlanes') + swimlaneId = this.parentComponent().parentComponent().data()._id; + else + swimlaneId = Swimlanes.findOne({boardId})._id; + if (title) { const _id = Cards.insert({ title, -- cgit v1.2.3-1-g7c22