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 --- client/components/cards/minicard.jade | 5 +++-- client/components/lists/listBody.js | 10 ++++++++++ client/components/sidebar/sidebarCustomFields.jade | 10 ++++++++++ client/components/sidebar/sidebarCustomFields.js | 18 ++++++++++++++++++ 4 files changed, 41 insertions(+), 2 deletions(-) (limited to 'client') diff --git a/client/components/cards/minicard.jade b/client/components/cards/minicard.jade index 5c609802..f23e91b3 100644 --- a/client/components/cards/minicard.jade +++ b/client/components/cards/minicard.jade @@ -53,8 +53,9 @@ template(name="minicard") each customFieldsWD if definition.showOnCard .minicard-custom-field - .minicard-custom-field-item - = definition.name + if definition.showLabelOnMiniCard + .minicard-custom-field-item + = definition.name .minicard-custom-field-item +viewer = trueValue diff --git a/client/components/lists/listBody.js b/client/components/lists/listBody.js index d99d9dc8..66b50123 100644 --- a/client/components/lists/listBody.js +++ b/client/components/lists/listBody.js @@ -59,6 +59,8 @@ BlazeComponent.extendComponent({ swimlaneId, type: 'cardType-card', }); + + // In case the filter is active we need to add the newly inserted card in // the list of exceptions -- cards that are not filtered. Otherwise the // card will disappear instantly. @@ -152,6 +154,14 @@ BlazeComponent.extendComponent({ this.labels = new ReactiveVar([]); this.members = new ReactiveVar([]); this.customFields = new ReactiveVar([]); + + const currentBoardId = Session.get('currentBoard'); + arr = [] + _.forEach(Boards.findOne(currentBoardId).customFields().fetch(), function(field){ + if(field.automaticallyOnCard) + arr.push({_id: field._id, value: null,}) + }) + this.customFields.set(arr); }, reset() { diff --git a/client/components/sidebar/sidebarCustomFields.jade b/client/components/sidebar/sidebarCustomFields.jade index fd31e5ac..f0a17773 100644 --- a/client/components/sidebar/sidebarCustomFields.jade +++ b/client/components/sidebar/sidebarCustomFields.jade @@ -41,6 +41,16 @@ template(name="createCustomFieldPopup") .materialCheckBox(class="{{#if showOnCard}}is-checked{{/if}}") span {{_ 'show-field-on-card'}} + a.flex.js-field-automatically-on-card(class="{{#if automaticallyOnCard}}is-checked{{/if}}") + .materialCheckBox(class="{{#if automaticallyOnCard}}is-checked{{/if}}") + + span {{_ 'automatically-field-on-card'}} + + a.flex.js-field-showLabel-on-card(class="{{#if showLabelOnMiniCard}}is-checked{{/if}}") + .materialCheckBox(class="{{#if showLabelOnMiniCard}}is-checked{{/if}}") + + span {{_ 'showLabel-field-on-card'}} + button.primary.wide.left(type="button") | {{_ 'save'}} if _id diff --git a/client/components/sidebar/sidebarCustomFields.js b/client/components/sidebar/sidebarCustomFields.js index e56d744e..ccc8ffb9 100644 --- a/client/components/sidebar/sidebarCustomFields.js +++ b/client/components/sidebar/sidebarCustomFields.js @@ -83,6 +83,22 @@ const CreateCustomFieldPopup = BlazeComponent.extendComponent({ $target.find('.materialCheckBox').toggleClass('is-checked'); $target.toggleClass('is-checked'); }, + 'click .js-field-automatically-on-card'(evt) { + let $target = $(evt.target); + if(!$target.hasClass('js-field-automatically-on-card')){ + $target = $target.parent(); + } + $target.find('.materialCheckBox').toggleClass('is-checked'); + $target.toggleClass('is-checked'); + }, + 'click .js-field-showLabel-on-card'(evt) { + let $target = $(evt.target); + if(!$target.hasClass('js-field-showLabel-on-card')){ + $target = $target.parent(); + } + $target.find('.materialCheckBox').toggleClass('is-checked'); + $target.toggleClass('is-checked'); + }, 'click .primary'(evt) { evt.preventDefault(); @@ -92,6 +108,8 @@ const CreateCustomFieldPopup = BlazeComponent.extendComponent({ type: this.type.get(), settings: this.getSettings(), showOnCard: this.find('.js-field-show-on-card.is-checked') !== null, + showLabelOnMiniCard: this.find('.js-field-showLabel-on-card.is-checked') !== null, + automaticallyOnCard: this.find('.js-field-automatically-on-card.is-checked') !== null, }; // insert or update -- cgit v1.2.3-1-g7c22 From f2dd725eff931c9b5c836d17fe0a72dca07a1ceb Mon Sep 17 00:00:00 2001 From: Nunes Nelson Date: Wed, 7 Nov 2018 18:23:28 +0100 Subject: custom fields upgrade -- correct --- client/components/lists/listBody.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'client') diff --git a/client/components/lists/listBody.js b/client/components/lists/listBody.js index 66b50123..1001f3bc 100644 --- a/client/components/lists/listBody.js +++ b/client/components/lists/listBody.js @@ -156,11 +156,11 @@ BlazeComponent.extendComponent({ this.customFields = new ReactiveVar([]); const currentBoardId = Session.get('currentBoard'); - arr = [] + arr = []; _.forEach(Boards.findOne(currentBoardId).customFields().fetch(), function(field){ if(field.automaticallyOnCard) - arr.push({_id: field._id, value: null,}) - }) + arr.push({_id: field._id, value: null}); + }); this.customFields.set(arr); }, -- 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 --- client/components/import/import.jade | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'client') diff --git a/client/components/import/import.jade b/client/components/import/import.jade index a1fbd83b..5b52f417 100644 --- a/client/components/import/import.jade +++ b/client/components/import/import.jade @@ -12,11 +12,11 @@ template(name="import") template(name="importTextarea") form - p: label(for='import-textarea') {{_ instruction}} + p: label(for='import-textarea') {{_ instruction}} {{_ 'import-board-instruction-about-errors'}} textarea.js-import-json(placeholder="{{_ 'import-json-placeholder'}}" autofocus) | {{jsonText}} if isSandstorm - h1.warning DANGER !!! THIS DESTROYS YOUR IMPORTED DATA, CAUSES BOARD NOT FOUND ERROR WHEN YOU OPEN THIS GRAIN AGAIN https://github.com/wekan/wekan/issues/1430 + h1.warning {{_ 'import-sandstorm-backup-warning'}} p.warning {{_ 'import-sandstorm-warning'}} input.primary.wide(type="submit" value="{{_ 'import'}}") -- cgit v1.2.3-1-g7c22