diff --git a/client/components/rules/actions/boardActions.jade b/client/components/rules/actions/boardActions.jade index 0a09d98e8..cd576d9d8 100644 --- a/client/components/rules/actions/boardActions.jade +++ b/client/components/rules/actions/boardActions.jade @@ -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 diff --git a/client/components/rules/actions/boardActions.js b/client/components/rules/actions/boardActions.js index b69e9f476..8379cff86 100644 --- a/client/components/rules/actions/boardActions.js +++ b/client/components/rules/actions/boardActions.js @@ -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 [ { diff --git a/client/components/rules/ruleDetails.js b/client/components/rules/ruleDetails.js index 235f17179..5c8a8f323 100644 --- a/client/components/rules/ruleDetails.js +++ b/client/components/rules/ruleDetails.js @@ -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() {