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

View file

@ -1,7 +1,13 @@
import { ReactiveCache } from '/imports/reactiveCache';
import { TAPi18n } from '/imports/i18n';
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() {
const ret = ReactiveCache.getBoards(
@ -19,6 +25,17 @@ BlazeComponent.extendComponent({
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() {
return [
{

View file

@ -5,6 +5,11 @@ BlazeComponent.extendComponent({
this.subscribe('allRules');
this.subscribe('allTriggers');
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() {