Merge pull request #5635 from NadavTasher/bugfix/move-swimlane-creation-button-to-board-header

Move swimlane creation button to board header when using swimlane view mode
This commit is contained in:
Lauri Ojansivu 2024-12-30 01:33:48 +02:00 committed by GitHub
commit 6427a5e5f1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 4 deletions

View file

@ -17,7 +17,8 @@ template(name="boardBody")
| {{_ 'tableVisibilityMode-allowPrivateOnly'}}
else
.board-wrapper(class=currentBoard.colorClass)
.board-canvas.js-swimlanes.dragscroll(
.board-canvas.js-swimlanes(
class="{{#if hasSwimlanes}}dragscroll{{/if}}"
class="{{#if Sidebar.isOpen}}is-sibling-sidebar-open{{/if}}"
class="{{#if MultiSelection.isActive}}is-multiselection-active{{/if}}"
class="{{#if draggingActive.get}}is-dragging-active{{/if}}")
@ -27,8 +28,13 @@ template(name="boardBody")
each currentBoard.swimlanes
+swimlane(this)
else if isViewSwimlanes
each currentBoard.swimlanes
+swimlane(this)
if hasSwimlanes
each currentBoard.swimlanes
+swimlane(this)
else
a.js-empty-board-add-swimlane(title="{{_ 'add-swimlane'}}")
h1.big-message.quiet
| {{_ 'add-swimlane'}} +
else if isViewLists
+listsGroup(currentBoard)
else if isViewCalendar

View file

@ -248,6 +248,10 @@ BlazeComponent.extendComponent({
}
},
hasSwimlanes() {
return Utils.getCurrentBoard().swimlanes().length > 0;
},
isViewLists() {
const currentUser = ReactiveCache.getCurrentUser();
if (currentUser) {
@ -288,6 +292,7 @@ BlazeComponent.extendComponent({
this._isDragging = false;
}
},
'click .js-empty-board-add-swimlane': Popup.open('swimlaneAdd'),
},
];
},

View file

@ -143,7 +143,7 @@ BlazeComponent.extendComponent({
Swimlanes.insert({
title,
boardId: Session.get('currentBoard'),
sort: sortValue.base,
sort: sortValue.base || 0,
type: swimlaneType,
});