mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 09:59:47 -05:00
The pane is called Problems in the menu, its address is /admin/problems, and
docs/Features/Admin-Panel/Problems is where it is documented. Two things still
called it Reports, from before it was renamed:
* the route NAME was 'admin-reports', where its three siblings are 'setting',
'people' and 'attachments' - the bare page key. So the one route whose name
did not match its own address;
* the template, and its three files, were adminReports.
Both are 'problems' / adminProblems now, across 41 files.
What did NOT change is `legacyBase: '/admin-reports'`. That is an address people
have bookmarked and it still redirects here - the point of the rename is that
the code agrees with the menu, not that an old link should break. The CHANGELOG
entries describing the old addresses are left alone too: a released section is a
record of what shipped.
Thanks to xet7 !
27 lines
1.4 KiB
JavaScript
27 lines
1.4 KiB
JavaScript
import { Mongo } from 'meteor/mongo';
|
|
import { REPORT_PAGE_COLLECTION } from '/models/lib/reportPageIndex';
|
|
|
|
// The page index the paginated publications send (models/lib/reportPageIndex.js):
|
|
// one document per report, holding the ids of the page the SERVER chose, in the
|
|
// order it sorted them.
|
|
//
|
|
// Client-only — there is no `report_pages` collection on the server, the
|
|
// publications just address documents to that name over DDP — and declared HERE,
|
|
// once, because `new Mongo.Collection(name)` throws if the name is taken. It used
|
|
// to live inside adminProblems.js, so the second page to need it (/public) could
|
|
// not have one.
|
|
export const ReportPages = new Mongo.Collection(REPORT_PAGE_COLLECTION);
|
|
|
|
// The documents of the page the server named, in the order it sorted them.
|
|
//
|
|
// A plain `collection.find()` shows whatever minimongo holds, which is right only
|
|
// for a collection nothing else fills. Boards and Cards are not those: every board
|
|
// the user has opened is in minimongo, so a page that read the collection drew
|
|
// rows from other pages while its pager - counted on the server - said "1 / 1".
|
|
export function reportPageDocs(collection, reportId, docsByIds) {
|
|
const index = ReportPages.findOne(reportId);
|
|
const ids = (index && index.ids) || [];
|
|
if (!ids.length) return [];
|
|
return docsByIds(ids, collection.find({ _id: { $in: ids } }).fetch());
|
|
}
|