From b7c5ba3d1b97bc33c95618cefbd0416d78a4d4dc Mon Sep 17 00:00:00 2001 From: Steffen Date: Thu, 29 Aug 2019 13:53:40 +0200 Subject: add card color to calendar event (#2651) --- client/components/boards/boardBody.js | 1 + 1 file changed, 1 insertion(+) (limited to 'client/components/boards/boardBody.js') diff --git a/client/components/boards/boardBody.js b/client/components/boards/boardBody.js index 6cff5ab1..07cd306a 100644 --- a/client/components/boards/boardBody.js +++ b/client/components/boards/boardBody.js @@ -326,6 +326,7 @@ BlazeComponent.extendComponent({ slug: currentBoard.slug, cardId: card._id, }), + className: card.color ? `calendar-event-${card.color}` : null, }); }); callback(events); -- cgit v1.2.3-1-g7c22 From ff550e91103115e7b731dd80c4588b93b2d4c64f Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Fri, 13 Sep 2019 03:45:55 +0300 Subject: Mobile and Desktop drag handles part 1. Thanks to xet7 ! Related #2081 --- client/components/boards/boardBody.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'client/components/boards/boardBody.js') diff --git a/client/components/boards/boardBody.js b/client/components/boards/boardBody.js index 07cd306a..713b6cbc 100644 --- a/client/components/boards/boardBody.js +++ b/client/components/boards/boardBody.js @@ -89,7 +89,7 @@ BlazeComponent.extendComponent({ helper.append(list.clone()); return helper; }, - handle: '.js-swimlane-header', + handle: '.js-swimlane-header-handle', items: '.swimlane:not(.placeholder)', placeholder: 'swimlane placeholder', distance: 7, -- cgit v1.2.3-1-g7c22 From 57119868bbb49f47c7d0b51b9952df9bd83d46f5 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Sat, 14 Sep 2019 05:55:32 +0300 Subject: Revert drag handle changes. Thanks to Keelan ! Related #2704 --- client/components/boards/boardBody.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'client/components/boards/boardBody.js') diff --git a/client/components/boards/boardBody.js b/client/components/boards/boardBody.js index 713b6cbc..07cd306a 100644 --- a/client/components/boards/boardBody.js +++ b/client/components/boards/boardBody.js @@ -89,7 +89,7 @@ BlazeComponent.extendComponent({ helper.append(list.clone()); return helper; }, - handle: '.js-swimlane-header-handle', + handle: '.js-swimlane-header', items: '.swimlane:not(.placeholder)', placeholder: 'swimlane placeholder', distance: 7, -- cgit v1.2.3-1-g7c22 From 03d7fc02ecc90690e1282d417f35b7e4561af066 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Tue, 17 Sep 2019 01:39:10 +0300 Subject: Drag handles. In Progress. --- client/components/boards/boardBody.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'client/components/boards/boardBody.js') diff --git a/client/components/boards/boardBody.js b/client/components/boards/boardBody.js index 07cd306a..713b6cbc 100644 --- a/client/components/boards/boardBody.js +++ b/client/components/boards/boardBody.js @@ -89,7 +89,7 @@ BlazeComponent.extendComponent({ helper.append(list.clone()); return helper; }, - handle: '.js-swimlane-header', + handle: '.js-swimlane-header-handle', items: '.swimlane:not(.placeholder)', placeholder: 'swimlane placeholder', distance: 7, -- cgit v1.2.3-1-g7c22 From 62b72a03c4889377169411c8cdbf372c71cac1af Mon Sep 17 00:00:00 2001 From: "Sam X. Chen" Date: Thu, 26 Sep 2019 10:53:40 -0400 Subject: Add feature: Add due timeline into Calendar view --- client/components/boards/boardBody.js | 52 ++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 16 deletions(-) (limited to 'client/components/boards/boardBody.js') diff --git a/client/components/boards/boardBody.js b/client/components/boards/boardBody.js index 07cd306a..d64636f4 100644 --- a/client/components/boards/boardBody.js +++ b/client/components/boards/boardBody.js @@ -309,26 +309,46 @@ BlazeComponent.extendComponent({ events(start, end, timezone, callback) { const currentBoard = Boards.findOne(Session.get('currentBoard')); const events = []; + const pushEvent = function(card, title, start, end, extraCls) { + start = start || card.startAt; + end = end || card.endAt; + title = title || card.title; + const className = + (extraCls ? `${extraCls} ` : '') + + (card.color ? `calendar-event-${card.color}` : ''); + events.push({ + id: card._id, + title, + start, + end: end || card.endAt, + allDay: + Math.abs(end.getTime() - start.getTime()) / 1000 === 24 * 3600, + url: FlowRouter.url('card', { + boardId: currentBoard._id, + slug: currentBoard.slug, + cardId: card._id, + }), + className, + }); + }; currentBoard .cardsInInterval(start.toDate(), end.toDate()) .forEach(function(card) { - events.push({ - id: card._id, - title: card.title, - start: card.startAt, - end: card.endAt, - allDay: - Math.abs(card.endAt.getTime() - card.startAt.getTime()) / - 1000 === - 24 * 3600, - url: FlowRouter.url('card', { - boardId: currentBoard._id, - slug: currentBoard.slug, - cardId: card._id, - }), - className: card.color ? `calendar-event-${card.color}` : null, - }); + pushEvent(card); + }); + currentBoard + .cardsDueInBetween(start.toDate(), end.toDate()) + .forEach(function(card) { + pushEvent( + card, + `${card.title} ${TAPi18n.__('card-due')}`, + card.dueAt, + new Date(card.dueAt.getTime() + 36e5), + ); }); + events.sort(function(first, second) { + return first.id > second.id ? 1 : -1; + }); callback(events); }, eventResize(event, delta, revertFunc) { -- cgit v1.2.3-1-g7c22 From 5bc355f9a5e78df4c19764fdc4a343a46af4fdf8 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Thu, 3 Oct 2019 04:23:33 +0300 Subject: Drag handles. In progress. --- client/components/boards/boardBody.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'client/components/boards/boardBody.js') diff --git a/client/components/boards/boardBody.js b/client/components/boards/boardBody.js index 47042ae7..d64636f4 100644 --- a/client/components/boards/boardBody.js +++ b/client/components/boards/boardBody.js @@ -89,7 +89,7 @@ BlazeComponent.extendComponent({ helper.append(list.clone()); return helper; }, - handle: '.js-swimlane-header-handle', + handle: '.js-swimlane-header', items: '.swimlane:not(.placeholder)', placeholder: 'swimlane placeholder', distance: 7, -- cgit v1.2.3-1-g7c22 From 7d6d3af54a2fc1fb68634725eb754b22f02fd430 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Tue, 29 Oct 2019 19:05:44 +0200 Subject: Add Features: allowing lists to be sorted by modifiedAt when not in draggable mode. Bug Fix #2093: the broken should be prior to file attachment feature introduced, and tested export board is working. Thanks to whowillcare ! ( xet7 merged this pull request manually from https://github.com/wekan/wekan/pull/2756 ) Closes #2093 --- client/components/boards/boardBody.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'client/components/boards/boardBody.js') diff --git a/client/components/boards/boardBody.js b/client/components/boards/boardBody.js index d64636f4..47042ae7 100644 --- a/client/components/boards/boardBody.js +++ b/client/components/boards/boardBody.js @@ -89,7 +89,7 @@ BlazeComponent.extendComponent({ helper.append(list.clone()); return helper; }, - handle: '.js-swimlane-header', + handle: '.js-swimlane-header-handle', items: '.swimlane:not(.placeholder)', placeholder: 'swimlane placeholder', distance: 7, -- cgit v1.2.3-1-g7c22 From 274a997e62b421b034e1eb0b3a486813fe127240 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Wed, 13 Nov 2019 19:33:13 +0200 Subject: Fix card, list and swimlane move. Allow moving cards in multiselect mode. Closes #2771, closes #2743, closes #2704, related #2081 --- client/components/boards/boardBody.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'client/components/boards/boardBody.js') diff --git a/client/components/boards/boardBody.js b/client/components/boards/boardBody.js index 47042ae7..82f12c40 100644 --- a/client/components/boards/boardBody.js +++ b/client/components/boards/boardBody.js @@ -89,7 +89,6 @@ BlazeComponent.extendComponent({ helper.append(list.clone()); return helper; }, - handle: '.js-swimlane-header-handle', items: '.swimlane:not(.placeholder)', placeholder: 'swimlane placeholder', distance: 7, @@ -193,6 +192,24 @@ BlazeComponent.extendComponent({ // ugly touch event hotfix enableClickOnTouch('.js-swimlane:not(.placeholder)'); + this.autorun(() => { + if ( + Utils.isMiniScreen() || + (!Utils.isMiniScreen() && Meteor.user().hasShowDesktopDragHandles()) + ) { + $swimlanesDom.sortable({ + handle: '.js-swimlane-header-handle', + }); + } else { + $swimlanesDom.sortable({ + handle: '.swimlane-header', + }); + } + + // Disable drag-dropping if the current user is not a board member or is comment only + $swimlanesDom.sortable('option', 'disabled', !userIsMember()); + }); + function userIsMember() { return ( Meteor.user() && -- cgit v1.2.3-1-g7c22 From 96abe3c6914ce37d9fb44da8fda375e40ad65c9e Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Mon, 18 Nov 2019 22:23:49 +0200 Subject: 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 ! --- client/components/boards/boardBody.js | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) (limited to 'client/components/boards/boardBody.js') diff --git a/client/components/boards/boardBody.js b/client/components/boards/boardBody.js index 82f12c40..8122a0b6 100644 --- a/client/components/boards/boardBody.js +++ b/client/components/boards/boardBody.js @@ -192,10 +192,13 @@ BlazeComponent.extendComponent({ // ugly touch event hotfix enableClickOnTouch('.js-swimlane:not(.placeholder)'); + import { Cookies } from 'meteor/ostrio:cookies'; + const cookies = new Cookies(); + this.autorun(() => { if ( Utils.isMiniScreen() || - (!Utils.isMiniScreen() && Meteor.user().hasShowDesktopDragHandles()) + (!Utils.isMiniScreen() && cookies.has('showDesktopDragHandles')) ) { $swimlanesDom.sortable({ handle: '.js-swimlane-header-handle', @@ -227,20 +230,32 @@ BlazeComponent.extendComponent({ }, isViewSwimlanes() { + import { Cookies } from 'meteor/ostrio:cookies'; + const cookies = new Cookies(); const currentUser = Meteor.user(); - if (!currentUser) return false; + if (!currentUser) { + return cookies.get('boardView') === 'board-view-swimlanes'; + } return (currentUser.profile || {}).boardView === 'board-view-swimlanes'; }, isViewLists() { + import { Cookies } from 'meteor/ostrio:cookies'; + const cookies = new Cookies(); const currentUser = Meteor.user(); - if (!currentUser) return true; + if (!currentUser) { + return cookies.get('boardView') === 'board-view-lists'; + } return (currentUser.profile || {}).boardView === 'board-view-lists'; }, isViewCalendar() { + import { Cookies } from 'meteor/ostrio:cookies'; + const cookies = new Cookies(); const currentUser = Meteor.user(); - if (!currentUser) return false; + if (!currentUser) { + return cookies.get('boardView') === 'board-view-cal'; + } return (currentUser.profile || {}).boardView === 'board-view-cal'; }, @@ -398,8 +413,12 @@ BlazeComponent.extendComponent({ }; }, isViewCalendar() { + import { Cookies } from 'meteor/ostrio:cookies'; + const cookies = new Cookies(); const currentUser = Meteor.user(); - if (!currentUser) return false; + if (!currentUser) { + return cookies.get('boardView') === 'board-view-cal'; + } return (currentUser.profile || {}).boardView === 'board-view-cal'; }, }).register('calendarView'); -- cgit v1.2.3-1-g7c22 From 351d4767d7e93c90ac798769d6071da8730d834f Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Tue, 19 Nov 2019 14:09:36 +0200 Subject: When logged in, use database for setting, so that changes are immediate. Only on public board use cookies. Comment out Collapse CSS that is not in use. Thanks to xet7 ! --- client/components/boards/boardBody.js | 57 ++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 21 deletions(-) (limited to 'client/components/boards/boardBody.js') diff --git a/client/components/boards/boardBody.js b/client/components/boards/boardBody.js index 8122a0b6..f00b8b1d 100644 --- a/client/components/boards/boardBody.js +++ b/client/components/boards/boardBody.js @@ -196,9 +196,20 @@ BlazeComponent.extendComponent({ const cookies = new Cookies(); this.autorun(() => { + let showDesktopDragHandles = false; + currentUser = Meteor.user(); + if (currentUser) { + showDesktopDragHandles = (currentUser.profile || {}).showDesktopDragHandles; + } else { + if (cookies.has('showDesktopDragHandles')) { + showDesktopDragHandles = true; + } else { + showDesktopDragHandles = false; + } + } if ( Utils.isMiniScreen() || - (!Utils.isMiniScreen() && cookies.has('showDesktopDragHandles')) + (!Utils.isMiniScreen() && showDesktopDragHandles) ) { $swimlanesDom.sortable({ handle: '.js-swimlane-header-handle', @@ -230,33 +241,36 @@ BlazeComponent.extendComponent({ }, isViewSwimlanes() { - import { Cookies } from 'meteor/ostrio:cookies'; - const cookies = new Cookies(); - const currentUser = Meteor.user(); - if (!currentUser) { + currentUser = Meteor.user(); + if (currentUser) { + return (currentUser.profile || {}).boardView === 'board-view-swimlanes'; + } else { + import { Cookies } from 'meteor/ostrio:cookies'; + const cookies = new Cookies(); return cookies.get('boardView') === 'board-view-swimlanes'; } - return (currentUser.profile || {}).boardView === 'board-view-swimlanes'; }, isViewLists() { - import { Cookies } from 'meteor/ostrio:cookies'; - const cookies = new Cookies(); - const currentUser = Meteor.user(); - if (!currentUser) { + currentUser = Meteor.user(); + if (currentUser) { + return (currentUser.profile || {}).boardView === 'board-view-lists'; + } else { + import { Cookies } from 'meteor/ostrio:cookies'; + const cookies = new Cookies(); return cookies.get('boardView') === 'board-view-lists'; } - return (currentUser.profile || {}).boardView === 'board-view-lists'; }, isViewCalendar() { - import { Cookies } from 'meteor/ostrio:cookies'; - const cookies = new Cookies(); - const currentUser = Meteor.user(); - if (!currentUser) { + currentUser = Meteor.user(); + if (currentUser) { + return (currentUser.profile || {}).boardView === 'board-view-cal'; + } else { + import { Cookies } from 'meteor/ostrio:cookies'; + const cookies = new Cookies(); return cookies.get('boardView') === 'board-view-cal'; } - return (currentUser.profile || {}).boardView === 'board-view-cal'; }, openNewListForm() { @@ -413,12 +427,13 @@ BlazeComponent.extendComponent({ }; }, isViewCalendar() { - import { Cookies } from 'meteor/ostrio:cookies'; - const cookies = new Cookies(); - const currentUser = Meteor.user(); - if (!currentUser) { + currentUser = Meteor.user(); + if (currentUser) { + return (currentUser.profile || {}).boardView === 'board-view-cal'; + } else { + import { Cookies } from 'meteor/ostrio:cookies'; + const cookies = new Cookies(); return cookies.get('boardView') === 'board-view-cal'; } - return (currentUser.profile || {}).boardView === 'board-view-cal'; }, }).register('calendarView'); -- cgit v1.2.3-1-g7c22 From 115d23f9293cad8a93f18f75a47a8a65756f71ce Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Tue, 19 Nov 2019 21:55:43 +0200 Subject: Use database when logged in. Continued. Thanks to xet7 ! --- client/components/boards/boardBody.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'client/components/boards/boardBody.js') diff --git a/client/components/boards/boardBody.js b/client/components/boards/boardBody.js index f00b8b1d..b10f55ab 100644 --- a/client/components/boards/boardBody.js +++ b/client/components/boards/boardBody.js @@ -199,7 +199,8 @@ BlazeComponent.extendComponent({ let showDesktopDragHandles = false; currentUser = Meteor.user(); if (currentUser) { - showDesktopDragHandles = (currentUser.profile || {}).showDesktopDragHandles; + showDesktopDragHandles = (currentUser.profile || {}) + .showDesktopDragHandles; } else { if (cookies.has('showDesktopDragHandles')) { showDesktopDragHandles = true; -- cgit v1.2.3-1-g7c22 From 788dd0a81a06efee165007a92780f9e8c2c754ac Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Wed, 20 Nov 2019 21:10:11 +0200 Subject: Fix lint errors. --- client/components/boards/boardBody.js | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'client/components/boards/boardBody.js') diff --git a/client/components/boards/boardBody.js b/client/components/boards/boardBody.js index b10f55ab..41b6f4ef 100644 --- a/client/components/boards/boardBody.js +++ b/client/components/boards/boardBody.js @@ -201,16 +201,14 @@ BlazeComponent.extendComponent({ if (currentUser) { showDesktopDragHandles = (currentUser.profile || {}) .showDesktopDragHandles; + } else if (cookies.has('showDesktopDragHandles')) { + showDesktopDragHandles = true; } else { - if (cookies.has('showDesktopDragHandles')) { - showDesktopDragHandles = true; - } else { - showDesktopDragHandles = false; - } + showDesktopDragHandles = false; } if ( - Utils.isMiniScreen() || - (!Utils.isMiniScreen() && showDesktopDragHandles) + Utils.isMiniScreen() + || (!Utils.isMiniScreen() && showDesktopDragHandles) ) { $swimlanesDom.sortable({ handle: '.js-swimlane-header-handle', @@ -227,9 +225,9 @@ BlazeComponent.extendComponent({ function userIsMember() { return ( - Meteor.user() && - Meteor.user().isBoardMember() && - !Meteor.user().isCommentOnly() + Meteor.user() + && Meteor.user().isBoardMember() + && !Meteor.user().isCommentOnly() ); } @@ -308,16 +306,16 @@ BlazeComponent.extendComponent({ scrollLeft(position = 0) { const swimlanes = this.$('.js-swimlanes'); - swimlanes && - swimlanes.animate({ + swimlanes + && swimlanes.animate({ scrollLeft: position, }); }, scrollTop(position = 0) { const swimlanes = this.$('.js-swimlanes'); - swimlanes && - swimlanes.animate({ + swimlanes + && swimlanes.animate({ scrollTop: position, }); }, @@ -361,8 +359,8 @@ BlazeComponent.extendComponent({ end = end || card.endAt; title = title || card.title; const className = - (extraCls ? `${extraCls} ` : '') + - (card.color ? `calendar-event-${card.color}` : ''); + (extraCls ? `${extraCls} ` : '') + + (card.color ? `calendar-event-${card.color}` : ''); events.push({ id: card._id, title, -- cgit v1.2.3-1-g7c22