summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2019-12-21 19:38:02 +0200
committerLauri Ojansivu <x@xet7.org>2019-12-21 19:38:02 +0200
commite928660bc0b1f873696fe5fece988a5be6fc2c4e (patch)
tree9e225cb7dd905ca008d5b6e9b519042c80997184
parent7a90e893486f5e7b8bf46382f8c3009c60331dd5 (diff)
downloadwekan-e928660bc0b1f873696fe5fece988a5be6fc2c4e.tar.gz
wekan-e928660bc0b1f873696fe5fece988a5be6fc2c4e.tar.bz2
wekan-e928660bc0b1f873696fe5fece988a5be6fc2c4e.zip
LINKED_CARDS_ENABLED settings part 3.
In Progress, linked cards not completely disabled yet. Thanks to xet7 !
-rw-r--r--client/components/lists/listBody.jade2
-rw-r--r--client/components/lists/listBody.js17
-rw-r--r--models/settings.js4
-rw-r--r--server/publications/cards.js30
4 files changed, 23 insertions, 30 deletions
diff --git a/client/components/lists/listBody.jade b/client/components/lists/listBody.jade
index 517b9d93..335e42cd 100644
--- a/client/components/lists/listBody.jade
+++ b/client/components/lists/listBody.jade
@@ -49,7 +49,7 @@ template(name="addCardForm")
button.primary.confirm(type="submit") {{_ 'add'}}
unless currentBoard.isTemplatesBoard
unless currentBoard.isTemplateBoard
- if linkCardsEnabled
+ if linkedCardsEnabled
span.quiet
| {{_ 'or'}}
a.js-link {{_ 'link'}}
diff --git a/client/components/lists/listBody.js b/client/components/lists/listBody.js
index 6ed95a2a..2851b69a 100644
--- a/client/components/lists/listBody.js
+++ b/client/components/lists/listBody.js
@@ -5,17 +5,6 @@ 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() {
@@ -388,6 +377,12 @@ BlazeComponent.extendComponent({
},
}).register('addCardForm');
+Template.addCardForm.helpers({
+ linkedCardsEnabled() {
+ return Meteor.settings.public.linkedCardsEnabled;
+ },
+});
+
BlazeComponent.extendComponent({
onCreated() {
this.selectedBoardId = new ReactiveVar('');
diff --git a/models/settings.js b/models/settings.js
index 0a1bd509..8eb02c5b 100644
--- a/models/settings.js
+++ b/models/settings.js
@@ -334,10 +334,6 @@ if (Meteor.isServer) {
getDefaultAuthenticationMethod() {
return process.env.DEFAULT_AUTHENTICATION_METHOD;
},
-
- getLinkedCardsEnabled() {
- return process.env.LINKED_CARDS_ENABLED === 'true';
- }
});
}
diff --git a/server/publications/cards.js b/server/publications/cards.js
index f326ea04..f850ccfe 100644
--- a/server/publications/cards.js
+++ b/server/publications/cards.js
@@ -1,15 +1,17 @@
-Meteor.publish('card', cardId => {
- check(cardId, String);
- if (process.env.LINKED_CARDS_ENABLED === 'true') {
+if (process.env.LINKED_CARDS_ENABLED === 'false') {
+ Meteor.settings.public.linkedCardsEnabled = 'false';
+ //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 });
- } else {
- // TODO: test
- return Cards.find({
- _id: cardId,
- linkedId: {$ne: [
- null,
- ''
- ]}
- });
- }
-});
+ });
+}