mirror of
https://github.com/wekan/wekan.git
synced 2026-11-25 04:49:41 -05:00
The "add member" rule action's acting-user option (issue #2522 - "add whoever just moved the card as a member") landed on main missing its shared module: server/rulesHelper.js and cardActions.js already import RULE_ACTING_USER_SENTINEL/resolveActingUserId from /models/lib/ruleActingUser, but that file was never committed, breaking the import on main. It also landed without the actual UI button that saves the sentinel action. models/lib/ruleActingUser.js resolves "who triggered this rule" from activity.userId - the exact same source buildRuleVars() already uses for the {username} template variable (#3304/#3301) - so both call one shared function instead of two implementations of the same concept. cardActions.jade gets the missing trigger button, wired to the existing js-add-actinguser-member-action handler in cardActions.js. tests/ruleAddMemberActingUser.test.cjs pins the sentinel resolution, that rulesHelper.js and buildRuleVars() both call the one shared resolver (with a negative, whole-tree source-pattern check that no other file re-implements the same activity.userId shape), that the ordinary fixed-member path is unaffected, the client/jade wiring, and that every locale file has a real (non-English-placeholder) translation of the new label. tests/ruleRemoveMemberAction.test.cjs and tests/rulesApiTriggerNormalize.test.cjs are updated for the addMember block's new if/else shape around the sentinel check. Thanks to arisjr and xet7 ! Closes #2522,