mirror of
https://github.com/wekan/wekan.git
synced 2026-11-07 11:02:33 -05:00
Clear stale manual-button metadata for automatic triggers and populate it for REST button rules. Verify actual menu visibility and History undo/redo for editor and REST changes. Thanks to xet7 !
9 lines
317 B
JavaScript
9 lines
317 B
JavaScript
'use strict';
|
|
|
|
function ruleButtonMetadata(trigger, title) {
|
|
return trigger?.activityType === 'button'
|
|
? { $set: { buttonType: trigger.buttonType || 'card', buttonLabel: trigger.buttonLabel || title || 'Rule' } }
|
|
: { $unset: { buttonType: '', buttonLabel: '' } };
|
|
}
|
|
module.exports = { ruleButtonMetadata };
|