Manually merged fixes from seve12.

Thanks to seve12 !

Related https://github.com/wekan/wekan/pull/5967
This commit is contained in:
Lauri Ojansivu 2025-12-22 23:18:01 +02:00
parent fc3bb962f7
commit ecfb0f0fdf
14 changed files with 457 additions and 20 deletions

View file

@ -24,6 +24,7 @@ template(name="boardActions")
| {{_'r-the-board'}}
div.trigger-dropdown
select(id="board-id")
option(value="" disabled selected if=not boards.length) {{loadingBoardsLabel}}
each boards
if $eq _id currentBoard._id
option(value="{{_id}}" selected) {{_ 'current'}}
@ -85,6 +86,7 @@ template(name="boardActions")
| {{_'r-the-board'}}
div.trigger-dropdown
select(id="board-id-link")
option(value="" disabled selected if=not boards.length) {{loadingBoardsLabel}}
each boards
if $eq _id currentBoard._id
option(value="{{_id}}" selected) {{_ 'current'}}

View file

@ -1,7 +1,11 @@
import { ReactiveCache } from '/imports/reactiveCache';
import { TAPi18n } from '/imports/i18n';
BlazeComponent.extendComponent({
onCreated() {},
onCreated() {
// Ensure boards are available for action dropdowns
this.subscribe('boards');
},
boards() {
const ret = ReactiveCache.getBoards(
@ -19,6 +23,16 @@ BlazeComponent.extendComponent({
return ret;
},
loadingBoardsLabel() {
try {
const txt = TAPi18n.__('loading-boards');
if (txt && !txt.startsWith("key '")) return txt;
} catch (e) {
// ignore translation lookup errors
}
return 'Loading boards...';
},
events() {
return [
{

View file

@ -5,6 +5,7 @@ BlazeComponent.extendComponent({
this.subscribe('allRules');
this.subscribe('allTriggers');
this.subscribe('allActions');
this.subscribe('boards');
},
trigger() {

View file

@ -1,7 +1,9 @@
template(name="rulesActions")
h2
| ✨
| {{_ 'r-rule' }} "#{data.ruleName.get}" - {{_ 'r-add-action'}}
| {{_ 'r-rule' }} "
= ruleName.get()
| " - {{_ 'r-add-action'}}
.triggers-content
.triggers-body
.triggers-side-menu

View file

@ -1,7 +1,9 @@
template(name="rulesTriggers")
h2
| ✨
| {{_ 'r-rule' }} "#{data.ruleName.get}" - {{_ 'r-add-trigger'}}
| {{_ 'r-rule' }} "
= ruleName.get()
| " - {{_ 'r-add-trigger'}}
.triggers-content
.triggers-body
.triggers-side-menu