RAM usage, the Problems README, Recovery, Repairs, Rules Report, Security Report, Snap, Speed, Summary and Tests now open with what the feature is, links to read more, step-by-step use, how each number is computed and how it is implemented, and end with the commits that built it. Corrected from the code: the automatic board repair no longer un-binds lists (since #6515); Recovery's rule email section has Review, Resend, Mark as sent and Drop, and a section for legacy rule emails; Delete is under Settings; the Product name is in Settings / Appearance; Speed rows fold per kind of request, not per path; the RAM row detail has WeKan RSS and no load; the snap command falls back to MONGO_URL and prints the Databases section. Thanks to xet7 !
4.9 KiB
Admin Panel / Problems / Rules Report
What it is
The Rules Report lists every automation rule on the instance, with its board,
trigger and action, so a site administrator can see in one place what WeKan
does automatically on every board - for example while looking for a rule that
moves cards unexpectedly. It shows all boards, not only the administrator's own.
Address: /admin/problems/rules. Site administrators only.
Read more
- Business rules engine on Wikipedia - rules made of a trigger (an event) and an action, which is what a WeKan rule is.
- In WeKan: Rules, Rules REST API, the shared table page.
How to use it
- Log in as a site administrator.
- Click your avatar or username at the top right and choose Admin Panel.
- Click the Problems tab.
- In the left menu, under Reports, click Rules Report.
- Page with the previous / next buttons; the total and
page X / Nare shown beside them. - To find a rule, type part of its title in the search box and press Enter. Clear the box and press Enter to see every rule again.
- To change a rule, open its board and edit it in the board's rules editor: this pane is read-only.
How the numbers are calculated
| Number | How it is computed |
|---|---|
| Total | getRulesReportCount counts every rule whose title matches the search (case-insensitive, the search text taken literally), or every rule when the search is empty (server/publications/rules.js). |
| Rows per page | 10 (TABLE_PAGE_ROWS_PER_PAGE in models/lib/tablePage.js). |
| Page count | ceil(total / 10), at least 1. |
| Order | by board id (sort: { boardId: 1 }), so the rules of one board are together. |
How it works in WeKan
The table
The shared table page, 10 rows a page, sorted by
board, fetched one page at a time from the server (rulesReport publication,
getRulesReportCount method, server/publications/rules.js):
| Column | Holds |
|---|---|
| Rule Title | the rule's title |
| Board Title | the board the rule belongs to |
| actionType | the type of the rule's action |
| activityType | the activity type of the rule's trigger |
The search box applies when Enter is pressed and matches the rule title, case-insensitively. The pane is read-only: rules are edited on their board.
The column labels are fixed English text in the table spec, not translated
(client/components/settings/adminProblems.js,
REPORT_TABLES['report-rules']).
Several triggers and actions
A rule may have several triggers (any of them fires it) and several actions
(run in order, the original first): triggerId/actionId plus
extraTriggerIds/extraActionIds (models/lib/ruleParts.js).
The publication sends every trigger and action of each rule on the page, but
the actionType and activityType columns show the rule's original action and
trigger (rule.action() and rule.trigger() in models/rules.js).
Server side
rulesReport(searchTerm, limit, skip)returns nothing unless the caller is a site administrator (isAdmin);getRulesReportCountthrowsnot-authorized.- The page is published manually (fetch, then
this.addedfor the rules, their actions, triggers and boards' titles, thenthis.ready), not as a live cursor: a sorted and limited live observe hung on FerretDB's OpLog and left the report on its spinner.
Tests
- tests/rulesBleed.test.cjs - the rules
publications,
rulesReportincluded, are admin-only. - tests/adminPageRows.test.cjs - the report fetches one page of rows from the server and counts them separately.
Related
Commits
- A rule may have several triggers and several actions; the report publishes all of them
- Admin reports show the whole instance, not only the admin's own boards
- Publish the report page manually so it loads on FerretDB
- Pagination and search for the Admin Panel reports
- RulesBleed: only administrators read every rule
- Add the rules report