The Rules page lost its Back with its own sidebar; only the trigger, action
and rule details pages kept one, to the rules list, so the way back to the
board was the Board View menu. The rules list and its Workflow, Bots,
Blocks and History views now have a Back link to the board at the top. The
three sub-pages keep their own Back and show no second one.
Thanks to mimZD and xet7 !
Fixes#6852.
Admin Panel / Settings / Visibility / Rules gets "Boards may show their
Rules to members, read-only", off by default (Settings
rulesReadOnlyForMembers, site admin only). With it on, a board admin ticks
"Show these Rules to board members, read-only" on the board's Rules page
(rulesVisibleToMembers). Members of that board then get Rules in Board
Settings and see the rules list and each rule's details, with no control
that changes a rule; the methods that change rules keep their board-admin
checks, so nothing is granted. Without both ticks only board and site
admins see the Rules page, which until now drew its list for any member
who opened the address.
models/lib/rulesReadOnly.js decides 'edit', 'read' or 'none', and
client/lib/rulesAccess.js is the one place the Rules page, Board Settings
and rule details ask. tests/rulesReadOnly.test.cjs covers both switches,
each alone, a non-member, and that a reader's page has no edit control.
boardMenuOrder now leaves the reader's alternative branch out of the
admin's sequence and pins it alone; instanceFeatures counts the fourth
site-admin method; roleHelperRegressions follows the canAdmin check to
rulesAccess.js. The new strings are English placeholders until the next
translation pass.
Thanks to justinr1234 and xet7 !
Fixes#2217.
Board Settings -> Bots, below Workflow view, is the Rules page's view for
bots: runners on your own server - an AI agent, a CI job, a script - that
the board hands cards to. It is laid out like kanbots in the board's own
theme, Font Awesome and drag and drop: a rail of bots, live runs and
activity; the board's lists as columns, each card with its run's state
(Queued, Running, Waiting for you, Ready to review, Done, Failed, Stopped),
the step it is on and the answers to a question it asked; and a drawer with
the card's thread, Hand to bot, Stop and a reply box. Board admins only,
like the rest of the Rules page, and never a board or public view.
A bot has no rights of its own, like Rules and workflows. WeKan only sends
to it: a bot is an outgoing webhook marked as a bot, subscribed to no board
activity and no reminders, and a dispatch goes through the ordinary webhook
queue - the SSRF guard, its signing token, retries, Sandstorm's Powerbox.
The runner works on the board through WeKan's REST API with its own user's
token and board role, and reports its run at one REST route that needs
write access to the board. Handing over is a board admin's choice, in the
view or with the new Rule action "Hand the card to bot"; an answer or a
reply is the admin's own comment, under their right to comment.
The GitHub- and Gitea-compatible APIs' routes are regular expression
literals now, and an instance board is Trello's "org" level.
The new strings are translated in every locale.
Thanks to xet7 !
#4294 asked for four things. Several triggers and actions, rule variables,
renaming in place and rule import/export were built earlier; two parts were
still missing.
- "I want the assignee to be the creator of the card by default": rules had
member actions only. Add and Remove assignee actions take a username, a
{creator}/{assignees}/{members} token, the user who triggered the rule, or
"*" for every assignee, and write card.assignees. They are durable through
Sync like the member actions, with the joinAssignee/unjoinAssignee
activities the assignees hook writes.
- "give a Rule a default name": Add Rule with an empty title showed an
error, and rules.createRule stored the literal "Rule". The title is now
optional; the rule is named after its trigger and action ("When ...,
then ..."), and the rules list renames it in place.
Fixing this found that "Remove all members from the card" iterated the
card's assignees while removing from its members: an earlier fix believed
assignMember wrote assignees, but both definitions in models/cards.js write
members. It removed only members who were also assignees. Remove-all now
iterates card.members, in the ordinary and the durable path, and the guards
that pinned the wrong collection now read models/cards.js to decide.
New text is added in English, pending Transifex.
Thanks to xeruf and xet7 !
Fixes#4294.
The Rules page had a separate right sidebar holding only Back and its
views (List view, Workflow view, Blocks, History, Import / Export
rules). It now uses the board's own sidebar, like the board: the same
views are in its Board Settings under Rules, and choosing one there
while on the Rules page closes the sidebar so the view is not left
under it. The separate sidebar and its template are removed.
Its Back button went with it, so picking a view in the Board View menu
while on the Rules page now goes back to the board, asking first before
unsaved Blocks work would be lost.
Source tests pin the Rules route to the board sidebar, the absence of
the old controls, the way back and the Board Settings entries' existing
translated labels. The Rules browser specs open views through Board
Settings; a member who is not a board admin is not offered them there,
and the Blocks view still refuses such a member. The Rules and Board
Settings specs pass in Chromium and WebKit.
Thanks to xet7 !
A trigger's list, swimlane, title, checklist and user fields may now use the
variables actions already resolve - {creator}, {assignees}, {members},
{customField:Name} and the rest - read from the card when the rule is
checked: "when a card is moved to the list named in its {customField:Stage}".
Such a value never equals what an activity carries, so the rule engine now
also fetches this board's triggers that hold a token and resolves them; every
other field keeps the ordinary exact-or-wildcard rule. People tokens match any
one of the named users, "by {assignees}" is kept as typed and compared by
username, and an unknown token stays literal. The editor explains this in a
new hint, English pending Transifex.
Thanks to xet7 !
Maintainer decision for #4294 and #2953: a rule keeps its own trigger and
action and may add up to ten more of each. It fires when any of its
triggers fires - once per activity, even when several match - and runs its
actions in order, its own first. Rule details lists the extra parts with
Add another trigger / Add another action and Remove; the new
rules.addPart/removePart methods keep the board-admin and cross-board
destination checks of rules.createRule and refuse a button as an extra
trigger.
Ordinary, scheduled and button rules, the durable Sync rule plan, rule
History (snapshot, part edits and restore), deletion, board copy, WeKan
export/import, the rules JSON export/import, the REST representation and
the admin rules report all handle every part. Two rule-engine test
harnesses now receive the new helpers they evaluate.
New strings are in en.i18n.json, pending translation.
Thanks to xet7 !
Fixes#2953,
Lazy-load Blockly for board administrators, preserve existing rule documents and execution, and provide direct List, Workflow, Blocks and History choices. Route workflow writes through server methods. Include local media, complete message-key coverage, translation merging and placeholder checks.
Translation coverage remains incomplete in additional locales. Low-confidence specialist terminology needs native review in Aragonese, Asturian, Corsican, Neapolitan, Occitan, Sardinian, Sicilian, Kashubian, Upper Sorbian, Silesian, Cornish, Manx, Gaelic and Breton; Faroese and Frisian also merit review.
Verified five Blockly/catalog Node tests, existing rules suites and four Blockly Chromium scenarios, including admin permissions, localization, drag editing and persisted execution.
Thanks to xet7 !
Reported directly, with screenshots: on Board Settings / Rules, clicking
"Workflow view" in the page sidebar changed the button's label to "List
view" but the page kept showing the "Add trigger" tab - the workflow
builder never appeared.
rulesMain.jade renders +rulesWorkflow only while its rulesCurrentTab
ReactiveVar is 'rulesList'. The toggle lives in rulesControls, a separate
template in the page sidebar with no handle on the rulesMain instance, so
it only flips Session 'rulesViewMode'; from the Add trigger / Add action /
rule details tabs that changed nothing visible. rulesMain now owns an
autorun that brings the page back to the list tab whenever the workflow
view is selected - the one place the tab state can be changed from.
tests/rulesWorkflowViewToggle.test.cjs pins it.
Thanks to xet7 !
#2713 asked for two things.
Editing a rule used to mean delete it and rebuild it from scratch, losing
its position and its identity. rulesList's rule row gets a second "Edit
trigger/action" button next to the existing title-rename pencil, opening
the same trigger/action wizard used to create a rule (rulesMain.js /
rulesTriggers / rulesActions and the board/card/checklist/mail action
templates), pre-filled with the rule's current title. A new server method,
rules.updateRule (server/rulesButton.js), mirrors rules.createRule's
authorization and cross-board destination checks but REPLACES the existing
trigger/action documents in place (full-document update by their existing
_id, not remove+insert), so the rule keeps its own _id, and its trigger/
action keep theirs, across an edit. Every action-template click handler
that used to call rules.createRule or insert Triggers/Actions/Rules
directly now goes through one shared helper,
client/components/rules/rulesSaveHelper.js, which picks create vs. update
based on whether the wizard was opened to edit an existing rule.
The "send an email" rule action already appended the card's title and a
link to it automatically (#3301), even when the user's own template used
none of the {card}/{cardLink} tokens; it did not do the same for the card's
description. server/rulesHelper.js now appends "Description: ..." to the
footer alongside the existing title/link lines, using the vars.description
value buildRuleVars already computed.
Actually attaching the card's FILE ATTACHMENTS to the outgoing email is
deferred - see CHANGELOG TODO Later. Every WeKan email today goes through
either Meteor's `Email.sendAsync`/`EmailLocalization.sendEmail`, which take
{ to, from, subject, text }, with no `attachments` parameter anywhere in
this codebase's call sites; wiring a real file through would need the
mailer wrapper itself to grow attachment support and code to read the file
back out of whichever storage backend (local disk / GridFS / S3) holds it,
which is mailer-level scope well past this rule action.
tests/ruleUpdateInPlace.test.cjs pins rules.updateRule's authorization,
its RuleBleed cross-board guard, and - the part that actually makes it an
edit rather than a second create - that it keeps the rule/trigger/action
_ids stable, including a logic-level round trip against a small in-memory
mock proving a changed actionType does not leave the old type's fields
behind. tests/ruleEmailIncludesDescription.test.cjs pins the new
description line, guarded the same way the existing title/line lines are
(only appended when non-empty).
tests/ruleCardActionSchema.test.cjs (#6630's guard, that desc lives on the
Action document and never leaks onto the Rule document) is updated for the
new saveRuleTriggerAction call shape.
Thanks to jvavassori and xet7 !
Admin Panel -> Settings -> Visibility gets a new checkbox beside "Public
boards": "Only admins can create boards"
(tableVisibilityMode-boardCreationAdminOnly, off by default). It follows
the exact TableVisibilityModeSettings pattern its sibling
tableVisibilityMode-allowPrivateOnly already uses: a collection doc seeded
in server/models/collectionBootstrap.js, a jade checkbox and reactive
helper in settingBody.jade/js, and a write in the section's own Save
handler.
The real enforcement is server-side: createBoardWithInitialSwimlanes
(server/models/boards.js) now rejects the call with a not-authorized error
when the setting is on and the caller is not isAdmin === true, before the
board is ever inserted. The client mirrors this only as a convenience - a
new client/lib/boardCreationAllowed.js helper hides the top-bar "+" (header
header.js/.jade) and the All Boards "Add board" tile (boardsList.js) for a
restricted non-admin, but nothing depends on that for security.
A full per-user allow/deny override was left out of this pass: it would
need is own schema field, a People/Admin Panel UI to flip it per account,
and server enforcement layered under the global toggle, which is a larger
change than this issue's "let an admin forbid board creation instance-wide"
core request. The global toggle covers that request cleanly on its own.
Added imports/i18n/data/en.i18n.json's board-creation-admin-only string and
a direct translation (no external translation API) in all other locale
files, in en.i18n.json's key order. tests/boardCreationAdminOnly.test.cjs
pins the default-off setting, the checkbox/handler wiring, the server-side
admin check (and that it runs before the insert), the shared client helper,
the i18n key placement, and - as a negative test - that no OTHER
Boards.insertAsync call site was silently added outside the two already
known and deliberately ungated ones (the per-user Templates container and
createBoardFromCard).
Thanks to belf88 and xet7 !
Closes#4475,
Second of the header restructure. The title moved to the first bar last time;
the buttons move here, so a page is its content plus one panel rather than its
content plus a strip of buttons above it.
Four pages had controls in their second header bar: My Cards, Due Cards, Global
Search and Rules. Each group becomes a <page>Controls template, and the shared
page sidebar renders it. Their header bars are gone entirely - title moved,
controls moved, nothing left to hold - and the routes no longer name them, which
they must not: a route naming a template that does not exist renders "No such
template" in that bar.
The handlers followed their markup. A Blaze event map only sees events inside
its OWN template, so Template.dueCardsHeaderBar.events would have fired for
nothing once the buttons were somewhere else.
The sidebar itself is the board sidebar's shell again - the same classes, the
same close button, the same content area - with the two things the All Boards
one had to learn: the theme goes on a WRAPPER, because every themed sidebar rule
is a descendant selector and a class on `.sidebar` matches nothing; and it is
pinned to the viewport below the measured header height, sharing that rule with
the All Boards panel rather than restating it.
Which sidebar the hamburger opens now depends on where you are: a board's own, All
Boards' own, or this shared one. And it is only drawn where it opens something -
a page with no controls has no sidebar and no hamburger, because a panel that
opens empty is worse than no panel.
One guard needed correcting: the All Boards geometry test read a single
selector, and that rule is a selector list now.
What is still NOT done: the board's own second bar and All Boards' own, whose
controls have a sidebar to move into but have not moved yet, and the Admin
Panel's tab bar. The pages that were only a title - Support, Shortcuts,
Accessibility, Broken Cards, Import, Archive - keep their second bar for now;
they have nothing to move, only a title to drop.
Thanks to xet7 !
The Delete and View buttons are in the rulesList child template's each,
but their handlers are on the parent rulesMain and used
Template.currentData() — which returned the PARENT data context, not the
clicked rule. So the rule id was null: deleting failed with
'Match error: Expected string, got null', and 'View rule' always opened
the first rule. Add explicit data-rule-id to the buttons and read it in
the handlers so both operate on the rule actually clicked.
Deleting a rule ran three separate client-side Collection.remove() calls
(Rules + Triggers + Actions). Each is gated by a per-collection allow() rule
that resolves the board from that document own boardId via
Boards.findOneAsync(doc.boardId). When a trigger/action document has no
resolvable boardId (legacy rules created before boardId was denormalised, or
docs not published to the client), the board resolves to null and
allowIsBoardAdmin returns false, so Meteor rejects the mutation with 403
"Access denied" and the delete fails even for a legitimate board admin.
Route rule deletion through a new server Meteor method rules.deleteRule, which
authorizes ONCE (active board admin or site admin) and removes the rule, its
trigger and its action server-side (bypassing the brittle client allow/deny).
The permission decision is extracted into the Meteor-free helper
models/lib/ruleDeletePermission.js and covered by
tests/ruleDeletePermission.test.cjs. No permission is loosened: only board
admins and site admins may delete, matching the board-admin gate used to
create a rule.
Convert all remaining BlazeComponent-based components to native Meteor
Template pattern: activities, comments, all rules actions/triggers,
swimlanes, users, gantt, import, and main utility components.