Files
wekan/client/lib/filterSubtasks.js
T
Lauri Ojansivu 4f20f24201 Card actions in their sections: Filter: Subtasks, Edit voting, Edit Planning Poker, Change spent time and Card kind in the opened card's section hamburgers and in Card Settings' panes.
- The five leave the card's actions menu. On the opened card each is in
  the hamburger of its section: Subtasks (Filter: Subtasks, and the
  subtask settings), Voting, Planning Poker, Spent time, and a new Scrum
  settings heading over the Scrum fields the card shows (Card kind).
  Voting, Planning Poker and Spent time show their heading when ticked
  "On this card" before there is anything in them, so the hamburger can
  fill them in.
- Card Settings: everything in a section's hamburger is also at the top
  of that section's pane, under its title - the card's actions when it
  is opened from a card, Subtask settings also from Board Settings.
  tests/cardSectionActions.test.cjs fails for a hamburger that is not.
- Filter: Subtasks is one function, client/lib/filterSubtasks.js.
- Card Settings: no select-all rows for Show on Minicard and Show on Card
  in its first entry, where there is nothing under them; the popup is
  high enough for every entry of its menu.

Docs: docs/Features/Cards/Card-Fields.md.

Thanks to xet7 !
2026-10-25 16:55:03 +02:00

23 lines
1.0 KiB
JavaScript

import { Session } from 'meteor/session';
import { Filter } from '/client/lib/filter';
import { Utils } from '/client/lib/utils';
import { getSidebarInstance } from '/client/features/sidebar/service';
// Filter: Subtasks - the board filtered to this card's subtasks, with the
// card closed so the board can be seen. Reached from the opened card's
// Subtasks hamburger and from Card Settings' Checklists pane
// (docs/Features/Cards/Card-Fields.md); it was in the card's actions menu.
export function filterSubtasksOf(card) {
if (!card || !card._id || card.boardId !== Session.get('currentBoard')) return;
Filter.parentId.reset();
Filter.parentId.add(card._id);
Filter.resetExceptions();
Session.set('openCards', (Session.get('openCards') || []).filter(id => id !== card._id));
if (Session.get('currentCard') === card._id) Session.set('currentCard', null);
Session.set('popupCardId', null);
Session.set('popupCardBoardId', null);
Popup.close();
Utils.goBoardId(card.boardId);
getSidebarInstance().setView('filter');
}