- The General/ level is gone: its 109 files moved up into the folders of the same name, and its topic table is the "Shared topics" section of Features.md. - Accessibility is one folder, docs/Features/Accessibility/, with the Admin Panel's accessibility page in it. - Every folder's main page is README.md (110 X/X.md pages renamed with git mv, five merged with an existing README.md, 26 index pages added for folders that had none), so a folder opened on GitHub shows its page. - The 73 "# Moved" forwarding pages are deleted, with the folders that held only them; every link that went to one goes to its final page. - docs/Features/README.md has the website's "Features in WeKan" overview, each feature linking to its page here. 1,129 Markdown links in 262 files and 352 doc paths in code, tests, compose, snap and release files follow. tests/docsFeaturesLayout.test.cjs fails when General/ or a "# Moved" page comes back, a folder has no README.md, or a relative link in the docs or README.md does not resolve. 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