summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.meteor/packages2
-rw-r--r--.meteor/versions2
-rw-r--r--README.md4
-rw-r--r--scalingo.json8
-rw-r--r--server/publications/boards.js139
5 files changed, 64 insertions, 91 deletions
diff --git a/.meteor/packages b/.meteor/packages
index 98c06cc9..93965383 100644
--- a/.meteor/packages
+++ b/.meteor/packages
@@ -18,13 +18,13 @@ es5-shim
aldeed:collection2
cfs:gridfs
cfs:standard-packages
+cottz:publish-relations
dburles:collection-helpers
idmontie:migrations
matb33:collection-hooks
matteodem:easy-search
mongo
mquandalle:collection-mutations
-reywood:publish-composite
# Account system
accounts-password
diff --git a/.meteor/versions b/.meteor/versions
index 9d7fe1b3..cf64a5d2 100644
--- a/.meteor/versions
+++ b/.meteor/versions
@@ -39,6 +39,7 @@ check@1.1.0
chuangbo:cookie@1.1.0
coffeescript@1.0.11
cosmos:browserify@0.9.2
+cottz:publish-relations@2.0.0
dburles:collection-helpers@1.0.4
ddp@1.2.2
ddp-client@1.2.1
@@ -119,7 +120,6 @@ reactive-dict@1.1.3
reactive-var@1.0.6
reload@1.1.4
retry@1.0.4
-reywood:publish-composite@1.4.2
routepolicy@1.0.6
seriousm:emoji-continued@1.4.0
service-configuration@1.0.5
diff --git a/README.md b/README.md
index a4dda6df..82927a72 100644
--- a/README.md
+++ b/README.md
@@ -23,6 +23,8 @@ that by providing one-click installation on Heroku or [Sandstorm]
[![Deploy][heroku_button]][heroku_deploy]
+[![Deploy to Scalingo][scalingo_button]][scalingo_deploy]
+
Wekan is released under the very permissive [MIT license](LICENSE), and made
with [Meteor](https://www.meteor.com).
@@ -36,3 +38,5 @@ with [Meteor](https://www.meteor.com).
[docker_image]: https://hub.docker.com/r/mquandalle/wekan/
[heroku_button]: https://www.herokucdn.com/deploy/button.png
[heroku_deploy]: https://heroku.com/deploy?template=https://github.com/wekan/wekan/tree/master
+[scalingo_button]: https://cdn.scalingo.com/deploy/button.svg
+[scalingo_deploy]: https://my.scalingo.com/deploy?source=https://github.com/wekan/wekan#devel \ No newline at end of file
diff --git a/scalingo.json b/scalingo.json
new file mode 100644
index 00000000..57acbacc
--- /dev/null
+++ b/scalingo.json
@@ -0,0 +1,8 @@
+{
+ "name": "wekan",
+ "description": "The open-source Trello-like kanban (build with Meteor)",
+ "repository": "https://github.com/wekan/wekan/",
+ "logo": "https://raw.githubusercontent.com/wekan/wekan/master/meta/icons/wekan-150.png",
+ "website": "https://wekan.io",
+ "addons": ["scalingo-mongodb"]
+}
diff --git a/server/publications/boards.js b/server/publications/boards.js
index ffb077e9..da6bc1cd 100644
--- a/server/publications/boards.js
+++ b/server/publications/boards.js
@@ -55,97 +55,58 @@ Meteor.publish('archivedBoards', function() {
});
});
-Meteor.publishComposite('board', function(boardId) {
+Meteor.publishRelations('board', function(boardId) {
check(boardId, String);
- return {
- find() {
- return Boards.find({
- _id: boardId,
- archived: false,
- // If the board is not public the user has to be a member of it to see
- // it.
- $or: [
- { permission: 'public' },
- { members: { $elemMatch: { userId: this.userId, isActive: true }}},
- ],
- }, { limit: 1 });
- },
- children: [
- // Lists
- {
- find(board) {
- return Lists.find({
- boardId: board._id,
- });
- },
- },
- // Cards and cards comments
- // XXX Originally we were publishing the card documents as a child of the
- // list publication defined above using the following selector `{ listId:
- // list._id }`. But it was causing a race condition in publish-composite,
- // that I documented here:
- //
- // https://github.com/englue/meteor-publish-composite/issues/29
- //
- // I then tried to replace publish-composite by cottz:publish, but it had
- // a similar problem:
- //
- // https://github.com/Goluis/cottz-publish/issues/4
- // https://github.com/wekan/wekan/pull/78
- //
- // The current state of relational publishing in meteor is a bit sad,
- // there are a lot of various packages, with various APIs, some of them
- // are unmaintained. Fortunately this is something that will be fixed by
- // meteor-core at some point:
- //
- // https://trello.com/c/BGvIwkEa/48-easy-joins-in-subscriptions
- //
- // And in the meantime our code below works pretty well -- it's not even a
- // hack!
- {
- find(board) {
- return Cards.find({
- boardId: board._id,
- });
- },
+ this.cursor(Boards.find({
+ _id: boardId,
+ archived: false,
+ // If the board is not public the user has to be a member of it to see
+ // it.
+ $or: [
+ { permission: 'public' },
+ { members: { $elemMatch: { userId: this.userId, isActive: true }}},
+ ],
+ }, { limit: 1 }), function(boardId, board) {
+ this.cursor(Lists.find({ boardId }));
- children: [
- // comments
- {
- find(card) {
- return CardComments.find({
- cardId: card._id,
- });
- },
- },
- // Attachments
- {
- find(card) {
- return Attachments.find({
- cardId: card._id,
- });
- },
- },
- ],
- },
+ // Cards and cards comments
+ // XXX Originally we were publishing the card documents as a child of the
+ // list publication defined above using the following selector `{ listId:
+ // list._id }`. But it was causing a race condition in publish-composite,
+ // that I documented here:
+ //
+ // https://github.com/englue/meteor-publish-composite/issues/29
+ //
+ // cottz:publish had a similar problem:
+ //
+ // https://github.com/Goluis/cottz-publish/issues/4
+ //
+ // The current state of relational publishing in meteor is a bit sad,
+ // there are a lot of various packages, with various APIs, some of them
+ // are unmaintained. Fortunately this is something that will be fixed by
+ // meteor-core at some point:
+ //
+ // https://trello.com/c/BGvIwkEa/48-easy-joins-in-subscriptions
+ //
+ // And in the meantime our code below works pretty well -- it's not even a
+ // hack!
+ this.cursor(Cards.find({ boardId }), function(cardId) {
+ this.cursor(CardComments.find({ cardId }));
+ this.cursor(Attachments.find({ cardId }));
+ });
- // Board members. This publication also includes former board members that
- // aren't members anymore but may have some activities attached to them in
- // the history.
- {
- find(board) {
- return Users.find({
- _id: { $in: _.pluck(board.members, 'userId') },
- });
- },
- // Presence indicators
- children: [{
- find(user) {
- return presences.find({userId: user._id});
- },
- }],
- },
- ],
- };
+ // Board members. This publication also includes former board members that
+ // aren't members anymore but may have some activities attached to them in
+ // the history.
+ //
+ this.cursor(Users.find({
+ _id: { $in: _.pluck(board.members, 'userId') },
+ }), function(userId) {
+ // Presence indicators
+ this.cursor(presences.find({ userId }));
+ });
+ });
+
+ return this.ready();
});