mirror of
https://github.com/wekan/wekan.git
synced 2026-01-01 07:08:49 +01:00
LINKED_CARDS_ENABLED settings part 3.
In Progress, linked cards not completely disabled yet. Thanks to xet7 !
This commit is contained in:
parent
7a90e89348
commit
e928660bc0
4 changed files with 23 additions and 30 deletions
|
|
@ -49,7 +49,7 @@ template(name="addCardForm")
|
||||||
button.primary.confirm(type="submit") {{_ 'add'}}
|
button.primary.confirm(type="submit") {{_ 'add'}}
|
||||||
unless currentBoard.isTemplatesBoard
|
unless currentBoard.isTemplatesBoard
|
||||||
unless currentBoard.isTemplateBoard
|
unless currentBoard.isTemplateBoard
|
||||||
if linkCardsEnabled
|
if linkedCardsEnabled
|
||||||
span.quiet
|
span.quiet
|
||||||
| {{_ 'or'}}
|
| {{_ 'or'}}
|
||||||
a.js-link {{_ 'link'}}
|
a.js-link {{_ 'link'}}
|
||||||
|
|
|
||||||
|
|
@ -5,17 +5,6 @@ BlazeComponent.extendComponent({
|
||||||
onCreated() {
|
onCreated() {
|
||||||
// for infinite scrolling
|
// for infinite scrolling
|
||||||
this.cardlimit = new ReactiveVar(InfiniteScrollIter);
|
this.cardlimit = new ReactiveVar(InfiniteScrollIter);
|
||||||
this.linkCardsEnabled = new ReactiveVar(true);
|
|
||||||
|
|
||||||
Meteor.call('getLinkedCardsEnabled', (error, ret) => {
|
|
||||||
if (!error && ret) {
|
|
||||||
this.linkCardsEnabled.set(ret);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
linkCardsEnabled() {
|
|
||||||
return this.linkCardsEnabled.get();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
mixins() {
|
mixins() {
|
||||||
|
|
@ -388,6 +377,12 @@ BlazeComponent.extendComponent({
|
||||||
},
|
},
|
||||||
}).register('addCardForm');
|
}).register('addCardForm');
|
||||||
|
|
||||||
|
Template.addCardForm.helpers({
|
||||||
|
linkedCardsEnabled() {
|
||||||
|
return Meteor.settings.public.linkedCardsEnabled;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
BlazeComponent.extendComponent({
|
BlazeComponent.extendComponent({
|
||||||
onCreated() {
|
onCreated() {
|
||||||
this.selectedBoardId = new ReactiveVar('');
|
this.selectedBoardId = new ReactiveVar('');
|
||||||
|
|
|
||||||
|
|
@ -334,10 +334,6 @@ if (Meteor.isServer) {
|
||||||
getDefaultAuthenticationMethod() {
|
getDefaultAuthenticationMethod() {
|
||||||
return process.env.DEFAULT_AUTHENTICATION_METHOD;
|
return process.env.DEFAULT_AUTHENTICATION_METHOD;
|
||||||
},
|
},
|
||||||
|
|
||||||
getLinkedCardsEnabled() {
|
|
||||||
return process.env.LINKED_CARDS_ENABLED === 'true';
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,17 @@
|
||||||
Meteor.publish('card', cardId => {
|
if (process.env.LINKED_CARDS_ENABLED === 'false') {
|
||||||
check(cardId, String);
|
Meteor.settings.public.linkedCardsEnabled = 'false';
|
||||||
if (process.env.LINKED_CARDS_ENABLED === 'true') {
|
//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 });
|
return Cards.find({ _id: cardId });
|
||||||
} else {
|
});
|
||||||
// TODO: test
|
}
|
||||||
return Cards.find({
|
|
||||||
_id: cardId,
|
|
||||||
linkedId: {$ne: [
|
|
||||||
null,
|
|
||||||
''
|
|
||||||
]}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue