From a82aa87850b9bfbab503b1f07dd6b7542a20c2f4 Mon Sep 17 00:00:00 2001 From: Nunes Nelson Date: Mon, 5 Nov 2018 21:46:57 +0100 Subject: custom fields upgrade --- models/customFields.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'models') diff --git a/models/customFields.js b/models/customFields.js index 203e46d0..5bb5e743 100644 --- a/models/customFields.js +++ b/models/customFields.js @@ -31,6 +31,12 @@ CustomFields.attachSchema(new SimpleSchema({ showOnCard: { type: Boolean, }, + automaticallyOnCard: { + type: Boolean, + }, + showLabelOnMiniCard: { + type: Boolean, + }, })); CustomFields.allow({ @@ -115,6 +121,8 @@ if (Meteor.isServer) { type: req.body.type, settings: req.body.settings, showOnCard: req.body.showOnCard, + automaticallyOnCard: req.body.automaticallyOnCard, + showLabelOnMiniCard: req.body.showLabelOnMiniCard, boardId: paramBoardId, }); -- cgit v1.2.3-1-g7c22 From 4cf98134491b5870796de795418000c0a7c3a694 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Thu, 8 Nov 2018 22:49:08 +0200 Subject: - Some fixes to Wekan import: - isCommentOnly and isNoComments are now optional - Turn off import error checking, so something is imported anyway, and import does not stop at error. - Now most of Sandstorm export do import to Standalone Wekan, but some of imported cards, dates etc are missing. - Sandstorm Import Wekan board warning messages are now translateable. Thanks to xet7 ! Closes #1945, closes #1616, closes #1903 --- models/boards.js | 2 ++ models/import.js | 10 +++++----- models/wekanCreator.js | 39 +++++++++++++++++++++------------------ 3 files changed, 28 insertions(+), 23 deletions(-) (limited to 'models') diff --git a/models/boards.js b/models/boards.js index cae6cf9f..57f3a1f1 100644 --- a/models/boards.js +++ b/models/boards.js @@ -127,9 +127,11 @@ Boards.attachSchema(new SimpleSchema({ }, 'members.$.isNoComments': { type: Boolean, + optional: true, }, 'members.$.isCommentOnly': { type: Boolean, + optional: true, }, permission: { type: String, diff --git a/models/import.js b/models/import.js index 09769794..5cdf8dc1 100644 --- a/models/import.js +++ b/models/import.js @@ -3,10 +3,10 @@ import { WekanCreator } from './wekanCreator'; Meteor.methods({ importBoard(board, data, importSource, currentBoard) { - check(board, Object); - check(data, Object); - check(importSource, String); - check(currentBoard, Match.Maybe(String)); + //check(board, Object); + //check(data, Object); + //check(importSource, String); + //check(currentBoard, Match.Maybe(String)); let creator; switch (importSource) { case 'trello': @@ -18,7 +18,7 @@ Meteor.methods({ } // 1. check all parameters are ok from a syntax point of view - creator.check(board); + //creator.check(board); // 2. check parameters are ok from a business point of view (exist & // authorized) nothing to check, everyone can import boards in their account diff --git a/models/wekanCreator.js b/models/wekanCreator.js index 59d0cfd5..b179cfae 100644 --- a/models/wekanCreator.js +++ b/models/wekanCreator.js @@ -40,6 +40,8 @@ export class WekanCreator { this.checklistItems = {}; // The comments, indexed by Wekan card id (to map when importing cards) this.comments = {}; + // Map of rules Wekan ID => Wekan ID + this.rules = {}; // the members, indexed by Wekan member id => Wekan user ID this.members = data.membersMapping ? data.membersMapping : {}; // Map of triggers Wekan ID => Wekan ID @@ -748,24 +750,25 @@ export class WekanCreator { } check(board) { - try { - // check(data, { - // membersMapping: Match.Optional(Object), - // }); - this.checkActivities(board.activities); - this.checkBoard(board); - this.checkLabels(board.labels); - this.checkLists(board.lists); - this.checkSwimlanes(board.swimlanes); - this.checkCards(board.cards); - this.checkChecklists(board.checklists); - this.checkRules(board.rules); - this.checkActions(board.actions); - this.checkTriggers(board.triggers); - this.checkChecklistItems(board.checklistItems); - } catch (e) { - throw new Meteor.Error('error-json-schema'); - } + //try { + // check(data, { + // membersMapping: Match.Optional(Object), + // }); + + // this.checkActivities(board.activities); + // this.checkBoard(board); + // this.checkLabels(board.labels); + // this.checkLists(board.lists); + // this.checkSwimlanes(board.swimlanes); + // this.checkCards(board.cards); + //this.checkChecklists(board.checklists); + // this.checkRules(board.rules); + // this.checkActions(board.actions); + //this.checkTriggers(board.triggers); + //this.checkChecklistItems(board.checklistItems); + //} catch (e) { + // throw new Meteor.Error('error-json-schema'); + // } } create(board, currentBoardId) { -- cgit v1.2.3-1-g7c22