This commit is contained in:
seve12 2025-10-22 17:35:16 +03:00
parent 9c8b72100e
commit a7755fa20c
3 changed files with 31 additions and 7 deletions

View file

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

View file

@ -1,7 +1,13 @@
import { ReactiveCache } from '/imports/reactiveCache'; import { ReactiveCache } from '/imports/reactiveCache';
import { TAPi18n } from '/imports/i18n';
BlazeComponent.extendComponent({ BlazeComponent.extendComponent({
onCreated() {}, onCreated() {
// Ensure boards are available for the actions dropdowns. This subscription
// is lightweight because the server publication already filters boards
// to those visible to the user.
this.subscribe('boards');
},
boards() { boards() {
const ret = ReactiveCache.getBoards( const ret = ReactiveCache.getBoards(
@ -19,6 +25,17 @@ BlazeComponent.extendComponent({
return ret; return ret;
}, },
loadingBoardsLabel() {
// Provide a translated label when available, otherwise fallback to English
try {
const txt = TAPi18n.__('loading-boards');
if (txt && !txt.startsWith("key '")) return txt;
} catch (e) {
// ignore
}
return 'Loading boards...';
},
events() { events() {
return [ return [
{ {

View file

@ -5,6 +5,11 @@ BlazeComponent.extendComponent({
this.subscribe('allRules'); this.subscribe('allRules');
this.subscribe('allTriggers'); this.subscribe('allTriggers');
this.subscribe('allActions'); this.subscribe('allActions');
// Ensure boards are available on the client so board selects in the
// Rules UI (move/link actions) can list other boards the user has access to.
// Without this subscription the select may be empty and users can't choose
// destination boards for rule actions.
this.subscribe('boards');
}, },
trigger() { trigger() {