From de7509dc60257667192054e320b381f9dd0f0a31 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Thu, 7 Nov 2019 22:46:55 +0200 Subject: Assignee field like Jira #2452 , Done. Update REST API docs, there can only be one assignee in array. Thanks to xet7 ! --- models/cards.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'models') diff --git a/models/cards.js b/models/cards.js index 3944b09f..816132fe 100644 --- a/models/cards.js +++ b/models/cards.js @@ -205,7 +205,8 @@ Cards.attachSchema( }, assignees: { /** - * who assignees of the card (user IDs) + * who is assignee of the card (user ID), + * maximum one ID of assignee in array. */ type: [String], optional: true, @@ -1995,7 +1996,7 @@ if (Meteor.isServer) { * @param {string} description the description of the new card * @param {string} swimlaneId the swimlane ID of the new card * @param {string} [members] the member IDs list of the new card - * @param {string} [assignees] the assignee IDs list of the new card + * @param {string} [assignees] the array of maximum one ID of assignee of the new card * @return_type {_id: string} */ JsonRoutes.add('POST', '/api/boards/:boardId/lists/:listId/cards', function( @@ -2081,7 +2082,7 @@ if (Meteor.isServer) { * @param {string} [labelIds] the new list of label IDs attached to the card * @param {string} [swimlaneId] the new swimlane ID of the card * @param {string} [members] the new list of member IDs attached to the card - * @param {string} [assignees] the new list of assignee IDs attached to the card + * @param {string} [assignees] the array of maximum one ID of assignee attached to the card * @param {string} [requestedBy] the new requestedBy field of the card * @param {string} [assignedBy] the new assignedBy field of the card * @param {string} [receivedAt] the new receivedAt field of the card -- cgit v1.2.3-1-g7c22 From bbc3ab3f994c5a61a4414bc64b05f5a03d259e46 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Thu, 14 Nov 2019 00:55:11 +0200 Subject: Change sorting to work on desktop drag handle page instead, where it seems to work better. Thanks to xet7 ! --- models/users.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'models') diff --git a/models/users.js b/models/users.js index 83a224ba..3e3a7bbb 100644 --- a/models/users.js +++ b/models/users.js @@ -396,8 +396,8 @@ Users.helpers({ return ret; }, hasSortBy() { - // if use doesn't have dragHandle, then we can let user to choose sort list by different order - return !this.hasShowDesktopDragHandles(); + // if user has dragHandle, then we can let user to choose sort list by different order + return this.hasShowDesktopDragHandles(); }, getListSortBy() { return this._getListSortBy()[0]; -- cgit v1.2.3-1-g7c22 From ab2a721a1443b903cdbbbe275f41ffd3269012c6 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Thu, 14 Nov 2019 21:31:38 +0200 Subject: Revert list sorting change of Wekan v3.51 because it reversed alphabetical sorting of lists. Thanks to Dalisay and xet7 ! --- models/users.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'models') diff --git a/models/users.js b/models/users.js index 3e3a7bbb..83a224ba 100644 --- a/models/users.js +++ b/models/users.js @@ -396,8 +396,8 @@ Users.helpers({ return ret; }, hasSortBy() { - // if user has dragHandle, then we can let user to choose sort list by different order - return this.hasShowDesktopDragHandles(); + // if use doesn't have dragHandle, then we can let user to choose sort list by different order + return !this.hasShowDesktopDragHandles(); }, getListSortBy() { return this._getListSortBy()[0]; -- 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 ! --- models/boards.js | 8 ++++-- models/swimlanes.js | 8 ++++-- models/users.js | 71 ++++++++++++++--------------------------------------- 3 files changed, 30 insertions(+), 57 deletions(-) (limited to 'models') diff --git a/models/boards.js b/models/boards.js index 85a7558c..857aa963 100644 --- a/models/boards.js +++ b/models/boards.js @@ -409,8 +409,12 @@ Boards.helpers({ }, lists() { - const enabled = Meteor.user().hasSortBy(); - return enabled ? this.newestLists() : this.draggableLists(); + //currentUser = Meteor.user(); + //if (currentUser) { + // enabled = Meteor.user().hasSortBy(); + //} + //return enabled ? this.newestLists() : this.draggableLists(); + return this.draggableLists(); }, newestLists() { diff --git a/models/swimlanes.js b/models/swimlanes.js index 831f1eff..aa7016f7 100644 --- a/models/swimlanes.js +++ b/models/swimlanes.js @@ -174,8 +174,12 @@ Swimlanes.helpers({ }, lists() { - const enabled = Meteor.user().hasSortBy(); - return enabled ? this.newestLists() : this.draggableLists(); + //currentUser = Meteor.user(); + //if (currentUser) { + // enabled = Meteor.user().hasSortBy(); + //} + //return enabled ? this.newestLists() : this.draggableLists(); + return this.draggableLists(); }, newestLists() { // sorted lists from newest to the oldest, by its creation date or its cards' last modification date diff --git a/models/users.js b/models/users.js index 83a224ba..08b10eb5 100644 --- a/models/users.js +++ b/models/users.js @@ -119,13 +119,6 @@ Users.attachSchema( type: String, optional: true, }, - 'profile.showDesktopDragHandles': { - /** - * does the user want to hide system messages? - */ - type: Boolean, - optional: true, - }, 'profile.hiddenSystemMessages': { /** * does the user want to hide system messages? @@ -133,13 +126,6 @@ Users.attachSchema( type: Boolean, optional: true, }, - 'profile.hiddenMinicardLabelText': { - /** - * does the user want to hide minicard label texts? - */ - type: Boolean, - optional: true, - }, 'profile.initials': { /** * initials of the user @@ -198,6 +184,7 @@ Users.attachSchema( allowedValues: [ 'board-view-lists', 'board-view-swimlanes', + 'board-view-collapse', 'board-view-cal', ], }, @@ -395,10 +382,18 @@ Users.helpers({ } return ret; }, - hasSortBy() { - // if use doesn't have dragHandle, then we can let user to choose sort list by different order - return !this.hasShowDesktopDragHandles(); - }, + //hasSortBy() { + // if use doesn't have dragHandle, then we can let user to choose sort list by different order + //return this.hasShowDesktopDragHandles(); + // return false; + /* + if (typeof currentUser === 'undefined' || typeof currentUser === 'null') { + return false; + } else { + return this.hasShowDesktopDragHandles(); + } + */ + //}, getListSortBy() { return this._getListSortBy()[0]; }, @@ -419,21 +414,11 @@ Users.helpers({ return _.contains(notifications, activityId); }, - hasShowDesktopDragHandles() { - const profile = this.profile || {}; - return profile.showDesktopDragHandles || false; - }, - hasHiddenSystemMessages() { const profile = this.profile || {}; return profile.hiddenSystemMessages || false; }, - hasHiddenMinicardLabelText() { - const profile = this.profile || {}; - return profile.hiddenMinicardLabelText || false; - }, - getEmailBuffer() { const { emailBuffer = [] } = this.profile || {}; return emailBuffer; @@ -455,8 +440,11 @@ Users.helpers({ }, getLimitToShowCardsCount() { - const profile = this.profile || {}; - return profile.showCardsCountAt; + currentUser = Meteor.user(); + if (currentUser) { + const profile = this.profile || {}; + return profile.showCardsCountAt; + } }, getName() { @@ -536,13 +524,6 @@ Users.mutations({ }, }; }, - toggleDesktopHandles(value = false) { - return { - $set: { - 'profile.showDesktopDragHandles': !value, - }, - }; - }, toggleSystem(value = false) { return { @@ -552,14 +533,6 @@ Users.mutations({ }; }, - toggleLabelText(value = false) { - return { - $set: { - 'profile.hiddenMinicardLabelText': !value, - }, - }; - }, - addNotification(activityId) { return { $addToSet: { @@ -624,18 +597,10 @@ Meteor.methods({ check(value, String); Meteor.user().setListSortBy(value); }, - toggleDesktopDragHandles() { - const user = Meteor.user(); - user.toggleDesktopHandles(user.hasShowDesktopDragHandles()); - }, toggleSystemMessages() { const user = Meteor.user(); user.toggleSystem(user.hasHiddenSystemMessages()); }, - toggleMinicardLabelText() { - const user = Meteor.user(); - user.toggleLabelText(user.hasHiddenMinicardLabelText()); - }, changeLimitToShowCardsCount(limit) { check(limit, Number); Meteor.user().setShowCardsCountAt(limit); -- 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 ! --- models/users.js | 71 ++++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 53 insertions(+), 18 deletions(-) (limited to 'models') diff --git a/models/users.js b/models/users.js index 08b10eb5..83a224ba 100644 --- a/models/users.js +++ b/models/users.js @@ -119,6 +119,13 @@ Users.attachSchema( type: String, optional: true, }, + 'profile.showDesktopDragHandles': { + /** + * does the user want to hide system messages? + */ + type: Boolean, + optional: true, + }, 'profile.hiddenSystemMessages': { /** * does the user want to hide system messages? @@ -126,6 +133,13 @@ Users.attachSchema( type: Boolean, optional: true, }, + 'profile.hiddenMinicardLabelText': { + /** + * does the user want to hide minicard label texts? + */ + type: Boolean, + optional: true, + }, 'profile.initials': { /** * initials of the user @@ -184,7 +198,6 @@ Users.attachSchema( allowedValues: [ 'board-view-lists', 'board-view-swimlanes', - 'board-view-collapse', 'board-view-cal', ], }, @@ -382,18 +395,10 @@ Users.helpers({ } return ret; }, - //hasSortBy() { - // if use doesn't have dragHandle, then we can let user to choose sort list by different order - //return this.hasShowDesktopDragHandles(); - // return false; - /* - if (typeof currentUser === 'undefined' || typeof currentUser === 'null') { - return false; - } else { - return this.hasShowDesktopDragHandles(); - } - */ - //}, + hasSortBy() { + // if use doesn't have dragHandle, then we can let user to choose sort list by different order + return !this.hasShowDesktopDragHandles(); + }, getListSortBy() { return this._getListSortBy()[0]; }, @@ -414,11 +419,21 @@ Users.helpers({ return _.contains(notifications, activityId); }, + hasShowDesktopDragHandles() { + const profile = this.profile || {}; + return profile.showDesktopDragHandles || false; + }, + hasHiddenSystemMessages() { const profile = this.profile || {}; return profile.hiddenSystemMessages || false; }, + hasHiddenMinicardLabelText() { + const profile = this.profile || {}; + return profile.hiddenMinicardLabelText || false; + }, + getEmailBuffer() { const { emailBuffer = [] } = this.profile || {}; return emailBuffer; @@ -440,11 +455,8 @@ Users.helpers({ }, getLimitToShowCardsCount() { - currentUser = Meteor.user(); - if (currentUser) { - const profile = this.profile || {}; - return profile.showCardsCountAt; - } + const profile = this.profile || {}; + return profile.showCardsCountAt; }, getName() { @@ -524,6 +536,13 @@ Users.mutations({ }, }; }, + toggleDesktopHandles(value = false) { + return { + $set: { + 'profile.showDesktopDragHandles': !value, + }, + }; + }, toggleSystem(value = false) { return { @@ -533,6 +552,14 @@ Users.mutations({ }; }, + toggleLabelText(value = false) { + return { + $set: { + 'profile.hiddenMinicardLabelText': !value, + }, + }; + }, + addNotification(activityId) { return { $addToSet: { @@ -597,10 +624,18 @@ Meteor.methods({ check(value, String); Meteor.user().setListSortBy(value); }, + toggleDesktopDragHandles() { + const user = Meteor.user(); + user.toggleDesktopHandles(user.hasShowDesktopDragHandles()); + }, toggleSystemMessages() { const user = Meteor.user(); user.toggleSystem(user.hasHiddenSystemMessages()); }, + toggleMinicardLabelText() { + const user = Meteor.user(); + user.toggleLabelText(user.hasHiddenMinicardLabelText()); + }, changeLimitToShowCardsCount(limit) { check(limit, Number); Meteor.user().setShowCardsCountAt(limit); -- cgit v1.2.3-1-g7c22 From 07724f99ae909b044f17bc3c0b1f800237747f86 Mon Sep 17 00:00:00 2001 From: Akuket Date: Thu, 28 Nov 2019 11:55:36 +0100 Subject: Add LINKED_CARDS_ENABLED env var --- models/settings.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'models') diff --git a/models/settings.js b/models/settings.js index 8eb02c5b..0a1bd509 100644 --- a/models/settings.js +++ b/models/settings.js @@ -334,6 +334,10 @@ if (Meteor.isServer) { getDefaultAuthenticationMethod() { return process.env.DEFAULT_AUTHENTICATION_METHOD; }, + + getLinkedCardsEnabled() { + return process.env.LINKED_CARDS_ENABLED === 'true'; + } }); } -- cgit v1.2.3-1-g7c22 From 40c70c439d3d6ac5a9affe52d386201e7da865b9 Mon Sep 17 00:00:00 2001 From: Robert Lebedeu Date: Tue, 17 Dec 2019 12:15:06 +0100 Subject: Allow card creation for board members - Only for members with card add permission --- models/cards.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'models') diff --git a/models/cards.js b/models/cards.js index 816132fe..496c69b3 100644 --- a/models/cards.js +++ b/models/cards.js @@ -2003,8 +2003,15 @@ if (Meteor.isServer) { req, res, ) { - Authentication.checkUserId(req.userId); + // Check user is logged in + Authentication.checkLoggedIn(req.userId); const paramBoardId = req.params.boardId; + // Check user has permission to add card to the board + const board = Boards.findOne({ + _id: paramBoardId + }); + const addPermission = allowIsBoardMemberCommentOnly(req.userId, board); + Authentication.checkAdminOrCondition(req.userId, addPermission); const paramListId = req.params.listId; const paramParentId = req.params.parentId; const currentCards = Cards.find( -- cgit v1.2.3-1-g7c22 From a35df88805410f2028cc9a0235f502d56ee8b87b Mon Sep 17 00:00:00 2001 From: Robert Lebedeu Date: Tue, 17 Dec 2019 12:15:41 +0100 Subject: Allow checklist creation for board members - Only for members with checklist add permission --- models/checklists.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'models') diff --git a/models/checklists.js b/models/checklists.js index 3b50cda6..11aba71b 100644 --- a/models/checklists.js +++ b/models/checklists.js @@ -283,8 +283,15 @@ if (Meteor.isServer) { 'POST', '/api/boards/:boardId/cards/:cardId/checklists', function(req, res) { - Authentication.checkUserId(req.userId); - + // Check user is logged in + Authentication.checkLoggedIn(req.userId); + const paramBoardId = req.params.boardId; + // Check user has permission to add checklist to the card + const board = Boards.findOne({ + _id: paramBoardId + }); + const addPermission = allowIsBoardMemberCommentOnly(req.userId, board); + Authentication.checkAdminOrCondition(req.userId, addPermission); const paramCardId = req.params.cardId; const id = Checklists.insert({ title: req.body.title, -- 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 ! --- models/settings.js | 4 ---- 1 file changed, 4 deletions(-) (limited to 'models') diff --git a/models/settings.js b/models/settings.js index 0a1bd509..8eb02c5b 100644 --- a/models/settings.js +++ b/models/settings.js @@ -334,10 +334,6 @@ if (Meteor.isServer) { getDefaultAuthenticationMethod() { return process.env.DEFAULT_AUTHENTICATION_METHOD; }, - - getLinkedCardsEnabled() { - return process.env.LINKED_CARDS_ENABLED === 'true'; - } }); } -- cgit v1.2.3-1-g7c22 From 2bf004120d5a43cd3c3c060fc7c0c30d1b01f220 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Fri, 3 Jan 2020 06:49:35 +0200 Subject: Add Worker role. Add more Font Awesome icons. Fix browser console errors when editing user profile name etc. Thanks to xet7 ! Closes #2788 --- models/accountSettings.js | 12 ++++++++++++ models/boards.js | 29 ++++++++++++++++++++++++++++- models/cards.js | 2 +- models/checklists.js | 2 +- models/users.js | 10 ++++++++++ 5 files changed, 52 insertions(+), 3 deletions(-) (limited to 'models') diff --git a/models/accountSettings.js b/models/accountSettings.js index f61614b8..a20303f5 100644 --- a/models/accountSettings.js +++ b/models/accountSettings.js @@ -82,4 +82,16 @@ if (Meteor.isServer) { }); } +AccountSettings.helpers({ + allowEmailChange() { + return AccountSettings.findOne('accounts-allowEmailChange').booleanValue; + }, + allowUserNameChange() { + return AccountSettings.findOne('accounts-allowUserNameChange').booleanValue; + }, + allowUserDelete() { + return AccountSettings.findOne('accounts-allowUserDelete').booleanValue; + }, +}); + export default AccountSettings; diff --git a/models/boards.js b/models/boards.js index 857aa963..4e193dc7 100644 --- a/models/boards.js +++ b/models/boards.js @@ -185,6 +185,7 @@ Boards.attachSchema( isActive: true, isNoComments: false, isCommentOnly: false, + isWorker: false, }, ]; } @@ -222,6 +223,13 @@ Boards.attachSchema( type: Boolean, optional: true, }, + 'members.$.isWorker': { + /** + * Is the member only allowed to move card, assign himself to card and comment + */ + type: Boolean, + optional: true, + }, permission: { /** * visibility of the board @@ -538,6 +546,7 @@ Boards.helpers({ isActive: true, isAdmin: false, isNoComments: true, + isWorker: false, }); }, @@ -547,6 +556,17 @@ Boards.helpers({ isActive: true, isAdmin: false, isCommentOnly: true, + isWorker: false, + }); + }, + + hasWorker(memberId) { + return !!_.findWhere(this.members, { + userId: memberId, + isActive: true, + isAdmin: false, + isCommentOnly: false, + isWorker: true, }); }, @@ -849,6 +869,7 @@ Boards.mutations({ isActive: true, isNoComments: false, isCommentOnly: false, + isWorker: false, }, }, }; @@ -881,6 +902,7 @@ Boards.mutations({ isAdmin, isNoComments, isCommentOnly, + isWorker, currentUserId = Meteor.userId(), ) { const memberIndex = this.memberIndex(memberId); @@ -894,6 +916,7 @@ Boards.mutations({ [`members.${memberIndex}.isAdmin`]: isAdmin, [`members.${memberIndex}.isNoComments`]: isNoComments, [`members.${memberIndex}.isCommentOnly`]: isCommentOnly, + [`members.${memberIndex}.isWorker`]: isWorker, }, }; }, @@ -1281,6 +1304,7 @@ if (Meteor.isServer) { * @param {boolean} [isActive] is the board active (default true) * @param {boolean} [isNoComments] disable comments (default false) * @param {boolean} [isCommentOnly] only enable comments (default false) + * @param {boolean} [isWorker] only move cards, assign himself to card and comment (default false) * @param {string} [permission] "private" board <== Set to "public" if you * want public Wekan board * @param {string} [color] the color of the board @@ -1300,6 +1324,7 @@ if (Meteor.isServer) { isActive: req.body.isActive || true, isNoComments: req.body.isNoComments || false, isCommentOnly: req.body.isCommentOnly || false, + isWorker: req.body.isWorker || false, }, ], permission: req.body.permission || 'private', @@ -1403,6 +1428,7 @@ if (Meteor.isServer) { * @param {boolean} isAdmin admin capability * @param {boolean} isNoComments NoComments capability * @param {boolean} isCommentOnly CommentsOnly capability + * @param {boolean} isWorker Worker capability */ JsonRoutes.add('POST', '/api/boards/:boardId/members/:memberId', function( req, @@ -1411,7 +1437,7 @@ if (Meteor.isServer) { try { const boardId = req.params.boardId; const memberId = req.params.memberId; - const { isAdmin, isNoComments, isCommentOnly } = req.body; + const { isAdmin, isNoComments, isCommentOnly, isWorker } = req.body; Authentication.checkBoardAccess(req.userId, boardId); const board = Boards.findOne({ _id: boardId }); function isTrue(data) { @@ -1426,6 +1452,7 @@ if (Meteor.isServer) { isTrue(isAdmin), isTrue(isNoComments), isTrue(isCommentOnly), + isTrue(isWorker), req.userId, ); diff --git a/models/cards.js b/models/cards.js index 496c69b3..eed1b958 100644 --- a/models/cards.js +++ b/models/cards.js @@ -2008,7 +2008,7 @@ if (Meteor.isServer) { const paramBoardId = req.params.boardId; // Check user has permission to add card to the board const board = Boards.findOne({ - _id: paramBoardId + _id: paramBoardId, }); const addPermission = allowIsBoardMemberCommentOnly(req.userId, board); Authentication.checkAdminOrCondition(req.userId, addPermission); diff --git a/models/checklists.js b/models/checklists.js index 11aba71b..cf73e500 100644 --- a/models/checklists.js +++ b/models/checklists.js @@ -288,7 +288,7 @@ if (Meteor.isServer) { const paramBoardId = req.params.boardId; // Check user has permission to add checklist to the card const board = Boards.findOne({ - _id: paramBoardId + _id: paramBoardId, }); const addPermission = allowIsBoardMemberCommentOnly(req.userId, board); Authentication.checkAdminOrCondition(req.userId, addPermission); diff --git a/models/users.js b/models/users.js index 83a224ba..7e23835c 100644 --- a/models/users.js +++ b/models/users.js @@ -352,6 +352,16 @@ if (Meteor.isClient) { return board && board.hasCommentOnly(this._id); }, + isNotWorker() { + const board = Boards.findOne(Session.get('currentBoard')); + return board && board.hasMember(this._id) && !board.hasWorker(this._id); + }, + + isWorker() { + const board = Boards.findOne(Session.get('currentBoard')); + return board && board.hasWorker(this._id); + }, + isBoardAdmin() { const board = Boards.findOne(Session.get('currentBoard')); return board && board.hasAdmin(this._id); -- cgit v1.2.3-1-g7c22 From 27943796ade78ca3c503637a1340918bf06a1267 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Fri, 3 Jan 2020 16:02:31 +0200 Subject: Revert to Wekan v3.57 version of client and models directories, removing Worker role temporarily, because Worker role changes broke saving card. Thanks to xet7 ! --- models/accountSettings.js | 12 ------------ models/boards.js | 29 +---------------------------- models/users.js | 10 ---------- 3 files changed, 1 insertion(+), 50 deletions(-) (limited to 'models') diff --git a/models/accountSettings.js b/models/accountSettings.js index a20303f5..f61614b8 100644 --- a/models/accountSettings.js +++ b/models/accountSettings.js @@ -82,16 +82,4 @@ if (Meteor.isServer) { }); } -AccountSettings.helpers({ - allowEmailChange() { - return AccountSettings.findOne('accounts-allowEmailChange').booleanValue; - }, - allowUserNameChange() { - return AccountSettings.findOne('accounts-allowUserNameChange').booleanValue; - }, - allowUserDelete() { - return AccountSettings.findOne('accounts-allowUserDelete').booleanValue; - }, -}); - export default AccountSettings; diff --git a/models/boards.js b/models/boards.js index 4e193dc7..857aa963 100644 --- a/models/boards.js +++ b/models/boards.js @@ -185,7 +185,6 @@ Boards.attachSchema( isActive: true, isNoComments: false, isCommentOnly: false, - isWorker: false, }, ]; } @@ -223,13 +222,6 @@ Boards.attachSchema( type: Boolean, optional: true, }, - 'members.$.isWorker': { - /** - * Is the member only allowed to move card, assign himself to card and comment - */ - type: Boolean, - optional: true, - }, permission: { /** * visibility of the board @@ -546,7 +538,6 @@ Boards.helpers({ isActive: true, isAdmin: false, isNoComments: true, - isWorker: false, }); }, @@ -556,17 +547,6 @@ Boards.helpers({ isActive: true, isAdmin: false, isCommentOnly: true, - isWorker: false, - }); - }, - - hasWorker(memberId) { - return !!_.findWhere(this.members, { - userId: memberId, - isActive: true, - isAdmin: false, - isCommentOnly: false, - isWorker: true, }); }, @@ -869,7 +849,6 @@ Boards.mutations({ isActive: true, isNoComments: false, isCommentOnly: false, - isWorker: false, }, }, }; @@ -902,7 +881,6 @@ Boards.mutations({ isAdmin, isNoComments, isCommentOnly, - isWorker, currentUserId = Meteor.userId(), ) { const memberIndex = this.memberIndex(memberId); @@ -916,7 +894,6 @@ Boards.mutations({ [`members.${memberIndex}.isAdmin`]: isAdmin, [`members.${memberIndex}.isNoComments`]: isNoComments, [`members.${memberIndex}.isCommentOnly`]: isCommentOnly, - [`members.${memberIndex}.isWorker`]: isWorker, }, }; }, @@ -1304,7 +1281,6 @@ if (Meteor.isServer) { * @param {boolean} [isActive] is the board active (default true) * @param {boolean} [isNoComments] disable comments (default false) * @param {boolean} [isCommentOnly] only enable comments (default false) - * @param {boolean} [isWorker] only move cards, assign himself to card and comment (default false) * @param {string} [permission] "private" board <== Set to "public" if you * want public Wekan board * @param {string} [color] the color of the board @@ -1324,7 +1300,6 @@ if (Meteor.isServer) { isActive: req.body.isActive || true, isNoComments: req.body.isNoComments || false, isCommentOnly: req.body.isCommentOnly || false, - isWorker: req.body.isWorker || false, }, ], permission: req.body.permission || 'private', @@ -1428,7 +1403,6 @@ if (Meteor.isServer) { * @param {boolean} isAdmin admin capability * @param {boolean} isNoComments NoComments capability * @param {boolean} isCommentOnly CommentsOnly capability - * @param {boolean} isWorker Worker capability */ JsonRoutes.add('POST', '/api/boards/:boardId/members/:memberId', function( req, @@ -1437,7 +1411,7 @@ if (Meteor.isServer) { try { const boardId = req.params.boardId; const memberId = req.params.memberId; - const { isAdmin, isNoComments, isCommentOnly, isWorker } = req.body; + const { isAdmin, isNoComments, isCommentOnly } = req.body; Authentication.checkBoardAccess(req.userId, boardId); const board = Boards.findOne({ _id: boardId }); function isTrue(data) { @@ -1452,7 +1426,6 @@ if (Meteor.isServer) { isTrue(isAdmin), isTrue(isNoComments), isTrue(isCommentOnly), - isTrue(isWorker), req.userId, ); diff --git a/models/users.js b/models/users.js index 7e23835c..83a224ba 100644 --- a/models/users.js +++ b/models/users.js @@ -352,16 +352,6 @@ if (Meteor.isClient) { return board && board.hasCommentOnly(this._id); }, - isNotWorker() { - const board = Boards.findOne(Session.get('currentBoard')); - return board && board.hasMember(this._id) && !board.hasWorker(this._id); - }, - - isWorker() { - const board = Boards.findOne(Session.get('currentBoard')); - return board && board.hasWorker(this._id); - }, - isBoardAdmin() { const board = Boards.findOne(Session.get('currentBoard')); return board && board.hasAdmin(this._id); -- cgit v1.2.3-1-g7c22 From cd253522a305523e3e36bb73313e8c4db500a717 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Fri, 3 Jan 2020 17:02:27 +0200 Subject: Add more Font Awesome icons. This was originally added at Wekan v3.58, removed at Wekan v3.60, and now added back at Wekan v3.61. Thanks to xet7 ! --- models/accountSettings.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'models') diff --git a/models/accountSettings.js b/models/accountSettings.js index f61614b8..a20303f5 100644 --- a/models/accountSettings.js +++ b/models/accountSettings.js @@ -82,4 +82,16 @@ if (Meteor.isServer) { }); } +AccountSettings.helpers({ + allowEmailChange() { + return AccountSettings.findOne('accounts-allowEmailChange').booleanValue; + }, + allowUserNameChange() { + return AccountSettings.findOne('accounts-allowUserNameChange').booleanValue; + }, + allowUserDelete() { + return AccountSettings.findOne('accounts-allowUserDelete').booleanValue; + }, +}); + export default AccountSettings; -- cgit v1.2.3-1-g7c22 From f6f7705f23ea18d7f1b8f8736b762eb89e00a3cf Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Sun, 5 Jan 2020 21:28:14 +0200 Subject: Add Worker role. This was originally added at Wekan v3.58, reverted at Wekan v3.60 because of bugs, and now after fixes added back. Thanks to xet7 ! Closes #2788 --- models/boards.js | 29 ++++++++++++++++++++++++++++- models/users.js | 10 ++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) (limited to 'models') diff --git a/models/boards.js b/models/boards.js index 857aa963..4e193dc7 100644 --- a/models/boards.js +++ b/models/boards.js @@ -185,6 +185,7 @@ Boards.attachSchema( isActive: true, isNoComments: false, isCommentOnly: false, + isWorker: false, }, ]; } @@ -222,6 +223,13 @@ Boards.attachSchema( type: Boolean, optional: true, }, + 'members.$.isWorker': { + /** + * Is the member only allowed to move card, assign himself to card and comment + */ + type: Boolean, + optional: true, + }, permission: { /** * visibility of the board @@ -538,6 +546,7 @@ Boards.helpers({ isActive: true, isAdmin: false, isNoComments: true, + isWorker: false, }); }, @@ -547,6 +556,17 @@ Boards.helpers({ isActive: true, isAdmin: false, isCommentOnly: true, + isWorker: false, + }); + }, + + hasWorker(memberId) { + return !!_.findWhere(this.members, { + userId: memberId, + isActive: true, + isAdmin: false, + isCommentOnly: false, + isWorker: true, }); }, @@ -849,6 +869,7 @@ Boards.mutations({ isActive: true, isNoComments: false, isCommentOnly: false, + isWorker: false, }, }, }; @@ -881,6 +902,7 @@ Boards.mutations({ isAdmin, isNoComments, isCommentOnly, + isWorker, currentUserId = Meteor.userId(), ) { const memberIndex = this.memberIndex(memberId); @@ -894,6 +916,7 @@ Boards.mutations({ [`members.${memberIndex}.isAdmin`]: isAdmin, [`members.${memberIndex}.isNoComments`]: isNoComments, [`members.${memberIndex}.isCommentOnly`]: isCommentOnly, + [`members.${memberIndex}.isWorker`]: isWorker, }, }; }, @@ -1281,6 +1304,7 @@ if (Meteor.isServer) { * @param {boolean} [isActive] is the board active (default true) * @param {boolean} [isNoComments] disable comments (default false) * @param {boolean} [isCommentOnly] only enable comments (default false) + * @param {boolean} [isWorker] only move cards, assign himself to card and comment (default false) * @param {string} [permission] "private" board <== Set to "public" if you * want public Wekan board * @param {string} [color] the color of the board @@ -1300,6 +1324,7 @@ if (Meteor.isServer) { isActive: req.body.isActive || true, isNoComments: req.body.isNoComments || false, isCommentOnly: req.body.isCommentOnly || false, + isWorker: req.body.isWorker || false, }, ], permission: req.body.permission || 'private', @@ -1403,6 +1428,7 @@ if (Meteor.isServer) { * @param {boolean} isAdmin admin capability * @param {boolean} isNoComments NoComments capability * @param {boolean} isCommentOnly CommentsOnly capability + * @param {boolean} isWorker Worker capability */ JsonRoutes.add('POST', '/api/boards/:boardId/members/:memberId', function( req, @@ -1411,7 +1437,7 @@ if (Meteor.isServer) { try { const boardId = req.params.boardId; const memberId = req.params.memberId; - const { isAdmin, isNoComments, isCommentOnly } = req.body; + const { isAdmin, isNoComments, isCommentOnly, isWorker } = req.body; Authentication.checkBoardAccess(req.userId, boardId); const board = Boards.findOne({ _id: boardId }); function isTrue(data) { @@ -1426,6 +1452,7 @@ if (Meteor.isServer) { isTrue(isAdmin), isTrue(isNoComments), isTrue(isCommentOnly), + isTrue(isWorker), req.userId, ); diff --git a/models/users.js b/models/users.js index 83a224ba..7e23835c 100644 --- a/models/users.js +++ b/models/users.js @@ -352,6 +352,16 @@ if (Meteor.isClient) { return board && board.hasCommentOnly(this._id); }, + isNotWorker() { + const board = Boards.findOne(Session.get('currentBoard')); + return board && board.hasMember(this._id) && !board.hasWorker(this._id); + }, + + isWorker() { + const board = Boards.findOne(Session.get('currentBoard')); + return board && board.hasWorker(this._id); + }, + isBoardAdmin() { const board = Boards.findOne(Session.get('currentBoard')); return board && board.hasAdmin(this._id); -- 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 --- models/settings.js | 8 -------- 1 file changed, 8 deletions(-) (limited to 'models') diff --git a/models/settings.js b/models/settings.js index 8eb02c5b..63bcd7f3 100644 --- a/models/settings.js +++ b/models/settings.js @@ -33,14 +33,6 @@ Settings.attachSchema( type: String, optional: true, }, - customHTMLafterBodyStart: { - type: String, - optional: true, - }, - customHTMLbeforeBodyEnd: { - type: String, - optional: true, - }, displayAuthenticationMethod: { type: Boolean, optional: true, -- cgit v1.2.3-1-g7c22 From e01f4dbf1393a789faaa2f38b53d2effad827e86 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Sat, 11 Jan 2020 13:08:29 +0200 Subject: Change Buffer to Buffer.alloc on Node v12. Try to fix Snap. --- models/export.js | 2 +- models/wekanCreator.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'models') diff --git a/models/export.js b/models/export.js index cc979ce0..69aaf619 100644 --- a/models/export.js +++ b/models/export.js @@ -138,7 +138,7 @@ export class Exporter { // [Old] for attachments we only export IDs and absolute url to original doc // [New] Encode attachment to base64 const getBase64Data = function(doc, callback) { - let buffer = new Buffer(0); + let buffer = new Buffer.alloc(0); // callback has the form function (err, res) {} const tmpFile = path.join( os.tmpdir(), diff --git a/models/wekanCreator.js b/models/wekanCreator.js index ec85d93f..26d34170 100644 --- a/models/wekanCreator.js +++ b/models/wekanCreator.js @@ -441,7 +441,7 @@ export class WekanCreator { }); } else if (att.file) { file.attachData( - new Buffer(att.file, 'base64'), + new Buffer.alloc(att.file, 'base64'), { type: att.type, }, -- cgit v1.2.3-1-g7c22 From 9b905c2833d54cf34d1875148075b2bf756d943a Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Sat, 18 Jan 2020 16:01:02 +0200 Subject: Try to fix Node 12 Buffer() deprecation errors. Thanks to xet7 ! --- models/export.js | 2 +- models/wekanCreator.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'models') diff --git a/models/export.js b/models/export.js index 69aaf619..cd72a6a4 100644 --- a/models/export.js +++ b/models/export.js @@ -138,7 +138,7 @@ export class Exporter { // [Old] for attachments we only export IDs and absolute url to original doc // [New] Encode attachment to base64 const getBase64Data = function(doc, callback) { - let buffer = new Buffer.alloc(0); + let buffer = Buffer.from(0); // callback has the form function (err, res) {} const tmpFile = path.join( os.tmpdir(), diff --git a/models/wekanCreator.js b/models/wekanCreator.js index 26d34170..9914f817 100644 --- a/models/wekanCreator.js +++ b/models/wekanCreator.js @@ -441,7 +441,7 @@ export class WekanCreator { }); } else if (att.file) { file.attachData( - new Buffer.alloc(att.file, 'base64'), + Buffer.from(att.file, 'base64'), { type: att.type, }, -- cgit v1.2.3-1-g7c22 From f868b3d1f977824ca1dc9fc45f0251ed4019b21e Mon Sep 17 00:00:00 2001 From: izadpoor Date: Thu, 23 Jan 2020 01:16:56 -0500 Subject: fixed board export with attchment --- models/export.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'models') diff --git a/models/export.js b/models/export.js index cd72a6a4..339123c8 100644 --- a/models/export.js +++ b/models/export.js @@ -24,7 +24,6 @@ if (Meteor.isServer) { JsonRoutes.add('get', '/api/boards/:boardId/export', function(req, res) { const boardId = req.params.boardId; let user = null; - const loginToken = req.query.authToken; if (loginToken) { const hashToken = Accounts._hashLoginToken(loginToken); @@ -35,7 +34,6 @@ if (Meteor.isServer) { Authentication.checkUserId(req.userId); user = Users.findOne({ _id: req.userId, isAdmin: true }); } - const exporter = new Exporter(boardId); if (exporter.canExport(user)) { JsonRoutes.sendResult(res, { @@ -137,8 +135,11 @@ export class Exporter { // [Old] for attachments we only export IDs and absolute url to original doc // [New] Encode attachment to base64 + const getBase64Data = function(doc, callback) { - let buffer = Buffer.from(0); + let buffer = Buffer.allocUnsafe(0); + buffer.fill(0); + // callback has the form function (err, res) {} const tmpFile = path.join( os.tmpdir(), @@ -149,14 +150,16 @@ export class Exporter { readStream.on('data', function(chunk) { buffer = Buffer.concat([buffer, chunk]); }); + readStream.on('error', function(err) { - callback(err, null); + callback(null, null); }); readStream.on('end', function() { // done fs.unlink(tmpFile, () => { //ignored }); + callback(null, buffer.toString('base64')); }); readStream.pipe(tmpWriteable); @@ -165,11 +168,14 @@ export class Exporter { result.attachments = Attachments.find(byBoard) .fetch() .map(attachment => { + let filebase64 = null; + filebase64 = getBase64DataSync(attachment); + return { _id: attachment._id, cardId: attachment.cardId, - // url: FlowRouter.url(attachment.url()), - file: getBase64DataSync(attachment), + //url: FlowRouter.url(attachment.url()), + file: filebase64, name: attachment.original.name, type: attachment.original.type, }; -- 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 --- models/boards.js | 117 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) (limited to 'models') diff --git a/models/boards.js b/models/boards.js index 4e193dc7..121272ec 100644 --- a/models/boards.js +++ b/models/boards.js @@ -278,6 +278,7 @@ Boards.attachSchema( optional: true, defaultValue: null, }, + subtasksDefaultListId: { /** * The default List ID assigned to subtasks. @@ -286,6 +287,19 @@ Boards.attachSchema( optional: true, defaultValue: null, }, + + dateSettingsDefaultBoardId: { + type: String, + optional: true, + defaultValue: null, + }, + + dateSettingsDefaultListId: { + type: String, + optional: true, + defaultValue: null, + }, + allowsSubtasks: { /** * Does the board allows subtasks? @@ -293,6 +307,39 @@ Boards.attachSchema( type: Boolean, defaultValue: true, }, + + allowsReceivedDate: { + /** + * Does the board allows received date? + */ + type: Boolean, + defaultValue: true, + }, + + allowsStartDate: { + /** + * Does the board allows start date? + */ + type: Boolean, + defaultValue: true, + }, + + allowsEndDate: { + /** + * Does the board allows end date? + */ + type: Boolean, + defaultValue: true, + }, + + allowsDueDate: { + /** + * Does the board allows due date? + */ + type: Boolean, + defaultValue: true, + }, + presentParentTask: { /** * Controls how to present the parent task: @@ -710,6 +757,39 @@ Boards.helpers({ return Boards.findOne(this.getDefaultSubtasksBoardId()); }, +//Date Settings option such as received date, start date and so on. + getDefaultDateSettingsBoardId() { + if ( + this.dateSettingsDefaultBoardId === null || + this.dateSettingsDefaultBoardId === undefined + ) { + this.dateSettingsDefaultBoardId = Boards.insert({ + title: `^${this.title}^`, + permission: this.permission, + members: this.members, + color: this.color, + description: TAPi18n.__('default-dates-board', { + board: this.title, + }), + }); + + Swimlanes.insert({ + title: TAPi18n.__('default'), + boardId: this.dateSettingsDefaultBoardId, + }); + Boards.update(this._id, { + $set: { + dateSettingsDefaultBoardId: this.dateSettingsDefaultBoardId, + }, + }); + } + return this.dateSettingsDefaultBoardId; + }, + + getDefaultDateSettingsBoard() { + return Boards.findOne(this.getDefaultDateSettingsBoardId()); + }, + getDefaultSubtasksListId() { if ( this.subtasksDefaultListId === null || @@ -728,6 +808,24 @@ Boards.helpers({ return Lists.findOne(this.getDefaultSubtasksListId()); }, + getDefaultDateSettingsListId() { + if ( + this.dateSettingsDefaultListId === null || + this.dateSettingsDefaultListId === undefined + ) { + this.dateSettingsDefaultListId = Lists.insert({ + title: TAPi18n.__('queue'), + boardId: this._id, + }); + this.setDateSettingsDefaultListId(this.dateSettingsDefaultListId); + } + return this.dateSettingsDefaultListId; + }, + + getDefaultDateSettingsList() { + return Lists.findOne(this.getDefaultDateSettingsListId()); + }, + getDefaultSwimline() { let result = Swimlanes.findOne({ boardId: this._id }); if (result === undefined) { @@ -925,6 +1023,25 @@ Boards.mutations({ return { $set: { allowsSubtasks } }; }, + setAllowsReceivedDate(allowsReceivedDate) { + return { $set: { allowsReceivedDate } }; + }, + + + setAllowsStartDate(allowsStartDate) { + return { $set: { allowsStartDate } }; + }, + + + setAllowsEndDate(allowsEndDate) { + return { $set: { allowsEndDate } }; + }, + + + setAllowsDueDate(allowsDueDate) { + return { $set: { allowsDueDate } }; + }, + setSubtasksDefaultBoardId(subtasksDefaultBoardId) { return { $set: { subtasksDefaultBoardId } }; }, -- cgit v1.2.3-1-g7c22 From b68557a29371a97d99922e8dfd8bafd7635e4e97 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Wed, 5 Feb 2020 01:44:29 +0200 Subject: Remove duplicate function. --- models/boards.js | 4 ---- 1 file changed, 4 deletions(-) (limited to 'models') diff --git a/models/boards.js b/models/boards.js index 69cf86fe..786e7108 100644 --- a/models/boards.js +++ b/models/boards.js @@ -1115,10 +1115,6 @@ Boards.mutations({ return { $set: { allowsLabels } }; }, - setAllowsAssignee(allowsAssignee) { - return { $set: { allowsAssignee } }; - }, - setAllowsReceivedDate(allowsReceivedDate) { return { $set: { allowsReceivedDate } }; }, -- cgit v1.2.3-1-g7c22 From 120a430deb04afe2cafc95a02298d2ead25b1d56 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Fri, 7 Feb 2020 02:34:57 +0200 Subject: Fix Bug enable/disable Comments in Card Settings. Thanks to warnt, mdurokov and xet7 ! Closes #2923 --- models/boards.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'models') diff --git a/models/boards.js b/models/boards.js index 786e7108..af7b739f 100644 --- a/models/boards.js +++ b/models/boards.js @@ -1095,8 +1095,8 @@ Boards.mutations({ return { $set: { allowsChecklists } }; }, - setAllowsAssignee(allowsComments) { - return { $set: { allowsComments } }; + setAllowsAssignee(allowsAssignee) { + return { $set: { allowsAssignee } }; }, setAllowsAssignedBy(allowsAssignedBy) { @@ -1115,6 +1115,10 @@ Boards.mutations({ return { $set: { allowsLabels } }; }, + setAllowsComments(allowsComments) { + return { $set: { allowsComments } }; + }, + setAllowsReceivedDate(allowsReceivedDate) { return { $set: { allowsReceivedDate } }; }, -- 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 --- models/boards.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'models') diff --git a/models/boards.js b/models/boards.js index af7b739f..ef074ad6 100644 --- a/models/boards.js +++ b/models/boards.js @@ -332,6 +332,14 @@ Boards.attachSchema( defaultValue: true, }, + allowsActivities: { + /** + * Does the board allows comments? + */ + type: Boolean, + defaultValue: true, + }, + allowsLabels: { /** * Does the board allows labels? @@ -1119,6 +1127,10 @@ Boards.mutations({ return { $set: { allowsComments } }; }, + setAllowsActivities(allowsActivities) { + return { $set: { allowsActivities } }; + }, + setAllowsReceivedDate(allowsReceivedDate) { return { $set: { allowsReceivedDate } }; }, -- 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 --- models/boards.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'models') diff --git a/models/boards.js b/models/boards.js index ef074ad6..8862f301 100644 --- a/models/boards.js +++ b/models/boards.js @@ -332,6 +332,22 @@ Boards.attachSchema( defaultValue: true, }, + allowsDescriptionTitle: { + /** + * Does the board allows description title? + */ + type: Boolean, + defaultValue: true, + }, + + allowsDescriptionText: { + /** + * Does the board allows description text? + */ + type: Boolean, + defaultValue: true, + }, + allowsActivities: { /** * Does the board allows comments? @@ -1127,6 +1143,14 @@ Boards.mutations({ return { $set: { allowsComments } }; }, + setAllowsDescriptionTitle(allowsDescriptionTitle) { + return { $set: { allowsDescriptionTitle } }; + }, + + setAllowsDescriptionText(allowsDescriptionText) { + return { $set: { allowsDescriptionText } }; + }, + setAllowsActivities(allowsActivities) { return { $set: { allowsActivities } }; }, -- cgit v1.2.3-1-g7c22