Merge branch 'master' of https://github.com/wekan/wekan into new-search

This commit is contained in:
John R. Supplee 2021-01-23 00:59:18 +02:00
commit 9d2bb505ae
78 changed files with 788 additions and 3439 deletions

View file

@ -124,9 +124,13 @@ BlazeComponent.extendComponent({
},
'click .js-clone-board'(evt) {
Meteor.call(
'cloneBoard',
'copyBoard',
this.currentData()._id,
Session.get('fromBoard'),
{
sort: Boards.find({ archived: false }).count(),
type: 'board',
title: Boards.findOne(this.currentData()._id).copyTitle(),
},
(err, res) => {
if (err) {
this.setError(err.error);

View file

@ -239,7 +239,7 @@ BlazeComponent.extendComponent({
.customFields()
.fetch(),
function(field) {
if (field.automaticallyOnCard)
if (field.automaticallyOnCard || field.alwaysOnCard)
arr.push({ _id: field._id, value: null });
},
);
@ -675,12 +675,18 @@ BlazeComponent.extendComponent({
element.type = 'swimlane';
_id = element.copy(this.boardId);
} else if (this.isBoardTemplateSearch) {
board = Boards.findOne(element.linkedId);
board.sort = Boards.find({ archived: false }).count();
board.type = 'board';
board.title = element.title;
delete board.slug;
_id = board.copy();
Meteor.call(
'copyBoard',
element.linkedId,
{
sort: Boards.find({ archived: false }).count(),
type: 'board',
title: element.title,
},
(err, data) => {
_id = data;
},
);
}
Popup.close();
},

View file

@ -59,6 +59,10 @@ template(name="createCustomFieldPopup")
span {{_ 'automatically-field-on-card'}}
a.flex.js-field-always-on-card(class="{{#if alwaysOnCard}}is-checked{{/if}}")
.materialCheckBox(class="{{#if alwaysOnCard}}is-checked{{/if}}")
span {{_ 'always-field-on-card'}}
a.flex.js-field-showLabel-on-card(class="{{#if showLabelOnMiniCard}}is-checked{{/if}}")
.materialCheckBox(class="{{#if showLabelOnMiniCard}}is-checked{{/if}}")

View file

@ -174,6 +174,14 @@ const CreateCustomFieldPopup = BlazeComponent.extendComponent({
$target.find('.materialCheckBox').toggleClass('is-checked');
$target.toggleClass('is-checked');
},
'click .js-field-always-on-card'(evt) {
let $target = $(evt.target);
if (!$target.hasClass('js-field-always-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')) {
@ -194,6 +202,8 @@ const CreateCustomFieldPopup = BlazeComponent.extendComponent({
this.find('.js-field-showLabel-on-card.is-checked') !== null,
automaticallyOnCard:
this.find('.js-field-automatically-on-card.is-checked') !== null,
alwaysOnCard:
this.find('.js-field-always-on-card.is-checked') !== null,
};
// insert or update