Merge pull request #4194 from mfilser/fix_multi_selection_sidebar_action_keep_card_order

Sidebar multi selection actions keep now the card sorting (cards moving, cards to archive etc.)
This commit is contained in:
Lauri Ojansivu 2021-11-26 01:25:08 +02:00 committed by GitHub
commit 1af75aa579
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -99,14 +99,14 @@ BlazeComponent.extendComponent({
}).register('filterSidebar');
function mutateSelectedCards(mutationName, ...args) {
Cards.find(MultiSelection.getMongoSelector()).forEach(card => {
Cards.find(MultiSelection.getMongoSelector(), {sort: ['sort']}).forEach(card => {
card[mutationName](...args);
});
}
BlazeComponent.extendComponent({
mapSelection(kind, _id) {
return Cards.find(MultiSelection.getMongoSelector()).map(card => {
return Cards.find(MultiSelection.getMongoSelector(), {sort: ['sort']}).map(card => {
const methodName = kind === 'label' ? 'hasLabel' : 'isAssigned';
return card[methodName](_id);
});