Revert "Move swimlane creation button to board header when using swimlane view mode"

This reverts commit d51e8d1d1d.
This commit is contained in:
Nadav Tasher 2024-12-30 00:17:56 +02:00
parent d51e8d1d1d
commit fecae8d0a3
6 changed files with 74 additions and 60 deletions

View file

@ -2,8 +2,6 @@ import { ReactiveCache } from '/imports/reactiveCache';
import { TAPi18n } from '/imports/i18n';
import dragscroll from '@wekanteam/dragscroll';
const { calculateIndexData } = Utils;
/*
const DOWNCLS = 'fa-sort-down';
const UPCLS = 'fa-sort-up';
@ -70,7 +68,6 @@ BlazeComponent.extendComponent({
events() {
return [
{
'click .js-open-add-swimlane-menu': Popup.open('swimlaneAdd'),
'click .js-edit-board-title': Popup.open('boardChangeTitle'),
'click .js-star-board'() {
ReactiveCache.getCurrentUser().toggleBoardStar(Session.get('currentBoard'));
@ -131,41 +128,6 @@ BlazeComponent.extendComponent({
},
}).register('boardHeaderBar');
BlazeComponent.extendComponent({
events() {
return [
{
submit(event) {
event.preventDefault();
const currentBoard = Utils.getCurrentBoard();
const titleInput = this.find('.swimlane-name-input');
const title = titleInput.value.trim();
const swimlaneType = currentBoard.isTemplatesBoard()
? 'template-swimlane'
: 'swimlane';
if (title) {
Swimlanes.insert({
title,
boardId: Session.get('currentBoard'),
sort: 0,
type: swimlaneType,
});
titleInput.value = '';
titleInput.focus();
}
// XXX ideally, we should move the popup to the newly
// created swimlane so a user can add more than one swimlane
// with a minimum of interactions
Popup.back();
},
'click .js-swimlane-template': Popup.open('searchElement'),
},
];
},
}).register('swimlaneAddPopup');
Template.boardHeaderBar.helpers({
boardView() {
return Utils.boardView();