Global Search Card Popup has now every data if the search was opened from another board

- the global search only returns the card details data needed to display
  the search results, but for opening the popup card details a lot more
  information is needed. It already worked if the data was already in the
  minimongo, but if not, nearly nothing was displayed
This commit is contained in:
Martin Filser 2021-11-08 11:47:41 +01:00
parent 72ddd66495
commit 4733afe4eb
6 changed files with 58 additions and 9 deletions

View file

@ -52,7 +52,22 @@ const escapeForRegex = require('escape-string-regexp');
Meteor.publish('card', cardId => {
check(cardId, String);
return Cards.find({ _id: cardId });
const ret = Cards.find({ _id: cardId });
return ret;
});
/** publish all data which is necessary to display card details as popup
* @returns array of cursors
*/
Meteor.publishRelations('popupCardData', function(cardId) {
check(cardId, String);
this.cursor(
Cards.find({_id: cardId}),
function(cardId, card) {
this.cursor(Boards.find({_id: card.boardId}));
},
);
return this.ready()
});
Meteor.publish('myCards', function(sessionId) {