From 5b41d72e8de93833e1788962427422cff62c09a2 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Thu, 14 Nov 2019 03:00:14 +0200 Subject: Add database migration for assignee. Thanks to ocdtrekkie and xet7 ! --- server/migrations.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'server') diff --git a/server/migrations.js b/server/migrations.js index 836220f3..01fb7a5b 100644 --- a/server/migrations.js +++ b/server/migrations.js @@ -777,3 +777,19 @@ Migrations.add('fix-incorrect-dates', () => { }), ); }); + +Migrations.add('add-assignee', () => { + Cards.update( + { + assignees: { + $exists: false, + }, + }, + { + $set: { + assignees: [], + }, + }, + noValidateMulti, + ); +}); -- 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 ! --- server/migrations.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'server') diff --git a/server/migrations.js b/server/migrations.js index 01fb7a5b..a8b59c3e 100644 --- a/server/migrations.js +++ b/server/migrations.js @@ -793,3 +793,27 @@ Migrations.add('add-assignee', () => { noValidateMulti, ); }); + +Migrations.add('remove-profile-showDesktopDragHandles', () => { + Users.update( + {}, + { + $unset: { + 'profile.showDesktopDragHandles': 1, + }, + }, + noValidateMulti, + ); +}); + +Migrations.add('remove-profile-hiddenMinicardLabelText', () => { + Users.update( + {}, + { + $unset: { + 'profile.hiddenMinicardLabelText': 1, + }, + }, + noValidateMulti, + ); +}); -- 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 ! --- server/migrations.js | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'server') diff --git a/server/migrations.js b/server/migrations.js index a8b59c3e..92339110 100644 --- a/server/migrations.js +++ b/server/migrations.js @@ -794,24 +794,32 @@ Migrations.add('add-assignee', () => { ); }); -Migrations.add('remove-profile-showDesktopDragHandles', () => { +Migrations.add('add-profile-showDesktopDragHandles', () => { Users.update( - {}, { - $unset: { - 'profile.showDesktopDragHandles': 1, + 'profile.showDesktopDragHandles': { + $exists: false, + }, + }, + { + $set: { + 'profile.showDesktopDragHandles': false, }, }, noValidateMulti, ); }); -Migrations.add('remove-profile-hiddenMinicardLabelText', () => { +Migrations.add('add-profile-hiddenMinicardLabelText', () => { Users.update( - {}, { - $unset: { - 'profile.hiddenMinicardLabelText': 1, + 'profile.hiddenMinicardLabelText': { + $exists: false, + }, + }, + { + $set: { + 'profile.hiddenMinicardLabelText': false, }, }, noValidateMulti, -- cgit v1.2.3-1-g7c22 From 0a1e7006b38979fe40653834aa037341c6ac3355 Mon Sep 17 00:00:00 2001 From: Guillaume Date: Fri, 29 Nov 2019 14:48:44 +0100 Subject: Using LINKED_CARDS_ENABLED --- server/publications/cards.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'server') diff --git a/server/publications/cards.js b/server/publications/cards.js index 61210ce5..f326ea04 100644 --- a/server/publications/cards.js +++ b/server/publications/cards.js @@ -1,4 +1,15 @@ Meteor.publish('card', cardId => { check(cardId, String); - return Cards.find({ _id: cardId }); + if (process.env.LINKED_CARDS_ENABLED === 'true') { + return Cards.find({ _id: cardId }); + } else { + // TODO: test + return Cards.find({ + _id: cardId, + linkedId: {$ne: [ + null, + '' + ]} + }); + } }); -- cgit v1.2.3-1-g7c22 From 2c4d3fa317db1d271e0e3467b0c1092a3e492631 Mon Sep 17 00:00:00 2001 From: Robert Lebedeu Date: Mon, 16 Dec 2019 18:10:48 +0100 Subject: Fix checkBoardAccess authentication check --- server/authentication.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'server') diff --git a/server/authentication.js b/server/authentication.js index 9e519fe1..20327280 100644 --- a/server/authentication.js +++ b/server/authentication.js @@ -58,7 +58,7 @@ Meteor.startup(() => { const board = Boards.findOne({ _id: boardId }); const normalAccess = board.permission === 'public' || - board.members.some(e => e.userId === userId).isActive; + board.members.some(e => e.userId === userId && e.isActive); Authentication.checkAdminOrCondition(userId, normalAccess); }; -- cgit v1.2.3-1-g7c22 From e928660bc0b1f873696fe5fece988a5be6fc2c4e Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Sat, 21 Dec 2019 19:38:02 +0200 Subject: LINKED_CARDS_ENABLED settings part 3. In Progress, linked cards not completely disabled yet. Thanks to xet7 ! --- server/publications/cards.js | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'server') diff --git a/server/publications/cards.js b/server/publications/cards.js index f326ea04..f850ccfe 100644 --- a/server/publications/cards.js +++ b/server/publications/cards.js @@ -1,15 +1,17 @@ -Meteor.publish('card', cardId => { - check(cardId, String); - if (process.env.LINKED_CARDS_ENABLED === 'true') { +if (process.env.LINKED_CARDS_ENABLED === 'false') { + Meteor.settings.public.linkedCardsEnabled = 'false'; + //Meteor.publish('card', cardId => { + // check(cardId, String); + // // TODO: test + // return Cards.find({ + // _id: cardId, + // linkedId: { $ne: [null, ''] }, + // }); + //}); +} else { + Meteor.settings.public.linkedCardsEnabled = 'true'; + Meteor.publish('card', cardId => { + check(cardId, String); return Cards.find({ _id: cardId }); - } else { - // TODO: test - return Cards.find({ - _id: cardId, - linkedId: {$ne: [ - null, - '' - ]} - }); - } -}); + }); +} -- cgit v1.2.3-1-g7c22 From e142acfdb745747c020a1bd5b1974b619d5bdb6d Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Sun, 22 Dec 2019 09:44:58 +0200 Subject: Remove LINKED_CARDS_ENABLED settings, because it does not work. Thanks to xet7 ! --- server/publications/cards.js | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) (limited to 'server') diff --git a/server/publications/cards.js b/server/publications/cards.js index f850ccfe..61210ce5 100644 --- a/server/publications/cards.js +++ b/server/publications/cards.js @@ -1,17 +1,4 @@ -if (process.env.LINKED_CARDS_ENABLED === 'false') { - Meteor.settings.public.linkedCardsEnabled = 'false'; - //Meteor.publish('card', cardId => { - // check(cardId, String); - // // TODO: test - // return Cards.find({ - // _id: cardId, - // linkedId: { $ne: [null, ''] }, - // }); - //}); -} else { - Meteor.settings.public.linkedCardsEnabled = 'true'; - Meteor.publish('card', cardId => { - check(cardId, String); - return Cards.find({ _id: cardId }); - }); -} +Meteor.publish('card', cardId => { + check(cardId, String); + return Cards.find({ _id: cardId }); +}); -- cgit v1.2.3-1-g7c22 From ddce0ada094e6450be260b4cda21fdfa09ae0133 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Mon, 6 Jan 2020 11:01:38 +0200 Subject: Removed Custom HTML feature that does not work. Thanks to xet7 ! Closes #2218 --- server/migrations.js | 32 -------------------------------- 1 file changed, 32 deletions(-) (limited to 'server') diff --git a/server/migrations.js b/server/migrations.js index 92339110..1b7146c5 100644 --- a/server/migrations.js +++ b/server/migrations.js @@ -472,38 +472,6 @@ Migrations.add('add-hide-logo', () => { ); }); -Migrations.add('add-custom-html-after-body-start', () => { - Settings.update( - { - customHTMLafterBodyStart: { - $exists: false, - }, - }, - { - $set: { - customHTMLafterBodyStart: '', - }, - }, - noValidateMulti, - ); -}); - -Migrations.add('add-custom-html-before-body-end', () => { - Settings.update( - { - customHTMLbeforeBodyEnd: { - $exists: false, - }, - }, - { - $set: { - customHTMLbeforeBodyEnd: '', - }, - }, - noValidateMulti, - ); -}); - Migrations.add('add-displayAuthenticationMethod', () => { Settings.update( { -- cgit v1.2.3-1-g7c22 From 4b56bbfe6dd1c16ac8d2cc8da91dc55cff60177e Mon Sep 17 00:00:00 2001 From: Peter Verraedt Date: Wed, 22 Jan 2020 12:09:26 +0100 Subject: Add rule action to move cards to other boards Fixes #1996 --- server/rulesHelper.js | 74 ++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 52 insertions(+), 22 deletions(-) (limited to 'server') diff --git a/server/rulesHelper.js b/server/rulesHelper.js index cf278c52..63e330ab 100644 --- a/server/rulesHelper.js +++ b/server/rulesHelper.js @@ -42,35 +42,65 @@ RulesHelper = { performAction(activity, action) { const card = Cards.findOne({ _id: activity.cardId }); const boardId = activity.boardId; - if (action.actionType === 'moveCardToTop') { - let listId; + if ( + action.actionType === 'moveCardToTop' || + action.actionType === 'moveCardToBottom' + ) { let list; - if (action.listTitle === '*') { - listId = card.listId; + let listId; + if (action.listName === '*') { list = card.list(); + if (boardId !== action.boardId) { + list = Lists.findOne({ title: list.title, boardId: action.boardId }); + } } else { - list = Lists.findOne({ title: action.listTitle, boardId }); - listId = list._id; + list = Lists.findOne({ + title: action.listName, + boardId: action.boardId, + }); } - const minOrder = _.min( - list.cardsUnfiltered(card.swimlaneId).map(c => c.sort), - ); - card.move(boardId, card.swimlaneId, listId, minOrder - 1); - } - if (action.actionType === 'moveCardToBottom') { - let listId; - let list; - if (action.listTitle === '*') { - listId = card.listId; - list = card.list(); + if (list === undefined) { + listId = ''; } else { - list = Lists.findOne({ title: action.listTitle, boardId }); listId = list._id; } - const maxOrder = _.max( - list.cardsUnfiltered(card.swimlaneId).map(c => c.sort), - ); - card.move(boardId, card.swimlaneId, listId, maxOrder + 1); + + let swimlane; + let swimlaneId; + if (action.swimlaneName === '*') { + swimlane = Swimlanes.findOne(card.swimlaneId); + if (boardId !== action.boardId) { + swimlane = Swimlanes.findOne({ + title: swimlane.title, + boardId: action.boardId, + }); + } + } else { + swimlane = Swimlanes.findOne({ + title: action.swimlaneName, + boardId: action.boardId, + }); + } + if (swimlane === undefined) { + swimlaneId = Swimlanes.findOne({ + title: 'Default', + boardId: action.boardId, + })._id; + } else { + swimlaneId = swimlane._id; + } + + if (action.actionType === 'moveCardToTop') { + const minOrder = _.min( + list.cardsUnfiltered(swimlaneId).map(c => c.sort), + ); + card.move(action.boardId, swimlaneId, listId, minOrder - 1); + } else { + const maxOrder = _.max( + list.cardsUnfiltered(swimlaneId).map(c => c.sort), + ); + card.move(action.boardId, swimlaneId, listId, maxOrder + 1); + } } if (action.actionType === 'sendEmail') { const to = action.emailTo; -- cgit v1.2.3-1-g7c22 From 0b00a8095ce34c753e5edac86d4b62e8aaa1b1e0 Mon Sep 17 00:00:00 2001 From: dollybean Date: Tue, 4 Feb 2020 02:28:45 -0800 Subject: Customize of some card's functions --- server/rulesHelper.js | 74 +++++++++++++++------------------------------------ 1 file changed, 22 insertions(+), 52 deletions(-) (limited to 'server') diff --git a/server/rulesHelper.js b/server/rulesHelper.js index 63e330ab..cf278c52 100644 --- a/server/rulesHelper.js +++ b/server/rulesHelper.js @@ -42,65 +42,35 @@ RulesHelper = { performAction(activity, action) { const card = Cards.findOne({ _id: activity.cardId }); const boardId = activity.boardId; - if ( - action.actionType === 'moveCardToTop' || - action.actionType === 'moveCardToBottom' - ) { - let list; + if (action.actionType === 'moveCardToTop') { let listId; - if (action.listName === '*') { + let list; + if (action.listTitle === '*') { + listId = card.listId; list = card.list(); - if (boardId !== action.boardId) { - list = Lists.findOne({ title: list.title, boardId: action.boardId }); - } - } else { - list = Lists.findOne({ - title: action.listName, - boardId: action.boardId, - }); - } - if (list === undefined) { - listId = ''; } else { + list = Lists.findOne({ title: action.listTitle, boardId }); listId = list._id; } - - let swimlane; - let swimlaneId; - if (action.swimlaneName === '*') { - swimlane = Swimlanes.findOne(card.swimlaneId); - if (boardId !== action.boardId) { - swimlane = Swimlanes.findOne({ - title: swimlane.title, - boardId: action.boardId, - }); - } - } else { - swimlane = Swimlanes.findOne({ - title: action.swimlaneName, - boardId: action.boardId, - }); - } - if (swimlane === undefined) { - swimlaneId = Swimlanes.findOne({ - title: 'Default', - boardId: action.boardId, - })._id; - } else { - swimlaneId = swimlane._id; - } - - if (action.actionType === 'moveCardToTop') { - const minOrder = _.min( - list.cardsUnfiltered(swimlaneId).map(c => c.sort), - ); - card.move(action.boardId, swimlaneId, listId, minOrder - 1); + const minOrder = _.min( + list.cardsUnfiltered(card.swimlaneId).map(c => c.sort), + ); + card.move(boardId, card.swimlaneId, listId, minOrder - 1); + } + if (action.actionType === 'moveCardToBottom') { + let listId; + let list; + if (action.listTitle === '*') { + listId = card.listId; + list = card.list(); } else { - const maxOrder = _.max( - list.cardsUnfiltered(swimlaneId).map(c => c.sort), - ); - card.move(action.boardId, swimlaneId, listId, maxOrder + 1); + list = Lists.findOne({ title: action.listTitle, boardId }); + listId = list._id; } + const maxOrder = _.max( + list.cardsUnfiltered(card.swimlaneId).map(c => c.sort), + ); + card.move(boardId, card.swimlaneId, listId, maxOrder + 1); } if (action.actionType === 'sendEmail') { const to = action.emailTo; -- cgit v1.2.3-1-g7c22 From 2fce02afbced07c6ff2b05786f159701c8b559e9 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Fri, 7 Feb 2020 13:58:43 +0200 Subject: Add Feature: Card Settings/Show on card/Activities. Fix: When in Card Settings hiding Comments, only adding new comment is hidden, not old comments. Thanks to xet7 ! Closes #2925 --- server/migrations.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'server') diff --git a/server/migrations.js b/server/migrations.js index 12a872a8..3bbd9964 100644 --- a/server/migrations.js +++ b/server/migrations.js @@ -985,3 +985,19 @@ Migrations.add('add-requested-by-allowed', () => { noValidateMulti, ); }); + +Migrations.add('add-activities-allowed', () => { + Boards.update( + { + allowsActivities: { + $exists: false, + }, + }, + { + $set: { + allowsActivities: true, + }, + }, + noValidateMulti, + ); +}); -- cgit v1.2.3-1-g7c22 From e89965f6422fd95b4ad2112ae407b1dde4853510 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Wed, 12 Feb 2020 02:08:29 +0200 Subject: Remove card element grouping to create compact card layout. Card Settings / Show on Card: Description Title and Description Text. Thanks to e-stoniauk, 2020product and xet7 ! Fixes https://github.com/wekan/wekan/pull/2922 --- server/migrations.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'server') diff --git a/server/migrations.js b/server/migrations.js index 3bbd9964..b4489987 100644 --- a/server/migrations.js +++ b/server/migrations.js @@ -1001,3 +1001,35 @@ Migrations.add('add-activities-allowed', () => { noValidateMulti, ); }); + +Migrations.add('add-description-title-allowed', () => { + Boards.update( + { + allowsDescriptionTitle: { + $exists: false, + }, + }, + { + $set: { + allowsDescriptionTitle: true, + }, + }, + noValidateMulti, + ); +}); + +Migrations.add('add-description-text-allowed', () => { + Boards.update( + { + allowsDescriptionText: { + $exists: false, + }, + }, + { + $set: { + allowsDescriptionText: true, + }, + }, + noValidateMulti, + ); +}); -- cgit v1.2.3-1-g7c22