mirror of
https://github.com/wekan/wekan.git
synced 2025-04-22 04:57:07 -04:00
Using LINKED_CARDS_ENABLED
This commit is contained in:
parent
07724f99ae
commit
0a1e7006b3
3 changed files with 27 additions and 4 deletions
|
@ -49,9 +49,10 @@ template(name="addCardForm")
|
|||
button.primary.confirm(type="submit") {{_ 'add'}}
|
||||
unless currentBoard.isTemplatesBoard
|
||||
unless currentBoard.isTemplateBoard
|
||||
span.quiet
|
||||
| {{_ 'or'}}
|
||||
a.js-link {{_ 'link'}}
|
||||
if linkCardsEnabled
|
||||
span.quiet
|
||||
| {{_ 'or'}}
|
||||
a.js-link {{_ 'link'}}
|
||||
span.quiet
|
||||
|
|
||||
| /
|
||||
|
|
|
@ -5,6 +5,17 @@ BlazeComponent.extendComponent({
|
|||
onCreated() {
|
||||
// for infinite scrolling
|
||||
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() {
|
||||
|
|
|
@ -1,4 +1,15 @@
|
|||
Meteor.publish('card', cardId => {
|
||||
check(cardId, String);
|
||||
return Cards.find({ _id: cardId });
|
||||
if (process.env.LINKED_CARDS_ENABLED === 'true') {
|
||||
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