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

@ -1,4 +1,16 @@
Utils = {
/** returns the current board id
* <li> returns the current board id or the board id of the popup card if set
*/
getCurrentBoardId() {
let popupCardBoardId = Session.get('popupCardBoardId');
let currentBoard = Session.get('currentBoard');
let ret = currentBoard;
if (popupCardBoardId) {
ret = popupCardBoardId;
}
return ret;
},
getCurrentCardId(ignorePopupCard) {
let ret = Session.get('currentCard');
if (!ret && !ignorePopupCard) {
@ -10,6 +22,14 @@ Utils = {
const ret = Session.get('popupCard');
return ret;
},
/** returns the current board
* <li> returns the current board or the board of the popup card if set
*/
getCurrentBoard() {
const boardId = Utils.getCurrentBoardId();
const ret = Boards.findOne(boardId);
return ret;
},
getCurrentCard(ignorePopupCard) {
const cardId = Utils.getCurrentCardId(ignorePopupCard);
const ret = Cards.findOne(cardId);