mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 09:59:47 -05:00
The swatch click handler of the rule action color popup read the color
from Template.currentData(). Inside a Blaze event handler that is the data
of the template the handler is defined on - the popup, opened with the
cardActions context { ruleName, triggerVar, ruleId } - not the clicked
swatch, so every click set the selection to undefined and the action could
only ever be saved with the "green" default. The handler now reads the
swatch's own data with Blaze.getData(event.currentTarget), like the card,
list and swimlane color popups, and ignores anything that is not a card
color. The Save button is type="button" so it cannot submit the form.
Tests: tests/ruleSetColorActionPicker.test.cjs drives the real handlers
with Blaze event semantics (every color is selectable and saved, a click
without a valid color keeps the selection, nothing applies without Save)
and scans every palette click handler under client/ so none takes its
color from Template.currentData() first; a Playwright spec picks red in
the Rules editor and checks the stored action.
Thanks to titver968 and xet7 !
Fixes #6748,