mirror of
https://github.com/wekan/wekan.git
synced 2025-12-17 16:00:13 +01:00
fixed #5698
This commit is contained in:
parent
9c8b72100e
commit
a7755fa20c
3 changed files with 31 additions and 7 deletions
|
|
@ -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'}}
|
||||
|
|
|
|||
|
|
@ -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 [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue