const { calculateIndexData } = Utils ;
let swimlaneColors ;
Meteor . startup ( ( ) => {
swimlaneColors = Swimlanes . simpleSchema ( ) . _schema . color . allowedValues ;
} ) ;
BlazeComponent . extendComponent ( {
editTitle ( event ) {
event . preventDefault ( ) ;
const newTitle = this . childComponents ( 'inlinedForm' ) [ 0 ]
. getValue ( )
. trim ( ) ;
const swimlane = this . currentData ( ) ;
if ( newTitle ) {
swimlane . rename ( newTitle . trim ( ) ) ;
}
} ,
events ( ) {
return [
{
'click .js-open-swimlane-menu' : Popup . open ( 'swimlaneAction' ) ,
'click .js-open-add-swimlane-menu' : Popup . open ( 'swimlaneAdd' ) ,
submit : this . editTitle ,
} ,
] ;
} ,
} ) . register ( 'swimlaneHeader' ) ;
Template . swimlaneHeader . helpers ( {
showDesktopDragHandles ( ) {
currentUser = Meteor . user ( ) ;
if ( currentUser ) {
return ( currentUser . profile || { } ) . showDesktopDragHandles ;
} else if ( window . localStorage . getItem ( 'showDesktopDragHandles' ) ) {
return true ;
New feature: Now there is popup selection of Lists/Swimlanes/Calendar/Roles.
New feature, not set visible yet, because switching to it does not
work properly yet: Collapsible Swimlanes #2804
Fix: Public board now loads correctly. When you select one of Lists/Swimlanes/Calendar view and
reload webbrowser page, it can change view. Closes #2311
Fix: List sorting commented out. Closes #2800
Fix: Errors hasHiddenMinicardText, hasShowDragHandles, showSort, hasSortBy, profile,
FirefoxAndroid/IE11/Vivaldi/Chromium browsers not working by using
cookies instead of database.
More details at https://github.com/wekan/wekan/issues/2643#issuecomment-554907955
Note: Cookie changes are not always immediate, if there is no effect,
you may need to reload webbrowser page.
Closes #2643 .
Thanks to xet7 !
6 years ago
} else {
return false ;
New feature: Now there is popup selection of Lists/Swimlanes/Calendar/Roles.
New feature, not set visible yet, because switching to it does not
work properly yet: Collapsible Swimlanes #2804
Fix: Public board now loads correctly. When you select one of Lists/Swimlanes/Calendar view and
reload webbrowser page, it can change view. Closes #2311
Fix: List sorting commented out. Closes #2800
Fix: Errors hasHiddenMinicardText, hasShowDragHandles, showSort, hasSortBy, profile,
FirefoxAndroid/IE11/Vivaldi/Chromium browsers not working by using
cookies instead of database.
More details at https://github.com/wekan/wekan/issues/2643#issuecomment-554907955
Note: Cookie changes are not always immediate, if there is no effect,
you may need to reload webbrowser page.
Closes #2643 .
Thanks to xet7 !
6 years ago
}
} ,
} ) ;
Template . swimlaneActionPopup . events ( {
'click .js-set-swimlane-color' : Popup . open ( 'setSwimlaneColor' ) ,
'click .js-close-swimlane' ( event ) {
event . preventDefault ( ) ;
this . archive ( ) ;
Popup . close ( ) ;
} ,
} ) ;
BlazeComponent . extendComponent ( {
onCreated ( ) {
this . currentSwimlane = this . currentData ( ) ;
} ,
events ( ) {
return [
{
submit ( event ) {
event . preventDefault ( ) ;
const currentBoard = Boards . findOne ( Session . get ( 'currentBoard' ) ) ;
const nextSwimlane = currentBoard . nextSwimlane ( this . currentSwimlane ) ;
const titleInput = this . find ( '.swimlane-name-input' ) ;
const title = titleInput . value . trim ( ) ;
const sortValue = calculateIndexData (
this . currentSwimlane ,
nextSwimlane ,
1 ,
) ;
const swimlaneType = currentBoard . isTemplatesBoard ( )
? 'template-swimlane'
: 'swimlane' ;
if ( title ) {
Swimlanes . insert ( {
title ,
boardId : Session . get ( 'currentBoard' ) ,
sort : sortValue . base ,
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 . close ( ) ;
} ,
'click .js-swimlane-template' : Popup . open ( 'searchElement' ) ,
} ,
] ;
} ,
} ) . register ( 'swimlaneAddPopup' ) ;
BlazeComponent . extendComponent ( {
onCreated ( ) {
this . currentSwimlane = this . currentData ( ) ;
this . currentColor = new ReactiveVar ( this . currentSwimlane . color ) ;
} ,
colors ( ) {
return swimlaneColors . map ( color => ( { color , name : '' } ) ) ;
} ,
isSelected ( color ) {
return this . currentColor . get ( ) === color ;
} ,
events ( ) {
return [
{
'click .js-palette-color' ( ) {
this . currentColor . set ( this . currentData ( ) . color ) ;
} ,
'click .js-submit' ( ) {
this . currentSwimlane . setColor ( this . currentColor . get ( ) ) ;
Popup . close ( ) ;
} ,
'click .js-remove-color' ( ) {
this . currentSwimlane . setColor ( null ) ;
Popup . close ( ) ;
} ,
} ,
] ;
} ,
} ) . register ( 'setSwimlaneColorPopup' ) ;